5.13. NAMELIST Statement

A NAMELIST statement establishes the name for a collection of objects that can then be referenced by the group name in certain I/O statements. The NAMELIST statement is defined as follows:

Table 5-26.

 

namelist_stmt

is

NAMELIST /  namelist_group_name / namelist_group_object_list
  [ [ , ] / namelist_group_name / namelist_group_object_list ] ...

 

namelist_group_object

is

variable_name

A variable in the variable name list must not be an array dummy argument with nonconstant bounds, a variable with assumed character length, an automatic object, a pointer, a Cray pointer, an object of a type that has a pointer component at any level, an allocatable array, or a subobject of any of the preceding objects.

Note: The Fortran standard does not describe Cray pointers.

If a namelist group name has the PUBLIC attribute, no item in the namelist group object list can have the PRIVATE attribute or have private components.

The namelist group name cannot be a name made accessible by USE association.

The order in which the data objects (variables) are specified in the NAMELIST statement determines the order in which the values appear on output.

A namelist group name can occur in more than one NAMELIST statement in a scoping unit. The variable list following each successive appearance of the same namelist group name in a scoping unit is treated as a continuation of the list for that namelist group name.

A variable can be a member of more than one namelist group.

A variable must have its type, type parameters, and shape specified previously in the same scoping unit, or it must be determined by implicit typing rules. If a variable is typed by the implicit typing rules, its appearance in any subsequent type declaration statement must confirm the implicit type and type parameters. The following is an example of a NAMELIST statement:

NAMELIST /N_LIST/ A, B, C