Re: reading binary

From: Andrew Mai <mai_at_nyahnyahspammersnyahnyah>
Date: Wed Sep 12 2012 - 23:21:35 MDT
On 09/12/2012 10:03 PM, Agnes Lim wrote:

I had a binary file generated using FORTRAN that contains 
an array 357 by 624.
I had used NCL to read it with the following code, but 
still a bit confuse whether I had place the dimension 
order correctly as the order that is in the binary file.


The NCL code is as follows:
temp=fbindirread("/river/alim/forecast_verification/data/multi_sensor/4km/ml_WRF_080517_00z_24hr_resample", 
0, -1, "float")
rain = onedtond(temp,(/357,624/))

If the array were dimensioned (357,624) in the Fortran program, you would need (/624,357/) here in your NCL program. The order of the dimensions (but NOT the order of the data in memory!) is opposite between Fortran and NCL.

Andy

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Sep 12 23:21:42 2012

This archive was generated by hypermail 2.1.8 : Thu Sep 13 2012 - 14:22:31 MDT