HP Fortran Programmer's Reference (September 2007)

Program units and procedures
Arguments
Chapter 7 171
Arguments
Arguments data to be passed during a procedure call. Arguments are of two sorts: dummy
arguments and actual arguments. Dummy arguments are specified in the argument list in a
procedure definition. They define the number, type, kind, and rank of the actual arguments.
The actual arguments are the arguments that appear in the procedure reference and are the
actual entities to be used by the referenced procedure, even though they are known by the
dummy argument names.
This section covers the following topics related to arguments:
Argument association
Keyword option
Duplicated association
INTENT attribute
%REF and %VAL
Argument association
Argument association is the linkage of actual argument to dummy argument that initially
occurs when a procedure having arguments is invoked. During the execution of the referenced
procedure, the dummy arguments are effectively aliases for the actual arguments. After
control returns to the program unit making the reference, the dummy arguments and actual
arguments are no longer associated, and the actual arguments may no longer be referenced by
the dummy argument names.
The principle of argument association is positional: the first item in the list of actual
arguments is associated with the first item in the list of dummy arguments, and so on with
the remaining arguments in each list. However, the programmer can use the keyword option
to override this positional correspondence; see “Keyword option” on page 175.
Dummy and actual arguments must agree in kind, type, and rank. The corresponding dummy
and actual arguments must both be scalars or both arrays; if they are both arrays, they must
have the same dimensionality. Likewise, if an actual argument is an expression or a reference
to a function, it must match the type and kind of the dummy argument.
The following sections provide more detailed information about these types of dummy
arguments:
Scalars