Oracle® Solaris Studio 12.4: Fortran User's Guide

Exit Print View

Updated: March 2015

Fortran Directives Summary

This appendix summarizes the directives recognized by f95 Fortran compiler:

  • General Fortran Directives

  • Sun Parallelization Directives

  • Cray Parallelization Directives

  • OpenMP Fortran 95 Directives, Library Routines, and Environment

C.1 General Fortran Directives

General directives accepted by f95 are described in Directives.

Table C-1  Summary of General Fortran Directives
!$PRAGMA keyword ( a [ , a ] … ) [ , keyword ( a [ , a ] … ) ] ,…
!$PRAGMA SUN keyword ( a [ , a ] … ) [ , keyword ( a [ , a ] … ) ] ,…
Comment-indicator in column 1 may be c, C, !, or *. (We use ! in these examples. f95 free-format must use !.)
C Directive
!$PRAGMA C(list)
Declares a list of names of external functions as C language routines.
IGNORE_TKR Directive
!$PRAGMA IGNORE_TKR {name {, name} ...}
The compiler ignores the type, kind, and rank of the specified dummy argument names appearing in a generic procedure interface when resolving a specific call.
UNROLL Directive
Advises the compiler that the following loop can be unrolled to a length n.
WEAK Directive
!$PRAGMA WEAK(name[=name2])
Declares name to be a weak symbol, or an alias for name2.
OPT Directive
Set optimization level for a subprogram to n.
PIPELOOP Directive
Assert dependency in loop between iterations n apart.
PREFETCH Directives
Request compiler generate prefetch instructions for references to name. (Requires -xprefetch option, which is enabled by default. Prefetch directives can be disabled by compiling with —xprefetch=no. Target architecture must also support prefetch instructions, and the compiler optimization level must be set greater than —xO2.)
ASSUME Directives
!$PRAGMA [BEGIN} ASSUME (expression [,probability])
Make assertions about conditions at certain points in the program that the compiler can assume are true.

C.2 Special Fortran Directives

The following directives are only available with f95. See FIXED and FREE Directives for details.

Table C-2  Special Fortran Directives
!DIR$ directive : initial line
!DIR$& ... : continuation line
With fixed-format source, C is also accepted as a directive-indicator:
CDIR$ directive...
The line must start in column 1. With free-format source, the line may be preceded by blanks.
FIXED/FREE Directives
These directives specify the source format of the lines following the directive. They apply to the rest of the source file in which they appear, up to the next FREE or FIXED directive.
Assert that the following DO, FORALL, or WHERE loop is free of loop-carried dependences, and can be optimized. Interpretation determined by the -xivdep option. See IVDEP Directive

C.3 Fortran OpenMP Directives

The Oracle Solaris Studio Fortran compiler supports the OpenMP 3.1 Fortran API. The -openmp compiler flag enables these directives. (See –xopenmp[={parallel|noopt|none}]).

See the OpenMP API User’s Guide for complete details.