Re: Re,binary read-in error.

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Sat, 22 Apr 2006 07:59:22 -0600 (MDT)

On Thu, 20 Apr 2006, Yi Wang wrote:

> Hi Everyone:
>
> I follow the following example:
>
> Examples
> The following will write ntimes records, each of length 64x128 float words.
>
> ntimes = 100
> z = new ( (/ntimes,64,128/), float)
> .
> path = "/dummy/file"
> do nt=0,ntimes-1
> fbindirwrite(path,z(nt,:,:) )
> end do
> The binary file will be the same as a one open via fortran's open statement:
> open(..., form="unformatted", access="direct", recl= ) ; recl is system
> dependent
>
> When I use ( my data is 14*myr in dimension, float. I am using Mac OS
> f77, same thing for tempest, f77)
>
> open(32,file='inputdata/Single.OPREC.6498.dat',
> $ form='unformatted',access='direct',recl=4*14*myr)
>
> The data which read in from above is wrong, except the first one,
> which is correct.
>
> Any clue about what is wrong here????
>
> Yi Wang PhD
> Center for Climatic Research
> University of Wisconsin-Madison
>
>
>
===========================================
Perhap, it is an endian issue.

tempest [IRIX OS] is big endian

Mac OS ... ?????? endian. Perhaps, it is little-endian

If so, prior to reading the file on the Mac

setfileoption("bin","ReadByteOrder","BigEndian")

http://www.ncl.ucar.edu/Document/Functions/Built-in/setfileoption.shtml

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sat Apr 22 2006 - 07:59:22 MDT

This archive was generated by hypermail 2.2.0 : Mon Apr 24 2006 - 09:06:29 MDT