Consider the following short program (Fortran95):
write(*,*) shape(2)
end
I tried running this with Fortran compilers (gfortran 4.8.2) and Absoft Pro Fortran 13.0.0 (mac) and I get the following result:
local $./a.out
local $
update: Also tried gfortran 4.4.7 (linux with the same result.
Here is what documentation of shape in gfortran says:
RESULT = SHAPE(SOURCE [, KIND])Arguments:
SOURCE Shall be an array or scalar of any type. If SOURCE is a pointer it must be associated and allocatable arrays must be allocated.Return value:
An INTEGER array of rank one with as many elements as SOURCE has dimensions. The elements of the resulting array correspond to the extend of SOURCE along the respective dimensions. If SOURCE is a scalar, the result is the rank one array of size zero. If KIND is absent, the return value has the default integer kind otherwise the specified kind.
In other words, I see only a newline and not a result. Should it not tell me that the shape is 1?