https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123321

            Bug ID: 123321
           Summary: Namelist input of variable accessed by use association
                    with renaming fails
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: van.snyder at sbcglobal dot net
  Target Milestone: ---

Created attachment 63169
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=63169&action=edit
The program in the example as a separate file

Where a variable name is accessed by use association and renamed, input using
the local name fails, but input using the name in the module succeeds.

module M

  public
  real :: Tol = 1.0e-8
  real :: Z = 1.e-3

end module M

program P

  use M, only: Tol_CG => Tol, Z
  namelist /v/ Tol_CG, Z
  read ( *, v )
  print '(a,1pg0.3)', 'Tol_CG ', Tol_CG, 'Z ', z
  write ( *, v )

end program p

DEBIAN_VERSION_FULL=13.2

# gfortran --version
GNU Fortran (Debian 14.2.0-19) 14.2.0

gfortran foo.f90

# echo "&v z=1.e-4 tol_cg=1.e-5/" | ./a.out
At line 13 of file foo.f90 (unit = 5, file = 'stdin')

# echo "&v z=1.e-4 tol=1.e-5/" | ./a.out
Tol_CG 1.000E-5
Z 1.000E-4
&V
 TOL=  9.99999975E-06,
 Z=  9.99999975E-05,
 /

Reply via email to