FORTRAN PROGRAMMING ENVIRONMENT FEATURES

FPE HOME | Directives | Double Options | Format | Functions | Operators | Options | Recommend | Source | Statements

SOURCE FILE DIRECTIVES

specify a parallel region

OpenMP !$OMP PARALLEL [clause...]
...
!$OMP END PARALLEL

where clauses may be IF(expr), SHARED(list), PRIVATE(list), FIRSTPRIVATE(list), REDUCTION(op:list), COPYIN(list), DEFAULT(SHARED), DEFAULT(PRIVATE), or DEFAULT(NONE)
DEC F90 Available.

specify a DO work-sharing construct

OpenMP !$OMP DO [clause...]
...
[!$OMP END DO [NOWAIT]]
where clauses may be PRIVATE(list), FIRSTPRIVATE(list), LASTPRIVATE(list), REDUCTION(op:list), SCHEDULE(specification), or ORDERED
and the SCHEDULE specification may be STATIC[,chunk], DYNAMIC[,chunk], GUIDED[,chunk], or RUNTIME.
DEC F90 Available.

specify a SECTIONS work-sharing construct

OpenMP !$OMP SECTIONS [clause...]
[!$OMP SECTION]
...
[!$OMP SECTION
...]
...
!$OMP END SECTIONS [NOWAIT]
where clauses may be PRIVATE(list), FIRSTPRIVATE(list), LASTPRIVATE(list), or REDUCTION(op:list)
DEC F90 Available.

specify a SINGLE work-sharing construct

OpenMP !$OMP SINGLE [clause...]
...
!$OMP END SINGLE [NOWAIT]
where clauses may be PRIVATE(list) or FIRSTPRIVATE(list)
DEC F90 Available.

specify a PARALLEL DO region and work-sharing construct

OpenMP !$OMP PARALLEL DO [clause...]
...
[!$OMP END PARALLEL DO]
where clauses may be IF(expr), SHARED(list), PRIVATE(list), FIRSTPRIVATE(list), LASTPRIVATE(list), REDUCTION(op:list), COPYIN(list), SCHEDULE(specification), ORDERED, or DEFAULT(SHARED), DEFAULT(PRIVATE), or DEFAULT(NONE)
and the SCHEDULE specification may be STATIC
[,chunk], DYNAMIC[,chunk], GUIDED[,chunk], or RUNTIME.
DEC F90 Available.
IBM XLF Available except for FIRSTPRIVATE, ORDERED, COPYIN, and DEFAULT. The SCHEDULE specification may be given in a seperate directive.

specify a PARALLEL SECTIONS region and work-sharing construct

OpenMP !$OMP PARALLEL SECTIONS [clause...]
[!$OMP SECTION]
...
[!$OMP SECTION
...]
...
!$OMP END PARALLEL SECTIONS
where the clauses may be IF(expr), SHARED(list), PRIVATE(list), FIRSTPRIVATE(list), LASTPRIVATE(list), REDUCTION(op:list), COPYIN(list), DEFAULT(SHARED), DEFAULT(PRIVATE), or DEFAULT(NONE).
DEC F90 Available.
IBM XLF Available except for FIRSTPRIVATE, LASTPRIVATE, and COPYIN.

specify a block for only the MASTER thread to execute

OpenMP !$OMP MASTER
...
!$OMP END MASTER
DEC F90 Available.

specify a critical section

OpenMP !$OMP CRITICAL [(name)]
...
!$OMP END CRITICAL [(name)]
DEC F90 Available.
IBM XLF Available.

specify a block to be executed in serial order

OpenMP !$OMP ORDERED
...
!$OMP END ORDERED
DEC F90 Available.

specify that each thread will get a seperate copy of a common block

OpenMP !$OMP THREADPRIVATE(/common_block/...)
DEC F90 Available.
IBM XLF !IBM$ THREADLOCAL /block/ is available to accomplish a similar function, however THREADLOCAL is only available in routines called from a parallel region, not from the routine containing the PARALLEL DO directive.

specify that the next statement is to be done atomically

OpenMP !$OMP ATOMIC
...
DEC F90 Available.

specify an additional barrier point

OpenMP !$OMP BARRIER
DEC F90 Available.

specify that all buffers and registers are to be stored to memory

OpenMP !$OMP FLUSH
DEC F90 Available.

specify relative placement of arrays

HPF !HPF$ ALIGN
DEC F90 !HPF$ ALIGN

specify partitioning of data among memory regions

HPF !HPF$ DISTRIBUTE
DEC F90 !HPF$ DISTRIBUTE

specify loop iterations do not interfere with each other

HPF !HPF$ INDEPENDENT
DEC F90 !HPF$ INDEPENDENT
IBM XLF !HPF$ INDEPENDENT [,NEW(list)] [,REDUCTION(list)]

align dummy argument the same as the actual argument

HPF !HPF$ INHERIT
DEC F90 !HPF$ INHERIT

treat common variables as non-sequential

HPF !HPF$ NOSEQUENCE
DEC F90 !HPF$ NOSEQUENCE

describe an arrangement of processors

HPF !HPF$ PROCESSORS
DEC F90 !HPF$ PROCESSORS

treat common variables as sequential

HPF !HPF$ SEQUENCE
DEC F90 !HPF$ SEQUENCE

create a virtual array for alignments

HPF !HPF$ TEMPLATE
DEC F90 !HPF$ TEMPLATE

specify compiler options to an individual compilation unit

IBM XLF @PROCESS directive In fixed-form, directive may start in column 1 or after column 6.

CDIR$ compiler directives

CF77 All CDIR$ directives are available.
CF90 The following CF77 CDIR$ directives will work in CF90 if fixed format is in use: ALIGN, AUXILIARY, [NO]BL, [NO]BOUNDS, [NO]FLOW, [NO]INLINE, INTEGER, IVDEP, NEXTSCALAR, NO SIDE EFFECTS, [NO]RECURRENCE, SHORTLOOP, STACK, SUPPRESS, TASKCOMMON, VFUNCTION, and [NO]VSEARCH. In free format CDIR$ must be replaced with !DIR$ (which will also work with fixed format).

CMIC$ microtasking directives used with the FMP part of CF77

CF77 If the FMP part of CF77 is not in use the microtasking directives are not available. Some of the directives may be replaced with autotasking directives in the same way as is done for CF90.
CF90 The following directives are not available: [NO]ALTCODE, [NO]ASSOC, COUNT, [NO]DEPCH, DENSE, [NO]EQVCHK, [NO]INNER, ITERATIONS, MAXCPUS, NEXPAND, [NO]LIST, [NO]LSTVAL, PRIVATEARRAY, RELATION, SCHEDULE, SEARCH, [NO]SKIP, SPARSE, [NO]SPLIT, and SWITCH. The following microtasking directives have autotasking replacements for use with CF90: for CMIC$ GUARD use !MIC$GUARD; for CMIC$END GUARD use !MIC$END GUARD; for CMIC$ DO GLOBAL use !MIC$ DO PARALLEL; for CMIC$ PROCESS use !MIC$ CASE; and for CMIC$ END PROCESS use !MIC$ END CASE.
Sun F90 The following directive is available: CMIC$ DOALL

C$PAR compiler directives

DEC F90 The C$PAR directives are available, but represent an earlier form of SMP parallel directives that are not as portable as the OpenMP directives. The following directives are accepted: PDO, END PDO, PDONE, PSECTIONS, SECTION, END PSECTIONS, SINGLE PROCESS, END SINGLE PROCESS, PARALLEL DO, END PARALLEL DO, PARALLEL SECTIONS, END PARALLEL SECTIONS, CRITICAL SECTION, END CRITICAL SECTION, BARRIER, TASKCOMMON, INSTANCE, COPYIN, MP_SCHEDTYPE, and CHUNK.
CF90 The following CF77 CDIR$ directives will work in CF90 if fixed format is in use: ALIGN, AUXILIARY, [NO]BL, [NO]BOUNDS, [NO]FLOW, [NO]INLINE, INTEGER, IVDEP, NEXTSCALAR, NO SIDE EFFECTS, [NO]RECURRENCE, SHORTLOOP, STACK, SUPPRESS, TASKCOMMON, VFUNCTION, and [NO]VSEARCH. In free format CDIR$ must be replaced with !DIR$ (which will also work with fixed format).

page eject in any listing file

IBM XLF EJECT
CIVIC EJECT.
CF77 cdir$ eject
PGF77 %EJECT

ignore vector dependencies on following loop

IBM XLHPF Use -qassert=nodeps to indicate no dependencies in any loops.
CIVIC cdir$ ivdep or clll. option assert(nohazard)
CF77 cdir$ ivdep [safevl=constant] where constant may be max VL to use.
CF90 cdir$ ivdep [safevl=constant] where constant may be max VL to use.

assume that there are no repeated values in the index array

IBM XLF !SMP$ PERMUTATION (arrays)
CF90 !SMP$ PERMUTATION (arrays)

turn on source listing in any listing file

CIVIC LIST.
CF77 cdir$ list
PGF77 %LIST

don't vectorize next loop

CIVIC cdir$ nextscalar or option assert(hazard).
CF77 cdir$ nextscalar
CF90 cdir$ nextscalar

turn off source listing in any listing file

CIVIC NOLIST.
CF77 cdir$ nolist
PGF77 %NOLIST

align code on a buffer boundary

CIVIC option align
CF77 CDIR$ ALIGN may be used to align a block of code on a buffer boundary, or -o loopalign may be used to attempt to align all applicable loops on buffer boundaries.
CF90 !DIR$ ALIGN may be used to align a block of code on a buffer boundary.

inform the compiler of some condition

IBM XLHPF !SMP$ ASSERT (list) where the list may contain NODEPS to indicate no loop-carried dependencies for the following loop or ITERCNT(n) to indicate the loop iteration count.
The -qassert=itercnt=n option may be used to indicate the iteration count of a typical loop.
CIVIC clll. option assert(cond)
CF77 cdir$ novector turns off vectorization until cdir$ vector;
cdir$ notask turns off auto-tasking until cdir$ task;
cdir$ ivdep is equivalent to option assert(nohazard);
cdir$ shortloop is equivalent to option assert(tripcount.le.64, tripcount.ne.0);
cdir$ prefervector indicates the preferred loop in a nest to vectorize;
cdir$ prefertask indicates the preferred loop in a nest to auto-task.
CF90 cdir$ novector turns off vectorization until cdir$ vector;
cdir$ ivdep is equivalent to option assert(nohazard);
cdir$ shortloop is equivalent to option assert(tripcount.le.64, tripcount.ne.0);
!dir$ concurrent says to assume there are no loop carried dependencies;
ignore_tkr say to ignore type, kind, and rank of dummy arguments when resolving generic calls to specific calls.

turn on array bounds checking

CIVIC clll. option bounds
CF77 cdir$ bounds local control which is overridden by execute line.

specify default integer size

CIVIC clll. option integer(m)
CF77 CDIR$ INTEGER=46 or
CDIR$ INTEGER=64 or
the -i option may be used.
CF90 !DIR$ INTEGER=46 or
!DIR$ INTEGER=64 or
!DIR$ INTEGER=32
DEC F90 !DEC$ INTEGER:1 or
!DEC$ INTEGER:2 or
!DEC$ INTEGER:4 or
!DEC$ INTEGER:8

specify default real size

DEC F90 !DEC$ REAL:4 or
!DEC$ REAL:8 or
!DEC$ REAL:16

specify that an external is written in some other language

IBM XLF May use the -qextname option to suffix an underscore on external names.
IBM XLHPF May use the -qextname option to suffix an underscore on external names.
CIVIC clll. option interface(...)
DEC F77 May use !DEC$ ALIAS x, "y" to have external x known to the loader as y.
DEC F90 May use !DEC$ ALIAS x, "y" to have external x known to the loader as y.
!DEC$ ATTRIBUTES C::x says x is a C routine (and uses C calling conventions). (ATTRIBUTES may also specify that the number of arguments is VARYING, that an ALIAS name is to be used, and that dummy arguments are to be passed by VALUE or by REFERENCE.)
PGF77 External names have underscore appended, so C routines should be defined with appended _ (and probably in lower case -- fun_ ). Character valued functions add address and length of result at start of arg list.
Sun F77 External x !$PRAGMA C(x) to link to routine x written in C--name taken as all lower case.
Sun F90 External x !$PRAGMA C(x) to link to routine x written in C--name taken as all lower case.

make sure a label is retained during optimization

CIVIC clll. option label(lab)
CF77 cdir$ suppress can be used to force all variables to memory.

put periodic compiler generated labels out

CIVIC clll. option linetag(cnt)
CF77 Use -o off to generate a break at each source line.

declare that a subroutine has no side effects

IBM XLF Use -qipa=nosideeffects=list to specify list of routines with no side effects. Use !SMP$ CNCALL to indicate that there are no loop-carried dependencies in the the next loop as a result of routines called.
CIVIC clll. option no side effects(list)
CF77 cdir$ no side effects directly before call in question.
CF90 MIC$ CNCALL directly before call in question.

turn off array bounds checking

CIVIC clll. option nobounds
CF77 cdir$ nobounds provides local control which is overridden by execute line.

assert that pointered areas are disjoint

IBM XLF Use -qalias=noaryovrlp execute line option to assert that there are no array assignments of overlapping arrays.
IBM XLHPF Use -qalias=noaryovrlp execute line option to assert that there are no array assignments of overlapping arrays.
CIVIC clll. option nodyneqv
CF77 Control not available. Compiler assumes no dynamic equivalencing.

revert to old LRLTRAN defaults

CIVIC clll. option oldlrltran

declare an external as soft (only loaded if needed elsewhere)

CIVIC clll. option soft external(list)
Sun F77 C$PRAGMA WEAK (name [=name2]) declares an external to be weak--i.e. the loader will not complain if the external is not found.

declare an external as a task head

CIVIC clll. option task external(list)

signal implicit coersion as error

CIVIC clll. option type convert

pronounce a variable dead

CIVIC clll. option undefine(list)
CF77 Not needed in general-- optimizer takes care of it.

control compiler individual loop unrolling

CIVIC clll. option unroll(n)
CF77 CDIR$ NOVECTOR to block complete unrolling on next loop.
CF90 CDIR$ UNROLL [n] to unroll n times;
CDIR$ UNROLL0 or CDIR$ UNROLL1 or CDIR$ NOUNROLL to not unroll.
Sun F77 !$PRAGMA SUN UNROLL=n
Sun F90 !$PRAGMA SUN UNROLL=n

assume that the next loop has a small tripcount

CIVIC clll. option shortloop or
option assert(tripcount.ne.0), assert(tripcount.le.64)
CF77 cdir$ shortloop indicates that tripcount of loop is 0<tripcount<65.
CF90 cdir$ shortloop indicates that tripcount of loop is 0<tripcount<65;
cdir$ shortloop128 indicates that tripcount of loop is 0<tripcount<129;

specify source format for subsequent lines

IBM XLF SOURCEFORM directive. Default form of directive is
!IBM* SOURCEFORM(form) where form is FIXED, FIXED(num_cols), FREE(F90), FREE(IBM), or FREE. The directive must start in column 1. The directive is in effect until the end of the file or until another SOURCEFORM directive or an @PROCESS directive that changes the format.
CF90 !DIR$ FREE or !DIR$ FIXED may be used within a source file to determine the source form.
DEC F90 !DEC$ FREEFORM or !DEC$ NOFREEFORM may be used within a source file to determine the source form.
Sun F90 !DIR$ FREE or !DIR$ FIXED may be used within a source file to determine the source form.

control compiler transformation of loops into library calls

CF90 !DIR$ PATTERN allows recognition of loop patterns that may be changed to library calls;
!DIR$ NOPATTERN turns off such pattern recognition.

Have code copy assumed shape array arguments to local storage for duration of routine

CF90 !DIR$ COPY_ASSUMED_SHAPE [array_list] makes local copies of the indicated (or all appropriate argument) arrays for better memory locality.

Specify that a variable is allocated in some other (non-Fortran) source

DEC F90 !DEC$ ATTRIBUTES EXTERN::object_list

Treat source as if IMPLICIT NONE was specified on all routines

DEC F90 !DEC$ DECLARE

Define a compile time variable (for conditional compilation)

DEC F90 !DEC$ [UN]DEFINE name[=value]

Conditional compilation construct

DEC F90 !DEC$ IF (expr) or !DEC$ IF DEFINED (name)
...
[!DEC$ ELSE IF (expr)
...]
[!DEC$ ELSE
...]
!DEC$ ENDIF

Specify fixed-form line length for subsequent lines

DEC F90 !DEC$ FIXEDFORMLINESIZE: {72 | 80 | 132}

Specify a string to identify an object module

DEC F90 !DEC$ IDENT "string"
CF90 !DIR$ ID "string"

Specify a string to print during the first compilation phase

DEC F90 !DEC$ MESSAGE: "string"

Specify a library that is to be searched at link time

DEC F90 !DEC$ OBJCOMMENT LIB: "name"

Specify alignment of items in common blocks or records

DEC F90 !DEC$ OPTIONS /ALIGN[=...]
...
!DEC$ END OPTIONS

Specify alignment of a common block

DEC F90 !DEC$ PSECT /common_name/ ALIGN=val where val is 0, 1, 2, 3, or 4 to indicate byte, word, long word, quad word, or oct word alignment.

Specify how tightly derived types and record structures are packed in memory

DEC F90 !DEC$ PACK:[ 1 | 2 | 4 ]

Restrict the language accepted to strict Fortran 90

DEC F90 !DEC$ STRICT

Specify the string to be used for the (sub)title field in a listing header

DEC F90 !DEC$ [SUB]TITLE "string"