The following general syntax rules apply to all parallel compiler directives. You must follow these rules precisely to compile your program properly and obtain meaningful results.
A parallel directive prefix (tag) takes one of the following forms:
The following are source form rules for directive prefixes:
In these source forms, the prefix must appear in columns 1 through 5; column 6 must be a blank or tab. From column 7 on, blanks are insignificant, so the directive can be positioned anywhere on the line after column 6. A directive ends in column 72 (or column 132, if a compiler option is specified).
In fixed and tab source forms, a prefix beginning with ! must follow the same rules for prefixes beginning with C, c, or * (see above).
In free source form, the prefix need not start in column 1, but it cannot be preceded by any nonblank characters on the same line. It can only be preceded by whitespace.
Parallel directives can be continued and comments can be mixed within a continued parallel directive. The directive prefix must appear on each line of a continued directive.
A comment can follow a directive on the same line.
Additional Fortran statements (or directives) cannot appear on the same line as the parallel directive.
Parallel directives cannot appear within a continued Fortran statement.
The following examples are equivalent:
!$OMP PARALLEL DO & !$OMP SHARED(A,B,C) !$OMP PARALLEL & !$OMP SHARED(A,B,C) !$OMP PARALLEL DO SHARED(A,B,C)