Clicky
Showing changes from revision #2 to #3:
(追記) Added (追記ここまで) | (削除) Removed (削除ここまで) | (削除) Chan (削除ここまで)(追記) ged (追記ここまで)
Determines the shape of an array.
Fortran 95 and later
(削除) Inquiry function (削除ここまで)(追記) Inquiry function (追記ここまで)
result = shape(source)
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.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.
program test_shape
integer, dimension(-1:1, -1:2) :: a
write(*,*) shape(a) ! (/ 3, 4 /)
write(*,*) size(shape(42)) ! (/ /)
end program