RE : writing netCDF as flat binary

From: James Scott <james.d.scott_at_nyahnyahspammersnyahnyah>
Date: Mon May 14 2012 - 14:40:49 MDT

No, you don't need to change the array dimension order. You can also read
the netcdf directly with Matlab.

On Mon, May 14, 2012 at 12:00 PM, <ncl-talk-request@ucar.edu> wrote:

> Hello NCL-talk:
>
> For further clarification, I am posting this question I previously asked
> and answered.
>
> For an analysis I need to convert netCDF output to flat binary - netCDF
> array size data(time,lat,lon) = data(1200,180,360).
>
> The output binary is read by a matlab program as data(lon,lat,time) =
> data(360,180,1200).
>
> Do I have to rotate the dimensions before writing the binary?
>
> The following scripts does the conversion.
>
> f1 = addfile ("infile.nc", "r")
> data = f1->data
> fo = "outfile.bin"
> data1 = data(time|:,lon|:,lat|:) ;each time step has 360 lons
> and 180 lats
> nt = 1200
>
> do nt=0,(nt-1 )
> fbindirwrite(fo, vals(nt,:,:) )
> end do
>
> Thanks,
> Noel
>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon May 14 14:41:18 2012

This archive was generated by hypermail 2.1.8 : Thu May 17 2012 - 13:42:02 MDT