next up previous contents
Next: References Up: Accessing Data Previous: Using the DRS Library

Using GrADS

  GrADS can be used for simple manipulation and display of mean and standard deviation data from the MCD and for more complicated calculations of derived quantities, e.g. vorticity. GrADS can also be useful for quickly translating portions of the DRS format files into other formats.

N.B. Some GrADS routines, in particular hdivg and hcurl which compute horizontal derivatives, assume that the data relates to the Earth; if they are used for calculating derived quantities from the database, results from them should always be multiplied by a factor of approximately 1.88 to account for the relative radii of the Earth and Mars. The dates used for the GrADS scripts are in Earth format, and are arbitrary, but the universal time of day is correct with one ``hour'' corresponding to 1/24 of a Martian Solar day (a Martian Solar day is 88775.2 seconds, so here 1 ``hour'' is actually about 3699 seconds). In the database 00:00 is midnight and 12:00 is noon at 0$^\circ$ longitude in True Solar Time.

A simple interactive GrADS session to plot the seasonal average surface temperature for season 4 from the Viking scenario simulation may run like this:

ga> open viks05me
Scanning description file: viks05me
Data file viks05me.dat is open as file 1
LON set to 0 360
LAT set to -88.125 88.125
LEV set to 0.9995 0.9995
Time values set: 2001:1:1:0 2001:1:1:0
ga> set mpdraw off
ga> display ave(tsurf,t=1,t=12)
Averaging. dim = 3, start = 1, end = 12
Contouring: 150 to 230 interval 10
ga>

To produce hard copy, type enable print filename.gx, then display the data which you require and type print when you have what you want. A clear command will start a new page and disable print or quit at the end of the session closes the filename.gx file. The .gx file can be viewed again on the screen with the gxtran utility or converted to PostScript for printing with gxps or gxeps. These utilities, and instructions for using them, are provided with the GrADS distribution (whether you get gxps, gxeps or other programs with similar names depends on exactly which version of GrADS you obtain).

For more complicated output, or for repeated applications which can be run in batch mode, it is more convenient to write a GrADS script. Some are provided in the mcd/grads subdirectory; it might be necessary to change the path to the data files to where the mcd directory has been installed on your machine if these scripts are to be run from another directory. The final part of the filename determines the dust scenario and season according to the code described previously in this document. These can be changed, and the titles modified accordingly, by editing the scripts. If different quantities are required from those which they plot, it should be straightforward to write new scripts using the ones supplied as templates. Most of the scripts are intended to produce output in portrait orientation, so either run GrADS and answer no to the initial landscape mode question, or specify portrait mode from the command line, grads -p. It is also useful to run the GrADS command set mpdraw off, which prevents GrADS from drawing outlines of countries on the Earth, although the scripts here will all do this explicitly when necessary; this could be achieved with a command aliased to grads -pc "set mpdraw off" which would run GrADS in portrait mode with no map outlines.

The scripts which are provided in the mcd/grads subdirectory are briefly described below. The scripts have been commented and they should provide a useful starting point.

GrADS is a popular and powerful public domain software package for displaying meteorological variables. You are referred to the manual for a description of all the features available. Also note that as GrADS is widely used there may be scripts already written to perform the particular task you are undertaking. It may be worth a search of the Internet and related newsgroups for GrADS scripts. The World Wide Web page at http://grads.iges.org/grads is a good starting place.


next up previous contents
Next: References Up: Accessing Data Previous: Using the DRS Library
Stephen Lewis
3/10/1999