Returns the shape of an array or scalar.
Inquiry function
The extent of each dimension in SOURCE is returned in the corresponding element of the result array.
If ARRAY is an assumed-rank object that is associated with an assumed-size array, the result has a value equal to [(SIZE(ARRAY, I, KIND), I=1, RANK(ARRAY))]. If KIND is omitted from SHAPE, KIND is also omitted from SIZE.
! A is the array | 7 6 3 1 |
! | 2 4 0 9 |
! | 5 7 6 8 |
!
RES = SHAPE( A )
! The result is | 3 4 | because A is a rank-2 array
! with 3 elements in each column and 4 elements in
! each row.