Syntax:
The /alignment option specifies the alignment of data items in common blocks, record structures, and derived-type structures. The /Zpn option specifies the alignment of data items in derived-type or record structures.
The /alignment options are:
The /align:commons option aligns the data items of all COMMON data blocks on natural boundaries up to four bytes. The default is /align:nocommons (unless /fast is specified), which does not align data blocks on natural boundaries. In the visual development environment, specify the Common Element Alignment as 4 in the Fortran Data Compiler Option Category.
The /align:dcommons option aligns the data items of all COMMON data blocks on natural boundaries up to eight bytes. The default is /align:nocommons (unless /fast is specified), which does not align data blocks on natural boundaries. Specifying /fast sets /align:dcommons. In the visual development environment, specify the Common Element Alignment as 8 in the Fortran Data Compiler Option Category.
The /align:records option (the default) requests that components of derived types and fields of records be aligned on natural boundaries up to 8 bytes (for derived types with the SEQUENCE statement, see /align:[no]sequence below). The /align:norecords option requests that components and fields be aligned on arbitrary byte boundaries, instead of on natural boundaries up to 8 bytes. In the visual development environment, specify the Structure Element Alignment in the Fortran Data Compiler Option Category.
The /align:sequence option requests that components of derived types with the SEQUENCE statement will obey whatever alignment rules are currently in use (default alignment rules will align unsequenced components on natural boundaries). The default value (unless /fast is specified) is /align:nosequence, which means that components of derived types with the SEQUENCE property will be packed, regardless of whatever alignment rules are currently in use. Specifying /fast sets /align:sequence.
In the visual development environment, specify Allow SEQUENCE Types to be Padded for Alignment in the Fortran Data Compiler Option Category.
The /align:recNbyte or /Zpn options request that fields of records and components of derived types be aligned on the smaller of:
Specifying /align:recNbyte, /Zpn, or /align:[no]records does not affect whether common block fields are naturally aligned or packed. In the visual development environment, specify the Structure Element Alignment in the Fortran Data Compiler Option Category.
Specifying | Is the Same as Specifying |
---|---|
/Zp | /alignment:records or /align:rec8byte |
/Zp1 | /alignment:norecords or /align:rec1byte |
/Zp2 | /align:rec2byte |
/Zp4 | /align:rec4byte |
/alignment | /Zp8 with /align:dcommons, /alignment:all, or /alignment:(dcommons,records) |
/noalignment | /Zp1, /alignment:none, or /alignment:(nocommons,nodcommons,norecords) |
/align:rec1byte | /align:norecords |
/align:rec8byte | /align:records |
When you omit the /alignment option, records and components of derived types are naturally aligned, but fields in common blocks are packed. This default is equivalent to:
/alignment=(nocommons,nodcommons,records,nosequence)
You can also control the alignment of components in records and derived types and data items in common blocks by Using the cDEC$ OPTIONS Directive.