@rdstern @MeSophie After a meeting with CIMH today, an issue was identified in the Water Balance code. This issue occurs when:
Evaporation variable is provided as a variable, and;
The process of "reducing" was not performed.
The issue is in the calculations for both wb_min and wb_max. The specific part of the code that needs correction is where these calculations are defined.
Originally, for wb_max, the code was set up to use purrr::accumulate2. We currently run this:
We want to simplify this by switching from purrr::accumulate2 to purrr::accumulate. This combines the evapotranspiration and rain_max variables before applying the accumulation, thereby removing the need for a separate .y parameter. The corrected version for wb_max looks like this:
@rdstern @MeSophie After a meeting with CIMH today, an issue was identified in the Water Balance code. This issue occurs when:
The issue is in the calculations for both
wb_min
andwb_max
. The specific part of the code that needs correction is where these calculations are defined.Originally, for
wb_max
, the code was set up to usepurrr::accumulate2
. We currently run this:We want to simplify this by switching from
purrr::accumulate2
topurrr::accumulate
. This combines theevapotranspiration
andrain_max
variables before applying the accumulation, thereby removing the need for a separate.y
parameter. The corrected version forwb_max
looks like this:The corrections involve two changes:
purrr::accumulate2
topurrr::accumulate
.y
parameter We no longer need the.y
parameter since this is only needed inaccumulate2
.Note this is just for when we have an evaporation variable given, but the reducing checkbox is not checked.
These changes should be applied to both the
wb_max
andwb_min
calculations.