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

OPEN RECL

jorgematheus
Beginner
630 Views
Hi.
I'm trying to convert my old fortran 77 v3.31 to the
digital visual fortran explicyt

Everything is seem to be fine but i got this problem
with the new created files.

i have this code:

CHARACTER* 10 DESCR
REAL*4 R1,Z1,X1,X2,X3
OPEN(20,file='test.DAT',ACCESS='DIRECT',RECL=34)
DO 100 I = 1, 100
WRITE(20,REC=I)'ABCDEFGHIJ',1.0,2.0,3.0,4.0,5.0
100 CONTINUE
STOP
END

When i hexdum my old file a i see exactly 34 bytes per record. But in the new file i see 128 bytes. The additional space are filled with spaces.

It's seem recl is not working!. I had tried the explicit recordtype='FIXED' but the file i got is exactly the same.

Thank for your time
0 Kudos
6 Replies
Steven_L_Intel1
Employee
630 Views
In Digital/Compaq Fortran, the units for RECL of unformatted files is four bytes. If you're using a reasonably recent version of Visual Fortran (and if yours says "Digital", you're not), there's an option /assume:byterecl to change the unit to bytes.

Unfortunately, 34 isn't divisible by 4 so you can't take the easy approach of just dividing the RECL by 4.

Steve
0 Kudos
Jugoslav_Dujic
Valued Contributor II
630 Views
/assume:byterecl was available in DVF5 -- Project/Settings/Fortran/Fortran Data/Use bytes...

Jugoslav
0 Kudos
Steven_L_Intel1
Employee
630 Views
Was it really? Good - I thought it came after that.

Steve
0 Kudos
Intel_C_Intel
Employee
630 Views
It might have been related to Microsoft Powerstation
compatibility, where the record lengths were measured in
bytes. I seem to remember that if you opened an old
Powerstation project in DVF, it would use bytes. If
you started a new project, it would default to words.
At the time, I was selling a VB graphics postprocessor to a Fortran model, where the intermediate file was an unformatted direct access file, and this was one of the
things that would often cause trouble.
0 Kudos
jorgematheus
Beginner
630 Views
Thank. Now everything is working fine.

I have a lot of small programs that need this setting, and i don't want to forget this setting in one of them because it will destroy my data. Can i preset the compiler to keep /assume:byterecl in all workspace??

Thank again
0 Kudos
Steven_L_Intel1
Employee
630 Views
Actually, /assume:byterecl predates DVF and any concern about PowerStation. We added it for the benefit of our customers porting from other vendors UNIX systems to our compilers.

There is a way to save settings. Once you have a project set up the way you want it, click on the "Save Fortran Environment" button (a green tree). You can then give the saved settings a name. The next time you create a project of the same type (eg. console), it will ask you if you want to apply the saved settings.

Steve
0 Kudos
Reply