XL Fortran for AIX 8.1

Language Reference

NAMELIST

Purpose

The NAMELIST statement specifies one or more lists of names for use in READ, WRITE, and PRINT statements.

Format



             .-+---+---------------------------.
             | '-,-'                           |
             V                                 |
>>-NAMELIST----/--Nname--/--variable_name_list-+---------------><
 
 

Nname
is a namelist group name

variable_name
must not be an array dummy argument with a nonconstant bound, a variable with nonconstant character length, an automatic object, a pointer, a variable of a type that has an ultimate component that is a pointer, an allocatable object, or a pointee.

Rules

The list of names belonging to a namelist group name ends with the appearance of another namelist group name or the end of the NAMELIST statement.

variable_name must either be accessed via use or host association, or have its type and type parameters specified by previous specification statements in the same scoping unit or by the implicit typing rules. If typed implicitly, any appearance of the object in a subsequent type declaration statement must confirm the implied type and type parameters. A derived-type object must not appear as a list item if any component ultimately contained within the object is not accessible within the scoping unit containing the namelist input/output statement on which its containing namelist group name is specified.

variable_name can belong to one or more namelist lists. If the namelist group name has the PUBLIC attribute, no item in the list can have the PRIVATE attribute or private components.

Nname can be specified in more than one NAMELIST statement in the scoping unit. The variable_name_list following each successive appearance of the same Nname in a scoping unit is treated as the continuation of the list for that Nname.

A namelist name can appear only in input/output statements. The rules for input/output conversion of namelist data are the same as the rules for data conversion.

Examples

DIMENSION X(5), Y(10)
NAMELIST /NAME1/ I,J,K
NAMELIST /NAME2/ A,B,C /NAME3/ X,Y
WRITE (10, NAME1)
PRINT NAME2

Related Information


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