XL Fortran for AIX 8.1

Language Reference

+-------------------------------IBM Extension--------------------------------+


Storage Classes for Variables

Note:
This section pertains only to storage for variables. Named constants and their subobjects have a storage class of literal.

Fundamental Storage Classes

All variables are ultimately represented by one of five storage classes:

Automatic
for variables in a procedure that will not be retained once the procedure ends. Variables reside in the stack storage area.

Static
for variables that retain memory throughout the program. Variables reside in the data storage area. Large, uninitialized variables reside in the .bss storage area.

Common
for common block variables. If a common block variable is initialized, the whole block resides in the data storage area; otherwise, the whole block resides in the .bss storage area.

Controlled Automatic
for automatic objects. Variables reside in the stack storage area. XL Fortran allocates storage on entry to the procedure and deallocates the storage when the procedure completes.

Controlled
for allocatable objects. Variables reside in the heap storage area. You must explicitly allocate and deallocate the storage.

Secondary Storage Classes

None of the following storage classes own their own storage, but are associated with a fundamental storage class at run time.

Pointee
is dependent on the value of the corresponding integer pointer.

Reference parameter
is a dummy argument whose actual argument is passed to a procedure using the default passing method or %REF.

Value parameter
is a dummy argument whose actual argument is passed by value to a procedure.

For details on passing methods, see %VAL and %REF.

Storage Class Assignment

Variable names are assigned storage classes in three ways:

  1. Explicitly:

    A variable that does not satisfy any of the above, but that is equivalenced with a variable that has an explicit storage class, inherits that explicit storage class.

    A variable that does not satisfy any of the above, and is not equivalenced with a variable that has an explicit storage class, has an explicit storage class of static if a SAVE statement with no list exists in the scoping unit.

  2. Implicitly:

    If a variable does not have an explicit storage class, it can be assigned an implicit storage class as follows:

    In a given scoping unit, if a letter, dollar sign or underscore has not been specified in an IMPLICIT STATIC or IMPLICIT AUTOMATIC statement, the implicit storage class is the same as that in the host.

    Variables declared in the specification part of a module are associated with the static storage class.

    A variable that does not satisfy any of the above but that is equivalenced with a variable that has an implicit storage class, inherits that implicit storage class.

  3. Default:

    All other variables have the default storage class:

+----------------------------End of IBM Extension----------------------------+


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]