Closed
Description
The snow precipitation was not calculated correctly in the code. There are a couple of issues that are solved in this branch
In principle, at any timestep, if surface temperature is <= zero, then precipitation is snow (not liquid) and should not be used in this time step. Rather, this snow_precipitation should be accumulated and go to next time step. At any of the further time steps, once surface temperature becomes > 0, then the accumulated snow precipitation is added to the liquid precipitation of this particular time step to define the total available precipitation. Then also proper runoff and infiltration will be calculated
The following corrections are implemented
- The accumulated snow precipitation was set to zero every timestep (see here), so the accumulation is wrong. Instead, the accumulated snow precipitation:
a) has a more representative namePrecip_snowAccum
b) is initialized with zero value at the first time step (Lines 48-52)
c) goes back to zero again once the surface temperature becomes > 0 (Line 70). - Proper accumulation based on the surface temperature value is done:
a) As long as surface temperature is < 0 -> then precipitation will be accumulated in snow precipitation (Lines 54-62).
b) Once surface temperature is > 0 -> accumulated snow precipitation is added to liquid precipitation (lines 63-71). - Because these modifications are done in the
+soilmoisture/calculateBoundaryConditions.m
, which runs through the STEMMUS iteration loop within every time step (loop start here, and the calculations are part of the loop here), these snow_precipitation calculations has to be done only once per time step (and not per every iteration within the time step), so an if condition is added for that purpose (Line 58 and Line 64). - This
Precip
variable refers actually to the applied infiltration (after removing runoff) so, it got a more representative nameapplied_inf
(here) and added to theForcingData
structure (also for BMI purposes)