Writing netCDF binary to flat binary

From: Noel Aloysius <noel.aloysius_at_nyahnyahspammersnyahnyah>
Date: Mon May 14 2012 - 11:08:55 MDT

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 11:09:04 2012

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