Skip to content

Commit

Permalink
bug fix, updated unittest and cfe build instruction.
Browse files Browse the repository at this point in the history
  • Loading branch information
ajkhattak committed May 22, 2024
1 parent 8872e17 commit 09823b3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ See general instructions [here](https://github.com/NOAA-OWP/ngen/wiki/NGen-Tutor
- cmake -B cmake_build -S . -DBMI_C_LIB_ACTIVE=ON -DBMI_FORTRAN_ACTIVE=ON -DNGEN_ACTIVATE_PYTHON=ON
- make -j4 -C cmake_build
- #### CFE
- git submodule update --remote extern/cfe/cfe
- cmake -B extern/cfe/cmake_build -S extern/cfe/cfe/ -DNGEN=ON
- make -C extern/cfe/cmake_build
- git submodule update --remote extern/cfe/cfe
- cmake -B extern/cfe/cfe/cmake_build -S extern/cfe/cfe/ -DNGEN=ON
- make -C extern/cfe/cfe/cmake_build
- #### SLoTH
SLoTH is also needed to run SFT in the ngen framework. SLoTH is a BMI that is used to set a bmi variable(s) that is not provided by other BMIs but required by the model. So build [SLoTH](https://github.com/NOAA-OWP/SLoTH) using the following instructions
- cd extern/sloth/ && git checkout latest
Expand Down
2 changes: 1 addition & 1 deletion src/bmi_cfe.c
Original file line number Diff line number Diff line change
Expand Up @@ -1912,7 +1912,7 @@ static int Get_value_ptr (Bmi *self, const char *name, void **dest)
return BMI_SUCCESS;
}

if (strcmp (name, "K_infiltraton") == 0) {
if (strcmp (name, "K_infiltration") == 0) {
cfe_state_struct *cfe_ptr;
cfe_ptr = (cfe_state_struct *) self->data;
*dest = (void*)&cfe_ptr->nash_surface_params.K_infiltration;
Expand Down
3 changes: 2 additions & 1 deletion test/main_unit_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,14 +393,15 @@ main(int argc, const char *argv[]){
printf("\nTEST BMI MODEL PARAMETERS\n*************************\n");

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

// 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",
"K_infiltration",
"N_nash"};
double test_set_value = 4.2;
double test_get_value = 0.0;
Expand Down

0 comments on commit 09823b3

Please sign in to comment.