FORTRAN Reference Manual

Statements
FORTRAN Reference Manual528615-001
7-26
DIMENSION Statement
Examples
DATA stock,rate,high,low/3500,15.25,42.75,13/
CHARACTER * 12 headings(5)
DATA headings/'April','May','June','July','August'/
DIMENSION Statement
The DIMENSION statement declares an array name and the number and size of its
dimensions.
name
is the symbolic name of an array or a RECORD.
dimension
is the array bounds specification in the form:
[ lower:] upper [, [ lower:] upper ]...
lower
is an integer expression that specifies the lower bound of a dimension. lower
must be less than or equal to upper. lower defaults to one if you omit it.
upper
is an integer expression that specifies the upper bound of the dimension.
Considerations
You can declare an array’s dimensions only once in a program unit.
You can specify an array’s dimensions in a COMMON statement or type statement,
instead of in a DIMENSION statement.
The number of [lower:] upper pairs in an array’s dimension specification
establishes the number of dimensions of the array.
An array can have up to seven dimensions.
A RECORD cannot have more than one dimension.
The bounds of an array can be positive, negative, or zero.
For information about assumed-size arrays or adjustable dimensions, see
Section 4, Program Units.
DIMENSION name ( dimension) [, name ( dimension) ]...