Illegal internal write?
- From: harper@xxxxxxxxxxxxx (John Harper)
- Date: 28 Feb 2006 13:44:20 +1300
The f95 standard 184.108.40.206, and the f2003 standard 220.127.116.11, both say:
"If an internal file has been specified, an input/output list item
shall not be in the file or associated with the file."
In the WRITE statement in the following program, the input/output
list item is IMHO not in the file, but it is an expression whose
value depends on that of the file. Does that make it "associated"
as that term is used in those Fortran standards?
CHARACTER :: fmts(3)*24 = (/"I0 ","ES11.4","F8.4 "/)
END PROGRAM testnoforall
Five f95 compilers that I tried accepted the program at compile time.
At run time, four of them printed
as I had hoped. However, one (gfortran) printed
(1X,A,) (1X,A,) (1X,A,)
The quoted rule is not in a Constraint, so I can't complain if
a program defying it compiles and runs, but if the program is
standard-conforming, which output is correct?
John Harper, School of Mathematics, Statistics and Computer Science,
Victoria University, PO Box 600, Wellington, New Zealand
e-mail john.harper@xxxxxxxxx phone (+64)(4)463 5341 fax (+64)(4)463 5045
- Prev by Date: Re: MPI
- Next by Date: Re: MPI
- Previous by thread: Standards conforming or not?
- Next by thread: Re: Illegal internal write?