strange io errors

I am trying to run CCSM3 and get errors, while it tries to read data from the binary files (restart files).

With the compiler version 6.1-2:
PGFIO/stdio: No such file or directory
PGFIO-F-/unformatted read/unit=10/error code returned by host stdio - 2.
File name = b30.031.cpl6.r.0821-01-01-00000 unformatted, sequential access record = 2
In source file /home/veremeev/ccsm3_0/models/csm_share/cpl/cpl_iobin_mod.F90, at line number 233

With the compiler version 6.1-4:
PGFIO/stdio: Success
PGFIO-F-/unformatted read/unit=10/error code returned by host stdio - 0.
File name = b30.031.cpl6.r.0821-01-01-00000 unformatted, sequential access record = 2
In source file /home/veremeev/ccsm3_0/models/csm_share/cpl/cpl_iobin_mod.F90, at line number 233

The errors occur only on the files, downloaded from the NCAR.
They do not occur with the files, produced locally.

More details on the errors are here.
http://bb.cgd.ucar.edu/showthread.php?p=802#post802

The restart files are plain binary files.

The failing code is:

231:   open(fid,file=fName,form="UNFORMATTED",status="OLD")
232:   read(fid) format     ! string len=256
233:   read(fid) name       ! string len=256
234:   read(fid) dstr,tstr  ! string len=256 * 2
235:   read(fid) comment    ! string len=256
236:   read(fid) cvsID      ! string len=256

I have added line numbers on the left, actually there are no line numbers in the file.

I have put the write statements after the line 232, and they gave the following.
Variable values before execution of this fragment:
fid=10
fName=b30.031.cpl6.r.0821-01-01-00000

The file is situated in the current working directory, getcwd confirms this.

Hi Vladimir,

It looks like a byte-swaping problem. Did you compile with “-byteswapio”? If not, can you try adding this flag?

  • Mat

Thank you, it worked!

I have also answered in the other my topic, about ‘save’`d variables, the compiler upgrade didn’t help, the variables are still not saved.