[gradsusr] sdfwrite
Kishore Ragi
kishoreragi at gmail.com
Wed Sep 11 13:19:18 EDT 2013
Dear Mahakur,
CDO is also an easy alternative for merging variables ....
Cheers,
Kishore
On Wed, Sep 11, 2013 at 10:40 PM, Jennifer Adams <jma at cola.iges.org> wrote:
> Please read the documentation at
> http://iges.org/grads/gadoc/gradcomdsdfwrite.html.
>
> Here's the relevant section of that page:
>
> *Appending Variables to a File*
> The sdfwrite command does not allow you to write out more than one
> variable to a file. The way to do achieve this is to write out each
> variable in a separate file, then merge them with the NetCDF Operators
> (NCO) <http://nco.sourceforge.net/nco.html>. Use the ncks<http://nco.sourceforge.net/nco.html#ncks>command to append variables defined on the same grid. The GrADS commands
> might look like this:
>
> open gfs.ctl
> set x 1 720
> set y 1 361
> set t 1 last
> define slp = mslp
> define precip = ptot
> set sdfwrite -flt slp.nc
> sdfwrite slp
> sdt sdfwrite -flt precip.nc
> sdfwrite precip
>
> Then, outside GrADS, or using the ! in front of the command to send it to
> the shell from within GrADS, merge these two files with ncks<http://nco.sourceforge.net/nco.html#ncks>:
>
>
> ncks <http://nco.sourceforge.net/nco.html#ncks> -O -h -A precip.nc slp.nc
>
> The -A is for appending to the output file, the -O is for overwriting
> existing output file, and the -h does not add anything to the output file's
> global 'history' attribute. Please see the NCO User's Guide<http://nco.sourceforge.net/nco.html>for more information.
>
>
>
>
> On Sep 11, 2013, at 12:41 PM, M.Mahakur wrote:
>
> Respected Everyone,
>
> Is it possible to write more than one variable to 'a single' netcdf file
> using sdfwrite? As below for example:
>
>
> var1=...
> var2='''
> var3 ...
> ..
>
> set sdfwrite all_var.nc
> sdfwrite var1
> sdfwrite var2
> ....
> clear sdfwrite
>
>
> With Regards and Thanks,
> Mahakur
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>
> --
> Jennifer M. Adams
> Center for Ocean-Land-Atmosphere Studies (COLA)
> 111 Research Hall, Mail Stop 2B3
> George Mason University
> 4400 University Drive
> Fairfax, VA 22030
>
>
>
>
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20130911/95cb32ac/attachment-0003.html
More information about the gradsusr
mailing list