emcsfc_snow2mdl  1.10.0
model_grid Module Reference

Read in data defining the model grid. More...

Functions/Subroutines

subroutine model_grid_cleanup
 Clean up allocatable arrays. More...
 
subroutine read_mdl_grid_info
 Read mdl grid. More...
 

Variables

integer grid_id_mdl
 grib id of model grid, 4-gaussian, 203-egrid More...
 
integer ijmdl
 total number of model land points More...
 
integer imdl
 i-dimension of model grid More...
 
integer, dimension(:), allocatable ipts_mdl
 i index of point on full grid More...
 
integer jmdl
 j-dimension of model grid More...
 
integer, dimension(:), allocatable jpts_mdl
 j index of point on full grid More...
 
integer, dimension(200) kgds_mdl
 holds grib gds info of model grid More...
 
real lat11
 Corner point latitude (1,1) of model grid. More...
 
real latlast
 Corner point latitude (imdl,jmdl) of model grid. More...
 
real, dimension(:), allocatable lats_mdl
 Latitudes of model grid points. More...
 
real lon11
 Corner point longitude (1,1) of model grid. More...
 
real lonlast
 Corner point longitude (imdl,jmdl) of model grid. More...
 
real, dimension(:), allocatable lons_mdl
 longitudes of model grid points More...
 
integer, dimension(:), allocatable lonsperlat_mdl
 Number of longitudes (i-points) for each latitude (row). More...
 
real, dimension(:,:), allocatable lsmask_mdl
 land mask of model grid (0 - non land, 1-land) for global grids run thinned, will contain a modified version of the original mask that has land at all points encompassed by a thinned point More...
 
real, dimension(:,:), allocatable lsmask_mdl_sav
 saved copy of land mask of model grid (0 - non land, 1-land) only used for global thinned grids. More...
 
real resol_mdl
 approximate model resolution in km. More...
 
logical thinned
 When true, global grids will run thinned (number of i points decrease toward pole) More...
 

Detailed Description

Read in data defining the model grid.

program history log:

  • 2005-dec-16 gayno - initial version
  • 2007-nov-30 gayno - improved method for thinning gfs grids. added nam b-grids.
  • 2014-sep-29 gayno - add option to read model lat, lon and landmask data in grib2.

variable definitions:

  • lonsperlat - for global grids, the number of i points in each row (decrease toward pole)
Author
George Gayno org: w/np2
Date
2005-Dec-16

Function/Subroutine Documentation

◆ model_grid_cleanup()

subroutine model_grid::model_grid_cleanup ( )

Clean up allocatable arrays.

This deallocate this module's allocatable array.

program history log: 2005-dec-16 gayno - initial version

Author
George Gayno org: w/np2
Date
Dec 16, 2005

Definition at line 578 of file model_grid.F90.

References ipts_mdl, jpts_mdl, lats_mdl, lons_mdl, lonsperlat_mdl, and lsmask_mdl.

Referenced by driver().

◆ read_mdl_grid_info()

subroutine model_grid::read_mdl_grid_info ( )

Read mdl grid.

program history log: 2005-dec-16 gayno - initial version 2007-nov-30 gayno - Improved method for thinning gfs grids. Added nam b-grids. 2014-sep-29 gayno - Add option to read lat,lon and mask data in grib2. files: inputs:

  • model latitudes (grib 1 or grib 2)
  • model longitudes (grib 1 or grib 2)
  • model landmask (grib 1 or grib 2)
  • number pts per row, gfs grid (the "lonsperlat" file, ascii) condition codes: all fatal 76 - bad open/read gfs "lonsperlat" file 79 - unrecognized model grid 80 - bad open model latitude file 81 - bad read of model latitude grib 1 header 82 - bad read of model latitude data 83 - bad open model longitude file 82 - bad read of model longitude data 85 - bad open model landmask file 86 - bad read of model landmask data 90 - model latitude file not grib 1 or grib 2 91 - model longitude file not grib 1 or grib 2 92 - model landmask file not grib 1 or grib 2
Author
George Gayno org: w/np2
Date
2005-dec-16

Definition at line 85 of file model_grid.F90.

References gdt_to_gds(), program_setup::gfs_lpl_file, grib2_free(), grib2_null(), grib_check(), grid_id_mdl, ijmdl, imdl, ipts_mdl, jmdl, jpts_mdl, kgds_mdl, lat11, latlast, lats_mdl, lon11, lonlast, lons_mdl, lonsperlat_mdl, lsmask_mdl, lsmask_mdl_sav, program_setup::model_lat_file, program_setup::model_lon_file, program_setup::model_lsmask_file, resol_mdl, and thinned.

Referenced by driver().

Variable Documentation

◆ grid_id_mdl

integer model_grid::grid_id_mdl

grib id of model grid, 4-gaussian, 203-egrid

Definition at line 26 of file model_grid.F90.

Referenced by read_mdl_grid_info(), and snow2mdl::write_grib1().

◆ ijmdl

integer model_grid::ijmdl

total number of model land points

Definition at line 29 of file model_grid.F90.

Referenced by snow2mdl::interp(), and read_mdl_grid_info().

◆ imdl

integer model_grid::imdl

i-dimension of model grid

Definition at line 27 of file model_grid.F90.

Referenced by snow2mdl::interp(), read_mdl_grid_info(), and snow2mdl::write_grib2().

◆ ipts_mdl

integer, dimension(:), allocatable model_grid::ipts_mdl

i index of point on full grid

Definition at line 30 of file model_grid.F90.

Referenced by snow2mdl::interp(), model_grid_cleanup(), and read_mdl_grid_info().

◆ jmdl

integer model_grid::jmdl

j-dimension of model grid

Definition at line 28 of file model_grid.F90.

Referenced by snow2mdl::interp(), read_mdl_grid_info(), and snow2mdl::write_grib2().

◆ jpts_mdl

integer, dimension(:), allocatable model_grid::jpts_mdl

j index of point on full grid

Definition at line 31 of file model_grid.F90.

Referenced by snow2mdl::interp(), model_grid_cleanup(), and read_mdl_grid_info().

◆ kgds_mdl

integer, dimension(200) model_grid::kgds_mdl

holds grib gds info of model grid

Definition at line 33 of file model_grid.F90.

Referenced by snow2mdl::interp(), read_mdl_grid_info(), snow2mdl::write_grib1(), and snow2mdl::write_grib2().

◆ lat11

real model_grid::lat11

Corner point latitude (1,1) of model grid.

Definition at line 42 of file model_grid.F90.

Referenced by read_mdl_grid_info(), and snow2mdl::write_grib2().

◆ latlast

real model_grid::latlast

Corner point latitude (imdl,jmdl) of model grid.

Definition at line 43 of file model_grid.F90.

Referenced by read_mdl_grid_info(), and snow2mdl::write_grib2().

◆ lats_mdl

real, dimension(:), allocatable model_grid::lats_mdl

Latitudes of model grid points.

Definition at line 41 of file model_grid.F90.

Referenced by snow2mdl::interp(), model_grid_cleanup(), and read_mdl_grid_info().

◆ lon11

real model_grid::lon11

Corner point longitude (1,1) of model grid.

Definition at line 44 of file model_grid.F90.

Referenced by read_mdl_grid_info(), and snow2mdl::write_grib2().

◆ lonlast

real model_grid::lonlast

Corner point longitude (imdl,jmdl) of model grid.

Definition at line 45 of file model_grid.F90.

Referenced by read_mdl_grid_info(), and snow2mdl::write_grib2().

◆ lons_mdl

real, dimension(:), allocatable model_grid::lons_mdl

longitudes of model grid points

Definition at line 46 of file model_grid.F90.

Referenced by snow2mdl::interp(), model_grid_cleanup(), and read_mdl_grid_info().

◆ lonsperlat_mdl

integer, dimension (:), allocatable model_grid::lonsperlat_mdl

Number of longitudes (i-points) for each latitude (row).

Used for global thinned (reduced) grids.

Definition at line 34 of file model_grid.F90.

Referenced by snow2mdl::interp(), model_grid_cleanup(), and read_mdl_grid_info().

◆ lsmask_mdl

real, dimension(:,:), allocatable model_grid::lsmask_mdl

land mask of model grid (0 - non land, 1-land) for global grids run thinned, will contain a modified version of the original mask that has land at all points encompassed by a thinned point

Definition at line 47 of file model_grid.F90.

Referenced by snow2mdl::interp(), model_grid_cleanup(), read_mdl_grid_info(), snow2mdl::write_grib1(), and snow2mdl::write_grib2().

◆ lsmask_mdl_sav

real, dimension(:,:), allocatable model_grid::lsmask_mdl_sav

saved copy of land mask of model grid (0 - non land, 1-land) only used for global thinned grids.

Definition at line 50 of file model_grid.F90.

Referenced by snow2mdl::interp(), and read_mdl_grid_info().

◆ resol_mdl

real model_grid::resol_mdl

approximate model resolution in km.

Definition at line 52 of file model_grid.F90.

Referenced by snow2mdl::interp(), and read_mdl_grid_info().

◆ thinned

logical model_grid::thinned

When true, global grids will run thinned (number of i points decrease toward pole)

Definition at line 38 of file model_grid.F90.

Referenced by snow2mdl::interp(), and read_mdl_grid_info().