[gradsusr] Organizing many GrADS scripts running on a regular basis

Muhammad Yunus Ahmad Mazuki ukm.yunus at gmail.com
Sun Apr 7 00:04:55 EDT 2013


Lets see, if its about creating image, I use mainly one script for each
variable, beccause each variable are usually representat differently. For
example temperature uses red for hot and blue for cold, as well as
precipitation, but the scales are different so I use different printing
scripts. In the printing scripts, I use 'd printvar1' until 'printvar4' as
needed. So I just call this printing script inside another calculatin
script. By using the GrADS scripting language, I can automate the the
titles to be drawn, i.e. 'draw title Precipitation 'Month' at 'Level' hPa,
'Year , so, instead of having multiple printing scripts for different
levels, I mainly use only one. Of course you can take this even further by
automating the countour colouration by making different scripts describing
countor levels to be called into the printing script itself.

open ...
run calculationscript1
define printvar1=var1
run printscript1
     run countor1
*draw title Precipitation 'Month' at 'Level' hPa, 'Year
*printim
run printscript2
      run countor2
*draw title whatever you need, 2 times printscript for imposing images, for
example, wind field over air temperature.
printim Something'Year''Month''Level'.png x1020 y800 white

This is my current approach. But of course, you can make this more
complicated by unifying the printscript, and call upon different countour
colouring, by automatically quering first what kind of variable you want to
printout the image, then call the appropriate countour colouration in the
printscript. Because some parameters need to be calculated first, such as
circulation, anomalies, correlation, theres the need for the calculation
script. If you know what you want do, and the process is automatic, you can
just automate everything and put the scripts in one place. With different
models, usually the longitude, latitude and and time can be incremented
easily, but the pressure height is not, in this case I manually entered the
appropriate level that I needed into different scripts.

Sometimes I run scrips that pull out data into binary files, which can be
read by Scilab, and calculates things inside Scilab. Sometimes I used
Scilab to generate GrADS scripts, particularly correlation scripts,
especially when the time to be correlated jumps around, 1982 1982 then 1989
1990, for different cases of climatology you are studying.

As for GrADS functions, I guess I only used the basics one, set gxout
variations, functions associated with image drawing, script funtions (loops
subwrd, subline), cdiff, hcurl and such.

Yunus.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20130407/3a3fdfab/attachment-0003.html 


More information about the gradsusr mailing list