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

Did Intel Fortran 2019 break/change READ?

Jackson__Bart
초급자
3,564 조회수
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 포인트
11 응답
Steve_Lionel
명예로운 기여자 III
3,564 조회수

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 포인트
Jackson__Bart
초급자
3,564 조회수

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 포인트
Steve_Lionel
명예로운 기여자 III
3,564 조회수

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 포인트
MWind2
새로운 기여자 III
3,564 조회수

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 포인트
MWind2
새로운 기여자 III
3,564 조회수

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

0 포인트
MWind2
새로운 기여자 III
3,564 조회수

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 포인트
Steve_Lionel
명예로운 기여자 III
3,564 조회수

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

0 포인트
MWind2
새로운 기여자 III
3,564 조회수

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

0 포인트
LRaim
새로운 기여자 I
3,564 조회수

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 포인트
Jackson__Bart
초급자
3,564 조회수

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 포인트
Barbara_P_Intel
3,564 조회수

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

 

0 포인트
응답