+------------------------Fortran 2003 Draft Standard-------------------------+

ALLOCATABLE

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.

Syntax



>>-ALLOCATABLE--+----+------------------------------------------>
                '-::-'
 
   .-,-----------------------------------------------.
   V                                                 |
>----object_name--+--------------------------------+-+---------><
                  '-(--deferred_shape_spec_list--)-'
 
 

object_name
is the name of an allocatable object

deferred_shape_spec
is a colon(:), where each colon represents a dimension

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.

Table 24. 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

+---------------------End of Fortran 2003 Draft Standard---------------------+

IBM Copyright 2003