[RegCNET] Reading the SAV binary files

Michael Notaro mnotaro at wisc.edu
Thu Jan 13 16:42:42 CET 2011


Thanks.  With the big_endian argument, I can successfully read the first
few integer values at least, like mdate, etc.  Without it, the script always
crashes with an "error during read".  So I think I must use the big_endian
argument.

I don't know what switches to use.  How do I figure that out?  As of now,
I can read the integers but not the double precision variables.

Michael



On Jan 12, 2011, at 7:43 PM, Steve Hostetler wrote:

> Are you sure you need to use the big_endian argument?  It might be native.  Also make sure your real types are compatible-- you might need to add a switch in your compile line.
> 
> __________________________
> Steve Hostetler
> US Geological Survey
> Department of Geosciences
> Wilkinson Hall Room 104
> Oregon State University
> Corvallis, OR 97331
> tel +1 541 737-8928
> fac +1 541 737-1200
> 
> 
> On 1/12/2011 3:39 PM, Michael Notaro wrote:
>> I am trying to open and read the SAV restart binary files
>> from regcm4.  I am on NCSA Abe (intel 64 cluster).
>> I tried reading the first bunch of variables on the file
>> with the following ifort script.  It reads all of the initial
>> integer values (mdate, ktau, ..., ntime) ok.  But all of
>> the double precision 2D variables have unreasonable
>> values.  Any suggestions?
>> 
>> 
>> c     ifort -convert big_endian -assume byterecl read_restart.f
>> 
>>       integer mdate, ktau , xtime , ldatez , lyear , lmonth , lday
>>       integer lhour , ntime
>>       real*8 ub0_io(128,152),vb0_io(128,152),qb0_io(128,152)
>>       real*8 tb0_io(128,152),ps0_io(128,152),ts0_io(128,152)
>> 
>>       open(21,file="G90s_SAV.1989010100",form="unformatted",
>>      #     status="old")
>>       read(21) mdate
>>       read(21) ktau, xtime, ldatez, lyear, lmonth, lday, lhour, ntime
>>       read(21) ub0_io, vb0_io, qb0_io, tb0_io ,ps0_io ,ts0_io
>> 
>>       print*, ub0_io
>> 
>>       close(21)
>>       end
>> 
>> _______________________________________________
>> RegCNET mailing list
>> RegCNET at lists.ictp.it
>> https://lists.ictp.it/mailman/listinfo/regcnet




More information about the RegCNET mailing list