FORTRAN 77 Language Reference

Input Actions

The NAMELIST input statement reads the next external record, skipping over column one, and looking for the symbol $ in column two or beyond, followed by the group name specified in the READ statement.

If the $group-name is not found, the input records are read until end of file.

The records are input and values assigned by matching names in the data with names in the group, using the data types of the variables in the group.

Variables in the group that are not found in the input data are unaltered.

The syntax of NAMELIST READ is:


READ ( extu, namelist-specifier [, iostat] [, err] [, end]) 

where namelist-specifier has the form:


[NML=]group-name 

and group-name has been previously defined in a NAMELIST statement.

Example: NAMELIST input:


	CHARACTER*14 SAMPLE 
	LOGICAL*4 NEW 
	REAL*4 DELTA, MAT(2,2) 
	NAMELIST /CASE/ SAMPLE, NEW, DELTA, MAT 
	READ ( 1, CASE ) 

In this example, the group CASE consists of the variables, SAMPLE, NEW, DELTA, and MAT. If you do omit the keyword NML, then you must also omit the keyword UNIT. The unit parameter must be first, namelist-specifier must be second, and there must not be a format specifier.

The READ can have the form of the following example:


	READ ( UNIT=1, NML=CASE )