HP Fortran Programmer's Reference (September 2007)

HP Fortran statements
PARAMETER (statement and attribute)
Chapter 10 421
The type of a named constant is determined by the implicit typing rules, unless its type is
specified by a type declaration statement prior to its first appearance in a PARAMETER
statement or by a type declaration statement that includes PARAMETER as one of its attributes.
If a PARAMETER statement declares and implicitly types a named constant, the named constant
may appear in a subsequent type declaration or IMPLICIT statement, but only to confirm the
type of the named constant.
When the type of the symbolic name and the constant do not agree, the value of the named
constant is assigned in accordance with assignment statement type-conversion rules, as given
in Table 4-5.
The following rules apply to type agreement between the constant and the symbolic name:
•If
cname
is of numeric type,
cexpr
must be an arithmetic constant expression.
•If
cname
is of type character, the corresponding
cexpr
must be a character constant
expression.
•If
cname
is of type logical, the corresponding
cexpr
may be either an arithmetic or logical
constant expression.
Any symbolic name of a constant that appears in
cexpr
must have been defined previously in
the same or a different PARAMETER statement in the same program unit. For example, the
expression in the second PARAMETER statement below is built from the expression in the first
PARAMETER statement, and is legal:
PARAMETER (limit = 1000)
PARAMETER (limit_plus_1 = limit + 1)
The logical operators (.EQ., .NE., .LT., .LE., .GT., and .GE.), as well as the following
intrinsic functions, can appear in the PARAMETER statement:
If these intrinsic functions are used in a PARAMETER statement, their arguments must be
constants.
Table 10-43
ABS IAND IXOR MAX
CHAR ICHAR LEN MIN
CMPLX IEOR LGE MOD
CONJB IMAG LGT NINT
DIM IOR LLE NOT
DPROD ISHFT LLT