/sys$common/syshlp/HELPLIB.HLB  —  FORTRAN  Statements  Directives  General Directives, OPTIONS
  cDEC$ OPTIONS

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

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

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

    option  Is one or both of the following:

    o /WARN=[NO]ALIGNMENT

    Controls whether warnings are issued by the compiler for
    data that is not naturally aligned.  By default, you receive
    compiler messages when misaligned data is encountered
    (/WARN=ALIGNMENT).

    o /[NO]ALIGN[=p]

    Controls whether the VSI Fortran compiler naturally aligns
    fields in derived-type and record structures and data items
    in common blocks for performance reasons, or whether the
    compiler packs those fields and data items together on
    arbitrary byte boundaries.

    p  Is a specifier with one of the following forms:

     [class =] rule
     (class = rule,...)
     ALL
     NONE

     class  Is one of the following keywords:

         COMMONS    (for common blocks)
         RECORDS    (for derived-type and record structures)
         STRUCTURES (a synonym for RECORDS)

     rule   Is one of the following keywords:

            PACKED -   Packs fields in structures or data
                       items in common blocks on arbitrary
                       byte boundaries.

            NATURAL -  Naturally aligns fields in structures
                       and data items in common blocks on
                       up to 64-bit boundaries (inconsistent
                       with the FORTRAN 77 standard).

                       If you specify NATURAL, the compiler will
                       naturally align all data in a common
                       block, including INTEGER*8, REAL*8, and
                       all COMPLEX data.

            STANDARD - Naturally aligns data items in common
                       blocks on up to 32-bit boundaries (con-
                       sistent with the FORTRAN 77 standard).

                       Note that this keyword only applies to
                       common blocks; so, you can specify
                       /ALIGN=COMMONS=STANDARD, but you cannot
                       specify /ALIGN=STANDARD.

     ALL    Is the same as /ALIGN, /ALIGN=NATURAL, and
            /ALIGN=(RECORDS=NATURAL,COMMONS=NATURAL).

     NONE   Is the same as /NOALIGN, /ALIGN=PACKED, and
            /ALIGN=(RECORDS=PACKED,COMMONS=PACKED)

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

  For performance reasons, VSI Fortran always 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   /ALIGN
          compiler option) minimizes misaligned data.

  To request aligned, data in common blocks, specify
  /ALIGN=COMMONS=STANDARD (for data items up to 32 bits in length) or
  /ALIGN=COMMONS=NATURAL (for data items up to 64 bits in length), or
  place source data declarations within the common block in
  descending size order, so that each data field is naturally
  aligned.

  To request packed, unaligned data in a record structure, specify
  /ALIGN=RECORDS=PACKED, or consider placing source data declarations
  for the record so that the data is naturally aligned.

  The OPTIONS directive supersedes the /ALIGN compiler option.

  OPTIONS directives must be balanced and can be nested up to 100
  levels, for example:

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

  Note that common blocks within Group B will be PACKED.  The CDEC$
  OPTION specification for Group B only applies to RECORDS, so
  COMMONS retains the previous setting (in this case, from the Group
  A specification).

  For more information on alignment and data sizes, see the HP
  Fortran for OpenVMS User Manual.
Close Help