Skip to content

Commit

Permalink
set MAX_NUM_SOIL_TYPE as both the upper limit the default value for n…
Browse files Browse the repository at this point in the history
…um_soil_types.
  • Loading branch information
ajkhattak authored and hellkite500 committed Sep 12, 2024
1 parent 2eddeea commit 46aa623
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion configs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ A detailed description of the parameters for model configuration (i.e., initiali
| forcing_resolution | double (scalar)| - | sec/min/hr | temporal resolution | - | timestep of the forcing data. Recommended value of 3600 seconds. |
| endtime | double (scalar)| >0 | sec, min, hr, d | simulation duration | - | time at which model simulation ends |
| layer_soil_type | int (1D array) | - | - | state variable | - | layer soil type (read from the database file soil_params_file) |
| max_valid_soil_types | int | >1 | - | - | - | maximum number of valid soil types read from the file soil_params_file (default is set to 12; model not valid for soil_type = waterbody, lava, glacier, etc.) |
| max_valid_soil_types | int | >1 | - | - | - | maximum number of valid soil types read from the file soil_params_file (default is set to 15; model not valid for soil_type = waterbody, lava, glacier, etc.) |
| wilting_point_psi | double (scalar) | - | cm | state variable | - | wilting point (the amount of water not available for plants) used in computing AET. Suggested value is 15495.0 cm, corresponding to 15 atm. |
| field_capacity_psi | double (scalar) | - | cm | state variable | - | capillary head corresponding to volumetric water content at which gravity drainage becomes slower, used in computing AET. Suggested value is 340.9 cm for most soils, corresponding to 1/3 atm, and 103.3 cm for sands, corresponding to 1/10 atm. |
| use_closed_form_G | bool | true or false | - | - | - | determines whether the numeric integral or closed form for G is used; a value of true will use the closed form. This defaults to false. |
Expand Down
4 changes: 2 additions & 2 deletions src/lgar.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ extern void InitFromConfigFile(string config_file, struct model_state *state)
continue;
}
else if (param_key == "max_valid_soil_types") {
state->lgar_bmi_params.num_soil_types = stoi(param_value);
state->lgar_bmi_params.num_soil_types = std::min(stoi(param_value), MAX_NUM_SOIL_TYPES);
is_max_valid_soil_types_set = true;
continue;
}
Expand Down Expand Up @@ -537,7 +537,7 @@ extern void InitFromConfigFile(string config_file, struct model_state *state)
}

if(!is_max_valid_soil_types_set)
state->lgar_bmi_params.num_soil_types = 12; // maximum number of soil types defaults to 12
state->lgar_bmi_params.num_soil_types = MAX_NUM_SOIL_TYPES; // maximum number of valid soil types defaults to 15

if (verbosity.compare("high") == 0) {
std::cerr<<"Maximum number of soil types: "<<state->lgar_bmi_params.num_soil_types<<"\n";
Expand Down

0 comments on commit 46aa623

Please sign in to comment.