Array declarators

An array declarator specifies the rank or rank and shape of an array.

You must declare every named array, and no scoping unit can have more than one array declarator for the same name. An array declarator can appear in any of the Compatible Statements and Attributes for Array Declarators table.
Table 1. Compatible statements and attributes for array declarators
ALLOCATABLE  1  AUTOMATIC  2  COMMON
DIMENSION CONTIGUOUS  3  PARAMETER
POINTER (integer)  2  POINTER PROTECTED  1 
STATIC  2  TARGET Type Declaration
VOLATILE    
Notes:
  •  1  Fortran 2003
  •  2  IBM extension
  •  3  Fortran 2008
For example:
DIMENSION :: A(1:5)         ! Declarator is "(1:5)"
REAL, DIMENSION(1,1:5) :: B ! Declarator is "(1,1:5)"
INTEGER C(10)               ! Declarator is "(10)"

The form of an array declarator is:

Read syntax diagramSkip visual syntax diagram
>>-(--array_spec--)--------------------------------------------><

array_spec
is an array specification. It is a list of dimension declarators, each of which establishes the lower and upper bounds of an array, or specifies that one or both will be set at run time. Each dimension requires one dimension declarator.
An array_spec is one of:
  • explicit_shape_spec_list
  • assumed_shape_spec_list
  • deferred_shape_spec_list
  • implied_shape_spec_list
  • assumed_size_spec
  • TS 29113 beginsassumed_rank_specTS 29113 ends
Each array_spec declares a different kind of array. For details, see the topics in the Array concepts section.


Voice your opinion on getting help information Ask IBM compiler experts a technical question in the IBM XL compilers forum Reach out to us