JISAO

GrADS helps



This page is a concatenation of how to do practical things with the Grid Analysis and Display System (GrADS), a command-line graphics (and some math) softare package. GrADS will plot maps, time series, and scatter diagrams. Please contribute to this list. The html file is /home/disk/tao/data/mosaic/computer_helps/grads_help.html and everyone has write permission for this file. Keep your write-up short, and include your name and the date of your contribution.

Outside helps

  • The GrADS WWW home page provides a tutorial (called "example.tar") and "documentation" that you should download and work through. This information is also available as an HTML document. This link also describes the scripting language. There is also a users group bulletin board on that page which provides answers to many problems.
  • Mike Fiorino, an unofficial GrADS guru, provides several of his scripts for others to use.
  • There is a GrADS users group where users submit questions and the group tries to answer them. This is often a very useful place to find solutions to problems. If you decide to submit something to this group, you should follow the guidelines linked here on the information that you need to submit in order for people to answer your question (machine architecture, GrADS version, ...).

    Homegrown helps

  • Shading continents and topography.
  • Calculating the range, mean, standard deviation of a field.
  • Dumping a data set out in binary.
    
    

    Calculate the mean, range, and standard deviation of a field.
  • "open filename.ctl" for .ctl files, "sdfopen filename.nc" for netCDF files.
  • "set dfile n" where n is a number, 1, 2, 3, ... If it's the first file you read in, set n to 1.
  • "q file n" will show you the names of the variables in the file.
  • "set gxout stat"
  • "d variablename" will provide a list of statistics for variable "variablename". The variable names can be obtained from step 2.
    Thanks to Rene Garreaud for this information. Todd Mitchell, February 2001.
    
    

    Dumping a data set out in binary.

    You need to create a file "loops.gs" to perform this operation. The basic structure of "loops.gs" is given below.
  • "open filename.ctl (or sdfopen filename.nc)" to open the file to be dumped.
  • "set gxout fwrite" the data will be written out to a file
  • "set fwrite filename.bin" the output filename is "filename.bin"
  • "run loops.gs" execute a script, loops.gs, that loops through the data, and displays (writes out) each map
  • "disable fwrite" to turn off the write function

    The "loops.gs" file contents:

    t=1
    while (t<366)  (write out the first 366 maps)
     'set t ' t    (move the pointer to the t'th map)
     'display data'  (write out the variable "data")
     t=t+1
     endwhile
    
    Todd Mitchell, September 2002.
    
    

    Todd Mitchell mitchell@atmos.washington.edu
    September 2002
    JISAO