2 c This program tests: namelist comment, a blank line before the nameilist name, the namelist name,
3 c a scalar qualifier, various combinations of space, comma and lf delimiters, f-formats, e-formats
4 c a blank line within the data read, nulls, a range qualifier, a new object name before end of data
5 c and an integer read. It also tests that namelist output can be re-read by namelist input.
6 c provided by Paul Thomas - pault@gcc.gnu.org
13 namelist /mynml/ x, xx
22 open (10,status="scratch")
23 write (10, *) "!mynml"
26 write (10, *) "&mynml x(7) =+99.0e0 x=1.0, 2.0 ,"
27 write (10, *) " 2*3.0, ,, 7.0e0,+0.08e+02 !comment"
29 write (10, *) " 9000e-3 x(4:5)=4 ,5 "
30 write (10, *) " x=,,3.0, xx=10d0 /"
33 read (10, nml=mynml, IOSTAT=ier)
34 if (ier.ne.0) call abort
38 if ( abs( x(i) - real(i) ) .gt. 1e-8 ) call abort
40 if ( abs( xx - 10d0 ) .gt. 1e-8 ) call abort
42 write (10, nml=mynml, iostat=ier)
43 if (ier.ne.0) call abort
46 read (10, NML=mynml, IOSTAT=ier)
47 if (ier.ne.0) call abort
51 if ( abs( x(i) - real(i) ) .gt. 1e-8 ) call abort
53 if ( abs( xx - 10d0 ) .gt. 1e-8 ) call abort