chgres_cube  1.13.0
 All Data Structures Files Functions Variables
utilities Module Reference

Public Member Functions

subroutine check_cnwat (cnwat, i_input, j_input)
 When using GEFS data, some points on the target grid have unreasonable canpy moisture content, so zero out any locations with unrealistic canopy moisture values (>0.5). More...
 
subroutine check_soilt (soilt, landmask, skint, ICET_DEFAULT, i_input, j_input, lsoil_input)
 Check for and replace certain values in soil temperature. More...
 
subroutine dint2p (PPIN, XXIN, NPIN, PPOUT, XXOUT, NPOUT, LINLOG, XMSG, IER)
 Pressure to presure vertical interpolation for tracers with linear or lnP interpolation. More...
 
subroutine error_handler (string, rc)
 General error handler. More...
 
subroutine handle_grib_error (vname, lev, method, value, varnum, read_from_input, iret, var, var8, var3d)
 Handle GRIB2 read error based on the user selected method in the varmap file. More...
 
subroutine netcdf_err (err, string)
 Error handler for netcdf. More...
 
recursive subroutine quicksort (a, first, last)
 Sort an array of values. More...
 
subroutine to_lower (strIn)
 Convert from upper to lowercase. More...
 
character(len=len(strin)) function to_upper (strIn)
 Convert string from lower to uppercase. More...
 

Detailed Description

Definition at line 1 of file utils.F90.

Member Function/Subroutine Documentation

subroutine utilities::check_cnwat ( real(esmf_kind_r8), dimension(i_input,j_input), intent(inout)  cnwat,
integer, intent(in)  i_input,
integer, intent(in)  j_input 
)

When using GEFS data, some points on the target grid have unreasonable canpy moisture content, so zero out any locations with unrealistic canopy moisture values (>0.5).

Parameters
cnwat[input] 2-dimensional canopy moisture content
i_input[in] i-dimension of input grid
j_input[in] j-dimension of input grid
Author
Larissa Reames CIMMS/NSSL

Definition at line 264 of file utils.F90.

Referenced by sfc_input_data::read_input_sfc_grib2_file().

subroutine utilities::check_soilt ( real(esmf_kind_r8), dimension(i_input,j_input,lsoil_input), intent(inout)  soilt,
integer(esmf_kind_i4), dimension(i_input,j_input), intent(in)  landmask,
real(esmf_kind_r8), dimension(i_input,j_input), intent(in)  skint,
real, intent(in)  ICET_DEFAULT,
integer, intent(in)  i_input,
integer, intent(in)  j_input,
integer, intent(in)  lsoil_input 
)

Check for and replace certain values in soil temperature.

At open water points (landmask=0) use skin temperature as a filler value. At land points (landmask=1) with excessive soil temperature, replace soil temperature with skin temperature. In GEFSv12.0 data there are some erroneous missing values at land points which this corrects. At sea ice points (landmask=2), store a default ice column temperature because grib2 files do not have ice column temperature which FV3 expects at these points.

Parameters
soilt[inout] 3-dimensional soil temperature arrray
landmask[in] landmask of the input grid
skint[in] 2-dimensional skin temperature array
ICET_DEFAULT[in] Default temperature to apply at ice points
i_input[in] i-dimension of input grid
j_input[in] j-dimension of input grid
lsoil_input[in] soil layers dimension of input grid
Author
Larissa Reames CIMMS/NSSL

Definition at line 229 of file utils.F90.

Referenced by sfc_input_data::read_input_sfc_grib2_file().

subroutine utilities::dint2p ( real*8, dimension(npin)  PPIN,
real*8, dimension(npin)  XXIN,
integer  NPIN,
real*8, dimension(npout)  PPOUT,
real*8, dimension(npout)  XXOUT,
integer  NPOUT,
integer  LINLOG,
real*8  XMSG,
integer  IER 
)

Pressure to presure vertical interpolation for tracers with linear or lnP interpolation.

Input tracers on pres levels are interpolated to the target output pressure levels. The matching levels of input and output will keep the same. Extrapolation is also allowed but needs caution. The routine is mostly for GFSV16 combined grib2 input when spfh has missing levels in low and mid troposphere from U/T/HGT/DZDT.

Parameters
[in]ppin1d input pres levs
[in]xxin1d input tracer
[in]npinnumber of input levs
[in]ppout1d target pres levs
[out]xxout1d interpolated tracer
[in]npoutnumber of target levs
[in]linloginterp method.1:linear;not 1:log;neg:extrp allowed
[in]xmsgfill values of missing levels (-999.0)
[out]iererror status. non 0: failed interpolation
Author
Jili Dong NCEP/EMC
Date
2021/07/30

Definition at line 299 of file utils.F90.

Referenced by atm_input_data::read_input_atm_grib2_file().

subroutine utilities::error_handler ( character(len=*), intent(in)  string,
integer, intent(in)  rc 
)

General error handler.

Parameters
[in]stringerror message
[in]rcerror status code

Definition at line 12 of file utils.F90.

Referenced by surface::adjust_soil_levels(), surface::adjust_soilt_for_terrain(), atmosphere::atmosphere_driver(), surface::calc_liq_soil_moisture(), chgres(), atmosphere::compute_zh(), atmosphere::convert_winds_to_uv(), atm_input_data::convert_winds_to_xyz(), atmosphere::create_atm_b4adj_esmf_fields(), atmosphere::create_atm_esmf_fields(), surface::create_nst_esmf_fields(), static_data::create_static_fields(), surface::create_surface_esmf_fields(), model_grid::define_input_grid_gaussian(), model_grid::define_input_grid_grib2(), model_grid::define_input_grid_mosaic(), model_grid::define_target_grid(), model_grid::gdt_to_gds(), model_grid::get_model_latlons(), model_grid::get_model_mask_terrain(), static_data::get_static_fields(), handle_grib_error(), atmosphere::horiz_interp_thomp_mp_climo(), atm_input_data::init_atm_esmf_fields(), sfc_input_data::init_sfc_esmf_fields(), surface::interp(), atmosphere::newpr1(), atmosphere::newps(), surface::nst_land_fill(), surface::qc_check(), sfc_input_data::read_grib_soil(), atm_input_data::read_input_atm_gaussian_nemsio_file(), atm_input_data::read_input_atm_gaussian_netcdf_file(), atm_input_data::read_input_atm_gfs_gaussian_nemsio_file(), atm_input_data::read_input_atm_gfs_sigio_file(), atm_input_data::read_input_atm_grib2_file(), atm_input_data::read_input_atm_restart_file(), atm_input_data::read_input_atm_tiled_history_file(), nst_input_data::read_input_nst_data(), nst_input_data::read_input_nst_nemsio_file(), nst_input_data::read_input_nst_netcdf_file(), sfc_input_data::read_input_sfc_gaussian_nemsio_file(), sfc_input_data::read_input_sfc_gfs_gaussian_nemsio_file(), sfc_input_data::read_input_sfc_gfs_sfcio_file(), sfc_input_data::read_input_sfc_grib2_file(), sfc_input_data::read_input_sfc_netcdf_file(), sfc_input_data::read_input_sfc_restart_file(), program_setup::read_setup_namelist(), thompson_mp_climo_data::read_thomp_mp_climo_data(), program_setup::read_varmap(), atmosphere::read_vcoord_info(), atm_input_data::read_winds(), surface::regrid_many(), surface::rescale_soil_moisture(), surface::roughness(), surface::search_many(), surface::surface_driver(), surface::update_landmask(), atmosphere::vintg(), atmosphere::vintg_thomp_mp_climo(), atmosphere::vintg_wam(), write_data::write_fv3_atm_bndy_data_netcdf(), write_data::write_fv3_atm_data_netcdf(), and write_data::write_fv3_sfc_data_netcdf().

subroutine utilities::handle_grib_error ( character(len=20), intent(in)  vname,
character(len=20), intent(in)  lev,
character(len=20), intent(in)  method,
real(esmf_kind_r4), intent(in)  value,
integer, intent(in)  varnum,
logical, dimension(:), intent(inout)  read_from_input,
integer, intent(inout)  iret,
real(esmf_kind_r4), dimension(:,:), intent(inout), optional  var,
real(esmf_kind_r8), dimension(:,:), intent(inout), optional  var8,
real(esmf_kind_r8), dimension(:,:,:), intent(inout), optional  var3d 
)

Handle GRIB2 read error based on the user selected method in the varmap file.

Parameters
[in]vnamegrib2 variable name
[in]levgrib2 variable level
[in]methodhow missing data is handled
[in]valuefill value for missing data
[in]varnumgrib2 variable number
[in,out]iretreturn status code
[in,out]var4-byte array of corrected data
[in,out]var88-byte array of corrected data
[in,out]var3d3-d array of corrected data
[in,out]read_from_inputlogical array indicating if variable was read in
Author
Larissa Reames

Definition at line 120 of file utils.F90.

References error_handler().

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

recursive subroutine utilities::quicksort ( real*8, dimension(*)  a,
integer  first,
integer  last 
)

Sort an array of values.

Parameters
athe sorted array
firstthe first value of sorted array
lastthe last value of sorted array
Author
Jili Dong NOAA/EMC

Definition at line 186 of file utils.F90.

Referenced by atm_input_data::read_input_atm_grib2_file().

subroutine utilities::to_lower ( character(len=*), intent(inout)  strIn)

Convert from upper to lowercase.

Author
Clive Page

Adapted from http://www.star.le.ac.uk/~cgp/fortran.html (25 May 2012)

Parameters
[in,out]strInstring to convert

Definition at line 87 of file utils.F90.

Referenced by program_setup::read_setup_namelist().

character(len=len(strin)) function utilities::to_upper ( character(len=*), intent(in)  strIn)

Convert string from lower to uppercase.

Author
Clive Page

Adapted from http://www.star.le.ac.uk/~cgp/fortran.html (25 May 2012)

Parameters
[in]strInstring to convert
Returns
strOut string in uppercase

Definition at line 62 of file utils.F90.

Referenced by sfc_input_data::read_input_sfc_grib2_file().


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