XL Fortran for AIX 8.1

Language Reference

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.

Format



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

Attributes Compatible with the ALLOCATABLE Attribute


  • AUTOMATIC
  • DIMENSION
  • INTENT
  • OPTIONAL

  • PRIVATE
  • PUBLIC
  • SAVE
  • STATIC

  • TARGET
  • VOLATILE

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


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