Purpose
The ALLOCATABLE attribute declares allocatable objects-- that is, objects whose space is dynamically allocated by execution of an ALLOCATE statement or by a derived-type assignment statement. If it is an array, it will be a deferred-shape array.
Format
>>-ALLOCATABLE--+----+------------------------------------------>
'-::-'
.-,-----------------------------------------------.
V |
>----object_name--+--------------------------------+-+---------><
'-(--deferred_shape_spec_list--)-'
|
Rules
The object cannot be a pointee. If the object is an array and it is specified elsewhere in the scoping unit with the DIMENSION attribute, the array specification must be a deferred_shape_spec.
| Attributes Compatible with the ALLOCATABLE Attribute | ||||
|---|---|---|---|---|
|
Examples
REAL, ALLOCATABLE :: A(:,:) ! Two-dimensional array A declared
! but no space yet allocated
READ (5,*) I,J
ALLOCATE (A(I,J))
END
Related Information