FORTRAN 77 Language Reference


A directive passes information to a compiler in a special form of comment. @ Directives are also called compiler pragmas. There are two kinds of directives:

See the Sun Fortran User's Guide and the Fortran Programming Guide for details on the specific directives available with f77.

General Directives

The form of a general directive is one of the following:@

The variable id identifies the directive keyword; a is an argument.


A directive has the following syntax:

Rules and Restrictions

After the first eight characters, blanks are ignored, and uppercase and lowercase are equivalent, as in FORTRAN text.

Because it is a comment, a directive cannot be continued, but you can have many C$PRAGMA lines, one after the other, as needed.

If a comment satisfies the above syntax, it is expected to contain one or more directives recognized by the compiler; if it does not, a warning is issued.

Parallelization Directives

Parallelization directives explicitly request the compiler attempt to parallelize the DO loop that follows the directive. The syntax differs from general directives. Parallelization directives are only recognized when compilation options --parallel or --explicitpar are used. (f77 parallelization options are described in the Fortran User's Guide.)

Parallelization directives have the following syntax:

Each parallelization directive has its own set of optional qualifiers that follow the keyword.

Example: Specifying a loop with a shared variable:


See the Fortran Programming Guide for details about parallelization and these directives.