Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: update last_state1 after updating state2 #220

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
14 changes: 9 additions & 5 deletions smoderp2d/runoff.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,11 +410,6 @@ def run(self):
2,
self.surface.arr.state
)
self.surface.arr.h_last_state1 = ma.where(
state_1_cond,
self.surface.arr.h_total_pre,
self.surface.arr.h_last_state1
)
# update state == 2
self.surface.arr.state = ma.where(
ma.logical_and(
Expand All @@ -424,6 +419,15 @@ def run(self):
1,
self.surface.arr.state
)
state_1_cond = ma.logical_and(
self.surface.arr.state == 1,
self.surface.arr.h_total_new < self.surface.arr.h_total_pre,
)
self.surface.arr.h_last_state1 = ma.where(
state_1_cond,
self.surface.arr.h_total_pre,
self.surface.arr.h_last_state1
)

self.surface.arr.h_total_pre = ma.copy(self.surface.arr.h_total_new)

Expand Down
Loading