|Fortran Language Reference Manual, Volume 1 - S-3692-51|
|Prev Section||Chapter 5. Declarations||Next Section|
Scalars and arrays may use the ALLOCATABLE attribute. An allocatable array is one for which the bounds are determined when an ALLOCATE statement is executed for the array. These arrays must be deferred-shape arrays.
The following is a format for a type declaration statement with an ALLOCATABLE attribute:
type, ALLOCATABLE [, attribute_list ] :: entity_decl_list
Subject to the rules governing combinations of these attributes, attribute_list can contain the following:
|DIMENSION (with deferred shape)|
The format of the ALLOCATABLE statement is defined as follows:
Under the Fortran 2003 draft, object_name can be a scalar, dummy argument, or a function result.
The ALLOCATABLE statement also confers the ALLOCATABLE attribute. It is subject to the same rules and restrictions as the ALLOCATABLE attribute.
The following examples show entity-oriented declarations:
REAL, ALLOCATABLE :: A(:, :) LOGICAL, ALLOCATABLE, DIMENSION(:) :: MASK1
The following examples show attribute-oriented declarations:
REAL A(:, :) LOGICAL MASK1 DIMENSION MASK1(:) ALLOCATABLE A, MASK1