Template usage
See Hai Ooi
axl419 at YAHOO.COM
Sat Jun 20 03:00:19 EDT 2009
Dear Muhammad,
Sorry. I do not use climate model data and my GrADS is a window version. However, I believe the principle of extracting the data is more or less similar. I trust that other experienced users in Fedora (?) can readily help you out to resolve your problem provided your save.gs file is made known to them.
Best regards.
Ooi
--- On Sat, 20/6/09, Muhammad Rahiz <muhammad.rahiz at OUCE.OX.AC.UK> wrote:
> From: Muhammad Rahiz <muhammad.rahiz at OUCE.OX.AC.UK>
> Subject: Re: Template usage
> To: GRADSUSR at LIST.CINECA.IT
> Date: Saturday, 20 June, 2009, 12:12 PM
> Dear Ooi,
>
> Perhaps I should brief you on what I'd like to do.
>
> I have a set of RegCM data (1960-1990 and 2070-2010) in .bin/.ctl format. I'm trying to extract only selected variables i.e. temperature and precipitation from the output file. In CDO, I can issue the command 'selvars' to extract a variable but I'm new to GrADS and there is no equivalent function of extracting variable(s). A description of a sample output file is as follows;
>
> dset ^ATM.1988070100
> title RegCM normal output variables
> options big_endian
> undef -1.e34
> pdef 118 109 eta.u 80.000 21.000 0.45045 0.42900
> xdef 303 linear 46.25 0.2252
> ydef 226 linear -5.07 0.2252
> zdef 18 levels 1008.23 998.20 983.15 958.07 922.96 877.81
> 822.63 757.42 682.18 601.92 521.66 441.40 361.14 280.88 205.63
> 140.42 85.24 35.08
> tdef 124 linear 6z01jul1988 6hr
> vars 11
> u 18 0 westerly wind (m/s)
> v 18 0 southerly wind (m/s)
> w 18 0 omega (hPa/s) p-velocity
> t 18 0 air temperature (degree)
> qv 18 0 air specific humidity
> qc 18 0 cloud water mixing ratio
> psa 0 99 surface pressure (hPa)
> tpr 0 99 total precipitation(mm/day
> tgb 0 99 groud temperature in BATS
> swt 0 99 total soil water in mm H2O
> rno 0 99 accumulated infiltration
> endvars
>
> I have a script (save.gs) that someone (Bin Guan) wrote that enables me to extract the variable(s) I want. So far, running the script for one ATM.xxx.ctl file does the job of extracting temperature. But I have 1080 (there are 360 ATM, 360 SRF and 360 RAD data) x 2 sets of files (present and future) to extract so the script writer recommended doing an aggregate and running the save.gs file just once.
>
> Previously, I did this in a simple script.
>
> 'open ATM.1988070100.ctl'
> 'set t 1 124'
> 'run save.gs'
> 'save -v t -n t -u -1.e34 -o atm.1988070100 -p ./output/'
>
> This works for one ctl file but I want Grads to automatically choose the input file and prints the output file. Any idea of how I can do that?. In shell scripting, I can issue a wildcard (*). For example,
>
> $ for input in $(ls *.tgz);do
> tar xvfz $input
>
> Obviously, wildcards do not work in Grads and it requires the specific name for the descriptor file as input. While Grads can take shell commands, can shell take grad commands?
>
> In short, I'd like to do either (but I'd like to know how to do both),
> 1. aggregate of all data files and run 'save.gs' once or
> 2. auto select input and generate corresponding output and run 'save.gs' on every file.
>
> If you have any suggestions, please advise.
>
> Thanks!
>
> Muhammad
>
> --
> Muhammad Rahiz | Doctoral Student in Regional
> Climate Modeling
> Climate Research Laboratory, School of Geography & the
> Environment
> Oxford University Centre for the Environment, University of
> Oxford
> South Parks Road, Oxford, OX1 3QY, United Kingdom
> Tel: +44 (0)1865-285194 Mobile: +44 (0)7854-625974
> Email: muhammad.rahiz at ouce.ox.ac.uk
Get your new Email address!
Grab the Email name you've always wanted before someone else does!
http://mail.promotions.yahoo.com/newdomains/aa/
More information about the gradsusr
mailing list