The REALIGN directive is similar to the ALIGN directive but is considered executable. An array (or template) may be realigned at any time, provided it has been declared DYNAMIC (see Section 8.5). Unlike redistribution (also in Section 8.5), realigning a data object does not cause any other object to be remapped. (However, realignment of even a single object, if it is large, can require a lot of computational and communication effort at run time; the programmer must take care when using this feature.)
The ALIGN directive may appear only in the specification-part of a scoping unit. The REALIGN directive is similar but may appear only in the execution-part of a scoping unit. The principal difference between ALIGN and REALIGN is that ALIGN must contain only a specification-expr as a subscript or in a subscript-triplet, whereas in REALIGN an expression as a subscript or in a subscript-triplet need not be a specification-expr. Another difference is that ALIGN is an attribute, and so can be combined with other attributes as part of a combined-directive, whereas REALIGN is not an attribute (although a REALIGN statement may be written in the style of attributed syntax, using ``::'' punctuation).
The syntax of REALIGN is as follows:
H803 realign-directive is REALIGN alignee align-directive-stuff
or REALIGN align-attribute-stuff :: alignee-list
Note that, although an object may not have both the INHERIT attribute and the ALIGN attribute, any object--whether or not it has the INHERIT attribute--may appear as an alignee in a REALIGN directive, provided it has the DYNAMIC attribute and that it does not appear as a distributee in a DISTRIBUTE or REDISTRIBUTE directive.
If a range directive (see Section 8.11) has been used to restrict the set of distribution formats allowed for an alignee, then the new mapping must match one of the formats specified in the range directive.