Table of contents Previous: Grids and Grid Files - Copying Grids and Grid Files Next: Grids and Grid Files - Displaying Gridded Data

9.3 Grids and Grid Files - Creating Grids and Grid Files

In this exercise, you will create a new grid dataset, copy and contour grids, create advection and divergence grids, and list the grids and grid files.

  1. Generate a local grid dataset in position 2 of the TEST-GRID dataset with a maximum of 100 grids, and the description ADVECTION AND DIVERGENCE GRIDS. Copy in the 12 hour 1000 mb forecast grids from the first BLIZZARD grid position.

    Type: GRDCOPY BLIZZARD/GRIDS.1 TG.2 DEL=YES LEVEL=1000 FHOUR=12 TITLE='ADVECTION AND DIVERGENCE GRIDS' MAXGRD=100 NUM=ALL

    If you don't specify a maximum number of grids, the grid file is created with space for 1000 grids.

  2. List the new dataset.

    Type: GRDLIST TG.2 NUM=ALL

    The dataset should contain four grids.

  3. Check to see that TG.2 contains the grids required to calculate divergence.

    Type: GRDLIST TG.2 DER=DVG

    If the grid can be created, the following output will be shown:
    GRDLIST TG.2 DER=DVG  
    PARAM  LEVEL      DAY        TIME    SRC FHOUR     FDAY       FTIME  GRID  PRO
    ----- ------- ------------ -------- ---- ----- ------------ -------- ----- ----
    DVG   1000 MB 11 MAR 93070 12:00:00  NGM    12 12 MAR 93071 00:00:00 MATH  MERC
    Number of grids listed = 1                                                     
    GRDLIST - done  
    
    Notice the GRID number is listed as "MATH". This indicates that the component grids required to create a divergence grid all exist within the TG.2 grid file. See the help sections of the individual commands for more information on the common meteorological parameters you can calculate from grids by using the DERIVE keyword.

    If the grid cannot be created, an error will be produced.

  4. Create a divergence grid from from the grids in the dataset.

    Type: GRDCOPY TG.2 TG.2 DER=DVG

  5. List the contents of the dataset to verify that a divergence grid was added.

    Type: GRDLIST TG.2 NUM=ALL

    The new grid was filed into grid 5, which is the first available grid:

    Dataset position 2      Directory Title= ADVECTION AND DIVERGENCE GRIDS         
    PARAM  LEVEL      DAY        TIME    SRC FHOUR     FDAY       FTIME   GRID  PRO 
    ----- ------- ------------ -------- ---- ----- ------------ -------- ------ ----
    Z     1000 MB 11 MAR 93070 12:00:00  NGM    12 12 MAR 93071 00:00:00      1 MERC
    T     1000 MB 11 MAR 93070 12:00:00  NGM    12 12 MAR 93071 00:00:00      2 MERC
    U     1000 MB 11 MAR 93070 12:00:00  NGM    12 12 MAR 93071 00:00:00      3 MERC
    V     1000 MB 11 MAR 93070 12:00:00  NGM    12 12 MAR 93071 00:00:00      4 MERC
    DVG   1000 MB 11 MAR 93070 12:00:00  NGM    12 12 MAR 93071 00:00:00      5 MERC
    Number of grids listed = 5                                                      
    

    Notice that the the DVG grid has now been created, has a grid number, and is listed as a PARAMETER.

  6. List information about the divergence grid:

    Type: GRDINFO TG.2 PARAM=DVG

    GRDINFO TG.2 PARAM=DVG                                                          
    Statistics of                                                                   
    Parameter: DVG                                                                  
    Units: 1/S                                                                      
    Level of data: 1000 MB                                                          
    Initial time of data: 120000 UTC                                                
    Initial day of data:   1993070                                                  
    Data came from: NGM                                                             
    12-hour forecast                                                                
                                                                                    
    Dataset: TG                                                                     
                                                                                    
    Minimum:  -0.6531000E-04 occurred at [row,col]: [   33,   26]                   
                                       [lat,lon]: [  20.00,  77.50]                 
    Maximum:   0.3372000E-04 occurred at [row,col]: [   33,   24]                   
                                       [lat,lon]: [  20.00,  82.50]                 
    Mean:   0.2849890E-07                                                           
    SD  :   0.1168576E-04                                                           
    Number of points analyzed:   1188                                               
    Number of points missing:     282                                               
                                                                                    
    Row range:     1 to    33                                                       
    Col range:     1 to    36                                                       
    GRDINFO Done, Number of grids statistically analyzed=1                          
    

  7. Create a temperature advection grid using the U, V and T grids. Use the formula TADV = -(u*DDX(T) + v*DDY(T)). Label the new grid TADV and set the units to K/sec.

    Type: GRDCOPY TG.2 TG.2 G1='PARAM T' G2='PARAM U' G3='PARAM V' MATH='-(G2*(DDX(G1))+G3*(DDY(G1)))' NEWPAR=TADV K/S

    The G1, G2, ...., Gn keywords are used to define the grids you want to use. Since all the grids in this dataset are from the same level, model run and forecast hour, just specifying the parameter defines the grid uniquely. You can use additional search criteria (ex: LEVEL, FHOUR) to further refine your selection. The MATH keyword defines the mathematical operation to perform on the grids specified with the Gn keywords. See the help sections of the individual commands for more information on the use of these keywords.

  8. List information about the temperature advection grid:

    Type: GRDINFO TG.2 PARAM=TADV

  9. OR, if you would like to get statistical information on a grid created with a mathematical equation, but won't need to actually display the grid, you can run the GRDINFO command with the MATH keywords included.

    Type: GRDINFO TG.2 G1='PARAM T' G2='PARAM U' G3='PARAM V' MATH='-(G2*(DDX(G1))+G3*(DDY(G1)))' NEWPAR=TTAD K/S

    This should list the same information as the previous GRDINFO command, except with a different parameter name.

In the next lesson, you will display the grids you created using the GRDDISP command.


Table of contents Previous: Grids and Grid Files - Copying Grids and Grid Files Next: Grids and Grid Files - Displaying Gridded Data