http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56660



             Bug #: 56660

           Summary: Fails to read NAMELIST with certain form array syntax

    Classification: Unclassified

           Product: gcc

           Version: 4.9.0

            Status: UNCONFIRMED

          Keywords: wrong-code

          Severity: normal

          Priority: P3

         Component: fortran

        AssignedTo: unassig...@gcc.gnu.org

        ReportedBy: bur...@gcc.gnu.org

                CC: jvdeli...@gcc.gnu.org, t...@tilo-schwarz.de

        Depends on: 51825





Another namelist failure, found by Jerry. 

See also PR 49791, PR 51825, PR 55117, PR 52512.





When reading the file, gfortran fails with:

  At line 17 of file pr51825-3.f90 (unit = 99, file = 'nml.dat')

  Fortran runtime error: Cannot match namelist object name 'bb'



Using NAG, one gets the output:

 &NAML1 TRACER = XX F XX F XX F/

 &NAML1 TRACER = aa T bb T XX F/



(There are plenty ways of outputting this data - as long as the data is there.)







type ptracer

   character(len = 2)  :: sname

   logical              :: lini

end type ptracer

type(ptracer) , dimension(3) :: tracer

namelist/naml1/  tracer



tracer(:) = ptracer('XXX', .false.)

write (*, nml=naml1)



open (99, file='nml.dat', status="replace")

write(99,*) "&naml1"

write(99,*) "   tracer(:)   = 'aa' , .true."

write(99,*) "   tracer(2)   = 'bb' , .true."

write(99,*) "/"

rewind(99)

read (99, nml=naml1)

write (*, nml=naml1)

close (99, status="delete")

end

Reply via email to