From 2f2e1cdf8c9d791298449af3fb5b889d67db878d Mon Sep 17 00:00:00 2001 From: Chris Nicol Date: Wed, 11 Aug 2021 14:36:59 +1000 Subject: [PATCH] fix(modflow/mfriv) unstructured mfusg RIV package load check fix flopy fails on checking mfusg unstructured RIV packages * add unstructured clause / disu reference to modflow/mfriv * modify autotest/t016.py test_usg_rch_evt_models01 to include a riv file and check() call --- autotest/t016_test.py | 1 + examples/data/mfusg_test/rch_evt_tests/usg_rch_evt.nam | 1 + examples/data/mfusg_test/rch_evt_tests/usg_rch_evt.riv | 3 +++ flopy/modflow/mfriv.py | 5 ++++- 4 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 examples/data/mfusg_test/rch_evt_tests/usg_rch_evt.riv diff --git a/autotest/t016_test.py b/autotest/t016_test.py index 31a7850ba6..a0d90966a1 100644 --- a/autotest/t016_test.py +++ b/autotest/t016_test.py @@ -210,6 +210,7 @@ def test_usg_rch_evt_models01(): m = flopy.modflow.Modflow.load( nam, model_ws=model_ws, version="mfusg", exe_name=v ) + m.riv.check() m.model_ws = tpth m.write_input() if run: diff --git a/examples/data/mfusg_test/rch_evt_tests/usg_rch_evt.nam b/examples/data/mfusg_test/rch_evt_tests/usg_rch_evt.nam index d9234b5479..ea7a5f501a 100644 --- a/examples/data/mfusg_test/rch_evt_tests/usg_rch_evt.nam +++ b/examples/data/mfusg_test/rch_evt_tests/usg_rch_evt.nam @@ -5,6 +5,7 @@ DISU 29 usg_rch_evt.disu OC 22 usg_rch_evt.oc RCH 18 usg_rch_evt.rch evt 17 usg_rch_evt.evt +riv 16 usg_rch_evt.riv CHD 199 usg_rch_evt.chd LPF 11 usg_rch_evt.lpf DATA(BINARY) 50 usg_rch_evt.cbb diff --git a/examples/data/mfusg_test/rch_evt_tests/usg_rch_evt.riv b/examples/data/mfusg_test/rch_evt_tests/usg_rch_evt.riv new file mode 100644 index 0000000000..00a76d4186 --- /dev/null +++ b/examples/data/mfusg_test/rch_evt_tests/usg_rch_evt.riv @@ -0,0 +1,3 @@ + 1 + 1 Stress Period 1 + 5 3.000000 10.0 2.500000 diff --git a/flopy/modflow/mfriv.py b/flopy/modflow/mfriv.py index 263d121bd9..36f38816e5 100644 --- a/flopy/modflow/mfriv.py +++ b/flopy/modflow/mfriv.py @@ -238,7 +238,10 @@ def check(self, f=None, verbose=True, level=1, checktype=None): # check that river stage and bottom are above model cell # bottoms also checks for nan values - botms = self.parent.dis.botm.array[inds] + if self.parent.structured: + botms = self.parent.dis.botm.array[inds] + else: + botms = self.parent.disu.bot.array[inds] for elev in ["stage", "rbot"]: txt = "{} below cell bottom".format(elev)