This PR exposes the model's calibratable parameters via its BMI so that they can be calibrated via NextGen.
Additions
Calibratable parameters
The following parameters were added to the model's BMI:
BEXP
SMCMAX
DKSAT
RSURF_EXP
REFKDT
AXAJ
BXAJ
XXAJ
SLOPE
CWP
VCMX25
MP
MFSNO
SCAMAX***
RSURF_SNOW
HVT
FRZX**
KDT**
Listings/functionality for the above parameters were added to the following BMI functions:
noahowp_var_grid
noahowp_var_type
noahowp_var_units
noahowp_var_itemsize
noahowp_var_location
noahowp_get_float
noahowp_set_float (except for FRZX and KDT)
** FRZX and KDT were added because they are recalculated/reinitialized when setting SMCMAX, DKSAT and/or REFKDT. FRZX and KDT were added so that they may be included in the unit test program; they are not intended to be calibrated.
*** This PR adds SCAMAX to Noah-OWP-Modular because it is a NWM 3.0 calibratable parameter. SCAMAX was added as a member of parametersgrid_type (as a 2D allocatable array) and parameters_type (as a scalar) and associated initialization and 'transfer-in' and 'transfer-out' subroutines. The calculation of FSNO (i.e., snow covered area) was amended to follow WRF-Hydro's calculation as:
The above parameters were not added to the input_items or output_items arrays within the BMI module. Instead, a new param_items array was created to hold these names. I believe this approach follows the examples of topmodel's BMI and cfe's BMI. param_item_count, param_location, and param_grid were also added to support BMI functionality associated with the added parameters. These new variables/arrays are declared as:
! calibratable parameter items
integer, parameter :: param_item_count = 17 ! number of calibratable parameters
character(len=BMI_MAX_VAR_NAME), dimension(param_item_count) :: param_items = [character(len=BMI_MAX_VAR_NAME) :: "CWP","VCMX25","MP","MFSNO","RSURF_SNOW","HVT", & ! name of each calibratable parameter indexed by calibratable parameter number (i.e., 1 through param_item_count)
"BEXP","SMCMAX","FRZX","DKSAT","KDT","RSURF_EXP","REFKDT", &
"AXAJ","BXAJ","XXAJ","SLOPE"]
character (len=BMI_MAX_LOCATION_NAME), dimension(param_item_count) :: param_location = 'node' ! location of each calibratable parameter (e.g., 'node' or 'edge') indexed by calibratable parameter number (default value is 'node')
integer, dimension(param_item_count) :: param_grid = 1 ! GridType%id (0 = scalar, 1 = 2D, 2 = 3D) associated each calibratable parameter indexed by calibratable parameter number (default value is 1)
Changes
The Noah-OWP-Modular unit test program (/test/noahowp_driver_test.f90) was refactored to facilitate testing of the calibratable parameters. The section of the unit test devoted to testing the get_value and set_value BMI functions will now print parameters that are necessarily recalculated when setting another parameter.
Testing
The refactored unit test program was executed and gave these results.
Notes
Below are 'calibratable parameters' that could not be found in Noah-OWP-Modular:
RETDEPRTFAC
RETDEPRTFAC is a WRF-Hydro parameter that is read-in via NetCDF via a call to the READ_ROUTING_seq subroutine in the WRF-Hydro module_HYDRO_io module
WRF-Hydro uses RETDEPRTFAChere to reduce/scale the retention_depth variable
LKSATFAC
LATSATFAC is a WRF-Hydro parameter that is read-in via NetCDF via a call to the READ_ROUTING_seq subroutine in the WRF-Hydro module_HYDRO_io module
WRF-Hydro uses LKSATFAChere to reduce/scale lateral saturated hydraulic conductivity
NEXP
NEXP is described as the 'Power law exponent in Subsurface lateral flow equation' and appears to correspond to NEXP in WRF-Hydro, which is described as the 'latksat decay coefficient'
NEXP is a WRF-Hydro parameter that is read-in via NetCDF via a call to the hdtbl_in_nc subroutine in the the WRF-Hydro module_HYDRO_io module
NEXP is used within the ROUTE_SUBSURFACE1 subroutine to reduce/scale lateral ksat with depth here
ZMAX
ZMAX is listed as a groundwater parameter and is described as the 'Maximum groundwater bucket depth'. ZMAX appears to correspond to the WRF-Hydro parameter z_max, which is described as the 'height of the gw bucket'. I ASSUMED that z_max is the maximum height of the gw bucket because max is in the variable name.
z_max is a WRF-Hydro parameter that is read-into WRF-Hydro via NetCDF via a call to the read_GWBUCKPARM subroutine in the WRF-Hydro module_HYDRO_io module
EXPON is listed as a 'Groundwater parameter' and is described as the 'Exponent controlling rate of bucket drainage as a function of depth'. The EXPON parameter appears to correspond to the WRF-Hydro parameter gw_buck_exp, which is described as the 'GW bucket model exponent'
gw_buck_exp is a WRF-Hydro parameter that is read-into WRF-Hydro via NetCDF via a call to the read_GWBUCKPARM subroutine in the WRF-Hydro module_HYDRO_io module
LOSS is listed as a groundwater parameter and is described as the 'fraction of discharge (outflow) from the bucket that is lost'. LOSS appears to correspond to the WRF-Hydro parameter gw_buck_loss, which is the 'GW bucket model loss fraction'
gw_buck_loss is a WRF-Hydro parameter that is read-into WRF-Hydro via NetCDF via a call to the read_GWBUCKPARM subroutine in the WRF-Hydro module_HYDRO_io module
Purpose
This PR exposes the model's calibratable parameters via its BMI so that they can be calibrated via NextGen.
Additions
Calibratable parameters
The following parameters were added to the model's BMI:
BEXP
SMCMAX
DKSAT
RSURF_EXP
REFKDT
AXAJ
BXAJ
XXAJ
SLOPE
CWP
VCMX25
MP
MFSNO
SCAMAX
***RSURF_SNOW
HVT
FRZX
**KDT
**Listings/functionality for the above parameters were added to the following BMI functions:
noahowp_var_grid
noahowp_var_type
noahowp_var_units
noahowp_var_itemsize
noahowp_var_location
noahowp_get_float
noahowp_set_float
(except forFRZX
andKDT
)**
FRZX
andKDT
were added because they are recalculated/reinitialized when settingSMCMAX
,DKSAT
and/orREFKDT
.FRZX
andKDT
were added so that they may be included in the unit test program; they are not intended to be calibrated.*** This PR adds
SCAMAX
to Noah-OWP-Modular because it is a NWM 3.0 calibratable parameter.SCAMAX
was added as a member ofparametersgrid_type
(as a 2D allocatable array) andparameters_type
(as a scalar) and associated initialization and 'transfer-in' and 'transfer-out' subroutines. The calculation ofFSNO
(i.e., snow covered area) was amended to follow WRF-Hydro's calculation as:water%FSNO = parameters%SCAMAX * TANH( water%SNOWH /(2.5 * parameters%Z0 * FMELT))
param_items
The above parameters were not added to the
input_items
oroutput_items
arrays within the BMI module. Instead, a newparam_items
array was created to hold these names. I believe this approach follows the examples of topmodel's BMI and cfe's BMI.param_item_count
,param_location
, andparam_grid
were also added to support BMI functionality associated with the added parameters. These new variables/arrays are declared as:Changes
The Noah-OWP-Modular unit test program (
/test/noahowp_driver_test.f90
) was refactored to facilitate testing of the calibratable parameters. The section of the unit test devoted to testing theget_value
andset_value
BMI functions will now print parameters that are necessarily recalculated when setting another parameter.Testing
The refactored unit test program was executed and gave these results.
Notes
Below are 'calibratable parameters' that could not be found in Noah-OWP-Modular:
RETDEPRTFAC
RETDEPRTFAC
is a WRF-Hydro parameter that is read-in via NetCDF via a call to theREAD_ROUTING_seq
subroutine in the WRF-Hydromodule_HYDRO_io
moduleRETDEPRTFAC
here to reduce/scale theretention_depth
variableLKSATFAC
LATSATFAC
is a WRF-Hydro parameter that is read-in via NetCDF via a call to theREAD_ROUTING_seq
subroutine in the WRF-Hydromodule_HYDRO_io
moduleLKSATFAC
here to reduce/scale lateral saturated hydraulic conductivityNEXP
NEXP
is described as the 'Power law exponent in Subsurface lateral flow equation' and appears to correspond toNEXP
in WRF-Hydro, which is described as the 'latksat decay coefficient'NEXP
is a WRF-Hydro parameter that is read-in via NetCDF via a call to thehdtbl_in_nc
subroutine in the the WRF-Hydromodule_HYDRO_io
moduleNEXP
is used within the ROUTE_SUBSURFACE1 subroutine to reduce/scale lateral ksat with depth hereZMAX
ZMAX
is listed as a groundwater parameter and is described as the 'Maximum groundwater bucket depth'.ZMAX
appears to correspond to the WRF-Hydro parameterz_max
, which is described as the 'height of the gw bucket'. I ASSUMED thatz_max
is the maximum height of the gw bucket because max is in the variable name.z_max
is a WRF-Hydro parameter that is read-into WRF-Hydro via NetCDF via a call to theread_GWBUCKPARM
subroutine in the WRF-Hydromodule_HYDRO_io
modulez_max
is used in thesimp_gw_buck_nhd
subroutine in themodule_GW_baseflow
moduleEXPON
EXPON
is listed as a 'Groundwater parameter' and is described as the 'Exponent controlling rate of bucket drainage as a function of depth'. The EXPON parameter appears to correspond to the WRF-Hydro parametergw_buck_exp
, which is described as the 'GW bucket model exponent'gw_buck_exp
is a WRF-Hydro parameter that is read-into WRF-Hydro via NetCDF via a call to theread_GWBUCKPARM
subroutine in the WRF-Hydromodule_HYDRO_io
modulegw_buck_exp
is used here within thesimp_gw_buck_nhd
subroutine in themodule_GW_baseflow
moduleLOSS
LOSS
is listed as a groundwater parameter and is described as the 'fraction of discharge (outflow) from the bucket that is lost'.LOSS
appears to correspond to the WRF-Hydro parametergw_buck_loss
, which is the 'GW bucket model loss fraction'gw_buck_loss
is a WRF-Hydro parameter that is read-into WRF-Hydro via NetCDF via a call to theread_GWBUCKPARM
subroutine in the WRF-Hydromodule_HYDRO_io
modulesimp_gw_buck_nhd
subroutine in themodule_GW_baseflow
` module