RECL units in OPEN statement

Hello all,

Bear with me on my (probably) simple question. I’m updating some really old FORTRAN code, transitioning from the intel fortran compiler, and I get a error about the OPEN statement having a problem with the array declaration of RECL (it throws a formatting error when I try executing the compiled code). I know that the intel compiler had it in units of 32-bit words defined by RECL, but I can’t for the life of me figure out what that should be for nvfortran… probably obvious (64-bit?), but I can’t figure it out.

The exact error I’m getting is:
FIO-F-219/unformatted read/unit=33/attempt to read/write past end of record.

I’d appreciate any help! Thanks!.

By default, RECL expects a record length in bytes. But what you can try is setting the environment variable “FORTRANOPT=vaxio”. This will change our default behavior to use the old VAX I/O (and Intel) method of using 32-bit words.

See: HPC Compilers User's Guide Version 21.5 for ARM, OpenPower, x86

Hope this helps,

Thanks for the quick reply! I will try modifying the RECL variable first to bytes (since that subroutine is loaded with the rest of the script anyways) then see if the environment variable works if that doesn’t. Thanks!

Thanks again for the help. I wanted to verify that vaxio changes to 32-bit words since the documentation indicates it changes it to 4-byte words? Thanks!

32-bits is the same as 4 bytes (8 bits to a byte).

Thanks again. I’m still getting my error, but it may be a different problem if this didn’t work.