9 Using Fortran directives
Compiler directives are commands within the source program that affect how the program is compiled. They are similar in function to
.Fextension, the source files are first passed to the C preprocessor for processing. For information about the C preprocessor, refer to cpp((1)).
Directive syntax
The syntax for specifying directives in HP Fortran source files varies according to the type of directive:
C preprocessor directives take the form:
HP Fortran compiler directives take the form:
where is
There must be no space between
Using HP Fortran directives
HP Fortran provides a number of compiler directives that are useful for controlling certain functions (for example, optimization) within the source file. Table
Table 35 Table
Directive | Function | |
|
|
|
$HP$ | ALIAS | Associates the name of a subroutine, function, entry, or common block |
|
| with an external name. |
|
|
|
$HP$ | CHECK_OVERFLOW | Generates code to trap integer overflows. |
|
|
|
$HP$ | LIST | Controls output of source lines in listing file. |
|
|
|
$HP$ | OPTIMIZE | Controls optimization within the source file. |
|
|
|
$HP$ | ESTIMATED FREQUENCY | Passes on to the compiler an estimate of how frequently the current |
|
| block is executed. |
|
| If the current block is an 'if' block, then 'f' must be 0< = f < = 1. In |
|
| this case, 'f' indicates the probability of executing this block compared |
|
| to the corresponding 'if' block. If the current block is a loop, then 'f' |
|
| must be f>= 0. In this case, 'f' indicates the number of times the loop |
|
| might get executed (trip count). |
|
|
|
|
|
|
NOTE: For a detailed description of Optimization directives, Parallelizing directives, OpenMP directives and Data privatization directives, see Parallel Programming Guide for
Directive syntax 123