XL Fortran for AIX 8.1

Language Reference

Array Elements

Array elements are the scalar data that make up an array. Each element inherits the type, type parameters, and INTENT, PARAMETER, and TARGET attributes from its parent array. The POINTER attribute is not inherited.

You identify an array element by an array element designator, whose form is:


is the name of an array

is a structure component whose rightmost comp_name is an array

is an scalar integer expression

+-------------------------------IBM Extension--------------------------------+

A subscript is a real expression in XL Fortran.

+----------------------------End of IBM Extension----------------------------+


The subscript value depends on the value of each subscript expression and on the dimensions of the array. It determines which element of the array is identified by the array element designator.

Related Information:

Structure Components
Array Sections and Structure Components

Array Element Order

The elements of an array are arranged in storage in a sequence known as the array element order, in which the subscripts change most rapidly in the first dimension, and subsequently in the remaining dimensions.

For example, an array declared as A(2, 3, 2) has the following elements:

 Position of Array Element             Array Element Order
 -------------------------             -------------------
          A(1,1,1)                              1
          A(2,1,1)                              2
          A(1,2,1)                              3
          A(2,2,1)                              4
          A(1,3,1)                              5
          A(2,3,1)                              6
          A(1,1,2)                              7
          A(2,1,2)                              8
          A(1,2,2)                              9
          A(2,2,2)                             10
          A(1,3,2)                             11
          A(2,3,2)                             12

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