Hello all,
I am using NCL to byteswap some fotran77-generated binary files using
the code shown at the bottom of this email. The files are about 4.5
gigs each. They work fine doing one record at a time until about
half-way through when all the values turn to zeroes. Is this because
the files are too big? Is there a 2Gb limit on binary file size like
there is for netCDF file size? I have developed a workaround using a
fortran subroutine that reads in the data, but I'm curious as to why
my first approach didn't work. Thanks.
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
begin
setfileoption("bin","ReadByteOrder","BigEndian")
setfileoption("bin","WriteByteOrder","LittleEndian")
if (isfilepresent("/flame1/SPI/spidata2003-01-sw.bin")) then
print ("removing previous file")
system ("rm /flame1/SPI/spidata2003-01-sw.bin")
end if
irec = 0
do nyr = 1895, 2003
do nmo = 1, 12
f = fbindirread("/flame1/SPI/spidata2003.01",irec,(/
1405,621/),"float")
f = f(:,620:0)
print ("irec "+irec+" year "+nyr+" "+nmo+"F "+f(299,299))
fbindirwrite("/flame1/SPI/spidata2003-01-sw.bin",f)
irec = irec + 1
delete(f)
end do
end do
end
**************************************************
Hauss Reinbold
Assistant Research Scientist / Programmer
Climate Ecosystem and Fire Applications
Desert Research Institute
Office Phone: 775-673-7386
email: Hauss.Reinbold_at_dri.edu
**************************************************
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Oct 25 2006 - 16:31:36 MDT
This archive was generated by hypermail 2.2.0 : Wed Nov 01 2006 - 11:37:05 MST