Don't Concatenate, Use GrADSv1.9

In the latest versions of GrADS a new feature was implemented that allows for a solution of this problem in a much clever way. Now it is possible to build a template CTL that points to different files depending on a user defined format.

It is easier to understand if you see an example. This one if from the GrADS manuals:

Here are two netCDF files, one containing 50 years of monthly data (600 time steps), the other 100 years (1200 time steps):

pr.1851-1900.nc
pr.1901-2000.nc

Your descriptor file should include the following entries:

DSET ^pr.%ch.nc
CHSUB   1  600 1851-1900
CHSUB 601 1800 1901-2000
OPTIONS template
DTYPE netcdf
TDEF 1800 linear jan1851 1mo

Pay attention to what is going on here. For instante, the keyword CHSUB1 defines that for the time steps 1st to 600th the string "1851-1900" will be assigned to variable '%ch'. Therefore GrADS will look for data in the right file, i.e., pr.1851-1900.nc for time steps up to the 600th.

If these two data files were located on different disks, you could write out the relevant descriptor file entries this way instead:

DSET %ch
CHSUB   1  600 /disk1/pr.1851-1900.nc
CHSUB 601 1800 /disk2/pr.1901-2000.nc

Pages you should read:

Doing GRIB in GrADS
About grib2ctl
About gribmap
About templates

Page last modified on May 26, 2015, at 05:39 PM
Powered by PmWiki