HP Fortran Programmer's Reference (September 2007)

HP Fortran statements
NAMELIST
Chapter 10404
The same variable name may appear in different NAMELIST statements within the same
scoping unit.
Examples
PROGRAM
INTEGER i, j(10)
CHARACTER*10 c
NAMELIST /n1/ i, j, c
! Define the namelist group n1
READ (UNIT=5,NML=n1)
WRITE (6, n1)
END
When this program is compiled and executed with the following input record:
&n1
j(8) = 6, 7, 8
i = 5c = 'xxxxxxxxx'
j = 5*0, -1, 2
c(2:6) = 'abcde'
/
its output is:
&n1
I = 5
J = 0 0 0 0 0 -1 2 6 7 8
C ='xabcdexxx'
/
Related statements
ACCEPT, OPEN, INQUIRE, PRINT, READ, and WRITE
Related concepts
Namelist-directed I/O is described in “Namelist-directed I/O” on page 213.