Is the following code valid?
Dominique Dhumieres
dominiq@lps.ens.fr
Fri Feb 9 13:07:00 GMT 2007
Is the following code:
MODULE debug
LOGICAL debug_area
NAMELIST/debugging/debug_area
END MODULE debug
PROGRAM ding
USE debug
IMPLICIT NONE
NAMELIST/debugging/debug_area
INTEGER :: ios
OPEN(unit=10, status='unknown', file='input.dat')
READ(unit=10, nml=debugging, iostat=ios)
PRINT*, 'nml=debugging',ios
END PROGRAM ding
valid? Gfortran and Portland group Fortran accept it
while xlf, ifort, and g95 reject it with (ifort):
fortcom: Error: namelist13.f90, line 9: The attributes of this name conflict with those made accessible by a USE statement. [DEBUGGING]
NAMELIST/debugging/debug_area
-----------^
Is this another example of invalid code for which a compiler
is allowed to do what ever it wants or is this a missed constraint?
TIA
Dominique
More information about the Fortran
mailing list