Syntax Rules for Compiler Directives

The following syntax rules apply to all general and OpenMP* Fortran compiler directives. You must follow these rules precisely to compile your program properly and obtain meaningful results.

A directive prefix (tag) takes one of the following forms:

General compiler directives:

!DIR$

OpenMP Fortran compiler directives:

!$OMP

Compiler directives that are extension to OpenMP:

!$OMPX (free format), !$OMX (fixed format)

In fixed-format source, the following prefix forms can be used in place of !DIR$: cDIR$, cDEC$, or !MS$, where c is one of the following: C (or c), !, or *.

In fixed-format source, the following prefix forms can be used in place of !$OMP: c$OMP, and in place of !$OMX: c$OMX, where c is one of the following: C (or c), !, or *.

The following are source form rules for directive prefixes:

A fixed-format compiler directive ends in column 72 (or column 132, if compiler option extend-source is specified). Free-format directives end in column 132.

General compiler directives and OpenMP Fortran directives can be continued in the same way as Fortran statements can be continued:

A comment beginning with an ! can follow a compiler directive on the same line.

Additional Fortran statements (or directives) cannot appear on the same line as the compiler directive.

Compiler directives cannot appear within a continued Fortran statement.

Blank common used in a compiler directive is specified by two slashes (/ /).

If the source line starts with a valid directive prefix but the directive is not recognized, the compiler displays an informational message and ignores the line.