Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28632 Discussions

Quirk reading list-directed (free format)

sgibby
Beginner
310 Views
CVF doesn't appear to intrepret the following input lines correctly:

'GAB', 'm2c12dec.res', 55.0
,'m2c11dec.res',55.0/


The FORTRAN READ statement is:

READ(51,*,END=1000,ERR=1100)LABELS,(FFILE(NRES),
TT(NRES),NRES=1,LIMRES)

The code misinterprets the line and ends up with

FFILE(1) 'm2c12dec.res'
FFILE(2) ' '
FFILE(3) '55.0 '

TT(1) 55.00000
TT(2) 0.0000000E+00


However, if the comma which started the second line is removed, it gets it right

'GAB', 'm2c12dec.res', 55.0
'm2c11dec.res',55.0/


FFILE(1) 'm2c12dec.res'
FFILE(2) 'm2c11dec.res'
TT(1) 55.00000
TT(2) 55.00000

The IBM RS/6000 code which I'm porting gets it right either way.
0 Kudos
1 Reply
Intel_C_Intel
Employee
310 Views
It looks to me as if CVF is getting it wrong here. The comma at the start of the second record is somewhat redundant but the documentation says that the end-of-record should count as a space and that a comma plus preceding or following spaces should count as a single separator.

Joe
0 Kudos
Reply