Skip to content

Commit

Permalink
fix(pakbase): specify dtype=bool for 0-d active array used for USG (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
mwtoews authored Aug 16, 2021
1 parent 0288f96 commit 74289dc
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
25 changes: 25 additions & 0 deletions autotest/t016_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,30 @@ def test_usg_rch_evt_models02a():
success, buff = m.run_model()
assert success

def test_usg_ss_to_tr():
# Test switching steady model to transient
# https://github.com/modflowpy/flopy/issues/1187
model_ws = os.path.join(
"..", "examples", "data", "mfusg_test", "01A_nestedgrid_nognc"
)
nam = "flow.nam"
m = flopy.modflow.Modflow.load(
nam, model_ws=model_ws, version="mfusg", exe_name=v
)
m.model_ws = tpth
m.disu.steady = [False]
m.write_input()
if run:
success, buff = m.run_model()
assert success

m = flopy.modflow.Modflow.load(
nam, model_ws=tpth, version="mfusg", exe_name=v
)
if run:
success, buff = m.run_model()
assert success


if __name__ == "__main__":
test_usg_disu_load()
Expand All @@ -266,3 +290,4 @@ def test_usg_rch_evt_models02a():
test_usg_rch_evt_models01()
test_usg_rch_evt_models02()
test_usg_rch_evt_models02a()
test_usg_ss_to_tr()
2 changes: 1 addition & 1 deletion flopy/pakbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ def _check_storage(self, chk, storage_coeff):
[sarrays["sy"][sl] for sl in node_k_slices]
).flatten()
active = np.asarray(
[active[sl] for sl in node_k_slices]
[active[sl] for sl in node_k_slices], dtype=bool
).flatten()
else:
sarrays["sy"] = sarrays["sy"][inds, :, :]
Expand Down

0 comments on commit 74289dc

Please # to comment.