RANK — Rank of a data objectRANK(A) returns the rank of a scalar or array data object.
RESULT = RANGE(A)
| A | can be of any type
|
INTEGER and of the default integer
kind. For arrays, their rank is returned; for scalars zero is returned.
program test_rank
integer :: a
real, allocatable :: b(:,:)
print *, rank(a), rank(b) ! Prints: 0 3
end program test_rank