chgres_cube  1.12.0
 All Data Structures Files Functions Variables
model_grid Module Reference

Sets up the ESMF grid objects for the input data grid and target FV3 grid. More...

Public Member Functions

subroutine, public cleanup_input_target_grid_data
 Deallocate all esmf grid objects. More...
 
subroutine, public define_input_grid (localpet, npets)
 Driver routine to setup the esmf grid object for the input grid. More...
 
subroutine define_input_grid_gaussian (npets)
 Define grid object for input data on global gaussian grids. More...
 
subroutine define_input_grid_grib2 (npets)
 Define input grid object for grib2 input data. More...
 
subroutine define_input_grid_mosaic (localpet, npets)
 Define input grid for tiled data using the 'mosaic', 'grid' and orography files. More...
 
subroutine, public define_target_grid (localpet, npets)
 Setup the esmf grid object for the target grid. More...
 
subroutine get_model_latlons (mosaic_file, orog_dir, num_tiles, tile, i_tile, j_tile, ip1_tile, jp1_tile, latitude, latitude_s, latitude_w, longitude, longitude_s, longitude_w)
 Read model lat/lons for a single tile from the "grid" specificaton file. More...
 
subroutine get_model_mask_terrain (orog_file, idim, jdim, mask, terrain)
 Read the model land mask and terrain for a single tile from the orography file. More...
 

Data Fields

integer, public i_input
 i-dimension of input grid (or of each global tile) More...
 
integer, public i_target
 i dimension of each global tile, or of a nest, target grid. More...
 
type(esmf_grid), public input_grid
 input grid esmf grid object More...
 
character(len=50), public input_grid_type = "latlon"
 map projection of input grid More...
 
integer, public ip1_input
 i_input plus 1 More...
 
integer, public ip1_target
 ip1_target plus 1 More...
 
integer, public j_input
 j-dimension of input grid (or of each global tile) More...
 
integer, public j_target
 j dimension of each global tile, or of a nest, target grid. More...
 
integer, public jp1_input
 j_input plus 1 More...
 
integer, public jp1_target
 jp1_target plus 1 More...
 
type(esmf_field), public landmask_target_grid
 land mask target grid - '1' land; '0' non-land More...
 
type(esmf_field), public latitude_input_grid
 latitude of grid center, input grid More...
 
type(esmf_field), public latitude_s_input_grid
 latitude of 'south' edge of grid box, input grid More...
 
type(esmf_field), public latitude_s_target_grid
 latitude of 'south' edge of grid box, target grid More...
 
type(esmf_field), public latitude_target_grid
 latitude of grid center, target grid More...
 
type(esmf_field), public latitude_w_input_grid
 latitude of 'west' edge of grid box, input grid More...
 
type(esmf_field), public latitude_w_target_grid
 latitude of 'west' edge of grid box, target grid More...
 
type(esmf_field), public longitude_input_grid
 longitude of grid center, input grid More...
 
type(esmf_field), public longitude_s_input_grid
 longitude of 'south' edge of grid box, input grid More...
 
type(esmf_field), public longitude_s_target_grid
 longitude of 'south' edge of grid box, target grid More...
 
type(esmf_field), public longitude_target_grid
 longitude of grid center, target grid More...
 
type(esmf_field), public longitude_w_input_grid
 longitude of 'west' edge of grid box, input grid More...
 
type(esmf_field), public longitude_w_target_grid
 longitude of 'west' edge of grid box, target grid More...
 
integer, public lsoil_target = 4
 Number of soil layers, target grid. More...
 
integer, public num_tiles_input_grid
 Number of tiles, input grid. More...
 
integer, public num_tiles_target_grid
 Number of tiles, target grid. More...
 
type(esmf_field), public seamask_target_grid
 sea mask target grid - '1' non-land; '0' land More...
 
type(esmf_grid), public target_grid
 target grid esmf grid object. More...
 
type(esmf_field), public terrain_target_grid
 terrain height target grid More...
 
character(len=5), dimension(:),
allocatable, public 
tiles_target_grid
 Tile names of target grid. More...
 

Private Member Functions

subroutine gdt_to_gds (igdtnum, igdstmpl, igdtlen, kgds, ni, nj, res)
 Convert the GRIB2 grid description template to to the GRIB1 grid description section. More...
 

Detailed Description

Sets up the ESMF grid objects for the input data grid and target FV3 grid.

Author
George Gayno NCEP/EMC

Definition at line 9 of file model_grid.F90.

Member Function/Subroutine Documentation

subroutine, public model_grid::cleanup_input_target_grid_data ( )

Deallocate all esmf grid objects.

Author
George Gayno NCEP/EMC

Definition at line 1393 of file model_grid.F90.

Referenced by chgres().

subroutine, public model_grid::define_input_grid ( integer, intent(in)  localpet,
integer, intent(in)  npets 
)

Driver routine to setup the esmf grid object for the input grid.

If the input source is tiled fv3 restart or history data, the grid is created by reading the mosaic and grid files. If the input source is fv3 global gaussian nemsio, spectral gfs global gaussian nemsio, or spectral gfs global gaussian sigio/sfcio, the grid is setup by computing lat/lons using the sp library.

Parameters
[in]localpetESMF local persistent execution thread
[in]npetsNumber of persistent execution threads
Author
George Gayno NCEP/EMC

Definition at line 116 of file model_grid.F90.

References define_input_grid_gaussian(), define_input_grid_grib2(), and define_input_grid_mosaic().

Referenced by chgres().

subroutine model_grid::define_input_grid_gaussian ( integer, intent(in)  npets)

Define grid object for input data on global gaussian grids.

Recognized file formats:

  • fv3gfs nemsio
  • spectral gfs nemsio (starting July 19, 2017)
  • spectral gfs sigio (prior to July 19, 2017)
  • spectral gfs sfcio (prior to July 19, 2017)
Parameters
[in]npetsNumber of persistent execution threads.
Author
George Gayno NCEP/EMC

Definition at line 147 of file model_grid.F90.

References utilities::error_handler(), and utilities::netcdf_err().

Referenced by define_input_grid().

subroutine model_grid::define_input_grid_grib2 ( integer, intent(in)  npets)

Define input grid object for grib2 input data.

Parameters
[in]npetsNumber of persistent execution threads
Author
Larissa Reames
Jeff Beck
George Gayno

Definition at line 614 of file model_grid.F90.

References utilities::error_handler(), and gdt_to_gds().

Referenced by define_input_grid().

subroutine model_grid::define_input_grid_mosaic ( integer, intent(in)  localpet,
integer, intent(in)  npets 
)

Define input grid for tiled data using the 'mosaic', 'grid' and orography files.

Parameters
localpetESMF local persistent execution thread
npetsTotal number of persistent execution threads
Author
George Gayno NCEP/EMC

Definition at line 401 of file model_grid.F90.

References utilities::error_handler(), get_model_latlons(), and utilities::netcdf_err().

Referenced by define_input_grid().

subroutine, public model_grid::define_target_grid ( integer, intent(in)  localpet,
integer, intent(in)  npets 
)

Setup the esmf grid object for the target grid.

Parameters
[in]localpetESMF local persistent execution thread
[in]npetsNumber of persistent execution threads
Author
George Gayno NCEP/EMC

Definition at line 887 of file model_grid.F90.

References utilities::error_handler(), get_model_latlons(), get_model_mask_terrain(), and utilities::netcdf_err().

Referenced by chgres().

subroutine model_grid::gdt_to_gds ( integer, intent(in)  igdtnum,
integer, dimension(igdtlen), intent(in)  igdstmpl,
integer, intent(in)  igdtlen,
integer, dimension(200), intent(out)  kgds,
integer, intent(out)  ni,
integer, intent(out)  nj,
real, intent(out)  res 
)
private

Convert the GRIB2 grid description template to to the GRIB1 grid description section.

Parameters
[in]igdtnumGRIB2 grid description template number.
[in]igdstmplLength of grib2 grid description template.
[in]igdtlenArray of GRIB2 grid description template octets.
[out]kgdsArray of GRIB1 grid description octets.
[out]niI-dimension of grid.
[out]njJ-dimension of grid.
[out]resResolution of grid in km.
Author
George Gayno NCEP/EMC

Definition at line 1448 of file model_grid.F90.

References utilities::error_handler().

Referenced by define_input_grid_grib2().

subroutine model_grid::get_model_latlons ( character(len=*), intent(in)  mosaic_file,
character(len=*), intent(in)  orog_dir,
integer, intent(in)  num_tiles,
integer, intent(in)  tile,
integer, intent(in)  i_tile,
integer, intent(in)  j_tile,
integer, intent(in)  ip1_tile,
integer, intent(in)  jp1_tile,
real(esmf_kind_r8), dimension(i_tile, j_tile), intent(out)  latitude,
real(esmf_kind_r8), dimension(i_tile, jp1_tile), intent(out)  latitude_s,
real(esmf_kind_r8), dimension(ip1_tile, j_tile), intent(out)  latitude_w,
real(esmf_kind_r8), dimension(i_tile, j_tile), intent(out)  longitude,
real(esmf_kind_r8), dimension(i_tile, jp1_tile), intent(out)  longitude_s,
real(esmf_kind_r8), dimension(ip1_tile, j_tile), intent(out)  longitude_w 
)

Read model lat/lons for a single tile from the "grid" specificaton file.

Parameters
[in]mosaic_fileThe mosaic file associated with the 'grid' files.
[in]orog_dirDirectory containing the 'grid' and orography files.
[in]num_tilesTotal number of tiles
[in]tileTile number to be read
[in]i_tile"i" dimension of the tile
[in]j_tile"j" dimension of the tile
[in]ip1_tile"i" dimension of the tile plus 1
[in]jp1_tile"j" dimension of the tile plus 1
[out]latitudegrid box center latitude
[out]latitude_slatitude of 'south' edge of grid box
[out]latitude_wlatitude of 'west' edge of grid box
[out]longitudegrid box center longitude
[out]longitude_slongitude of 'south' edge of grid box
[out]longitude_wlongitude of 'west' edge of grid box
Author
George Gayno NCEP/EMC

Definition at line 1175 of file model_grid.F90.

References utilities::error_handler(), and utilities::netcdf_err().

Referenced by define_input_grid_mosaic(), and define_target_grid().

subroutine model_grid::get_model_mask_terrain ( character(len=*), intent(in)  orog_file,
integer, intent(in)  idim,
integer, intent(in)  jdim,
integer(esmf_kind_i8), dimension(idim,jdim), intent(out)  mask,
real(esmf_kind_i8), dimension(idim,jdim), intent(out)  terrain 
)

Read the model land mask and terrain for a single tile from the orography file.

Parameters
[in]orog_filePath/name of orography file
[in]idim"i" dimension of tile
[in]jdim"j" dimension of tile
[out]maskland mask of tile
[out]terrainterrain height of tile
Author
George Gayno NCEP/EMC

Definition at line 1326 of file model_grid.F90.

References utilities::error_handler(), and utilities::netcdf_err().

Referenced by define_target_grid().

Field Documentation

integer, public model_grid::i_input

i-dimension of input grid (or of each global tile)

Definition at line 27 of file model_grid.F90.

integer, public model_grid::i_target

i dimension of each global tile, or of a nest, target grid.

Definition at line 37 of file model_grid.F90.

type(esmf_grid), public model_grid::input_grid

input grid esmf grid object

Definition at line 52 of file model_grid.F90.

character(len=50), public model_grid::input_grid_type = "latlon"

map projection of input grid

Definition at line 21 of file model_grid.F90.

integer, public model_grid::ip1_input

i_input plus 1

Definition at line 33 of file model_grid.F90.

integer, public model_grid::ip1_target

ip1_target plus 1

Definition at line 43 of file model_grid.F90.

integer, public model_grid::j_input

j-dimension of input grid (or of each global tile)

Definition at line 30 of file model_grid.F90.

integer, public model_grid::j_target

j dimension of each global tile, or of a nest, target grid.

Definition at line 40 of file model_grid.F90.

integer, public model_grid::jp1_input

j_input plus 1

Definition at line 35 of file model_grid.F90.

integer, public model_grid::jp1_target

jp1_target plus 1

Definition at line 45 of file model_grid.F90.

type(esmf_field), public model_grid::landmask_target_grid

land mask target grid - '1' land; '0' non-land

Definition at line 74 of file model_grid.F90.

type(esmf_field), public model_grid::latitude_input_grid

latitude of grid center, input grid

Definition at line 57 of file model_grid.F90.

type(esmf_field), public model_grid::latitude_s_input_grid

latitude of 'south' edge of grid box, input grid

Definition at line 61 of file model_grid.F90.

type(esmf_field), public model_grid::latitude_s_target_grid

latitude of 'south' edge of grid box, target grid

Definition at line 79 of file model_grid.F90.

type(esmf_field), public model_grid::latitude_target_grid

latitude of grid center, target grid

Definition at line 77 of file model_grid.F90.

type(esmf_field), public model_grid::latitude_w_input_grid

latitude of 'west' edge of grid box, input grid

Definition at line 67 of file model_grid.F90.

type(esmf_field), public model_grid::latitude_w_target_grid

latitude of 'west' edge of grid box, target grid

Definition at line 82 of file model_grid.F90.

type(esmf_field), public model_grid::longitude_input_grid

longitude of grid center, input grid

Definition at line 59 of file model_grid.F90.

type(esmf_field), public model_grid::longitude_s_input_grid

longitude of 'south' edge of grid box, input grid

Definition at line 64 of file model_grid.F90.

type(esmf_field), public model_grid::longitude_s_target_grid

longitude of 'south' edge of grid box, target grid

Definition at line 87 of file model_grid.F90.

type(esmf_field), public model_grid::longitude_target_grid

longitude of grid center, target grid

Definition at line 85 of file model_grid.F90.

type(esmf_field), public model_grid::longitude_w_input_grid

longitude of 'west' edge of grid box, input grid

Definition at line 70 of file model_grid.F90.

type(esmf_field), public model_grid::longitude_w_target_grid

longitude of 'west' edge of grid box, target grid

Definition at line 90 of file model_grid.F90.

integer, public model_grid::lsoil_target = 4

Number of soil layers, target grid.

Definition at line 25 of file model_grid.F90.

integer, public model_grid::num_tiles_input_grid

Number of tiles, input grid.

Definition at line 47 of file model_grid.F90.

integer, public model_grid::num_tiles_target_grid

Number of tiles, target grid.

Definition at line 49 of file model_grid.F90.

type(esmf_field), public model_grid::seamask_target_grid

sea mask target grid - '1' non-land; '0' land

Definition at line 93 of file model_grid.F90.

type(esmf_grid), public model_grid::target_grid

target grid esmf grid object.

Definition at line 54 of file model_grid.F90.

type(esmf_field), public model_grid::terrain_target_grid

terrain height target grid

Definition at line 96 of file model_grid.F90.

character(len=5), dimension(:), allocatable, public model_grid::tiles_target_grid

Tile names of target grid.

Definition at line 19 of file model_grid.F90.


The documentation for this module was generated from the following file: