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

Did Intel Fortran 2019 break/change READ?

Jackson__Bart
Beginner
1,367 Views
I inherited some Fortran code earlier this year.  It had been working using Visual Studio 2015 and 2017.  We recently upgraded to 2019 (parallel studio XE 2019 update 5, with Visual Studio 2019, 16.3.6).  With the update there is a read that throws a "forrtl: severe 268 end of record during read" exception. A snippet of code:     CHARACTER*36 HEADER     READ(FILE, 100, ERR=800)HEADER 100 FORMAT (36A) READ (HEADER, FMT=110, ERR=800) IVAR1, IVAR2, IVAR3 110 FORMAT(3I12) If I change both 36s above to 37, and add a space at the end end of the first line of the file, the exception is not thrown (it happens on the 2nd read). For reasons too long to state here, I don't want to keep that kludge. Any ideas what is wrong?
0 Kudos
11 Replies
Steve_Lionel
Honored Contributor III
1,367 Views

Please provide a complete test case that demonstrates the problem, not a snippet. Also include a sample data file - you can attach a ZIP with these. Nobody can help you based on the description so far.

0 Kudos
Jackson__Bart
Beginner
1,367 Views

I reproduced the problem with the attached code and file (I can't post the real code).

I also noticed something while testing this: if I open the properties of the project and navigate to Fortran->Compatibility and change "Enable F77 run-time compatibility" to NO it works fine.  But this was a YES on the 2015 and 2017 computers and it worked fine.

0 Kudos
Steve_Lionel
Honored Contributor III
1,367 Views

Ok, I can reproduce this in 19.0.5, but it works in the 19.1 beta, so it looks as if the bug was identified and fixed.

Do you really need that option enabled?

0 Kudos
MWind2
New Contributor III
1,367 Views

What options were used to compile bartest.for? I get :

BartTest.for
1>D:\c\vs2019\1949101\ft\ft\BartTest.for(11): error #5149: Illegal character in statement label field  
1>D:\c\vs2019\1949101\ft\ft\BartTest.for(11): error #5148: A continuation character is illegal on a line with a statement label
1>D:\c\vs2019\1949101\ft\ft\BartTest.for(11): error #5082: Syntax error, found IDENTIFIER 'A' when expecting one of: :: ) , : * <END-OF-STATEMENT> ; . (/ + - ] /) ' ** > PRIVATE / // ...
1>D:\c\vs2019\1949101\ft\ft\BartTest.for(15): error #5149: Illegal character in statement label field  
1>D:\c\vs2019\1949101\ft\ft\BartTest.for(15): error #5148: A continuation character is illegal on a line with a statement label
1>D:\c\vs2019\1949101\ft\ft\BartTest.for(15): error #5082: Syntax error, found IDENTIFIER 'I12' when expecting one of: :: ) , : * <END-OF-STATEMENT> ; . (/ + - ] /) ' ** > PRIVATE / // ...
1>D:\c\vs2019\1949101\ft\ft\BartTest.for(9): error #6052: This label has not been defined as a FORMAT label.   [100]
1>compilation aborted for D:\c\vs2019\1949101\ft\ft\BartTest.for (code 1)
1>

0 Kudos
MWind2
New Contributor III
1,367 Views

I changed from ".for" to ".f90" and it compiled.

0 Kudos
MWind2
New Contributor III
1,367 Views

I compile and get no error in debug using 16.3.10 (x86) and 19.0.5.281 [IA-32] with test.txt=

00000000: 20202020 20202020 20203139 20202020                   19
00000010: 20202020 20313530 20202020 20202020         150
00000020: 20333030 0D0A0909 2020                          300
 

0 Kudos
Steve_Lionel
Honored Contributor III
1,367 Views

The FORMAT statements don't start in the right columns for .for - I adjusted that.

0 Kudos
MWind2
New Contributor III
1,367 Views

I fixed ".for" as you wrote, and it compiles, debugs and executes release OK. What am I missing about crash?

0 Kudos
LRaim
New Contributor I
1,367 Views

With "CHARACTER*36 HEADER" the FORMAT I would use is "(A36)". In case the HEADER is defined as "CHARACTER(LEN=1) HEADER(36)" the FORMAT statement will be "(36A1)".

Regards

0 Kudos
Jackson__Bart
Beginner
1,367 Views

I appreciate the feedback here.  Until this year, I haven't used Fortran since 1986.  It feels like a foreign language now.  :(

I work in a very unusual environment, and have been unable to use that PC this week.  The code is on a LAN that is detached from the internet.  I will get back to it next week, and examine/tinker with other options.

Re: "do we need that option enabled".  Disabling it would require a great deal of regression testing, since this is a large code base.  I fear disabling it would cause a break in several places.  The code is very old (and very complex), and was ported through various releases of Fortran, but stopped at Fortran77.  

Any idea when the 19.1 will be released?

0 Kudos
Barbara_P_Intel
Moderator
1,367 Views

Look for an announcement about PSXE2020 which includes Fortran 19.1 in the next week or so.

 

0 Kudos
Reply