rank(3f) - [FORTRAN:INTRINSIC:ARRAY INQUIRY] Rank of a data object
result = rank(a)
rank(a) returns the rank of a scalar or array data object.
A can be of any type
The return value is of type INTEGER and of the default integer kind. For arrays, their rank is returned; for scalars zero is returned.
Sample program:
program demo_rank implicit none integer :: a real, allocatable :: b(:,:) real :: c(10,20,30) print *, rank(a), rank(b), rank(c) end program demo_rankResults:
0 2 3 Expected output:
[[TS 29113]]
Inquiry function
rank (3) | March 11, 2021 |