Re: dumping multiple variables in one output binary file

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Thu Jul 04 2013 - 21:54:03 MDT

Ipsita,

If you read the documentation for fbindirwrite, you will see that every time you write a variable to a file, it appends it.

See the attached example script that creates three dummy arrays, writes them out with three calls to fbindirwrite, and then reads them back in with fbindirread.

--Mary

On Jul 4, 2013, at 5:10 AM, Ipsita Putatunda <ipsita.putatunda@gmail.com> wrote:

> Hi,
> I have some HDF files, each containing 21 variables. I want to convert it in binary files. below is the ncl script given, that I'm using for this conversion. But is there any way to dump all the 21 variables in one output binary files using fbindirwrite?
> Otherwise I am getting 21 output binary files for each variable.
> ;----------------------------------------------------------
> load "$NCARG_ROOT/lib/ncarg/nclex/gsun/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
> ;------------------------------------------------------
> ;------------------------------------------------------------
> fi=addfile("test.HDF","r")
> data=fi->Q1RMean
> data!0="lev"
> data!1="lon"
> data!2="lat"
> d_reorder=data(lev|:,lat|:,lon|:)
>
> nlev=19
> do nlv=0,nlev-1
> fbindirwrite("Q1RMean.dat",d_reorder(nlv,:,:))
> end do
>
>
> Thanks,
> Ipsita
> _______________________________________________
> 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 Thu Jul 4 21:54:11 2013

This archive was generated by hypermail 2.1.8 : Fri Jul 05 2013 - 13:06:49 MDT