| 1 |
! { dg-do run } |
| 2 |
! PR56660 Fails to read NAMELIST with certain form array syntax |
| 3 |
type ptracer |
| 4 |
character(len = 2) :: sname |
| 5 |
logical :: lini |
| 6 |
end type ptracer |
| 7 |
|
| 8 |
type(ptracer) , dimension(3) :: tracer |
| 9 |
namelist/naml1/ tracer |
| 10 |
|
| 11 |
tracer(:) = ptracer('XXX', .false.) |
| 12 |
|
| 13 |
open (99, file='nml_82.dat', status="replace") |
| 14 |
write(99,*) "&naml1" |
| 15 |
!write(99,*) " tracer(2) = 'bb' , .true." |
| 16 |
write(99,*) " tracer(:) = 'aa' , .true." |
| 17 |
write(99,*) " tracer(2) = 'bb' , .true." |
| 18 |
write(99,*) "/" |
| 19 |
rewind(99) |
| 20 |
|
| 21 |
read (99, nml=naml1) |
| 22 |
close (99, status="delete") |
| 23 |
|
| 24 |
if (tracer(1)%sname.ne.'aa') STOP 1 |
| 25 |
if (.not.tracer(1)%lini) STOP 2 |
| 26 |
if (tracer(2)%sname.ne.'bb') STOP 3 |
| 27 |
if (.not.tracer(2)%lini) STOP 4 |
| 28 |
if (tracer(3)%sname.ne.'XX') STOP 5 |
| 29 |
if (tracer(3)%lini) STOP 6 |
| 30 |
|
| 31 |
!write (*, nml=naml1) |
| 32 |
|
| 33 |
end |