Set up a grid

GEM(CLIM) offers the possibilities of running global uniform, global stretched (or variable) and limited area (LAM) grids. Have a look at the grid types.

The grid is specified in the file 'gemclim_settings.nml' in the namelist 'grid'. This GEMDM  grid specification parameters link explains how to define the parametres (login and password are 'science'). Alternatively, see below.

You have to set variables for the

After having specified a grid in the file 'gemclim_settings.nml' you can have a look at the grid you specified using the grille GEMCLIM script. Note that you should generally set the model environment first:

  . r.sm.dot gemclim 3.3.0

In the directory in which you have your file 'gemclim_settings.nml' simply type :

  grille -xrec

this command will open 'xrec' with three fields of your grid:

   
LA
:
Latitudes

LO
:
Longitudes

ME
:
Mountain heights


Grid type

First thing to do is to set 'Grd_typ_S' to the grid type you want:

   
Grd_typ_S='GU'    :
Global Uniform grid

Grd_typ_S='GV' :
Global Variable grid

Grd_typ_S='LU' :
Limited area, Uniform


Grid rotation

Next specify wether your grid is to be rotated or not (if not just skip this paragraph).
Four variables are used to define the rotation of the grid. They define two points:
Both points are specified in latitudes and longitudes of the real globe.
I.e.:

  Grd_xlon1 =  260.00 , Grd_xlat1 =   50.00 ,
  Grd_xlon2 =   -10.00 , Grd_xlat2 =    0.00 ,









Number of grid points and grid size


Global uniform grid
It is enough to specify the total number of points. The model will then calculate size of the grid boxes automatically.

   
Grd_ni
:
total number of grid points in x-direction

Grd_nj :
total number of grid points in y-direction


Global variable grid
First you should specify the size of the grid boxes in degrees

   
Grd_dx :
grid size of high resolution area in x-direction in degrees

Grd_dy :
grid size of high resolution area in y-direction in degrees

Grd_dxmax :
maximum resolution in x-direction in degrees (optional)

Grd_dymax :
maximum resolution in y-direction in degrees (optional)

and the number of grid points of your high resolution area

   
Grd_nila
:
number of grid points in high resolution area in x-direction

Grd_njla :
number of grid points in high resolution area in y-direction

Now it gets tricky. You have to find the total number of grid points.

To do this you should use 'r.diag makezg'. You can also simply type 'r.diag makezg' to get information about this function. To be able to use this function you need an RPN standard file with at least 1 record. A global file would be good but is not necessary. Then you call this function giving it all of the parameters you have defined so far as input parameters. For the first try you will have to estimate the total number of points Grd_ni and Grd_nj!:
 
    r.diag makezg
 
input_file ./output_file
-kind =-1
-m Grd_dx [Grd_dxmax]
-n Grd_dy [Grd_dymax]
-dlon1 Grd_xlon1 -dlat1 Grd_xlat1
-dlon2 Grd_xlon2 -dlat2 Grd_xlat2
-i Grd_ni Grd_nila
-j Grd_nj Grd_njla

At first you might get some error messages telling you that the number of grid points you asked for is not supported. Follow the "suggestions" of these error messages until the program finishes properly.

Please check the listing for the values of "OUTWARD AMPLIFICATION FACTOR FOR HX OR HY". They should both be near 1.07. This is the factor by which the size of grid boxes increases from Grd_dx to Grd_dxmax resp. Grd_dy to Grd_dymax in the relaxation zone .

To adjust this value you need to change the total number of points Grd_ni and Grd_nj.
Then you can set your total number of grid points.

   
Grd_ni
:
total number of grid points in x-direction

Grd_nj :
total number of grid points in y-direction



LAM grid
Specify the total number of points and the size of the grid boxes in degrees.
If at all possible, insure that the total number of grid points in x-direction matches the FFT criteria.

   
Grd_ni
:
total number of grid points in x-direction
(including blending and pilot area)

Grd_nj :
total number of grid points in y-direction
(including blending and pilot area)

Grd_dx :
grid size in x-direction in degrees

Grd_dy :
grid size in y-direction in degrees


Location of limited area (just for LAM grids)

The only thing left now when setting up a LAM grid is to specify where the limited area is located on the rotated grid.

   
Grd_iref :
reference point in limited area region, x-grid coordinate

Grd_jref :
reference point in limited area region, y-grid coordinate

Grd_latr :
location of reference point in "grid latitude"

Grd_lonr :
location of reference point in "grid longitude"




Click here to find out how to set blending and pilot area (halo).


FFT criteria

To fulfill the FFT criteria the number of grid points in x-direction, excluding the pilot zone, must be a multiple of 2, 3, 5, and 7. Use the findfft GEMCLIM script to find the possible numbers of grid points fulfilling the FFT criteria.
Again you need to insure that the model environment is set:

  . r.sm.dot gemclim 3.3.0

Then you can use findfft:

  
findfft   -gnimin   :
minimum number of grid points


-gnimax

maximum number of grid points


-pw
:
size of (eastern) pilot region (LAM only)


-pe
:
size of (western) pilot region (LAM only)




Author: Katja Winger
Last update: June 2008