Re: Grads to netcdf

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Wed, 04 Jun 2008 14:43:58 -0600

[1] To look at *any* fortran sequential binary file

setfileoption("bin","readByteOrder","bigendian") ; <=== whatever is
appropriate
fnam = "snow.grd"
nrecs = fbinnumrec(fnam)
do i = 0, nrecs -1
; loop over ever record
     data = fbinrecread(fnam, i,-1, "float")
     print("recnum: " + (i + 1) + " recsize: " + dimsizes(data) + "
recmin: " + min(data) + " recmax: " + max(data))
     delete(data)
end do

You could do this interactivly if you want.
Note: **no* knowledge of the file structure is needed!!!

[2] I will send a sample NCL script off line.

D

Gina Henderson wrote:
> Hi there,
>
> thanks for your response. In searching I have read about the gfdl tool
> grads2nc but the data are sequential and the description of this tool
> says it doesn't work with sequential data. Below is my .ctl file. I
> have also been looking at the ncl binary I/O examples but don't know
> if they are applicable?
>
> Here's the data description in the .ctl file:
> *****************************************************************
> dset snow.grd
> title snow depth winter
> options sequential big_endian
> undef -9999.00
> xdef 29 linear 20. 5.
> ydef 8 linear 35. 5.
> zdef 1 linear 1 1
> tdef 60 linear jan1936 1yr
> vars 1
> p 0 0 precipitation
> endvars
> *****************************************************************
>
>
> On Wed, Jun 4, 2008 at 2:01 PM, Dennis Shea <shea_at_ucar.edu
> <mailto:shea_at_ucar.edu>> wrote:
>
> Yes, people have done this with NCL. What does the ctl look like?
> The 'problem' is that there is not standard. Each ctl must be
> handled individually. EG: are the data written as "sequential"
> or "flat/direct"?
>
>
> GFDL used to have a command line tool but they stopped supporting it.
> Do w a search on grads2nc.
>
> D
>
>
> Gina Henderson wrote:
>
> Hi there,
>
> I have a data in the Grads format together with its .ctl file
> descriptor and I am trying to convert it to netcdf. I have
> seen that there is a script to do this on the website using
> Ruby only. Is there anyone who has done this in ncl or fortran
> before?
>
> Thanks Gina.
>

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Jun 04 2008 - 14:43:58 MDT

This archive was generated by hypermail 2.2.0 : Wed Jun 04 2008 - 15:43:54 MDT