DIMENSION

Purpose

The DIMENSION attribute specifies the name and dimensions of an array.

Syntax

Read syntax diagramSkip visual syntax diagram>>-DIMENSION--+----+--array_declarator_list--------------------><
              '-::-'
 

Rules

According to Fortran 95, you can specify an array with up to seven dimensions.

IBM Extension

With XL Fortran, you can specify up to 20 dimensions.

End of IBM Extension

Only one dimension specification for an array name can appear in a scoping unit.

Attributes compatible with the DIMENSION attribute

Examples

CALL SUB(5,6)
CONTAINS
SUBROUTINE SUB(I,M)
  DIMENSION LIST1(I,M)                         ! automatic array
  INTEGER, ALLOCATABLE, DIMENSION(:,:) :: A    ! deferred-shape array
       
  ·
  ·
  ·
END SUBROUTINE END

Related information