Lahey/Fujitsu Fortran

ALLOCATED Function

Description

The ALLOCATED function returns a true or false value indicating the status of an allocatable variable.

Syntax

ALLOCATED (array)

Arguments

array is an INTENT(IN) array with the allocatable attribute.

Result

The result is a scalar of default LOGICAL type. It has the value true if array is currently allocated and false if array is not currently allocated.

Example

integer, allocatable :: i(:) write(*,*) allocated(i) ! writes F allocate (i(2)) write(*,*) allocated(i) ! writes T