An array declarator specifies the symbolic name that identifies an array within a program unit and indicates the properties of that array. It takes the following form:
a(d [,d] . . . )
[dl:] du
The number of dimension declarators indicates the number of dimensions in the array. The number of dimensions can range from one to seven.
The value of the lower-bound dimension declarator can be negative, zero, or positive. The value of the upper-bound dimension declarator must be greater than or equal to that of the corresponding lower- bound dimension declarator. The number of elements in the dimension is du - dl + 1. If a lower bound is not specified, it is assumed to be one, and the value of the upper bound specifies the number of elements in that dimension. For example, a dimension declarator of 50 indicates that the dimension contains 50 elements.
Each dimension bound is an integer arithmetic expression in which each operand is a constant, a variable in the same dummy argument list, or a variable in a common block. The expression is converted to an integer if necessary.
The type of a variable used in a bound expression cannot be changed by a later type declaration.
You can use dimension bounds (which are not constant expressions) in a subprogram to define adjustable arrays. You can use adjustable arrays within a single subprogram to process arrays with different dimension bounds by specifying the array name as a subprogram argument, and by either specifying the bounds as subprogram arguments or by placing the bounds in a common block. Only dimension bounds that are constant expressions are permitted in a main program.
The number of elements in an array is equal to the product of the number of elements in each dimension.
An array name can appear in only one array declarator within a program unit.