chgres_cube  1.11.0
All Data Structures Namespaces Files Functions Variables Pages
surface Module Reference

Process surface and nst fields. More...

Data Types

type  realptr_2d
 
type  realptr_3d
 

Functions/Subroutines

subroutine adjust_soil_levels (localpet)
 Adjust soil levels of the input grid if there is a mismatch between input and target grids. More...
 
subroutine adjust_soilt_for_terrain
 Adjust soil temperature for changes in terrain height between the input and target grids. More...
 
subroutine calc_liq_soil_moisture
 Compute liquid portion of the total soil moisture. More...
 
subroutine cleanup_all_target_sfc_data
 Free up memory once the target grid surface fields are no longer needed. More...
 
subroutine, public create_nst_esmf_fields
 Create ESMF fields for the target grid nst variables. More...
 
subroutine, public create_surface_esmf_fields
 Create ESMF fields for the target grid surface variables. More...
 
real function FRH2O (TKELV, SMC, SH2O, SMCMAX, BEXP, PSIS)
 Calculate supercooled soil moisture. More...
 
subroutine ij_to_i_j (ij, itile, jtile, i, j)
 Convert 1d index to 2d indices. More...
 
subroutine, public interp (localpet)
 Horizontally interpolate surface fields from input to target FV3 grid using esmf routines. More...
 
subroutine, public nst_land_fill
 nst is not active at land or sea ice points. More...
 
subroutine qc_check
 Perform some quality control checks before output. More...
 
subroutine, public regrid_many (bundle_pre, bundle_post, num_field, route, dozero, unmapped_ptr, resetifd)
 Regrid multiple ESMF fields from input to target grid. More...
 
subroutine rescale_soil_moisture
 Adjust soil moisture for changes in soil type between the input and target grids. More...
 
subroutine roughness
 Set roughness length at land and sea ice. More...
 
subroutine, public search_many (num_field, bundle_target, tile, search_nums, localpet, latitude, terrain_land, soilt_climo, mask)
 Execute the search function for multple fields. More...
 
subroutine, public surface_driver (localpet)
 Driver routine to process surface/nst data. More...
 

Variables

real, parameter, private blim = 5.5
 soil 'b' parameter limit More...
 
real, parameter, private frz_h2o = 273.15
 melting pt water More...
 
real, parameter, private frz_ice = 271.21
 melting pt sea ice More...
 
real, parameter, private grav = 9.81
 gravity More...
 
real, parameter, private hlice = 3.335E5
 latent heat of fusion More...
 
type(esmf_field) soil_type_from_input_grid
 soil type interpolated from input grid More...
 
type(esmf_field) terrain_from_input_grid
 terrain height interpolated from input grid More...
 
type(esmf_field) terrain_from_input_grid_land
 terrain height interpolated from input grid at all land points More...
 
integer, parameter veg_type_landice_target = 15
 Vegetation type category that defines permanent land ice points. More...
 

Detailed Description

Process surface and nst fields.

Interpolates fields from the input to target grids. Adjusts soil temperature according to differences in input and target grid terrain. Rescales soil moisture for soil type differences between input and target grid. Computes frozen portion of total soil moisture.

Assumes the input land data are Noah LSM-based, and the fv3 run will use the Noah LSM. NSST fields are not available when using GRIB2 input data.

Public variables are defined below. "target" indicates field associated with the target grid. "input" indicates field associated with the input grid.

Author
George Gayno NCEP/EMC

Function/Subroutine Documentation

◆ adjust_soil_levels()

subroutine surface::adjust_soil_levels ( integer, intent(in)  localpet)

Adjust soil levels of the input grid if there is a mismatch between input and target grids.

Presently can only convert from 9 to 4 levels.

Parameters
[in]localpetESMF local persistent execution thread
Author
Larissa Reames
Jeff Beck

Definition at line 2028 of file surface.F90.

References model_grid::i_input, model_grid::input_grid, model_grid::j_input, and model_grid::lsoil_target.

Referenced by surface_driver().

◆ adjust_soilt_for_terrain()

subroutine surface::adjust_soilt_for_terrain ( )

Adjust soil temperature for changes in terrain height between the input and target grids.

Author
George Gayno NOAA/EMC

Definition at line 1952 of file surface.F90.

References model_grid::landmask_target_grid, surface_target_data::soil_temp_target_grid, terrain_from_input_grid, model_grid::terrain_target_grid, veg_type_landice_target, and static_data::veg_type_target_grid.

Referenced by surface_driver().

◆ calc_liq_soil_moisture()

◆ cleanup_all_target_sfc_data()

subroutine surface::cleanup_all_target_sfc_data ( )

Free up memory once the target grid surface fields are no longer needed.

Author
George Gayno NOAA/EMC

Definition at line 3429 of file surface.F90.

References surface_target_data::cleanup_target_sfc_data(), soil_type_from_input_grid, terrain_from_input_grid, and terrain_from_input_grid_land.

Referenced by surface_driver().

◆ create_nst_esmf_fields()

◆ create_surface_esmf_fields()

◆ FRH2O()

real function surface::FRH2O ( real(esmf_kind_r8)  TKELV,
real(esmf_kind_r8)  SMC,
real(esmf_kind_r8)  SH2O,
real  SMCMAX,
real  BEXP,
real  PSIS 
)

Calculate supercooled soil moisture.

Calculate amount of supercooled liquid soil water content if temperature is below 273.15K. Requires Newton-type iteration to solve the nonlinear implicit equation given in eqn 17 of Koren et. al (1999, JGR, VOL 104(D16), 19569-19585).

New version (June 2001): Much faster and more accurate Newton iteration achieved by first taking log of eqn cited above – less than 4 (typically 1 or 2) iterations achieves convergence. Also, explicit 1-step solution option for special case of parameter ck=0, which reduces the original implicit equation to a simpler explicit form, known as the "Flerchinger eqn". Improved handling of solution in the limit of freezing point temperature.

Parameters
[in]tkelvTemperature (Kelvin)
[in]smcTotal soil moisture content (volumetric)
[in]sh2OLiquid soil moisture content (volumetric)
[in]smcmaxSaturation soil moisture content
[in]bexpSoil type "b" parameter
[in]psisSaturated soil matric potential
Returns
frh2O Supercooled liquid water content
Author
George Gayno NOAA/EMC
Date
2005-05-20

Definition at line 1646 of file surface.F90.

References blim, frz_h2o, grav, and hlice.

◆ ij_to_i_j()

subroutine surface::ij_to_i_j ( integer(esmf_kind_i4), intent(in)  ij,
integer, intent(in)  itile,
integer, intent(in)  jtile,
integer, intent(out)  i,
integer, intent(out)  j 
)

Convert 1d index to 2d indices.

Parameters
[in]ijthe 1d index
[in]itilei-dimension of the tile
[in]jtilej-dimension of the tile
[out]ithe "i" index
[out]jthe "j" index
Author
George Gayno NOAA/EMC

Definition at line 3136 of file surface.F90.

Referenced by interp(), and regrid_many().

◆ interp()

subroutine, public surface::interp ( integer, intent(in)  localpet)

Horizontally interpolate surface fields from input to target FV3 grid using esmf routines.

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

Definition at line 249 of file surface.F90.

References surface_target_data::c_0_target_grid, surface_target_data::c_d_target_grid, surface_target_data::canopy_mc_target_grid, program_setup::convert_nst, surface_target_data::d_conv_target_grid, surface_target_data::dt_cool_target_grid, surface_target_data::f10m_target_grid, surface_target_data::ffmm_target_grid, model_grid::i_target, surface_target_data::ifd_target_grid, ij_to_i_j(), model_grid::input_grid, model_grid::j_target, program_setup::lai_from_climo, surface_target_data::lai_target_grid, model_grid::landmask_target_grid, model_grid::latitude_target_grid, model_grid::lsoil_target, static_data::max_veg_greenness_target_grid, static_data::min_veg_greenness_target_grid, program_setup::minmax_vgfrc_from_climo, model_grid::num_tiles_target_grid, surface_target_data::q2m_target_grid, surface_target_data::qrain_target_grid, regrid_many(), surface_target_data::seaice_depth_target_grid, surface_target_data::seaice_fract_target_grid, surface_target_data::seaice_skin_temp_target_grid, model_grid::seamask_target_grid, search_util::search(), search_many(), surface_target_data::skin_temp_target_grid, surface_target_data::snow_depth_target_grid, surface_target_data::snow_liq_equiv_target_grid, surface_target_data::soil_temp_target_grid, soil_type_from_input_grid, static_data::soil_type_target_grid, surface_target_data::soilm_tot_target_grid, program_setup::sotyp_from_climo, surface_target_data::srflag_target_grid, static_data::substrate_temp_target_grid, surface_target_data::t2m_target_grid, model_grid::target_grid, terrain_from_input_grid, terrain_from_input_grid_land, atm_input_data::terrain_input_grid, program_setup::tg3_from_soil, surface_target_data::tprcp_target_grid, surface_target_data::tref_target_grid, surface_target_data::ustar_target_grid, static_data::veg_greenness_target_grid, veg_type_landice_target, static_data::veg_type_target_grid, program_setup::vgfrc_from_climo, program_setup::vgtyp_from_climo, surface_target_data::w_0_target_grid, surface_target_data::w_d_target_grid, surface_target_data::xs_target_grid, surface_target_data::xt_target_grid, surface_target_data::xtts_target_grid, surface_target_data::xu_target_grid, surface_target_data::xv_target_grid, surface_target_data::xz_target_grid, surface_target_data::xzts_target_grid, surface_target_data::z0_target_grid, surface_target_data::z_c_target_grid, and surface_target_data::zm_target_grid.

Referenced by surface_driver().

◆ nst_land_fill()

◆ qc_check()

◆ regrid_many()

subroutine, public surface::regrid_many ( type(esmf_fieldbundle), intent(in)  bundle_pre,
type(esmf_fieldbundle), intent(in)  bundle_post,
integer, intent(in)  num_field,
type(esmf_routehandle), intent(inout)  route,
logical, dimension(num_field), intent(in)  dozero,
integer(esmf_kind_i4), dimension(:), intent(inout), optional  unmapped_ptr,
logical, intent(in), optional  resetifd 
)

Regrid multiple ESMF fields from input to target grid.

Parameters
[in]bundle_preESMF fieldBundle on input grid
[in]bundle_postESMF fieldBundle on target grid
[in]num_fieldNumber of fields in target field pointer
[in,out]routeRoute handle to saved ESMF regridding instructions
[in]dozeroLogical length num_field for whether field should be zeroed out before regridding
[in,out]unmapped_ptr(optional) Pointer to unmapped points from FieldRegrid
[in]resetifd(optional) Logical for whether to reset ifd (only for water where nst data is used)
Author
Larissa Reames, OU CIMMS/NOAA/NSSL

Definition at line 3172 of file surface.F90.

References program_setup::convert_nst, model_grid::i_target, surface_target_data::ifd_target_grid, ij_to_i_j(), and model_grid::j_target.

Referenced by interp().

◆ rescale_soil_moisture()

subroutine surface::rescale_soil_moisture ( )

◆ roughness()

subroutine surface::roughness ( )

Set roughness length at land and sea ice.

At land, roughness is set from a lookup table based on the vegetation type. At sea ice, roughness is set to 1 cm.

Author
George Gayno NOAA/EMC

Definition at line 2144 of file surface.F90.

References model_grid::landmask_target_grid, static_data::veg_type_target_grid, and surface_target_data::z0_target_grid.

Referenced by surface_driver().

◆ search_many()

subroutine, public surface::search_many ( integer, intent(in)  num_field,
type(esmf_fieldbundle), intent(inout)  bundle_target,
integer, intent(in)  tile,
integer, dimension(num_field), intent(inout)  search_nums,
integer, intent(in)  localpet,
real(esmf_kind_r8), dimension(i_target,j_target), intent(inout), optional  latitude,
real(esmf_kind_r8), dimension(i_target,j_target), intent(inout), optional  terrain_land,
real(esmf_kind_r8), dimension(i_target,j_target), intent(inout), optional  soilt_climo,
integer(esmf_kind_i8), dimension(i_target,j_target), intent(inout), optional  mask 
)

Execute the search function for multple fields.

Parameters
[in]num_fieldNumber of fields to process.
[in,out]bundle_targetESMF FieldBundle holding target fields to search
[in]tileCurrent cubed sphere tile.
[in,out]search_numsArray length num_field holding search field numbers corresponding to each field provided for searching.
[in]localpetESMF local persistent execution thread.
[in]latitude(optional) A real array size i_target,j_target of latitude on the target grid
[in]terrain_land(optional) A real array size i_target,j_target of terrain height (m) on the target grid
[in]soilt_climo(optional) A real array size i_target,j_target of climatological soil type on the target grid
[in,out]mask(optional) An integer array of size i_target,j_target that holds masked (0) and unmasked (1) values indicating where to execute search (only at

Definition at line 3317 of file surface.F90.

References program_setup::external_model, model_grid::i_target, program_setup::input_type, model_grid::j_target, model_grid::lsoil_target, and search_util::search().

Referenced by interp().

◆ surface_driver()

subroutine, public surface::surface_driver ( integer, intent(in)  localpet)

Variable Documentation

◆ blim

real, parameter, private surface::blim = 5.5
private

soil 'b' parameter limit

Definition at line 69 of file surface.F90.

Referenced by calc_liq_soil_moisture(), and FRH2O().

◆ frz_h2o

real, parameter, private surface::frz_h2o = 273.15
private

melting pt water

Definition at line 71 of file surface.F90.

Referenced by calc_liq_soil_moisture(), and FRH2O().

◆ frz_ice

real, parameter, private surface::frz_ice = 271.21
private

melting pt sea ice

Definition at line 73 of file surface.F90.

Referenced by qc_check().

◆ grav

real, parameter, private surface::grav = 9.81
private

gravity

Definition at line 75 of file surface.F90.

Referenced by calc_liq_soil_moisture(), and FRH2O().

◆ hlice

real, parameter, private surface::hlice = 3.335E5
private

latent heat of fusion

Definition at line 77 of file surface.F90.

Referenced by calc_liq_soil_moisture(), and FRH2O().

◆ soil_type_from_input_grid

type(esmf_field) surface::soil_type_from_input_grid
private

soil type interpolated from input grid

Definition at line 59 of file surface.F90.

Referenced by cleanup_all_target_sfc_data(), create_surface_esmf_fields(), interp(), and rescale_soil_moisture().

◆ terrain_from_input_grid

type(esmf_field) surface::terrain_from_input_grid
private

terrain height interpolated from input grid

Definition at line 62 of file surface.F90.

Referenced by adjust_soilt_for_terrain(), cleanup_all_target_sfc_data(), create_surface_esmf_fields(), and interp().

◆ terrain_from_input_grid_land

type(esmf_field) surface::terrain_from_input_grid_land
private

terrain height interpolated from input grid at all land points

Definition at line 65 of file surface.F90.

Referenced by cleanup_all_target_sfc_data(), and interp().

◆ veg_type_landice_target

integer, parameter surface::veg_type_landice_target = 15
private

Vegetation type category that defines permanent land ice points.

The Noah LSM land ice physics are applied at these points.

Definition at line 53 of file surface.F90.

Referenced by adjust_soilt_for_terrain(), calc_liq_soil_moisture(), interp(), qc_check(), and rescale_soil_moisture().