HP Fortran Programmer's Guide (September 2007)

Using Fortran directives
Using HP Fortran directives
Chapter 9202
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.
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
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).