RANK(3f)

DESCRIPTION
RANK(A) returns the rank of a scalar or array data object.

STANDARD
Technical Specification (TS) 29113

CLASS
Inquiry function

SYNTAX
RESULT = RANK(A)

ARGUMENTS

A can be of any type

RETURN VALUE
The return value is of type INTEGER and of the default integer kind. For arrays, their rank is returned; for scalars zero is returned.

EXAMPLE
          program test_rank
            integer :: a
            real, allocatable :: b(:,:)

            print *, rank(a), rank(b) ! Prints: 0 2
          end program test_rank

AUTHOR

This information was taken from the GFortran documentation (https://gcc.gnu.org/onlinedocs/gcc-5.3.0/gfortran/) and converted to a manpage by AstroFloyd (http://astrofloyd.org).