The RESHAPE() intrinsic returns a two dimensional array in your example. The SHAPE() intrinsic returns the extents of the one dimensional array in the first statement and of the two dimensional array in the second statement. When you print out the 2D array, the result is garbage because the array x(:) was never defined – it was declared, but values were never given to the elements. The SHAPE() intrinsic works anyway because it does not depend on the values of the array elements, just on the array metadata (i.e. the rank and the extents).