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

Read statements changed in latest intel release

Bowman__Eric
Novice
4,425 Views

say I have the following data in a text file: 

 

       0.0       0.0     20.00        0.        1.        0.        0.

 

and that I read it with the following statement: 

READ(1,40)PSL,RANGE,TRIM,LIST,RDCH,CHARTF,CHARTS
40 FORMAT(7F10.2)

I know that the text in the text file does not exactly match the format descriptor, but this was not a problem in previous versions of the intel fortran compiler, it would read the data in just fine. Now it won't read it in unless I reformat my input decks to explicitly match the format descriptor. 

 

Is this a compiler setting that got changed? 

 

I noticed that a lot of the debug compiler flags were changed....which was a big headache.

 

Eric

 

0 Kudos
21 Replies
mecej4
Honored Contributor III
511 Views

In retrospect, you invited trouble by using a flawed verification procedure.

 

In the program, you have I/O statements with ERR= and IOSTAT= clauses, but you ignore the IOSTAT value and the ERR= simply leads to RETURN. Had you used plain I/O statements without these clauses, even the FPS4 compiler would have flagged at least some of the errors that we have uncovered in this thread.

 

Intel Fortran gives the following error with input1.txt:

forrtl: severe (61): format/variable-type mismatch, unit 11, file T:\LANG\bowma\F90\input1.txt

 

Gfortran gives more detailed diagnostics:

 

At line 69 of file eb.f90 (unit = 11, file = 'input1.txt')
Fortran runtime error: Expected REAL for item 9 in formatted transfer, got INTEGER
(//7F10.2//7F10.2//7F10.2)
            ^

 

0 Kudos
Reply