HP Fortran Programmer's Reference (September 2007)

HP Fortran statements
OPTIONS (extension)
Chapter 10 419
OPTIONS (extension)
Lowers the optimization level used by the HP Fortran compiler.
Syntax
OPTIONS +O
n
where +O
n
(or -O
n
) specifies a level of optimization that is equal to or less than the level
specified on the command line.
Description
The OPTIONS statement is an extension of HP Fortran and is used to specify a level of
optimization that is equal to or less than the level specified on the command line. If the level
specified by the OPTIONS statement is higher than that specified on the command line, the
statement is ignored.
The OPTIONS statement must be placed outside all program units. The changed level of
optimization applies to the beginning of the next program unit and remains in effect for all
succeeding program units or until superseded by another OPTIONS statement or by the
!$HP$ OPTIMIZE directive.
The OPTIONS statement differs from the OPTIMIZE directive in that the OPTIMIZE
directive enables or disables optimization but does not change the optimization level. The
!$HP$ OPTIMIZE directive is described in the HP Fortran Programmer’s Guide.
The OPTIMIZE directive takes precedence over the OPTIONS statement: when the
OPTIMIZE directive is used to disable optimization, any subsequent OPTIONS statement
has no effect until a later directive enables optimization.
Examples
In the following example, the first OPTIONS statement optimizes the subroutine go_fast at
optimization level 3. The second OPTIONS statement lowers the optimization level to 2.
OPTIONS +O3
SUBROUTINE go_fast
...
END SUBROUTINE go_fast
OPTIONS +O2
SUBROUTINE not_so_fast
...
END SUBROUTINE not_so_fast