chgres_cube  1.6.0
 All Data Structures Files Functions Variables
program_setup Module Reference

This module contains code to read the setup namelist file, handle the varmap file for GRIB2 data, and calculate the soil parameters. More...

Public Member Functions

subroutine, public calc_soil_params_driver (localpet)
 Driver routine to compute soil parameters for each soil type. More...
 
subroutine, public get_var_cond (var_name, this_miss_var_method, this_miss_var_value, this_field_var_name, loc)
 Search the variable mapping table to find conditions for handling missing variables. More...
 
subroutine, public read_setup_namelist (filename)
 Reads program configuration namelist. More...
 
subroutine, public read_varmap
 Reads the variable mapping table, which is required for initializing with GRIB2 data. More...
 

Data Fields

character(len=500), dimension(7),
public 
atm_core_files_input_grid = "NULL"
 File names of input atmospheric restart core files. More...
 
character(len=500), dimension(6),
public 
atm_files_input_grid = "NULL"
 File names of input atmospheric data. More...
 
character(len=500), dimension(6),
public 
atm_tracer_files_input_grid = "NULL"
 File names of input atmospheric restart tracer files. More...
 
character(len=500), public atm_weight_file ="NULL"
 File containing pre-computed weights to horizontally interpolate atmospheric fields. More...
 
real, dimension(:),
allocatable, public 
bb_target
 Soil 'b' parameter, target grid. More...
 
character(len=20), dimension(:),
allocatable, public 
chgres_var_names
 Varmap table variable name as recognized by this program. More...
 
logical, public convert_atm = .false.
 Convert atmospheric data when true. More...
 
logical, public convert_nst = .false.
 Convert nst data when true. More...
 
logical, public convert_sfc = .false.
 Convert sfc data when true. More...
 
character(len=6), public cres_target_grid = "NULL"
 Target grid resolution, i.e., C768. More...
 
integer, public cycle_day = -999
 Cycle day. More...
 
integer, public cycle_hour = -999
 Cycle hour. More...
 
integer, public cycle_mon = -999
 Cycle month. More...
 
integer, public cycle_year = -999
 Cycle year. More...
 
character(len=500), public data_dir_input_grid = "NULL"
 Directory containing input atm or sfc files. More...
 
real, dimension(:),
allocatable, public 
drysmc_input
 Air dry soil moisture content input grid. More...
 
real, dimension(:),
allocatable, public 
drysmc_target
 Air dry soil moisture content target grid. More...
 
character(len=20), public external_model ="GFS"
 The model that the input data is derived from. More...
 
character(len=20), dimension(:),
allocatable, public 
field_var_names
 The GRIB2 variable name in the varmap table. More...
 
character(len=500), public fix_dir_input_grid = "NULL"
 Directory containing files of latitude and and longitude for certain GRIB2 input data. More...
 
character(len=500), public fix_dir_target_grid = "NULL"
 Directory containing target grid pre-computed fixed data (ex: soil type). More...
 
character(len=500), public geogrid_file_input_grid = "NULL"
 Name of "geogrid" file, which contains static surface fields on the input grid. More...
 
character(len=500), public grib2_file_input_grid = "NULL"
 REQUIRED. More...
 
integer, public halo_blend = 0
 Number of row/cols of blending halo, where model tendencies and lateral boundary tendencies are applied. More...
 
integer, public halo_bndy = 0
 Number of row/cols of lateral halo, where pure lateral bndy conditions are applied (regional target grids). More...
 
character(len=25), public input_type ="restart"
 Input data type: More...
 
logical, public lai_from_climo = .true.
 If false, interpolate leaf area index from the input data to the target grid instead of using data from static data. More...
 
integer, parameter, public max_tracers =100
 Maximum number of atmospheric tracers processed. More...
 
real, dimension(:),
allocatable, public 
maxsmc_input
 Maximum soil moisture content input grid. More...
 
real, dimension(:),
allocatable, public 
maxsmc_target
 Maximum soil moisture content target grid. More...
 
logical, public minmax_vgfrc_from_climo = .true.
 If false, interpolate min/max vegetation fraction from the input data to the target grid instead of using data from static data. More...
 
character(len=20), dimension(:),
allocatable, public 
missing_var_methods
 Method to replace missing GRIB2 input records. More...
 
real, dimension(:),
allocatable, public 
missing_var_values
 If input GRIB2 record is missing, the variable is set to this value. More...
 
character(len=500), public mosaic_file_input_grid = "NULL"
 Input grid mosaic file. More...
 
character(len=500), public mosaic_file_target_grid = "NULL"
 Target grid mosaic file. More...
 
integer, public nsoill_out = 4
 Number of soil levels desired in the output data. More...
 
character(len=500), public nst_files_input_grid = "NULL"
 File name of input nst data. More...
 
integer, public num_tracers
 Number of atmospheric tracers to be processed. More...
 
integer, public num_tracers_input
 Number of atmospheric tracers in input file. More...
 
character(len=500), public orog_dir_input_grid = "NULL"
 Directory containing the input grid orography files. More...
 
character(len=500), public orog_dir_target_grid = "NULL"
 Directory containing the target grid orography files. More...
 
character(len=500), dimension(6),
public 
orog_files_input_grid = "NULL"
 Input grid orography files. More...
 
character(len=500), dimension(6),
public 
orog_files_target_grid = "NULL"
 Target grid orography files. More...
 
logical, dimension(:),
allocatable, public 
read_from_input
 When false, variable was not read from GRIB2 input file. More...
 
real, dimension(:),
allocatable, public 
refsmc_input
 Reference soil moisture content input grid (onset of soil moisture stress). More...
 
real, dimension(:),
allocatable, public 
refsmc_target
 Reference soil moisture content target grid (onset of soil moisture stress). More...
 
integer, public regional = 0
 For regional target grids. More...
 
real, dimension(:),
allocatable, public 
satpsi_target
 Saturated soil potential, target grid. More...
 
character(len=500), dimension(6),
public 
sfc_files_input_grid = "NULL"
 File names containing input surface data. More...
 
logical, public sotyp_from_climo = .true.
 If false, interpolate soil type from the input data to the target grid instead of using data from static data. More...
 
logical, public tg3_from_soil = .false.
 If false, use lowest level soil temperature for the base soil temperature instead of using data from static data. More...
 
character(len=500), public thomp_mp_climo_file = "NULL"
 Path/name to the Thompson MP climatology file. More...
 
character(len=20), dimension(max_tracers),
public 
tracers ="NULL"
 Name of each atmos tracer to be processed. More...
 
character(len=20), dimension(max_tracers),
public 
tracers_input ="NULL"
 Name of each atmos tracer record in the input file. More...
 
logical, public use_thomp_mp_climo =.false.
 When true, read and process Thompson MP climatological tracers. More...
 
character(len=500), public varmap_file = "NULL"
 REQUIRED. More...
 
character(len=500), public vcoord_file_target_grid = "NULL"
 Vertical coordinate definition file. More...
 
logical, public vgfrc_from_climo = .true.
 If false, interpolate vegetation fraction from the input data to the target grid instead of using data from static data. More...
 
logical, public vgtyp_from_climo = .true.
 If false, interpolate vegetation type from the input data to the target grid instead of using data from static data. More...
 
logical, public wam_cold_start = .false.
 When true, cold start for whole atmosphere model. More...
 
real, dimension(:),
allocatable, public 
wltsmc_input
 Plant wilting point soil moisture content input grid. More...
 
real, dimension(:),
allocatable, public 
wltsmc_target
 Plant wilting point soil moisture content target grid. More...
 

Private Member Functions

subroutine calc_soil_params (num_soil_cats, smlow, smhigh, satdk, maxsmc, bb, satpsi, satdw, refsmc, drysmc, wltsmc)
 Compute soil parameters. More...
 

Detailed Description

This module contains code to read the setup namelist file, handle the varmap file for GRIB2 data, and calculate the soil parameters.

Author
George Gayno NCEP/EMC

Definition at line 9 of file program_setup.F90.

Member Function/Subroutine Documentation

subroutine program_setup::calc_soil_params ( integer, intent(in)  num_soil_cats,
real, intent(in)  smlow,
real, intent(in)  smhigh,
real, dimension(num_soil_cats), intent(in)  satdk,
real, dimension(num_soil_cats), intent(in)  maxsmc,
real, dimension(num_soil_cats), intent(in)  bb,
real, dimension(num_soil_cats), intent(in)  satpsi,
real, dimension(num_soil_cats), intent(out)  satdw,
real, dimension(num_soil_cats), intent(out)  refsmc,
real, dimension(num_soil_cats), intent(out)  drysmc,
real, dimension(num_soil_cats), intent(out)  wltsmc 
)
private

Compute soil parameters.

These will be used to rescale soil moisture differences in soil type between the input grid and target model grid.

Parameters
[in]num_soil_catsnumber of soil type categories
[in]smlowreference parameter for wltsmc
[in]smhighreference parameter for refsmc
[in]satdksaturated soil moisture hydraulic conductivity
[in]maxsmcmaximum soil moisture (porosity)
[in]bbsoil 'b' parameter
[in]satpsisaturated soil potential
[out]satdwsaturated soil diffusivity/conductivity coefficient
[out]refsmconset of soil moisture stress (field capacity)
[out]drysmcair dry soil moisture limit
[out]wltsmcplant soil moisture wilting point
Author
George Gayno NCEP/EMC

Definition at line 680 of file program_setup.F90.

Referenced by calc_soil_params_driver().

subroutine, public program_setup::calc_soil_params_driver ( integer, intent(in)  localpet)

Driver routine to compute soil parameters for each soil type.

Works for Zobler and STATSGO soil categories.

The calculations are those used in the Noah Land Surface Model. For more information see Implementation of Noah land surface model advances in the National Centers for Environmental Prediction operational mesoscale Eta model.

For more details about the soil parameters/properties see Coupling an Advanced Land Surface–Hydrology Model with the Penn State–NCAR MM5 Modeling System. Part I: Model Implementation and Sensitivity.

The original source for soil properties is here:

Cosby, B. J., G. M. Hornberger, R. B. Clapp, and T. R. Ginn, 1984: A statistical exploration of the relationships of soil moisture characteristics to the physical properties of soils. Water Resour. Res.,20, 682–690.

The parameters in this subroutine were copied from https://github.com/HelinWei-NOAA/ccpp-physics/blob/master/physics/set_soilveg.f values need to be kept in sync with set_soilveg.f.

For more information about these parameters see https://github.com/HelinWei-NOAA/ccpp-physics/blob/master/physics/sflx.f.

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

Definition at line 520 of file program_setup.F90.

References calc_soil_params().

Referenced by surface::surface_driver().

subroutine, public program_setup::get_var_cond ( character(len=20), intent(in)  var_name,
character(len=20), intent(out), optional  this_miss_var_method,
real(esmf_kind_r4), intent(out), optional  this_miss_var_value,
character(len=20), intent(out), optional  this_field_var_name,
integer, intent(out), optional  loc 
)

Search the variable mapping table to find conditions for handling missing variables.

Only applicable when using GRIB2 data as input.

Parameters
[in]var_nametable variable name to search for
[out]this_miss_var_methodthe method used to replace missing data
[out]this_miss_var_valuethe value used to replace missing data
[out]this_field_var_namename of variable in output file. not currently implemented.
[out]locvariable table location index
Author
Larissa Reames
Jeff Beck

Definition at line 448 of file program_setup.F90.

Referenced by input_data::read_grib_soil(), input_data::read_input_atm_grib2_file(), input_data::read_input_sfc_grib2_file(), and input_data::read_winds().

subroutine, public program_setup::read_setup_namelist ( character(len=*), intent(in), optional  filename)

Reads program configuration namelist.

Parameters
filenamethe name of the configuration file (defaults to ./fort.41).
Author
George Gayno NCEP/EMC

Definition at line 154 of file program_setup.F90.

References error_handler(), and to_lower().

Referenced by chgres().

subroutine, public program_setup::read_varmap ( )

Reads the variable mapping table, which is required for initializing with GRIB2 data.

The varmap files has entries that look like this:

dzdt dzdt set_to_fill 0 D

These are the chgres_var_name, field_var_name, missing_var_method, missing_var_value, var_type.

The missing_var_method is one of:

  • set_to_fill
  • skip
  • stop

The var_type is one of:

  • T - tracer.
  • D - variables processed by atmosphere subroutine that are not tracers.
  • S - variables processed by surface subroutine that are not tracers.
Author
Larissa Reames
Jeff Beck

Definition at line 378 of file program_setup.F90.

References error_handler().

Referenced by chgres().

Field Documentation

character(len=500), dimension(7), public program_setup::atm_core_files_input_grid = "NULL"

File names of input atmospheric restart core files.

Only used for 'restart' input type.

Definition at line 20 of file program_setup.F90.

character(len=500), dimension(6), public program_setup::atm_files_input_grid = "NULL"

File names of input atmospheric data.

Not used for "grib2" or "restart" input types.

Definition at line 16 of file program_setup.F90.

character(len=500), dimension(6), public program_setup::atm_tracer_files_input_grid = "NULL"

File names of input atmospheric restart tracer files.

Only used for 'restart' input type.

Definition at line 21 of file program_setup.F90.

character(len=500), public program_setup::atm_weight_file ="NULL"

File containing pre-computed weights to horizontally interpolate atmospheric fields.

Definition at line 39 of file program_setup.F90.

real, dimension(:), allocatable, public program_setup::bb_target

Soil 'b' parameter, target grid.

Definition at line 136 of file program_setup.F90.

character(len=20), dimension(:), allocatable, public program_setup::chgres_var_names

Varmap table variable name as recognized by this program.

Definition at line 80 of file program_setup.F90.

logical, public program_setup::convert_atm = .false.

Convert atmospheric data when true.

Definition at line 95 of file program_setup.F90.

logical, public program_setup::convert_nst = .false.

Convert nst data when true.

Definition at line 96 of file program_setup.F90.

logical, public program_setup::convert_sfc = .false.

Convert sfc data when true.

Definition at line 97 of file program_setup.F90.

character(len=6), public program_setup::cres_target_grid = "NULL"

Target grid resolution, i.e., C768.

Definition at line 38 of file program_setup.F90.

integer, public program_setup::cycle_day = -999

Cycle day.

Definition at line 87 of file program_setup.F90.

integer, public program_setup::cycle_hour = -999

Cycle hour.

Definition at line 88 of file program_setup.F90.

integer, public program_setup::cycle_mon = -999

Cycle month.

Definition at line 86 of file program_setup.F90.

integer, public program_setup::cycle_year = -999

Cycle year.

Definition at line 85 of file program_setup.F90.

character(len=500), public program_setup::data_dir_input_grid = "NULL"

Directory containing input atm or sfc files.

Definition at line 22 of file program_setup.F90.

real, dimension(:), allocatable, public program_setup::drysmc_input

Air dry soil moisture content input grid.

Definition at line 128 of file program_setup.F90.

real, dimension(:), allocatable, public program_setup::drysmc_target

Air dry soil moisture content target grid.

Definition at line 129 of file program_setup.F90.

character(len=20), public program_setup::external_model ="GFS"

The model that the input data is derived from.

Current supported options are: "GFS", "HRRR", "NAM", "RAP". Default: "GFS"

Definition at line 54 of file program_setup.F90.

character(len=20), dimension(:), allocatable, public program_setup::field_var_names

The GRIB2 variable name in the varmap table.

Definition at line 82 of file program_setup.F90.

character(len=500), public program_setup::fix_dir_input_grid = "NULL"

Directory containing files of latitude and and longitude for certain GRIB2 input data.

Definition at line 56 of file program_setup.F90.

character(len=500), public program_setup::fix_dir_target_grid = "NULL"

Directory containing target grid pre-computed fixed data (ex: soil type).

Definition at line 23 of file program_setup.F90.

character(len=500), public program_setup::geogrid_file_input_grid = "NULL"

Name of "geogrid" file, which contains static surface fields on the input grid.

GRIB2 option only.

Definition at line 28 of file program_setup.F90.

character(len=500), public program_setup::grib2_file_input_grid = "NULL"

REQUIRED.

File name of grib2 input data. Assumes atmospheric and surface data are in a single file.

Definition at line 27 of file program_setup.F90.

integer, public program_setup::halo_blend = 0

Number of row/cols of blending halo, where model tendencies and lateral boundary tendencies are applied.

Regional target grids only.

Definition at line 92 of file program_setup.F90.

integer, public program_setup::halo_bndy = 0

Number of row/cols of lateral halo, where pure lateral bndy conditions are applied (regional target grids).

Definition at line 91 of file program_setup.F90.

character(len=25), public program_setup::input_type ="restart"

Input data type:

  • "restart" for fv3 tiled warm restart files (netcdf).
  • "history" for fv3 tiled history files (netcdf).
  • "gaussian_nemsio" for fv3 gaussian nemsio files;
  • "gaussian_netcdf" for fv3 gaussian netcdf files.
  • "grib2" for grib2 files.
  • "gfs_gaussian_nemsio" for spectral gfs gaussian nemsio files
  • "gfs_sigio" for spectral gfs gfs sigio/sfcio files.

Definition at line 40 of file program_setup.F90.

logical, public program_setup::lai_from_climo = .true.

If false, interpolate leaf area index from the input data to the target grid instead of using data from static data.

Default: True.

Definition at line 120 of file program_setup.F90.

integer, parameter, public program_setup::max_tracers =100

Maximum number of atmospheric tracers processed.

Definition at line 60 of file program_setup.F90.

real, dimension(:), allocatable, public program_setup::maxsmc_input

Maximum soil moisture content input grid.

Definition at line 130 of file program_setup.F90.

real, dimension(:), allocatable, public program_setup::maxsmc_target

Maximum soil moisture content target grid.

Definition at line 131 of file program_setup.F90.

logical, public program_setup::minmax_vgfrc_from_climo = .true.

If false, interpolate min/max vegetation fraction from the input data to the target grid instead of using data from static data.

Use with caution as vegetation categories can vary. Default: True.

Definition at line 116 of file program_setup.F90.

character(len=20), dimension(:), allocatable, public program_setup::missing_var_methods

Method to replace missing GRIB2 input records.

Definition at line 78 of file program_setup.F90.

real, dimension(:), allocatable, public program_setup::missing_var_values

If input GRIB2 record is missing, the variable is set to this value.

Definition at line 138 of file program_setup.F90.

character(len=500), public program_setup::mosaic_file_input_grid = "NULL"

Input grid mosaic file.

Only used for "restart" or "history" input type.

Definition at line 24 of file program_setup.F90.

character(len=500), public program_setup::mosaic_file_target_grid = "NULL"

Target grid mosaic file.

Definition at line 25 of file program_setup.F90.

integer, public program_setup::nsoill_out = 4

Number of soil levels desired in the output data.

chgres_cube can interpolate from 9 input to 4 output levels. DEFAULT: 4.

Definition at line 93 of file program_setup.F90.

character(len=500), public program_setup::nst_files_input_grid = "NULL"

File name of input nst data.

Only used for input_type "gfs_gaussian_nemsio".

Definition at line 26 of file program_setup.F90.

integer, public program_setup::num_tracers

Number of atmospheric tracers to be processed.

Definition at line 61 of file program_setup.F90.

integer, public program_setup::num_tracers_input

Number of atmospheric tracers in input file.

Definition at line 62 of file program_setup.F90.

character(len=500), public program_setup::orog_dir_input_grid = "NULL"

Directory containing the input grid orography files.

Only used for "restart" or "history" input types.

Definition at line 31 of file program_setup.F90.

character(len=500), public program_setup::orog_dir_target_grid = "NULL"

Directory containing the target grid orography files.

Definition at line 33 of file program_setup.F90.

character(len=500), dimension(6), public program_setup::orog_files_input_grid = "NULL"

Input grid orography files.

Only used for "restart" or "history" input types.

Definition at line 32 of file program_setup.F90.

character(len=500), dimension(6), public program_setup::orog_files_target_grid = "NULL"

Target grid orography files.

Definition at line 34 of file program_setup.F90.

logical, dimension(:), allocatable, public program_setup::read_from_input

When false, variable was not read from GRIB2 input file.

Definition at line 64 of file program_setup.F90.

real, dimension(:), allocatable, public program_setup::refsmc_input

Reference soil moisture content input grid (onset of soil moisture stress).

Definition at line 132 of file program_setup.F90.

real, dimension(:), allocatable, public program_setup::refsmc_target

Reference soil moisture content target grid (onset of soil moisture stress).

Definition at line 133 of file program_setup.F90.

integer, public program_setup::regional = 0

For regional target grids.

When '1' remove boundary halo region from atmospheric/surface data and output atmospheric boundary file. When '2' output boundary file only. Default is '0' (global grids).

Definition at line 89 of file program_setup.F90.

real, dimension(:), allocatable, public program_setup::satpsi_target

Saturated soil potential, target grid.

Definition at line 137 of file program_setup.F90.

character(len=500), dimension(6), public program_setup::sfc_files_input_grid = "NULL"

File names containing input surface data.

Not used for 'grib2' input type.

Definition at line 35 of file program_setup.F90.

logical, public program_setup::sotyp_from_climo = .true.

If false, interpolate soil type from the input data to the target grid instead of using data from static data.

Use with caution as the code assumes input soil type use STATSGO soil categories. Default: True.

Definition at line 106 of file program_setup.F90.

logical, public program_setup::tg3_from_soil = .false.

If false, use lowest level soil temperature for the base soil temperature instead of using data from static data.

Default: False.

Definition at line 123 of file program_setup.F90.

character(len=500), public program_setup::thomp_mp_climo_file = "NULL"

Path/name to the Thompson MP climatology file.

Definition at line 37 of file program_setup.F90.

character(len=20), dimension(max_tracers), public program_setup::tracers ="NULL"

Name of each atmos tracer to be processed.

These names will be used to identify the tracer records in the output files. Follows the convention in the field table. FOR GRIB2 FILES: Not used. Tracers instead taken from the varmap file.

Definition at line 67 of file program_setup.F90.

character(len=20), dimension(max_tracers), public program_setup::tracers_input ="NULL"

Name of each atmos tracer record in the input file.

May be different from value in 'tracers'. FOR GRIB2 FILES: Not used. Tracers instead taken from the varmap file.

Definition at line 73 of file program_setup.F90.

logical, public program_setup::use_thomp_mp_climo =.false.

When true, read and process Thompson MP climatological tracers.

False, when 'thomp_mp_climo_file' is NULL.

Definition at line 126 of file program_setup.F90.

character(len=500), public program_setup::varmap_file = "NULL"

REQUIRED.

Full path of the relevant varmap file.

Definition at line 15 of file program_setup.F90.

character(len=500), public program_setup::vcoord_file_target_grid = "NULL"

Vertical coordinate definition file.

Definition at line 36 of file program_setup.F90.

logical, public program_setup::vgfrc_from_climo = .true.

If false, interpolate vegetation fraction from the input data to the target grid instead of using data from static data.

Use with caution as vegetation categories can vary. Default: True.

Definition at line 111 of file program_setup.F90.

logical, public program_setup::vgtyp_from_climo = .true.

If false, interpolate vegetation type from the input data to the target grid instead of using data from static data.

Use with caution as vegetation categories can vary. Default: True.

Definition at line 102 of file program_setup.F90.

logical, public program_setup::wam_cold_start = .false.

When true, cold start for whole atmosphere model.

Definition at line 98 of file program_setup.F90.

real, dimension(:), allocatable, public program_setup::wltsmc_input

Plant wilting point soil moisture content input grid.

Definition at line 134 of file program_setup.F90.

real, dimension(:), allocatable, public program_setup::wltsmc_target

Plant wilting point soil moisture content target grid.

Definition at line 135 of file program_setup.F90.


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