2009-10-05 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / pr18122.f90
blob3907f0ae15837f8d62d4ea2be1e3edcc374610ef
1 ! { dg-do run }
2 ! test namelist with scalars and arrays.
3 ! Based on example provided by thomas.koenig@online.de
5 program sechs_w
6 implicit none
8 integer, parameter :: dr=selected_real_kind(15)
10 integer, parameter :: nkmax=6
11 real (kind=dr) :: rb(nkmax)
12 integer :: z
14 real (kind=dr) :: dg
15 real (kind=dr) :: a
16 real (kind=dr) :: da
17 real (kind=dr) :: delta
18 real (kind=dr) :: s,t
19 integer :: nk
20 real (kind=dr) alpha0
22 real (kind=dr) :: phi, phi0, rad, rex, zk, z0, drdphi, dzdphi
24 namelist /schnecke/ z, dg, a, t, delta, s, nk, rb, alpha0
26 open (10,status="scratch")
27 write (10, *) "&SCHNECKE"
28 write (10, *) " z=1,"
29 write (10, *) " dg=58.4,"
30 write (10, *) " a=48.,"
31 write (10, *) " delta=0.4,"
32 write (10, *) " s=0.4,"
33 write (10, *) " nk=6,"
34 write (10, *) " rb=60, 0, 40,"
35 write (10, *) " alpha0=20.,"
36 write (10, *) "/"
38 rewind (10)
39 read (10,schnecke)
40 close (10)
41 if ((z /= 1) .or. (dg /= 58.4_dr) .or. (a /= 48.0_dr) .or. &
42 (delta /= 0.4_dr).or. (s /= 0.4_dr) .or. (nk /= 6) .or. &
43 (rb(1) /= 60._dr).or. (rb(2) /= 0.0_dr).or. (rb(3) /=40.0_dr).or. &
44 (alpha0 /= 20.0_dr)) call abort ()
45 end program sechs_w