@@ -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