A storage unit is a fixed unit of physical memory allocated to certain data. A storage sequence is a sequence of storage units. The size of a storage sequence is the number of storage units in the storage sequence. A storage unit can be numeric, character, or unspecified.
A nonpointer scalar of type default real, integer, or logical occupies one numeric storage unit. A nonpointer scalar of type double precision real or default complex occupies two contiguous numeric storage units. In Compaq Fortran, one numeric storage unit corresponds to 4 bytes of memory.
A nonpointer scalar of type default character with character length 1 occupies one character storage unit. A nonpointer scalar of type default character with character length len occupies len contiguous character storage units. In Compaq Fortran, one character storage unit corresponds to 1 byte of memory.
A nonpointer scalar of nondefault data type occupies a single unspecified storage unit. The number of bytes corresponding to the unspecified storage unit differs depending on the data type.
Table 16-2 lists the storage requirements (in bytes) for the intrinsic data types.
Table 16-2 Data Type Storage Requirements
Data Type | Storage Requirements (in bytes) |
---|---|
BYTE | 1 |
LOGICAL | 2, 4, or 8 1 |
LOGICAL(1) | 1 |
LOGICAL(2) | 2 |
LOGICAL(4) | 4 |
LOGICAL(8) | 8 |
INTEGER | 2, 4, or 8 1 |
INTEGER(1) | 1 |
INTEGER(2) | 2 |
INTEGER(4) | 4 |
INTEGER(8) | 8 |
REAL | 4, 8, or 16 2 |
REAL(4) | 4 |
DOUBLE PRECISION | 8 |
REAL(8) | 8 |
REAL(16) 3 | 16 |
COMPLEX | 8, 16, or 32 2 |
COMPLEX(4) | 8 |
DOUBLE COMPLEX | 16 |
COMPLEX(8) | 16 |
COMPLEX(16) 3 | 32 |
CHARACTER*len | len 4 |
CHARACTER*(*) | assumed-length 5 |
1 Depending on default integer, LOGICAL and INTEGER can
have 2, 4, or
8 bytes. The default allocation is four bytes.
2 Depending on default real, REAL can have 4, 8, or 16 bytes and COMPLEX can have 8, 16, or 32 bytes. The default allocations are four bytes for REAL and eight bytes for COMPLEX. 3 VMS, U*X 4 The value of len is the number of characters specified. The largest valid value is 2147483647 (2**31-1) on Tru64 UNIX, Linux, and Windows systems; 65535 on OpenVMS systems. Negative values are treated as zero. 5 The assumed-length format *(*) applies to dummy arguments, PARAMETER statements, or character functions, and indicates that the length of the actual argument or function is used. (See Section 8.8.4 and your user manual or programmer's guide.) |
A nonpointer scalar of sequence derived type occupies a sequence of storage sequences corresponding to the components of the structure, in the order they occur in the derived-type definition. (A sequence derived type has a SEQUENCE statement.)
A pointer occupies a single unspecified storage unit that is different from that of any nonpointer object and is different for each combination of type, type parameters, and rank.
The definition status and value of a data object affects the definition status and value of any storage-associated entity.
When two objects occupy the same storage sequence, they are totally storage-associated. When two objects occupy parts of the same storage sequence, they are partially associated. An EQUIVALENCE statement, a COMMON statement, or an ENTRY statement can cause total or partial storage association of storage sequences.
For More Information: