Skip to content

Commit

Permalink
removed N_nash_subsurface bmi var, we don't calibrated it, updated re…
Browse files Browse the repository at this point in the history
…adme
  • Loading branch information
ajkhattak committed Sep 5, 2024
1 parent 2b1372e commit 0dc07d2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 32 deletions.
14 changes: 7 additions & 7 deletions configs/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Configuration File
Example configuration files are provided in this directory. To build and run the given examples see the instructions [here](https://github.com/NOAA-OWP/cfe/blob/master/INSTALL.md). A detailed description of the parameters for model configuration (i.e., initialize/setup) is provided below. The asterisk (*) denotes calibratable parameters.
Example configuration files are provided in this directory. To build and run the given examples see the instructions [here](https://github.com/NOAA-OWP/cfe/blob/master/INSTALL.md). A detailed description of the parameters for model configuration (i.e., initialize/setup) is provided below. The asterisk (*) denotes calibratable parameters. The has (#) shows the parameters only used with the Nash Cascade-based runoff.

| Variable | Datatype | Limits | Units | Role | Process | Description |
| -------- | -------- | ------ | ----- | ---- | ------- | ----------- |
Expand Down Expand Up @@ -28,12 +28,12 @@ Example configuration files are provided in this directory. To build and run the
| verbosity | *int* | `0`-`3` | | optional | | prints various debug and bmi info (defaults to 0) |
| surface_water_partitioning_scheme | *char* | `Xinanjiang` or `Schaake` | | parameter_adjustable | infiltraton excess | |
| surface_runoff_scheme | *char* | GIUH or NASH_CASCADE | | parameter_adjustable | surface runoff | also supports 1 for GIUH and 2 for NASH_CASCADE; default is GIUH |
| N_nash_surface | *int* | | | parameter_adjustable | surface runoff | number of Nash reservoirs for surface runoff |
| K_nash_surface | *double* | | 1/hour [h^-1] | parameter_adjustable | surface runoff | Nash Config param for surface runoff |
| nash_storage_surface | 1D array (*double*) | | meters [m] | parameter_adjustable | surface runoff | Nash Config param; reservoir surface storage; default is zero storage |
| nsubsteps_nash_surface | *int* | | | parameter_adjustable | surface runoff | optional (default = 10); number of subtimstep for Nash runoff |
| Kinf_nash_surface | *double* | | 1/hour [h^-1] | parameter_adjustable | surface runoff | optional (default = 0.05); storage fraction per hour that moves from reservoirs to soil |
| retention_depth_nash_surface | *double* | | m | parameter_adjustable | surface runoff | optional (default = 0.001); water retention depth threshold (only applied to the first reservoir) |
| #N_nash_surface | *int* | | | parameter_adjustable | surface runoff | number of Nash reservoirs for surface runoff |
| #K_nash_surface | *double* | | 1/hour [h^-1] | parameter_adjustable | surface runoff | Nash Config param for surface runoff |
| #nash_storage_surface | 1D array (*double*) | | meters [m] | parameter_adjustable | surface runoff | Nash Config param; reservoir surface storage; default is zero storage |
| #nsubsteps_nash_surface | *int* | | | parameter_adjustable | surface runoff | optional (default = 10); number of subtimstep for Nash runoff |
| #*Kinf_nash_surface | *double* | | 1/hour [h^-1] | parameter_adjustable | surface runoff | optional (default = 0.05); storage fraction per hour that moves from reservoirs to soil |
| #*retention_depth_nash_surface | *double* | | m | parameter_adjustable | surface runoff | optional (default = 0.001); water retention depth threshold (only applied to the first reservoir) |
| *a_Xinanjiang_inflection_point_parameter | *double* | | | parameter_adjustable | infiltration excess runoff | when `surface_water_partitioning_scheme=Xinanjiang` |
| *b_Xinanjiang_shape_parameter=1 | *double* | | | parameter_adjustable | infiltration excess runoff | when `surface_water_partitioning_scheme=Xinanjiang` |
| *x_Xinanjiang_shape_parameter=1 | *double* | | | parameter_adjustable | infiltration excess runoff | when `surface_water_partitioning_scheme=Xinanjiang` |
Expand Down
28 changes: 3 additions & 25 deletions src/bmi_cfe.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,23 @@
#define STATE_VAR_NAME_COUNT 94 // must match var_info array size


#define PARAM_VAR_NAME_COUNT 19
#define PARAM_VAR_NAME_COUNT 18
// 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"
"retention_depth_nash_surface"
};

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

if (strcmp (name, "N_nash_subsurface") == 0) {
cfe_state_struct *cfe_ptr;
cfe_ptr = (cfe_state_struct *) self->data;
*dest = (void*)&cfe_ptr->N_nash_subsurface;
return BMI_SUCCESS;
}

if (strcmp (name, "Kinf_nash_surface") == 0) {
cfe_state_struct *cfe_ptr;
cfe_ptr = (cfe_state_struct *) self->data;
Expand Down Expand Up @@ -2199,20 +2191,6 @@ static int Set_value (Bmi *self, const char *name, void *src)

}

if (strcmp (name, "N_nash_subsurface") == 0) {
cfe_state_struct* cfe_ptr = (cfe_state_struct *) self->data;

if( cfe_ptr->nash_storage_subsurface != NULL )
free(cfe_ptr->nash_storage_subsurface);
cfe_ptr->nash_storage_subsurface = malloc(sizeof(double) * cfe_ptr->N_nash_subsurface);

if( cfe_ptr->nash_storage_subsurface == NULL )
return BMI_FAILURE;

for (j = 0; j < cfe_ptr->N_nash_subsurface; j++)
cfe_ptr->nash_storage_subsurface[j] = 0.0;
}

if (strcmp (name, "storage_max_m") == 0) {
cfe_state_struct* cfe_ptr = (cfe_state_struct *) self->data;
cfe_ptr->gw_reservoir.storage_m = cfe_ptr->gw_reservoir.gw_storage * cfe_ptr->gw_reservoir.storage_max_m;
Expand Down

0 comments on commit 0dc07d2

Please sign in to comment.