XL Fortran for AIX 8.1

Language Reference

DIMENSION

Purpose

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

Format



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


  • ALLOCATABLE
  • AUTOMATIC
  • INTENT
  • OPTIONAL

  • PARAMETER
  • POINTER
  • PRIVATE
  • PUBLIC

  • SAVE
  • STATIC
  • TARGET
  • VOLATILE

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


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