Closed snorfalorpagus closed 7 years ago
Well it causes a bin of divide by zero errors. I assume Cq == 0
is equivalent to no non-linear storage component. Probably better to have Cq == None
and not use the non-linear component?
The Excel models states "Typically 0 to 5000" next to the input. A value of 0 effectively means there is not output from the nonlinear storage, i.e. the subcatchment has a linear component only.
Hence keep 0 as an invalid input NonLinearStore
, but if None
is given then don't make one for that subcatchment?
I'm happy to convert the value to None and skip the nonlinear storage if a zero value is given.
I've identified another bug, whereby when the nonlinear storage is None then the averaging between yesterday's flow and today's flow isn't done. I think this needs to be done as part of the SubCatchment object, not the NonLinearStorage. This creates a small problem, as the nonlinear storage needs access to the previous flow.
I think it best if both storage objects keep a previous flow (which they do now), but also have an property to produce the daily average if required. Then you would have the following pseudo code in SubCatchment,
if non_linear_store:
Q = non_linear_store.daily_average_flow
else:
Q = linear_store.daily_average_flow
This was resolved in d7a831ba5362209876ed3e171294a1fab3ff97a7.
Just come across this error. I think that 0 is a valid value of
Cq
?