HP 3000 Manuals

DIMENSION Statement (Nonexecutable) [ HP FORTRAN 77/iX Reference ] MPE/iX 5.0 Documentation


HP FORTRAN 77/iX Reference

DIMENSION Statement (Nonexecutable) 

The DIMENSION statement defines the dimensions and bounds of arrays.

[]
Dimension Declarator
[]
----------------------------------------------------------------------------------------------- | | | | | Item | Description/Default | Restrictions | | | | | ----------------------------------------------------------------------------------------------- | | | | | array_name | Symbolic name of the array. | None. | | | | | ----------------------------------------------------------------------------------------------- | | | | | first | Lower dimension bound. Defaults | Must be less than or equal to | | | to 1. | last. | | | | | ----------------------------------------------------------------------------------------------- | | | | | last | Upper dimension bound. | Must be greater than or equal to | | | | first. | | | | | ----------------------------------------------------------------------------------------------- | | | | | * | Dynamic upper bound. | Can only appear in the last upper | | | | bound of a formal argument of a | | | | subprogram. | | | | | ----------------------------------------------------------------------------------------------- Semantics There must be one dimension declarator for each dimension in the array. When an array is defined in a DIMENSION statement, only the name of the array, not the complete declarator, can be used in a type or COMMON statement. Only the upper dimension bound of the last dimension in an array declarator of a formal argument can be an asterisk. As an extension to the ANSI 77 standard, an array can have an unlimited number of dimensions. See "Array Declarators" for further details. Examples Notes --------------------------------------------------------------------------------------- INTEGER*2 arri The type statement specifies arri as a DIMENSION arri(-3:1,4) two-byte integer. Only the name of the array is used, not the complete array declarator. The DIMENSION statement causes 20 words of memory to be allocated for the array arri. An equivalent type specification would be: INTEGER*2 arri(-3:1,4) COMPLEX num(5,5) This construct is illegal because num is DIMENSION num(5,5) declared as an array twice.


MPE/iX 5.0 Documentation