Next: The INHERIT Directive
Up: Alignment
Previous: Alignment
Here we describe precisely how to determine the template with which
the dummy argument is ultimately aligned:
Templates are not passed through the subprogram argument interface. A
dummy argument and its corresponding actual argument may be aligned to
the same template only if that template is accessible in both the
caller and the called subprogram either through host association or
use association. In any other case, the template with which a dummy
argument is aligned is always distinct from the template with which
the actual argument is aligned, though it may be a copy (see
Section 4.4.2). On exit from a procedure, an
HPF implementation arranges that the actual argument is aligned with
the same template with which it was aligned before the call.
The template of the dummy argument is arrived at in one of three ways:
- If the dummy argument appears explicitly as an alignee
in an ALIGN directive, its template is the
align-target if the align-target is a template;
otherwise its template is the template with which the
align-target is ultimately aligned.
- If the dummy argument is not explicitly aligned and does not
have the INHERIT attribute (described in
Section 4.4.2 below), then the template has
the same shape and bounds as the dummy argument; this is called the
natural template for the dummy.
(Thus, all the examples in
Section 4.3 use the natural
template.)
- If the dummy argument is not explicitly aligned and does have
the INHERIT attribute, then the template is ``inherited''
from the actual argument according to the following rules:
- If the actual argument is a whole array, the template of the
dummy is a copy of the template with which the actual argument is
ultimately aligned.
- If the actual argument is an array section of array
where no subscript is a vector subscript, then the template of the
dummy is a copy of the template with which is ultimately
aligned.
- If the actual argument is any other expression, the shape
and distribution of the template may be chosen arbitrarily by
the language processor (and therefore the programmer cannot know
anything a priori about its distribution).
In all of these cases, we say that the dummy has an
inherited template.
Next: The INHERIT Directive
Up: Alignment
Previous: Alignment