using template control file for grib files

Eric Altshuler ela at COLA.IGES.ORG
Wed Apr 2 17:13:11 EDT 2008


Dan,

Try using the following in your DSET specification:

dset /usr/local/archive/grib_out/%iy2%im2%id2%ih2_arw_d02.GrbF%f3%n2

You are using %y2%m2%d206 which refers to the verification date/time, but your files are named according to initialization time, not verification time (this inconsistency will confuse grads and probably lead to incorrect results). The corresponding template for files named according to initialization time is %iy2%im2%id2%ih2 (you can replace the 06 with %ih2 which refers to the hour of initialization, i.e. cycle). This should fix your problem and you won't need to use CHSUB at all. See http://grads.iges.org/grads/gadoc/templates.html for documentation on the use of templates.

Best regards,

Eric L. Altshuler
Assistant Research Scientist
Center for Ocean-Land-Atmosphere Studies
4041 Powder Mill Road, Suite 302
Calverton, MD 20705-3106
USA

E-mail: ela at cola.iges.org
Phone: (301) 902-1257
Fax: (301) 595-9793


----- Original Message -----
From: "Dan Leins" <theedge981 at GMAIL.COM>
To: GRADSUSR at LIST.CINECA.IT
Sent: Wednesday, April 2, 2008 10:42:43 AM GMT -05:00 US/Canada Eastern
Subject: using template control file for grib files

List,

I am having a bit of trouble setting up and using a template control file to display grib formatted model data. I've never used a template before (I've always used an individual control file for each hour's worth of forecast data) so this question may seem rather trivial. A similar question was asked a few months ago, but I didn't see a response that helped me out.

I've got 36 hours worth of grib1 model data and would like to use a template instead of opening 37 different control files.  The naming convention of the files is as follows:

YYMMDDCC_arw_d01.GrbFHHHMM

(pretty straightforward, but YYMMDD is the 2 digit year/month/day of the run and CC is the 2 digit cycle of the run (i.e. 00, 06, 12, 18). YYMMDDCC stays constant for each file. Of course HHHMM is a 3 digit forecast hour and 2 digit minute which always happens to be 00).


I've set up my control file as follows: (I hard-coded the 06 cycle time into the template for now)

dset /usr/local/archive/grib_out/%y2%m2%d206_arw_d02.GrbF%f300
index indexfile
OPTIONS template

When I run gribmap -v -i template.ctl, the 00 forecast hour works fine. As a matter of fact, the first 17 files work just fine. However hours 18 to 36 fail because it's
advancing DD by 1.

Here's the output from gribmap...

gribmap:  Opening GRIB file /usr/local/archive/grib_out/08040306_arw_d02.GrbF01800
Warning: Could not open GRIB file: /usr/local/archive/grib_out/08040306_arw_d02.GrbF01800
gribmap:  Opening GRIB file /usr/local/archive/grib_out/08040306_arw_d02.GrbF01900
Warning: Could not open GRIB file: /usr/local/archive/grib_out/08040306_arw_d02.GrbF01900


It should be looking for /usr/local/archive/grib_out/08040206_arw_d02.GrbF01800 and GrbF01900 respectively.

Any idea how I can stop it from advancing the date? As a workaround, I tried using CHSUB 1 37 08040206 and putting %ch in place of the %y2%m2%d206 and that solved the problem.

My question though is how can I stop it from advancing the date incorrectly and if that can't be done, is there any way I can pass in the CHSUB section as an argument when I open the template control file? My template control file works fine, as long as I go in ahead of time and manually change CHSUB to the run I'm interested in. That's not really ideal though....

Any help would be greatly appreciated!

Thanks!
Dan



More information about the gradsusr mailing list