VMS Help  —  FORTRAN  /ALIGNMENT[=p] D=/ALIGN=(COMM=(PACK,NOMULTI),RECO=NATU)
  /[NO]ALIGNMENT

  Controls whether the VSI Fortran compiler naturally aligns
  fields in records or data items in common blocks, or whether the
  compiler packs those fields and data items together on arbitrary
  byte boundaries.

  Although VSI Fortran always aligns local data items on natural
  boundaries, certain data declaration statements and misaligned
  arguments can force misaligned data.

  Use the /ALIGNMENT qualifier to control the alignment of fields
  associated with common blocks, derived-type structures, and record
  structures.

  The compiler issues messages when it detects misaligned data by
  default (/WARNINGS=ALIGNMENT).  For information about the causes of
  misaligned data and detection at run time, see the HP Fortran for
  OpenVMS User Manual.

                                 NOTE

          Misaligned data significantly increases the time it
          takes to execute a program, depending on the number
          of  misaligned  fields   encountered.    Specifying
          /ALIGNMENT=ALL    (same    as   /ALIGNMENT=NATURAL)
          minimizes misaligned data.

  To obtain compiler messages when misaligned data is encountered,
  use the /WARNING=ALIGNMENT qualifier (or within the OpenVMS
  Debugger, use the command SET BREAK/UNALIGNED).

  Parameter "p" is a specifier with one of the following forms:

     [class =] rule
     (class = rule [,...])
     SEQUENCE
     ALL (or NATURAL)
     MULTILANGUAGE
     NONE (or PACKED)
     PAD_ALIGN_SIZE

  class
  Is one of the following keywords:

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

  In VSI Fortran, STRUCTURES and RECORDS are the same.

  rule
  Is one of the following keywords:

  NATURAL
    Naturally aligns fields in derived-type and record structures and
    data items in common blocks on up to 8-byte boundaries.

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

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

  STANDARD
    Naturally aligns data items in common blocks on up to 4-byte
    boundaries (consistent with the Fortran 95/90 and FORTRAN 77
    standards).

    The compiler will not naturally align INTEGER(KIND=8),
    REAL(KIND=8), and COMPLEX data declarations.  Such data
    declarations should be planned so they fall on natural
    boundaries.  Specifying /ALIGNMENT=COMMONS=STANDARD alone means
    that the default for record structures is used.

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

  [NO]MULTILANGUAGE
    Controls whether the compiler pads the size of common blocks to
    ensure compatibility when the common block program section is
    shared by code created by other compilers running on OpenVMS.

    When a program section generated by a Fortran common block is
    overlaid with a program section consisting of a C structure,
    linker error messages can result.  This is because the sizes of
    the program sections are inconsistent; the C structure is padded
    and the Fortran common block is not.

    Specifying /ALIGNMENT=COMMON=MULTILANGUAGE ensures that HP
    Fortran follows a consistent program section size allocation
    scheme that works with DEC C program sections that are shared
    across multiple images.  Program sections shared in a single
    image do not have a problem.  The corollary DEC C qualifier is
    /PSECT_MODEL=[NO]MULTILANGUAGE.

    The default is /ALIGNMENT=COMMON=NOMULTILANGUAGE, which is also
    the default behavior of HP Fortran 77 (formerly Compaq
    Fortran 77) and is sufficient for most applications.

    This keyword only applies to common blocks; therefore, you can
    specify /ALIGNMENT=COMMONS=[NO]MULTILANGUAGE, but you cannot
    specify /ALIGNMENT=[NO]MULTILANGUAGE.

  [NO]PAD_ALIGN_SIZE
    Controls whether the compiler pads the size of common blocks
    based on the alignment size.

    Specifying /ALIGNMENT=COMMON=PAD_ALIGN_SIZE ensures that the
    padding appended to the common blocks makes the program section
    size allocation as large as the alignment size.

    Using this keyword results in a program section allocation
    incompatible with sharing across multiple images if those
    images are not Fortran images which have also been compiled
    with this keyword.

    This keyword applies only to common blocks; therefore, you can
    specify /ALIGNMENT=COMMON=[NO]PAD_ALIGN_SIZE, but you cannot
    specify /ALIGNMENT=[NO]PAD_ALIGN_SIZE.

  [NO]SEQUENCE
    Specifies whether or not SEQUENCE types follow the alignment rule
    currently in effect.

    If SEQUENCE is in effect, then SEQUENCE types participate in
    alignment the same as derived types without the SEQUENCE
    property.

    If NOSEQUENCE is in effect, SEQUENCE types are always packed,
    regardless of the current alignment rules.

  ALL
    Is equivalent to /ALIGNMENT, /ALIGNMENT=(NATURAL, SEQUENCE) and
    /ALIGNMENT=(COMMONS=(NATURAL, NOMULTILANGUAGE), RECORDS=NATURAL,
    SEQUENCE).

  NONE
    Is equivalent to /NOALIGNMENT, /ALIGNMENT=(PACKED, NOSEQUENCE),
    and /ALIGNMENT=(COMMONS=(PACKED, NOMULTILANGUAGE),
    RECORDS=PACKED, NOSEQUENCE).

  Defaults depend whether the /ALIGNMENT and /FAST qualifiers are
  specified, as follows:

  Command Line               Default
  ------------               -------
  Omit /ALIGNMENT and        /ALIGNMENT=(NOSEQUENCE, COMMONS=(PACKED,
      omit /FAST              NOMULTILANGUAGE), RECORD=NATURAL)

  Omit /ALIGNMENT and        /ALIGNMENT=(SEQUENCE, COMMONS=(NATURAL,
      specify /FAST           NOMULTILANGUAGE), RECORD=NATURAL)

  /ALIGNMENT=COMMONS=rule    Use whatever the /ALIGNMENT qualifier
                             specifies for COMMONS, but use the
                             default of RECORDS=NATURAL

  /ALIGNMENT=RECORD=rule     Use whatever the /ALIGNMENT qualifier
                             specifies for RECORDS, but use the
                             default of COMMONS (depends whether
                             /FAST was specified or omitted)

  If you specify /ALIGNMENT=class=rule, the rule only applies to that
  class, the other class gets aligned according to the default; for
  example:

  1. /ALIGNMENT=COMMONS=STANDARD

     In this case, RECORDS=NATURAL by default.

  2. /ALIGNMENT=RECORDS=NATURAL

     In this case, COMMONS=PACKED by default.

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

  To request aligned data in common blocks, specify
  /ALIGNMENT=COMMONS=STANDARD (for data items up to 4 bytes in
  length) or /ALIGNMENT=COMMONS=NATURAL (for data items up to 8 bytes
  length), or place source data declarations within the common block
  carefully so that each data field is naturally aligned.

  The /ALIGNMENT and /WARN=ALIGNMENT qualifiers can be used together
  in the same command line.

  You can override the alignment specified on the command line by
  using a CDEC$ OPTIONS directive, as described in the HP Fortran for
  OpenVMS Language Reference Manual.

  You can also specify /ALIGNMENT=REC2BYTE or /ALIGNMENT=REC4BYTE.
  These options specify that fields of records and components of
  derived types are to be aligned on the smaller of:

   o  The 2- or 4-byte boundary specified

   o  The boundary that will naturally align them

  These options do not affect whether common blocks are naturally
  aligned or packed.
Close Help