Tutorials

This is a list of all of the tutorials available on GrADS-aholic. It has come to my attention that navigating to some of the older tutorials can be somewhat of a chore. This list should make it quick and easy to access specific tutorials without having to wade through to find them. As a general note, the examples provided in the tutorials use weather model data from around the date the tutorial was posted. As such, the example scripts associated with older tutorials may not work properly as the data may have expired. In this case, simply change the date of the data file to be more recent.

Beginner

Basics of Scripting   -  May 2013
How to Make a Basemap   -  May 2013
Shapefile Basics  -  May 2013
Vertical Cross Section with Topography in Pressure Coordinates  -  May 2013
Hovmoller Diagram  -  May 2013
Tips on Handeling more than one File  -  June 2013


Intermediate

Overlay an Image onto a Basemap Image  -  May 2013
Plotting Radar Data using GrADS  -  May 2013
Display Satellite Data from CLASS in GrADS  -  May 2013
Two Methods to plot more than one Shaded Variable in GrADS  -  May 2013
Two Different Methods for Array Syntax in GrADS  -  May 2013
Use the tcorr function to create Regression/Correlation Maps in GrADS  -  May 2013
Shapefile: A look at the DBF file  -  May 2013
Outline Nested Grid Boundaries in GrADS  -  June 2013
An introduction to using surface station data in GrADS  - February 2014
Overlay model resolution onto weather map  - February 2014
An overview of 'set gxout linefill' function  - November 2014
Use basemap.gs to make a beautiful map of "SST", Sea Ice and Snow in GrADS   - Feb 2015

Advanced

How to Save Data from GrADS into a .txt File - May 2013
Draw SLP map with marked H's and L's  -  May 2013
Draw Arbitrary Cross Sections with Topography  -  May 2013
Use GrADS to draw Shapefiles -  May 2013
Two methods to plot future storm tracks in GrADS  -  July 2013
Using the fwrite command to save data subsets - September 2013
Widgets, and GUI capabilities; Make a functional calculator using GrADS - March 2014
 Self describing and non-self describing NETCDF files, and how to write them - December 2015



Misc

A Few Tips on running GrADS from windows Batch Script  -  May 2013
Tips on using the Finite Differencing Functions in GrADS  -  May 2013
A look at different Map Projections in GrADS   -  May 2013
Basic Font Control in GrADS   -  June 2014
Reference Table of Common Metadata and Statistical Queries - January 2015
HCL Color Scales for GrADS  - July 2015


25 comments:

  1. Hi,

    I'm trying to output a 12 x 12 array i created in a .gs routine. I'd like to do it using fwrite but grads doesn't seem to recognize the array as a variable. I could write it out as ascii but i want to do further work in grads with arrays of this type. Having it as a grads binary would be best. Any ideas.
    (pete.robertson@nasa.gov)

    ReplyDelete
  2. Hi there

    I was wondering if I can get a grads scripts for calculating convergence and moisture convergence
    thanks
    Net

    ReplyDelete
    Replies
    1. There is a canned script for moisture convergence called 'mconv' here:

      http://grads.iges.org/grads/gadoc/library.html

      Also, for divergence/convergence the 'hdivg' function does a good job.

      Delete
  3. Hello,
    I'm using a grads script find in ARWpost package to draw skew-T diagram. The script is nicely draws the plot but I have problem setting the temperature and dew-point sounding lines in which they start from their actual levels (i.e. 1200m and 1500m above sea level), not from 1000 mb.
    I wonder if you have used the same script to create skew-T diagram in your other website (http://mountainmanmet.com/skewt.php) and could kindly point me to the line in which I shall modify to get the accurate plot.

    Many thanks in advance,

    ReplyDelete
    Replies
    1. I don't have access to the modified script right now, but I will send you the little snippet of code that I use (I borrowed jt from someone else) to maskout values below the surface height in the near future.

      Delete
  4. Hi.

    I want to draw hovmuller plot.
    I just got a little information on the other website.

    I found the information about the hovmuller plot which is gs file in this website.
    But, I can't download the *.gs files.

    How can I get it?

    Many Thanks

    ReplyDelete
    Replies
    1. You should be able to get it via the link at the bottom of the Hovmuller Tutorial (dropbox). If not, just copy paste the code examples directly from the tutorial into a .gs script, and that should give you the same result.

      Delete
  5. Is there a way to get GrADS to download the most recent file from the GrADS Data Server. I see all of the files on that server are saved in directories according to time. I can download files using sdfopen, but I would like to automate the process, and have GrADS download the most recent file. Thanks.

    ReplyDelete
    Replies
    1. Yes. Its actually quite simple! All you have to do is read in the date via an argument through a bash (or if on windows) batch script. Here is a link to a tutorial to help you get started reading arguments in to grads! All you would need to do is include an argument for the date format the GDS asks for (I think it's yyyymmdd), then you are good to go.

      http://gradsaddict.blogspot.com/2013/05/some-tips-on-running-grads-from-windows.html

      This is more for windows, but if you are on linux or max, the syntax is not much different.

      Delete
  6. I am using windows, but I do not know much about batch files. Is there some kind of template batch file I can download and use for this? Sorry if I seem a little thick, but this is all new to me.

    ReplyDelete
    Replies
    1. Here is an example of the script I use

      set DATE = %date%
      echo Todays Date = %DATE%
      set Day=%DATE:~7,2%
      set Month=%DATE:~4,2%
      set Year=%DATE:~10,4%

      grads -blcx 'run myscript.gs '%year%%month%%day%'

      Again, I recommend you check out the tutorial so that you know whats going on.

      http://gradsaddict.blogspot.com/2013/05/some-tips-on-running-grads-from-windows.html


      Delete
  7. Thank you again for your assistance, and patience. I have thoroughly reviewed your tutorial, but I am still having trouble. I created the batch file, as you specified, and created the GrADS file. In the GrADS file, I have the following line:

    'sdfopen http://nomads.ncep.noaa.gov:80/dods/gfs_0p25/gfs%year%%month%%day%/gfs_0p25_12z'

    In theory, this should download the the 12z file from today, however I am getting an error that says "cannot find http://nomads.ncep.noaa.gov:80/dods/gfs_0p25/gfs%year%%month%%day%/gfs_0p25_12z. It does not appear to be writing in the year, month, or day. I assume I have the syntax wrong, but I am not sure.

    ReplyDelete
    Replies
    1. Simple simple!

      You do not want the %% signs within the grads script, that should be used in the batch script only. In the grads script you want to be sure to include the line at the top:

      function script(args)


      This tells grads that the script you are running is looking for arguments within the variable "args"

      Then you simply call each argument using the subwrd command. If your batch script is:

      grads -blcx 'run myscript.gs '%year%%month%%day%'

      Then your GrADS script is:

      function script(args)
      date=subwrd(args,1)

      'sdfopen http://nomads.ncep.noaa.gov:80/dods/gfs_0p25/gfs'date'/gfs_0p25_12z'

      Delete
  8. Thank you very much. Works Great!

    ReplyDelete
  9. Hello there,

    Thank you very much for your awesome tutorials and helpful hints as it has jump started my GrADS experience.

    Regarding the above conversation about passing variables, I am having trouble figuring out the syntax for a Bash script.

    here is my bash script:

    #!/bin/bash

    RUNDATE=`date +%y%m%d`

    echo $RUNDATE

    grads -lbc 'run /home/ubuntu/grads/scripts/test/gs $RUNDATE'

    GrADS Script:

    function test(args)

    rundate = subwrd(args,1)

    say rundate



    The result is grads printing "$RUNDATE" in stead of "160123"

    I have tried several different syntax to no avail.

    Any ideas how to get that variable into GrADS?

    Many thanks in advanced

    ReplyDelete
    Replies
    1. Wow! Right after i posted this I figured it out.

      you must use double quotes in the bash script!

      grads -lbcx "run te..........."

      :-)

      Delete
  10. Hi there. I'm trying to plot 2 x line graphs on the same plot. Defeated as the plot area changes each time I call display. Any ideas please? thank you

    ReplyDelete
  11. hello, i have daily total precipitation data with 2 time data
    time 1 00-12 time 2 12-24. my data from january,1,2012-december,31,2016. i have 3654 time step. help me to get monthly climatologies and monthly anomalies please

    ReplyDelete
  12. Dear All,
    I want to concatenate a number of daily_data.nc on Windows OS. Please can someone identify a script that works on OpenGrADS 2.0.

    Thanks.

    ReplyDelete
    Replies
    1. For file concatenation / sub-setting I recommend using NCO, it looks like you can get it to work in Windows.

      https://sourceforge.net/p/nco/discussion/9830/thread/59fe446d/

      Delete
  13. hi iam willy,
    can i plot mixed layer depth in grads? please tell me

    ReplyDelete
    Replies
    1. Sure, so long as the data file you are opening with GrADS has mixed-layer depth as a variable. Alternatively, GrADS can do some pretty solid math operations on the data, so you can plot mixed-layer depth if the data file at least has the variables used in the mixed-layer diagnostic.

      Delete
  14. Hello. how can i open grib2 file in Grads and how can i convert grib2 to Netcdf formate?

    ReplyDelete
  15. Hi

    I am trying to make a base map of Fiji Island but the link to the tutorial is not working." sdfopen http://..."

    i downloaded the example as well but did not work

    thanks for help

    ReplyDelete
  16. Hey!

    I'm trying to plot several maps with the same legend but i'm having some problem with that. When I use Cbar or Cbarn each map create it's own legend and as the values range of each of them is not the same, the legend is not the same.
    Can you help me with that?

    Thanks!

    ReplyDelete