HP Fortran Programmer's Guide (B3908-90031; September 2011)

Using Fortran directives
Using HP Fortran directives
Chapter 9208
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 9-1 lists and briefly describes these directives; they are
listed in the order in which they appear in the sections below.
NOTE For a detailed description of Optimization directives, Parallelizing directives, OpenMP
directives and Data privatization directives, see Parallel Programming Guide for HP-UX
Systems.
In files that use free format, directives must start with the comment character !. In fixed format, they must
start with the comment character C, *, or ! in column 1. Keywords and any arguments must be delimited by
at least one space character, as in the following:
!$HP$ OPTIMIZE ON
Using the comment character as the directive prefix ensures that, unless the compiler is specifically looking
for the directive, it is otherwise treated as a comment and ignored.
Table 9-1 HP Fortran directives
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).