HP Fortran Programmer's Reference (September 2007)

Program units and procedures
Arguments
Chapter 7 173
...
d(2,3,2) <=> a(3,2)
When an actual argument and the associated dummy argument are default character arrays,
they may be of unequal character length. If this is the case, then the first character of the
dummy and actual arguments are matched, and the successive characters—rather than array
elements—are matched.
The next example illustrates character sequence association. Assuming this declaration of the
actual argument:
CHARACTER*2 a(3,4)
and this declaration of the corresponding dummy argument:
CHARACTER*4 d(2,3)
then the correspondence between elements of the actual and dummy arguments is as follows:
Dummy <=> Actual
-------------------
d(1,1) <=> a(1,1)//a(2,1)
d(2,1) <=> a(3,1)//a(1,2)
...
d(2,3) <=> a(2,4)//a(3,4)
An actual argument may be an array section, but associating an array section with any other
but an assumed-shape dummy argument may cause a copy of the array section to be
generated and is likely to result in a degradation in performance.
For information about the different types of arrays, see “Array declarations” on page 59.
Derived-type dummy argument
When passing a derived-type object, the corresponding dummy and actual arguments of
derived types are assumed to be of the same derived type. Unless the interface of the
referenced procedure is explicit within the program unit that makes the reference, the
compiler does not perform any type-checking. It is the programmer’s responsibility to ensure
that the types of the dummy argument and the actual argument are the same, such as by
doing either of the following:
Replicating the definition of the derived type in both subprograms
Placing the definition in a module and making the definition available to both
subprograms by use association
For information about explicit interface, see “Procedure interface” on page 181. For
information modules and use association, see “Modules” on page 190.