Contains utility routines.
More...
Go to the source code of this file.
|
subroutine | utilities::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 | utilities::check_soilt (soilt, landmask, skint, ICET_DEFAULT, i_input, j_input, lsoil_input) |
| Check for and replace certain values in soil temperature. More...
|
|
subroutine | utilities::dint2p (PPIN, XXIN, NPIN, PPOUT, XXOUT, NPOUT, LINLOG, XMSG, IER) |
| Pressure to presure vertical interpolation for tracers with linear or lnP interpolation. More...
|
|
subroutine | utilities::error_handler (string, rc) |
| General error handler. More...
|
|
subroutine | utilities::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 | utilities::netcdf_err (err, string) |
| Error handler for netcdf. More...
|
|
recursive subroutine | utilities::quicksort (a, first, last) |
| Sort an array of values. More...
|
|
subroutine | utilities::to_lower (strIn) |
| Convert from upper to lowercase. More...
|
|
character(len=len(strin)) function | utilities::to_upper (strIn) |
| Convert string from lower to uppercase. More...
|
|
Contains utility routines.
Definition in file utils.F90.
◆ check_cnwat()
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 265 of file utils.F90.
◆ check_soilt()
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 230 of file utils.F90.
◆ dint2p()
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] | 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 |
- Author
- Jili Dong NCEP/EMC
- Date
- 2021/07/30
Definition at line 301 of file utils.F90.
◆ error_handler()
subroutine utilities::error_handler |
( |
character(len=*), intent(in) |
string, |
|
|
integer, intent(in) |
rc |
|
) |
| |
General error handler.
- Parameters
-
[in] | string | error message |
[in] | rc | error status code |
Definition at line 13 of file utils.F90.
◆ handle_grib_error()
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] | 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 |
- Author
- Larissa Reames
Definition at line 121 of file utils.F90.
◆ netcdf_err()
subroutine utilities::netcdf_err |
( |
integer, intent(in) |
err, |
|
|
character(len=*), intent(in) |
string |
|
) |
| |
Error handler for netcdf.
- Parameters
-
[in] | err | error status code |
[in] | string | error message |
Definition at line 35 of file utils.F90.
◆ quicksort()
recursive subroutine utilities::quicksort |
( |
real*8, dimension(*) |
a, |
|
|
integer |
first, |
|
|
integer |
last |
|
) |
| |
Sort an array of values.
- Parameters
-
a | the sorted array |
first | the first value of sorted array |
last | the last value of sorted array |
- Author
- Jili Dong NOAA/EMC
Definition at line 187 of file utils.F90.
◆ to_lower()
subroutine utilities::to_lower |
( |
character(len=*), intent(inout) |
strIn | ) |
|
◆ to_upper()
character(len=len(strin)) function utilities::to_upper |
( |
character(len=*), intent(in) |
strIn | ) |
|