Re: to read binary data

From: Dave Allured - NOAA Affiliate <dave.allured_at_nyahnyahspammersnyahnyah>
Date: Mon Apr 29 2013 - 14:32:22 MDT

Jeff,

You said "not successfully". What was your symptom? Did you get any
error messages?

--Dave

On Mon, Apr 29, 2013 at 12:43 PM, <jeff@ucar.edu> wrote:
> Hi,
>
> A binary data file can be read successfully as the following:
>
> open(11,file=input,status='old',form='unformatted',
> + access='direct',recl=nx*ny*nz*4)
>
> irec = 1
> do n = 1 , nvar
> read(11,rec=irec) var
> irec = irec +1
> end do
>
> with pgf90 -byteswapio read.f
>
>
> By NCL I"ve tried, but not successfully,
>
> files = systemfunc("ls ../01_data/*.dat")
>
> setfileoption ("bin", "ReadByteOrder", "LittleEndian")
>
> do ivar = 0,nvar-1
>
> data(:,:,:) = fbindirread(files(0),ivar,(/nz,ny,nx/),"float")
>
> end do
>
> Thanks for any suggestion.
>
> Jeff
>
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Apr 29 14:32:36 2013

This archive was generated by hypermail 2.1.8 : Thu May 02 2013 - 11:16:45 MDT