ALLOCATED(3f)

DESCRIPTION
ALLOCATED(ARRAY) and ALLOCATED(SCALAR) check the allocation status of ARRAY and SCALAR, respectively.

STANDARD
Fortran 95 and later. Note, the SCALAR= keyword and allocatable scalar entities are available in Fortran 2003 and later.

CLASS
Inquiry function

SYNTAX

RESULT = ALLOCATED(ARRAY) RESULT = ALLOCATED(SCALAR)

ARGUMENTS

ARRAY The argument shall be an ALLOCATABLE array. SCALAR The argument shall be an ALLOCATABLE scalar.

RETURN VALUE
The return value is a scalar LOGICAL with the default logical kind type parameter. If the argument is allocated, then the result is .TRUE.; otherwise, it returns .FALSE.

EXAMPLE
          program test_allocated
            integer :: i = 4
            real(4), allocatable :: x(:)
            if (.not. allocated(x)) allocate(x(i))
          end program test_allocated

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).