Skip to content

Commit 08dfff9

Browse files
authored
fix(lakpak_utils): fix telev and belev for horizontal connections (#1168)
1 parent 73a4405 commit 08dfff9

File tree

2 files changed

+18
-14
lines changed

2 files changed

+18
-14
lines changed

autotest/t049_test.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ def test_modpath():
7878
success, buff = mp.run_model(silent=False)
7979
except:
8080
success = False
81-
assert success, (
82-
"forward modpath model run did not terminate successfully"
83-
)
81+
assert (
82+
success
83+
), "forward modpath model run did not terminate successfully"
8484

8585
mpnam = "freybergmpp"
8686
mpp = flopy.modpath.Modpath6(
@@ -106,9 +106,9 @@ def test_modpath():
106106
success, buff = mpp.run_model(silent=False)
107107
except:
108108
success = False
109-
assert success, (
110-
"backward modpath model run did not terminate successfully"
111-
)
109+
assert (
110+
success
111+
), "backward modpath model run did not terminate successfully"
112112

113113
# load modpath output files
114114
if run:

flopy/mf6/utils/lakpak_utils.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -211,44 +211,48 @@ def __structured_lake_connections(
211211
# back face
212212
if i > 0:
213213
ci = (k, i - 1, j)
214+
cit = (k + 1, i - 1, j)
214215
if np.ma.is_masked(lake_map[ci]) and idomain[ci] > 0:
215216
cellids.append(ci)
216217
claktypes.append("horizontal")
217-
belevs.append(elevations[k + 1, i, j])
218-
televs.append(elevations[k, i, j])
218+
belevs.append(elevations[cit])
219+
televs.append(elevations[ci])
219220
connlens.append(0.5 * dy[i - 1])
220221
connwidths.append(dx[j])
221222

222223
# left face
223224
if j > 0:
224225
ci = (k, i, j - 1)
226+
cit = (k + 1, i, j - 1)
225227
if np.ma.is_masked(lake_map[ci]) and idomain[ci] > 0:
226228
cellids.append(ci)
227229
claktypes.append("horizontal")
228-
belevs.append(elevations[k + 1, i, j])
229-
televs.append(elevations[k, i, j])
230+
belevs.append(elevations[cit])
231+
televs.append(elevations[ci])
230232
connlens.append(0.5 * dx[j - 1])
231233
connwidths.append(dy[i])
232234

233235
# right face
234236
if j < ncol - 1:
235237
ci = (k, i, j + 1)
238+
cit = (k + 1, i, j + 1)
236239
if np.ma.is_masked(lake_map[ci]) and idomain[ci] > 0:
237240
cellids.append(ci)
238241
claktypes.append("horizontal")
239-
belevs.append(elevations[k + 1, i, j])
240-
televs.append(elevations[k, i, j])
242+
belevs.append(elevations[cit])
243+
televs.append(elevations[ci])
241244
connlens.append(0.5 * dx[j + 1])
242245
connwidths.append(dy[i])
243246

244247
# front face
245248
if i < nrow - 1:
246249
ci = (k, i + 1, j)
250+
cit = (k + 1, i + 1, j)
247251
if np.ma.is_masked(lake_map[ci]) and idomain[ci] > 0:
248252
cellids.append(ci)
249253
claktypes.append("horizontal")
250-
belevs.append(elevations[k + 1, i, j])
251-
televs.append(elevations[k, i, j])
254+
belevs.append(elevations[cit])
255+
televs.append(elevations[ci])
252256
connlens.append(0.5 * dy[i + 1])
253257
connwidths.append(dx[j])
254258

0 commit comments

Comments
 (0)