Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference

ID 767251
Date 3/22/2024
Public
Document Table of Contents

STORAGE_SIZE

Inquiry Intrinsic Function (Generic): Returns the storage size in bits.

result = STORAGE_SIZE (a [, kind])

a

(Input) Must be a scalar or array. It can be of any type. If it has any deferred type parameters it must not be an unallocated allocatable variable, or a disassociated, or undefined pointer.

kind

(Input; optional) Must be a scalar integer constant expression.

Results

The result is a scalar of type integer. If kind is present, the kind parameter of the result is that specified by kind; otherwise, the kind parameter of the result is that of default integer. If the processor cannot represent the result value in the kind of the result, the result is undefined.

The result value is the size expressed in bits for an element of an array that has the dynamic type and kind parameters of a.

If the type and kind parameters are such that storage association applies, the result is consistent with the named constants defined in the intrinsic module ISO_FORTRAN_ENV.

An array element may take more bits to store than a scalar, since any hardware-imposed alignment requirements for array elements may not apply to a scalar variable.

NOTE:

The result is intended to be the size in memory that an object takes when it is stored. This size may differ from the size it takes during expression handling (which may be the native register size) or when stored in a file. If an object is never stored in memory but only in a register, this function returns the size it would take if it were stored in memory.

Example

STORAGE_SIZE (1.0) has the same value as the named constant NUMERIC_STORAGE_SIZE in the intrinsic module ISO_FORTRAN_ENV.