From 45c0cf2f1fb66b28388354178ac1100fff1080f2 Mon Sep 17 00:00:00 2001 From: Peter La Follette Date: Wed, 29 Apr 2026 20:58:38 -0700 Subject: [PATCH] fixed ponded head mass balance accounting error for when conceptual reservoir is enabled and ponded head is allowed to be greater than 0 --- src/bmi_lgar.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bmi_lgar.cxx b/src/bmi_lgar.cxx index 4613f59..aca5fd2 100644 --- a/src/bmi_lgar.cxx +++ b/src/bmi_lgar.cxx @@ -393,6 +393,7 @@ Update() state->state_previous = listCopy(state->head); double ponded_flux_for_CR = 0.0; + double volon_start_subtimestep_cm = volon_timestep_cm; // allocates some water to conceptual reservoir storage via conditional preferential flow if (state->lgar_bmi_params.runoff_in_prev_step){ @@ -742,7 +743,7 @@ Update() /*----------------------------------------------------------------------*/ // mass balance at the subtimestep (local mass balance) - double local_mb = volstart_subtimestep_cm + precip_subtimestep_cm + volon_timestep_cm - volrunoff_subtimestep_cm - volQ_CR_subtimestep_cm - volCRend_subtimestep_cm + volCRstart_subtimestep_cm + double local_mb = volstart_subtimestep_cm + precip_subtimestep_cm + volon_start_subtimestep_cm - volrunoff_subtimestep_cm - volQ_CR_subtimestep_cm - volCRend_subtimestep_cm + volCRstart_subtimestep_cm - AET_subtimestep_cm - volon_subtimestep_cm - volrech_subtimestep_cm - interflow_subtimestep_cm - volend_subtimestep_cm;