Indicate whether or not an allocatable object is currently allocated.
Class
Inquiry function
Result Type and Attributes
Default logical scalar.
Result Value
The result corresponds to the allocation status of ARRAY or SCALAR: .TRUE. if it is currently allocated, .FALSE. if it is not currently allocated, or undefined if its allocation status is undefined. If you are compiling with the -qxlf90=autodealloc compiler option there is no undefined allocation status.
Examples
INTEGER, ALLOCATABLE, DIMENSION(:) :: A
PRINT *, ALLOCATED(A) ! A is not allocated yet.
ALLOCATE (A(1000))
PRINT *, ALLOCATED(A) ! A is now allocated.
END
Related Information
Allocatable Arrays, ALLOCATE, Allocation Status.