Skip to content

Commit

Permalink
added retention_depth parameters to calibratable params list.
Browse files Browse the repository at this point in the history
  • Loading branch information
ajkhattak committed Jul 12, 2024
1 parent 012ffbb commit 9e165f4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
11 changes: 9 additions & 2 deletions src/bmi_cfe.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@
#define STATE_VAR_NAME_COUNT 94 // must match var_info array size


#define PARAM_VAR_NAME_COUNT 18
#define PARAM_VAR_NAME_COUNT 19
// NOTE: If you update the params, also update the unit test in ../test/main_unit_test_bmi.c
static const char *param_var_names[PARAM_VAR_NAME_COUNT] = {
"maxsmc", "satdk", "slope", "b", "Klf",
"Kn", "Cgw", "expon", "max_gw_storage",
"satpsi","wltsmc","alpha_fc","refkdt",
"a_Xinanjiang_inflection_point_parameter","b_Xinanjiang_shape_parameter","x_Xinanjiang_shape_parameter",
"Kinf_nash_surface",
"retention_depth_nash_surface",
"N_nash_subsurface"
};

Expand All @@ -41,7 +42,7 @@ static const char *param_var_types[PARAM_VAR_NAME_COUNT] = {
"double", "double", "double", "double",
"double", "double", "double", "double",
"double","double","double", "double",
"int"
"double", "int"
};
//----------------------------------------------
// Put variable info into a struct to simplify
Expand Down Expand Up @@ -1931,6 +1932,12 @@ static int Get_value_ptr (Bmi *self, const char *name, void **dest)
return BMI_SUCCESS;
}

if (strcmp(name, "retention_depth_nash_surface") == 0) {
cfe_state_struct *cfe_ptr;
cfe_ptr = (cfe_state_struct *) self->data;
*dest = (void*)&cfe_ptr->nash_surface_params.retention_depth;
return BMI_SUCCESS;
}
/***********************************************************/
/*********** OUTPUT ***********************************/
/***********************************************************/
Expand Down
5 changes: 3 additions & 2 deletions test/main_unit_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,16 +393,17 @@ main(int argc, const char *argv[]){
printf("\nTEST BMI MODEL PARAMETERS\n*************************\n");

//Set number of params -- UPDATE if params changed
#define PARAM_COUNT 18
#define PARAM_COUNT 19

// expected_param_names copied directly from param_var_names[PARAM_VAR_NAME_COUNT] in ../src/bmi_cfe.c
static const char *expected_param_names[PARAM_COUNT] = {
"maxsmc", "satdk", "slope", "b", "Klf",
"Kn", "Cgw", "expon", "max_gw_storage",
"satpsi","wltsmc","alpha_fc","refkdt",
"a_Xinanjiang_inflection_point_parameter","b_Xinanjiang_shape_parameter","x_Xinanjiang_shape_parameter",
"Kinf_nash_surface",
"Kinf_nash_surface", "retention_depth_nash_surface",
"N_nash_subsurface"};

double test_set_value = 4.2;
double test_get_value = 0.0;
int test_set_value_int = 5;
Expand Down

0 comments on commit 9e165f4

Please sign in to comment.