Skip to content

Commit

Permalink
comment bmi Q initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
hellkite500 committed Sep 20, 2023
1 parent fc066cb commit 2ffd6e4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/bmi_topmodel.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,12 +284,15 @@ int init_config(const char* config_file, topmodel_model* model)
d_alloc(&model->rain,model->nstep);
d_alloc(&model->pe,model->nstep);
d_alloc(&model->Qobs,model->nstep); //TODO: Consider removing this all together when framework
//FIXME this is no longer useful, as the follow `init` will ultimatey
//reallocate Q to based on the number of computed histogram ordinates
d_alloc(&model->Q,model->nstep);
d_alloc(&model->contrib_area,model->nstep);

(model->rain)[1]=0.0;
(model->pe)[1]=0.0;
(model->Qobs)[1]=0.0;
//FIXME not really useful, as `init` will reallocate and properly initialize
(model->Q)[1]=0.0;
(model->contrib_area)[1]=0.0;
}
Expand Down
7 changes: 7 additions & 0 deletions test/main_unit_test_bmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,13 @@ main(void){
}
}
}
for (i=0; i<count_out; i++){
free(names_out[i]);
}
free(names_out);
for (i=0; i<count_in; i++){
free(names_in[i]);
}
free(names_in);

// JG Note: added 03.22.2022 to test added params get set values.
Expand Down Expand Up @@ -410,6 +416,7 @@ main(void){
printf("\n finalizing...\n");
status = model->finalize(model);
if (status == BMI_FAILURE) return BMI_FAILURE;
free(model);
printf("\n******************\nEND BMI UNIT TEST\n\n");
}
return 0;
Expand Down

0 comments on commit 2ffd6e4

Please sign in to comment.