next up previous contents
Next: High Performance Fortran Language Up: Notation and Syntax Previous: Notation

Syntax of Directives

HPF directives are consistent with Fortran syntax in the following sense: if any HPF directive were to be adopted as part of a future Fortran standard, the only change necessary to convert an HPF program would be to replace the directive-origin with blanks.

H201 hpf-directive-lineis directive-origin hpf-directive
H202 directive-originis !HPF$
or CHPF$
or *HPF$
H203 hpf-directiveis specification-directive
or executable-directive
H204 directive-originis processors-directive
or align-directive
or distribute-directive
or inherit-directive
or template-directive
or combined-directive
or sequence-directive
H205 executable-directiveis independent-directive

Constraint:
An hpf-directive-line cannot be commentary following another statement on the same line.

Constraint:
A specification-direcive may appear only where a declaration-construct may appear.

Constraint:
An executable-directive may appear only where an executable-construct may appear.

Constraint:
An hpf-directive-line follows the rules of either Fortran free form (F95:3.3.1.1) or fixed form (F95:3.3.2.1) comment lines, depending on the source form of the surrounding Fortran source form in that program unit. (F95:3.3)

An hpf-directive is case insensitive and conforms to the rules for blanks in free source form (3.3.1), even in an HPF program otherwise in fixed source form. However an HPF-conforming language processor is not required to diagnose extra or missing blanks in an HPF directive. Note that, due to Fortran rules, the directive-origin in free source form must be the characters!HPF$. HPF directives may be continued, in which case each continued line also begins with a directive-origin. No statements may be interspersed within a continued HPF-directive. HPF directive lines must not apear within a continued statement. HPF directive lines may incluede trailing commentary.

The blanks in the adjacent keywords END FORALL and NO SEQUENCE are optional, in either source form.

An example of an HPF directive continuation in free source form is:

!HPF$ ALIGN ANTIDISESTABLISHMENTARIANISM (I,J,K) &
!HPF$        WITH ORNITHORHYNCHUS_ANATINUS (J,K,I)

An example of an HPF directive continuation in fixed source form follows. Observe that column 6 must be blank, except when signifying continuation.

!HPF$ ALIGN ANTIDISESTABLISHMENTARIANISM (I,J,K)
!HPF$*WITH ORNITHORHYNCHUS_ANATINUS (J,K,I)

his example shows an HPF directive continuation that is "universal" in that it can be treated as eithe fixed source form or free source form. Note that the "&" in the first line is in column 73. &

!HPF$ ALIGN ANTIDISESTABLISHMENTARIANISM (I,J,K)                        &
!HPF$&WITH ORNITHORHYNCHUS_ANATINUS (J,K,I)

Part iii introduces new directives, both specifications and executable ones, for the approved extensions to HPF 2.0. These are included below:

H206 specification-directive-extended is processors-directive
or subset-directive
or align-directive
or distribute-directive
or inherit-directive
or template-directive
or combined-directive
or sequence-directive
or dynamic-directive
or range-directive
or shadow-directive
H208 executable-directive-extended is independent-directive
or realign-directive
or redistribute-directive
or on-directive
or resident-directive

The following rule extends rule R215 of Fortran 95:

H208 executable-construct-extended is action-stmt
or case-construct
or do-construct
or if-construct
or where-construct
or on-construct
or resident-construct
or task-region-construct