chgres_cube
1.13.0
|
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... | |
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).
cnwat | [input] 2-dimensional canopy moisture content |
i_input | [in] i-dimension of input grid |
j_input | [in] j-dimension of input grid |
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.
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 |
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.
[in] | ppin | 1d input pres levs |
[in] | xxin | 1d input tracer |
[in] | npin | number of input levs |
[in] | ppout | 1d target pres levs |
[out] | xxout | 1d interpolated tracer |
[in] | npout | number of target levs |
[in] | linlog | interp method.1:linear;not 1:log;neg:extrp allowed |
[in] | xmsg | fill values of missing levels (-999.0) |
[out] | ier | error status. non 0: failed interpolation |
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.
[in] | string | error message |
[in] | rc | error 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.
[in] | vname | grib2 variable name |
[in] | lev | grib2 variable level |
[in] | method | how missing data is handled |
[in] | value | fill value for missing data |
[in] | varnum | grib2 variable number |
[in,out] | iret | return status code |
[in,out] | var | 4-byte array of corrected data |
[in,out] | var8 | 8-byte array of corrected data |
[in,out] | var3d | 3-d array of corrected data |
[in,out] | read_from_input | logical array indicating if variable was read in |
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().
subroutine utilities::netcdf_err | ( | integer, intent(in) | err, |
character(len=*), intent(in) | string | ||
) |
Error handler for netcdf.
[in] | err | error status code |
[in] | string | error message |
Definition at line 34 of file utils.F90.
Referenced by model_grid::define_input_grid_gaussian(), model_grid::define_input_grid_mosaic(), model_grid::define_target_grid(), model_grid::get_model_latlons(), model_grid::get_model_mask_terrain(), sfc_input_data::read_fv3_grid_data_netcdf(), atm_input_data::read_input_atm_gaussian_netcdf_file(), atm_input_data::read_input_atm_restart_file(), atm_input_data::read_input_atm_tiled_history_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(), static_data::read_static_file(), thompson_mp_climo_data::read_thomp_mp_climo_data(), write_data::write_fv3_atm_bndy_data_netcdf(), write_data::write_fv3_atm_data_netcdf(), write_data::write_fv3_atm_header_netcdf(), and write_data::write_fv3_sfc_data_netcdf().
recursive subroutine utilities::quicksort | ( | real*8, dimension(*) | a, |
integer | first, | ||
integer | last | ||
) |
Sort an array of values.
a | the sorted array |
first | the first value of sorted array |
last | the last value of sorted array |
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.
Adapted from http://www.star.le.ac.uk/~cgp/fortran.html (25 May 2012)
[in,out] | strIn | string 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.
Adapted from http://www.star.le.ac.uk/~cgp/fortran.html (25 May 2012)
[in] | strIn | string to convert |
Definition at line 62 of file utils.F90.
Referenced by sfc_input_data::read_input_sfc_grib2_file().