bug with internal file I/O?
Tobias Burnus
burnus@net-b.de
Fri Jun 8 12:33:00 GMT 2007
Hi Magnus,
Magnus Hagdorn wrote:
> the attached program does not run as expected.
(You should add
intvalues = 0
otherwise not all values are initialized.)
> I tried this code with the NAG compiler where it works as expected. Both gfortran-4.1 and gfortran-4.2 reach the
> end of the do loop.
>
There is a difference between NAG f95 and sunf95 on one hand and g95,
gfortran, ifort on the other hand. NAG f95 and sunf95 give:
6 (len)
3 (i -1)
2 5 69
gfortran, g95 and ifort have:
6 (len)
100 (i -1)
2 5 59 0 0 0 ...
Now someone needs to study the standard for io-implied-do (cf. F2003,
"9.5.2 Data transfer input/output list").
It either might be that gfortran/g95/ifort have a bug or that it is
undefined by the standard. (Or that nagf95/sunf95 are wrong ;-)
Reading the standard (e.g. "For an io-implied-do, the loop
initialization and execution is the same as for a DO construct
(8.1.6.4)."), I would not be surprised if sunf95 and NAG f95 are correct
and that gfortran and g95/ifort have a bug.
Maybe one should ask at c.l.fortran and see what Richard Maine et al.
will answer.
Tobias
More information about the Fortran
mailing list