# Storage Units and Storage Sequence

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 Intel® 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 Intel® 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.

The following table lists the storage requirements (in bytes) for the intrinsic data types:

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) | 16
COMPLEX | 8, 16, or 32 2
COMPLEX(4) | 8
DOUBLE COMPLEX | 16
COMPLEX(8) | 16
COMPLEX(16) | 32
CHARACTER | 1
CHARACTER*len | len 3
CHARACTER*(*) | assumed-length 4
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 The value of len is the number of characters specified. The largest valid value is 2**31-1 on IA-32 architecture; 2**63-1 on Intel® 64 architecture. Negative values are treated as zero. 4 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 Assumed-Length Character Arguments.)

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. Note that 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.

Parent topic: Storage Association

## See Also

Assumed-Length Character Arguments
COMMON
ENTRY
EQUIVALENCE