Assumed-Size Specifications

An assumed-size array is a dummy argument array that assumes the size (only) of its associated actual argument array; the rank and extents can differ for the actual and dummy arrays. An assumed-size specification takes the following form:

([expli-shape-spec,] [expli-shape-spec,] ... [dl:] *)

expli-shape-spec
Is an explicit-shape specification.

dl
Is a specification expression indicating the lower bound of the dimension. The expression can have a positive, negative, or zero value. If necessary, the value is converted to integer type.

If the lower bound is not specified, it is assumed to be 1.

*
Is the upper bound of the last dimension.

The rank of the array is the number of explicit-shape specifications plus 1.

The size of the array is assumed from the actual argument associated with the assumed-size dummy array as follows:

An assumed-size array can only be used as a whole array reference in the following cases:

Because the actual size of an assumed-size array is unknown, an assumed-size array cannot be used as any of the following in an I/O statement:

Examples

The following is an example of an assumed-size specification:

  SUBROUTINE SUB(A, N)
    REAL A, N
    DIMENSION A(1:N, *)
    ...

The following example shows that you can specify lower bounds for any of the dimensions of an assumed-size array, including the last:

  SUBROUTINE ASSUME(A)
    REAL A(-4:-2, 4:6, 3:*)

For More Information:

For details on array element order, see Array Elements.