| United States-English |
|
|
|
![]() |
HP Fortran 90 Programmer's Reference: HP Series 700/800 Computers > Chapter 3 Data types and data objectsStorage association and alignment |
|
In general, no assumptions about the relative storage locations of any entities can be made. The use of COMMON and EQUIVALENCE statements enable storage association to be established. The detailed syntax and description of these statements is given in Chapter 10. The COMMON statement enables common blocks of storage to be established. The use of a COMMON statement referring to the same common block in more than one program unit ensures that the same storage locations are referenced in each of the program units. The EQUIVALENCE statement enables more than one name to be given to the same storage location within a program unit. Where common block elements or array elements are referenced, restrictions apply because of the imposed sequencing of these elements within storage. The SEQUENCE statement appears only in a derived-type definition (see “Derived-type definition”). It enables derived-type variables to be located in common blocks and to be named in EQUIVALENCE statements. The COMMON and SEQUENCE storage statements enforce an ordering of variables within storage. Association may be established between variables with different type and kind parameters. The general rules for the alignment of variables in storage are as follows:
The following example illustrates how a sequence of variables would be stored within a derived type.
Each element of t is allocated as in Table 3-5 “Example of structure storage”. The first component of t starts at an address that is a multiple of 8
The four trailing padding bytes are necessary to preserve the alignment of r8 in each element of the array. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||