-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for short and long soil_params
names in config
#100
base: master
Are you sure you want to change the base?
Changes from all commits
eb4ecb7
0421789
74b2124
77b6c8e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
forcing_file=BMI | ||
soil_params.depth=2.0[m] | ||
b=4.05[] | ||
satdk=0.00000338[m s-1] | ||
satpsi=0.355[m] | ||
slope=1.0[m/m] | ||
maxsmc=0.439[m/m] | ||
wltsmc=0.066[m/m] | ||
soil_params.expon=1.0[] | ||
soil_params.expon_secondary=1.0[] | ||
max_gw_storage=0.25[m] | ||
Cgw=1.8e-05[m h-1] | ||
expon=6.0[] | ||
gw_storage=0.125[m/m] | ||
alpha_fc=0.33[] | ||
soil_storage=0.585626[m/m] | ||
K_nash=0.03[] | ||
K_lf=0.01[] | ||
nash_storage=0.0,0.0 | ||
giuh_ordinates=0.06,0.51,0.28,0.12,0.03 | ||
num_timesteps=1 | ||
verbosity=2 | ||
surface_partitioning_scheme=Schaake |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -545,12 +545,12 @@ int read_init_config_cfe(const char* config_file, cfe_state_struct* model) | |
} | ||
continue; | ||
} | ||
if (strcmp(param_key, "soil_params.bb") == 0 || strcmp(param_key, "soil_params.b") == 0) { | ||
if (strcmp(param_key, "b") == 0 || strcmp(param_key, "soil_params.bb") == 0 || strcmp(param_key, "soil_params.b") == 0) { | ||
model->NWM_soil_params.bb = strtod(param_value, NULL); | ||
is_soil_params__bb_set = TRUE; | ||
continue; | ||
} | ||
if (strcmp(param_key, "soil_params.satdk") == 0) { | ||
if (strcmp(param_key, "satdk") == 0 || strcmp(param_key, "soil_params.satdk") == 0) { | ||
model->NWM_soil_params.satdk = strtod(param_value, NULL); | ||
is_soil_params__satdk_set = TRUE; | ||
// Check if units are present and print warning if missing from config file | ||
|
@@ -561,7 +561,7 @@ int read_init_config_cfe(const char* config_file, cfe_state_struct* model) | |
} | ||
continue; | ||
} | ||
if (strcmp(param_key, "soil_params.satpsi") == 0) { | ||
if (strcmp(param_key, "satpsi") == 0 || strcmp(param_key, "soil_params.satpsi") == 0) { | ||
model->NWM_soil_params.satpsi = strtod(param_value, NULL); | ||
is_soil_params__satpsi_set = TRUE; | ||
// Check if units are present and print warning if missing from config file | ||
|
@@ -572,7 +572,7 @@ int read_init_config_cfe(const char* config_file, cfe_state_struct* model) | |
} | ||
continue; | ||
} | ||
if (strcmp(param_key, "soil_params.slope") == 0 || strcmp(param_key, "soil_params.slop") == 0) { | ||
if (strcmp(param_key, "slope") == 0 || strcmp(param_key, "soil_params.slope") == 0 || strcmp(param_key, "soil_params.slop") == 0) { | ||
model->NWM_soil_params.slop = strtod(param_value, NULL); | ||
is_soil_params__slop_set = TRUE; | ||
// Check if units are present and print warning if missing from config file | ||
|
@@ -583,7 +583,7 @@ int read_init_config_cfe(const char* config_file, cfe_state_struct* model) | |
} | ||
continue; | ||
} | ||
if (strcmp(param_key, "soil_params.smcmax") == 0 || strcmp(param_key, "soil_params.maxsmc") == 0) { | ||
if (strcmp(param_key, "maxsmc") == 0 || strcmp(param_key, "soil_params.smcmax") == 0 || strcmp(param_key, "soil_params.maxsmc") == 0) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we have There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I only added |
||
model->NWM_soil_params.smcmax = strtod(param_value, NULL); | ||
is_soil_params__smcmax_set = TRUE; | ||
// Check if units are present and print warning if missing from config file | ||
|
@@ -594,7 +594,7 @@ int read_init_config_cfe(const char* config_file, cfe_state_struct* model) | |
} | ||
continue; | ||
} | ||
if (strcmp(param_key, "soil_params.wltsmc") == 0) { | ||
if (strcmp(param_key, "wltsmc") == 0 || strcmp(param_key, "soil_params.wltsmc") == 0) { | ||
model->NWM_soil_params.wltsmc = strtod(param_value, NULL); | ||
is_soil_params__wltsmc_set = TRUE; | ||
// Check if units are present and print warning if missing from config file | ||
|
@@ -671,7 +671,7 @@ int read_init_config_cfe(const char* config_file, cfe_state_struct* model) | |
continue; | ||
} | ||
|
||
if (strcmp(param_key, "soil_params.alpha_fc") == 0 || strcmp(param_key, "alpha_fc") == 0) { | ||
if (strcmp(param_key, "alpha_fc") == 0 || strcmp(param_key, "soil_params.alpha_fc") == 0) { | ||
model->NWM_soil_params.alpha_fc = strtod(param_value, NULL); | ||
is_alpha_fc_set = TRUE; | ||
continue; | ||
|
@@ -701,7 +701,7 @@ int read_init_config_cfe(const char* config_file, cfe_state_struct* model) | |
is_K_nash_set = TRUE; | ||
continue; | ||
} | ||
if (strcmp(param_key, "K_lf") == 0) { | ||
if (strcmp(param_key, "Klf") == 0 || strcmp(param_key, "K_lf") == 0) { | ||
model->K_lf = strtod(param_value, NULL); | ||
is_K_lf_set = TRUE; | ||
continue; | ||
|
@@ -905,7 +905,7 @@ int read_init_config_cfe(const char* config_file, cfe_state_struct* model) | |
} | ||
if (is_K_lf_set == FALSE) { | ||
#if CFE_DEBUG >= 1 | ||
printf("Config param 'K_lf' not found in config file\n"); | ||
printf("Config param 'K_lf' or 'Klf' not found in config file\n"); | ||
#endif | ||
return BMI_FAILURE; | ||
} | ||
|
@@ -2004,7 +2004,7 @@ static int Set_value_at_indices (Bmi *self, const char *name, int * inds, int le | |
return BMI_FAILURE; | ||
memcpy(ptr, src, var_item_size * len); | ||
|
||
if (strcmp (name, "maxsmc") == 0 || strcmp (name, "alpha_fc") == 0 || strcmp (name, "wltsmc") == 0 || strcmp (name, "maxsmc") == 0 || strcmp (name, "b") == 0 || strcmp (name, "slope") == 0 || strcmp (name, "satpsi") == 0 || strcmp (name, "Klf") == 0 || strcmp (name, "satdk") == 0){ | ||
if (strcmp (name, "maxsmc") == 0 || strcmp (name, "alpha_fc") == 0 || strcmp (name, "wltsmc") == 0 || strcmp (name, "b") == 0 || strcmp (name, "slope") == 0 || strcmp (name, "satpsi") == 0 || strcmp (name, "Klf") == 0 || strcmp (name, "satdk") == 0){ | ||
|
||
cfe_state_struct* cfe_ptr = (cfe_state_struct *) self->data; | ||
init_soil_reservoir(cfe_ptr); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for consistency, we should follow the same style for
soil_params.depth
as wellThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In an ideal world, I would have added short forms of all of the
soil_params
, but I couldn't forsoil_params.expon
becauseexpon
already exists... so, I only added short forms for calibratable parameters. @ajkhattak, thoughts on how to get around this?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay, I see what you mean... Let's discuss it with other folks. I would suggest something like
soil_param_name (e.g.,
soil_storage
)gw_param_name (e.g.,
gw_storage
)since the parameter
expon
is used in both soil and groundwater reservoirs, so following the above, we usesoil_expon
andgw_expon
.we can update the names for calibratable parameters too, so they are consistent with their names in the config file.
@SnowHydrology @hellkite500