Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion include/bmi_lgar.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public:
this->output_var_names[13] = "groundwater_to_stream_recharge";
this->output_var_names[14] = "mass_balance";
this->output_var_names[15] = NWM_PONDED_DEPTH_OUT_VAR;
this->output_var_names[16] = "precipitation_rate_out";

/*
this->output_var_names[13] = "cum_precipitation";
Expand Down Expand Up @@ -145,7 +146,7 @@ private:
void realloc_soil();
struct model_state* state;
static const int input_var_name_count = 3;
static const int output_var_name_count = 16;
static const int output_var_name_count = 17;
static const int calib_var_name_count = 7;

std::string input_var_names[input_var_name_count];
Expand Down
1 change: 1 addition & 0 deletions realizations/realization_config_lasam.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"main_output_variable": "total_discharge",
"output_variables" : [
"precipitation",
"precipitation_rate_out",
"potential_evapotranspiration",
"actual_evapotranspiration",
"surface_runoff",
Expand Down
1 change: 1 addition & 0 deletions realizations/realization_config_lasam_sft.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"main_output_variable": "total_discharge",
"output_variables" : [
"precipitation",
"precipitation_rate_out",
"potential_evapotranspiration",
"actual_evapotranspiration",
"surface_runoff",
Expand Down
1 change: 1 addition & 0 deletions realizations/realization_config_lasam_smp.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"main_output_variable": "total_discharge",
"output_variables" : [
"precipitation",
"precipitation_rate_out",
"potential_evapotranspiration",
"actual_evapotranspiration",
"surface_runoff",
Expand Down
14 changes: 10 additions & 4 deletions src/bmi_lgar.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,7 @@ GetVarGrid(std::string name)
return 0;
else if (
name.compare("precipitation_rate") == 0
|| name.compare("precipitation_rate_out") == 0
|| name.compare("precipitation") == 0
Comment thread
zhengtaocui marked this conversation as resolved.
|| name.compare("potential_evapotranspiration_rate") == 0
|| name.compare("potential_evapotranspiration") == 0
Expand Down Expand Up @@ -847,7 +848,8 @@ GetVarItemsize(std::string name)
std::string BmiLGAR::
GetVarUnits(std::string name)
{
if (name.compare("precipitation_rate") == 0 || name.compare("potential_evapotranspiration_rate") == 0)
if (name.compare("precipitation_rate") == 0 || name.compare("precipitation_rate_out") == 0
|| name.compare("potential_evapotranspiration_rate") == 0)
return "mm h^-1";
else if (name.compare("precipitation") == 0 || name.compare("potential_evapotranspiration") == 0
|| name.compare("actual_evapotranspiration") == 0) // double
Expand Down Expand Up @@ -887,9 +889,11 @@ GetVarNbytes(std::string name)
std::string BmiLGAR::
GetVarLocation(std::string name)
{
if (name.compare("precipitation_rate") == 0 || name.compare("precipitation") == 0 ||
name.compare("potential_evapotranspiration") == 0 || name.compare("potential_evapotranspiration_rate") == 0
|| name.compare("actual_evapotranspiration") == 0) // double
if (name.compare("precipitation_rate") == 0 || name.compare("precipitation_rate_out") == 0 ||
name.compare("precipitation") == 0 ||
name.compare("potential_evapotranspiration") == 0 ||
name.compare("potential_evapotranspiration_rate") == 0 ||
name.compare("actual_evapotranspiration") == 0)
return "node";
else if (name.compare("surface_runoff") == 0 || name.compare("giuh_runoff") == 0
|| name.compare("soil_storage") == 0 || name.compare(NWM_PONDED_DEPTH_OUT_VAR)) // double
Expand Down Expand Up @@ -985,6 +989,8 @@ GetValuePtr (std::string name)
{
if (name.compare("precipitation_rate") == 0)
return (void*)(&this->state->lgar_bmi_input_params->precipitation_mm_per_h);
else if (name.compare("precipitation_rate_out") == 0)
return (void*)(&this->state->lgar_bmi_input_params->precipitation_mm_per_h);
else if (name.compare("precipitation") == 0)
return (void*)(&bmi_unit_conv.volprecip_timestep_m);
else if (name.compare("potential_evapotranspiration_rate") == 0)
Expand Down
4 changes: 2 additions & 2 deletions src/bmi_main_lgar.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ int main(int argc, char *argv[])
std::string var_name_wf = "soil_moisture_wetting_fronts";
std::string var_name_thickness_wf = "soil_depth_wetting_fronts";

int num_output_var = 11;
int num_output_var = 12;
std::vector<std::string> output_var_names(num_output_var);
std::vector<double> output_var_data(num_output_var);

Expand All @@ -72,7 +72,7 @@ int main(int argc, char *argv[])
output_var_names[8] = "percolation";
output_var_names[9] = "groundwater_to_stream_recharge";
output_var_names[10] = "mass_balance";

output_var_names[11] = "precipitation_rate_out";

// total number of timesteps

Expand Down
6 changes: 3 additions & 3 deletions tests/main_unit_test_bmi.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ int main(int argc, char *argv[])
int num_wetting_fronts = 3; // total number of wetting fronts
bool test_status = true; // unit test status flag, if test fail the flag turns false
int num_input_vars = 3; // total number of bmi input variables
int num_output_vars = 15; // total number of bmi output variables
int num_output_vars = 16; // total number of bmi output variables

// *************************************************************************************
// names of the bmi input/output variables and the corresponding sizes, with units of input variables
Expand All @@ -59,13 +59,13 @@ int main(int argc, char *argv[])
"actual_evapotranspiration", "surface_runoff",
"giuh_runoff", "soil_storage", "total_discharge",
"infiltration", "percolation", "groundwater_to_stream_recharge",
"mass_balance"};
"mass_balance", "precipitation_rate_out"};

int nbytes_input[] = {sizeof(double), sizeof(double), sizeof(double)};
int nbytes_output[] = {int(num_wetting_fronts * sizeof(double)), int(num_layers * sizeof(double)),
int(num_wetting_fronts * sizeof(double)), sizeof(int), sizeof(double),
sizeof(double), sizeof(double), sizeof(double), sizeof(double), sizeof(double),
sizeof(double), sizeof(double), sizeof(double), sizeof(double), sizeof(double)};
sizeof(double), sizeof(double), sizeof(double), sizeof(double), sizeof(double), sizeof(double)};

std::vector<std::string> bmi_units = {"mm h^-1", "mm h^-1", "K"};
// *************************************************************************************
Expand Down
Loading