gfortran I/O issues.
Tobias Burnus
burnus@net-b.de
Thu Jan 22 19:30:00 GMT 2009
Hi,
Smith-Rowland, Edward M wrote:
> I think there is a bug in gfortran where an error is flagged for this example.
> I'm just reading a comma delimited string into a size 3 array.
>
I believe the error message is OK, but I leave it to our experts to
check the standard.
* * *
I get with gfortran 4.3/4.4, NAG f95 5.1, g95, pathscale 3.1, pgf95 7.1
the same output (modulo a few spaces):
0 0 0
line = 255,255,255
Error
while gfortran 4.1/4.2, ifort 11, sunf95 and openf95 print:
0 0 0
line = 255,255,255
255 255 255 <<<<<<<<<< Note the extra line.
Error
Without 'err=1' one gets the run-time error messages:
gfortran 4.3/4.4: Fortran runtime error: Bad value during integer read
NAG f95: Invalid character in integer input field
g95: Fortran runtime error: Bad value during integer read
pgi: PGFIO-F-217/formatted read/internal file/attempt to read past end
of file.
pathf95: A READ operation tried to read past the end-of-file.
I think it is OK to give an error when reading the string:
' 255,255,255 '
1234567890123
using the format '(3I12)'. Using I12 one grabs " 255,255,255" which I
would regard as strange integer string. (What is the meaning of "," in
an integer?)
However, I might miss something and the "," is regarded as separator
even in this case and it overrules the "I12". Jerry, what do you think?
Tobias
More information about the Fortran
mailing list