15.1.14 OPTIONS Directive

The OPTIONS directive affects data alignment and warnings about data alignment. It takes the following form:

cDEC$ OPTIONS option [option]
      ...
cDEC$ END OPTIONS


c
Is one of the following: C (or c), !, or * (see Section 15.1.1).


option
Is one (or both) of the following:


Rules and Behavior

The OPTIONS (and accompanying END OPTIONS) directives must come after OPTIONS, SUBROUTINE, FUNCTION, and BLOCK DATA statements (if any) in the program unit, and before the executable part of the program unit.

The OPTIONS directive supersedes the compiler option that sets alignment.

For performance reasons, Compaq Fortran aligns local data items on natural boundaries. However, EQUIVALENCE, COMMON, RECORD, and STRUCTURE data declaration statements can force misaligned data. If /WARN=NOALIGNMENT is specified, warnings will not be issued if misaligned data is encountered.


Note: Misaligned data significantly increases the time it takes to execute a program. As the number of misaligned fields encountered increases, so does the time needed to complete program execution. Specifying cDEC$ OPTIONS/ALIGN (or the compiler option that sets alignment) minimizes misaligned data.

If you want aligned data in common blocks, do one of the following:

If you want packed, unaligned data in a record structure, do one of the following:

An OPTIONS directive must be accompanied by an END OPTIONS directive; the directives can be nested up to 100 levels. For example:

 CDEC$ OPTIONS   /ALIGN=PACKED         ! Start of Group A
    declarations
 CDEC$ OPTIONS   /ALIGN=RECO=NATU         ! Start of nested Group B
    more declarations
 CDEC$ END   OPTIONS                      ! End of Group B
    still more declarations
 CDEC$ END   OPTIONS                   ! End of Group A

The CDEC$ OPTIONS specification for Group B only applies to RECORDS; common blocks within Group B will be PACKED. This is because COMMONS retains the previous setting (in this case, from the Group A specification).

For More Information:


Previous Page Next Page Table of Contents