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

Incorrect RECL when opening a scratch file

davidgraham
Beginner
725 Views
I have just upgraded from cvf to ivf and am getting an error opening a scratch file.
"The error message is forrtl: severe (104) incorrect RECL = specifier value for connected file, unit 61, file ...."

The code is shown below, sometimes it works, sometimes it doesn't. It was OK in cvf, maybe its a security issue with Windows 7. Any suggestions what the problem is.

OPEN (15,FILE=ctrg,ACCESS='DIRECT',form='binary',RECL=30)

OPEN (17,FILE=CCON,ACCESS='DIRECT',form='binary',RECL=12)

open (61,STATUS='scratch',access='direct',form='binary',recl=14)

open (62,STATUS='scratch',access='direct',form='binary',recl=30)

open (63,STATUS='scratch',access='direct',form='binary',recl=8)

open (64,STATUS='scratch',access='direct',form='binary',recl=4)

0 Kudos
3 Replies
mecej4
Honored Contributor III
725 Views
From the Intel Fortran Reference Manual (boldface added), under

OPEN: RECL Specifier:


For fixed-length records, RECL indicates the size of each record; it must be specified. If the records are unformatted, the size must be expressed as an even multiple of four.

I hope someone else can explain why "multiple of eight" was not used instead of "even multiple of four", or if "even multiple" simply means "integer multiple".
0 Kudos
TimP
Honored Contributor III
725 Views
I didn't see whether the question was about RECL specified in bytes or according to the CVF default of multiples of 4.
If possible, it might be worth while to convert this stuff to standard Fortran syntax. For ifort to preserve all non-standard behaviors of CVF is a lot to ask.
0 Kudos
davidgraham
Beginner
725 Views
I found the solution, it was because the file had been opened previously in another option with a different record length. For some reasom with cfv I didn't need to close/delete it. I have now added
close (61,status='DELETE')
and it is OK.
0 Kudos
Reply