Read 3-D NCL output binary data

From: Yongxin Zhang <yongxin_at_nyahnyahspammersnyahnyah>
Date: Tue, 21 Mar 2006 18:45:03 -0700


     I output a subset of my 4-D array, Pres(ntim, nlon, nlat, nlev)
where ntim=13, nlon=315, nlat=306 and nlev=30, as binary data using
the following NCL code

      fout = "Pres_3D.bin"

      do i = 4, 16
       fbinrecwrite(fout, -1, Pres(i, :, :, :))
      end do

and my Fortran code looks like this

        real pres(ntim, ?, ?, ?)


        do i = 1, 13
          read(11) pres(i, :, :, :)

       One thing I am not sure is how to define my pres variable in
my Fortran code. I used "real pres(ntim, nlon, nlat, nlev)" but did
not get the correct data format. The NCL webpage does indicate a swap
of dimensions order for a 2-D array from the NCL code (e.g. u
(64,128)) to the Fortran code (e.g. u(128, 64)) but there is no
example for a 3-D array. Your suggestions on how to correctly define
the pres variable are greatly appreciated.

Thank you,
ncl-talk mailing list
Received on Tue Mar 21 2006 - 18:45:03 MST

This archive was generated by hypermail 2.2.0 : Wed Mar 29 2006 - 11:52:49 MST