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

Direct Access file record length anomaly

Arne_van_Garrel
Beginner
599 Views

I (lately) have a problem occurring when writing to direct-access files. Attached is the smallest code that reproduces the problem on my Win10 system. 

In the 'Debug' mode for x64 the code runs as expected: data is written to the direct-access file. In the 'Release' mode for x64 the following error message is produced:

forrtl: severe (66): output statement overflows record, unit 12, file C:\arne\Visual Studio 2015\Projects\test_direct_access\test_da.dat
Image              PC                Routine            Line        Source
test_direct_acces  00007FF6624C7E07  Unknown               Unknown  Unknown
test_direct_acces  00007FF6624BB9C2  Unknown               Unknown  Unknown
test_direct_acces  00007FF6624B8AB8  Unknown               Unknown  Unknown
test_direct_acces  00007FF6624B12F5  Unknown               Unknown  Unknown
test_direct_acces  00007FF662511532  Unknown               Unknown  Unknown
test_direct_acces  00007FF6625118D5  Unknown               Unknown  Unknown
KERNEL32.DLL       00007FFF870B1FE4  Unknown               Unknown  Unknown
ntdll.dll          00007FFF89B1EFB1  Unknown               Unknown  Unknown
Press any key to continue . . . 

The ‘Release’ code seems to assume that the record length is specified in ‘bytes’ and not in ‘4 byte units’ as specified in the project. Changing ‘LEN_R64 = 2’ to ‘LEN_R64 = 8’ makes that the ‘Release’ version runs without error.

Any idea about what causes this strange behavior?

 

 

0 Kudos
3 Replies
Arne_van_Garrel
Beginner
599 Views

I (lately) have a problem occurring when writing to direct-access files. Attached is the smallest code that reproduces the problem on my Win10 system. 

In the 'Debug' mode for x64 the code runs as expected: data is written to the direct-access file.

In the 'Release' mode for x64 the following error message is produced:

forrtl: severe (66): output statement overflows record, unit 12, file C:\arne\Visual Studio 2015\Projects\test_direct_access\test_da.dat
Image              PC                Routine            Line        Source
test_direct_acces  00007FF6624C7E07  Unknown               Unknown  Unknown
test_direct_acces  00007FF6624BB9C2  Unknown               Unknown  Unknown
test_direct_acces  00007FF6624B8AB8  Unknown               Unknown  Unknown
test_direct_acces  00007FF6624B12F5  Unknown               Unknown  Unknown
test_direct_acces  00007FF662511532  Unknown               Unknown  Unknown
test_direct_acces  00007FF6625118D5  Unknown               Unknown  Unknown
KERNEL32.DLL       00007FFF870B1FE4  Unknown               Unknown  Unknown
ntdll.dll          00007FFF89B1EFB1  Unknown               Unknown  Unknown
Press any key to continue . . . 

The ‘Release’ code seems to assume that the record length is specified in ‘bytes’ and not in ‘4 byte units’ as specified in the project. Changing ‘LEN_R64 = 2’ to ‘LEN_R64 = 8’ makes that the ‘Release’ version runs without error.

Any idea about what causes this strange behavior in 'Release' mode?

0 Kudos
mecej4
Honored Contributor III
599 Views

That's a result of using all the options "in the kitchen-sink". The /standard-semantics option pulls in /assume:byterecl. Either turn off /standard-semantics or override the /assume:byterecl part of it, as described in the documentation of the compiler options, or edit your project settings for Release mode and specify /assume:nobyterecl.

0 Kudos
Arne_van_Garrel
Beginner
599 Views

Thanks, that was it! It makes sense; but that's always in hindsight...

0 Kudos
Reply