sdfwrite: write NetCDF formatted data file.

Examples

The following commands produce a regional subset of a global precip forecast :

open gfs.ctl
set lon -111.3 -103.8 
set lat 40.9 45.0 
set t 1 last
define precip = ptot
set sdfwrite wyoming_precip.nc
sdfwrite precip

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). Use the 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:

ncks -O -h -A precip.nc slp.nc

http://www.iges.org/grads/gadoc/gradcomdsdfwrite.html

Advertisements

One thought on “sdfwrite: write NetCDF formatted data file.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s