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

forrtl: severe (36) error with direct access

bergman
Beginner
642 Views
Greetings,

I'm a new user of ifort and I'm exploring both it and gfortran for further development of old research code that I've been developing with Absoft compilers for many years. I ported the code to gfortran yesterday and it runs fine, identical output to the well-tested Absoft version. It was not difficult to set up a Makefile to compile it with ifort, but when I run the test case I am getting a severe error when accessing a data file in direct access mode:

forrtl: severe (36): attempt to access non-existent record, unit 11, file /Users/eab/Documents/Seismology/Projects/mloc/mloc_working/tables/ak135.tbl
Image PC Routine Line Source
mloc8.7i 00134387 Unknown Unknown Unknown
mloc8.7i 00133823 Unknown Unknown Unknown
mloc8.7i 0010628C Unknown Unknown Unknown
mloc8.7i 000CC56A Unknown Unknown Unknown
mloc8.7i 000CC166 Unknown Unknown Unknown
mloc8.7i 000E32E1 Unknown Unknown Unknown
mloc8.7i 000E22DC Unknown Unknown Unknown
mloc8.7i 0001A36E Unknown Unknown Unknown

Stack trace terminated abnormally.

The file in question has been opened successfully but I think it bombs out at the first read attempt. The open statement looks like this:

open (nin,file=,status='old',form='unformatted', access='direct', recl=nasgr)

The code is identical to that which has run successfully on many Absoft compilers, gfortran, on a Sun workstation, and even under a Microsoft fortran compiler in Windows. In all the years of development and many thousands of production runs I have never had a problem with this part of the code, so I think the problem is probably not a Fortran bug so much as it is a different default behavior that needs to be corrected with a compiler directive.

Any suggestions about where to look will be appreciated,

Eric

0 Kudos
3 Replies
Ron_Green
Moderator
642 Views
Hi Eric,

Try -assume byterecl

This assumes your argument to RECL= is in bytes.
0 Kudos
bergman
Beginner
642 Views
Thanks Ron, that solved the problem. Exactly the kind of issue I expected. The ifort version now runs and gives identical results to both the gfortran and Absoft versions. That's always comforting! Eric
0 Kudos
Ron_Green
Moderator
642 Views
great. Now we can kick it up a notch. If you have a newer Xeon or Core 2 system, try these options:

-O3 -xT -ipo

check the -x compiler option docs to select the right target architecture. If you have a processor from that other three-letter company, try -xO

ron
0 Kudos
Reply