XL Fortran for AIX 8.1

Language Reference


ALLOCATED(ARRAY) or ALLOCATED(SCALAR)

Indicate whether or not an allocatable object is currently allocated.

ARRAY
is an allocatable array whose allocation status you want to know.

SCALAR
is an allocatable scalar whose allocation status you want to know.

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.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]