HP Fortran Programmer's Guide (March 2010)
Using Fortran directives
Using HP Fortran directives
Chapter 9222
For more information
See “Incompatibilities with HP FORTRAN 77” on page 220 for information about the +list
option.
$HP$ OPTIMIZE
The $HP$ OPTIMIZE directive enables or disables the level of optimization that was specified
on the command line.
Syntax
!$HP$ OPTIMIZE [ON | OFF]
ON enables the level of optimization specified on the command line.
OFF disables the level of optimization specified on the command line.
This directive is effective for all program units that follow it in your program. It should
therefore be placed outside and before the program units it is to affect. If you insert this
directive inside a program unit, it will have no effect on that program unit, only on those that
follow.
Description and restrictions
The $HP$ OPTIMIZE directive allows you to determine which areas of your program that the
optimizer will process. Specifying $HP$ OPTIMIZE OFF causes the following source lines not
to be optimized. $HP$ OPTIMIZE ON re-enables optimization for the following source lines.
This directive is effective only if you have used either the -On or +On option when you
compiled the program. If you have not specified either option, both $HP$ OPTIMIZE ON and
$HP$ OPTIMIZE OFF will give you level 0 optimization.
The following are supported:
!HP$ OPTIMIZE ON
!HP$ OPTIMIZE OFF
!HP$ OPTIMIZE level 1
!HP$ OPTIMIZE level 0
!HP$ OPTIMIZE level 2
!HP$ OPTIMIZE level 1 on
!HP$ OPTIMIZE level 0 on
!HP$ OPTIMIZE level 2 on