Skip to content

Commit 9020bf3

Browse files
authored
fix(modpath7): address #993 and #1053 (#1170)
closes #993 closes #1053
1 parent 090849e commit 9020bf3

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

flopy/modpath/mp7particledata.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,9 +340,17 @@ def write(self, f=None):
340340
d = np.recarray.copy(self.particledata)
341341
lnames = [name.lower() for name in d.dtype.names]
342342
# Add one to the kij and node indices
343-
for idx in ["k", "i", "j", "node", "id"]:
343+
for idx in (
344+
"k",
345+
"i",
346+
"j",
347+
"node",
348+
):
344349
if idx in lnames:
345350
d[idx] += 1
351+
# Add one to the particle id if required
352+
if self.particleidoption == 0 and "id" in lnames:
353+
d["id"] += 1
346354

347355
# write the particle data
348356
fmt = self._fmt_string + "\n"

flopy/utils/modpathfile.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,8 @@ def get_destination_data(self, dest_cells, to_recarray=True):
204204
Parameters
205205
----------
206206
dest_cells : list or array of tuples
207-
(k, i, j) of each destination cell (zero-based)
207+
(k, i, j) of each destination cell for MODPATH versions less than
208+
MODPATH 7 or node number of each destination cell. (zero based)
208209
to_recarray : bool
209210
Boolean that controls returned series. If to_recarray is True,
210211
a single recarray with all of the pathlines that intersect
@@ -724,7 +725,8 @@ def get_destination_pathline_data(self, dest_cells, to_recarray=False):
724725
Parameters
725726
----------
726727
dest_cells : list or array of tuples
727-
(k, i, j) of each destination cell (zero-based)
728+
(k, i, j) of each destination cell for MODPATH versions less than
729+
MODPATH 7 or node number of each destination cell. (zero based)
728730
to_recarray : bool
729731
Boolean that controls returned pthldest. If to_recarray is True,
730732
a single recarray with all of the pathlines that intersect
@@ -1180,7 +1182,8 @@ def get_destination_endpoint_data(self, dest_cells, source=False):
11801182
Parameters
11811183
----------
11821184
dest_cells : list or array of tuples
1183-
(k, i, j) or (node,) of each destination cell (zero-based)
1185+
(k, i, j) of each destination cell for MODPATH versions less than
1186+
MODPATH 7 or node number of each destination cell. (zero based)
11841187
source : bool
11851188
Boolean to specify is dest_cells applies to source or
11861189
destination cells (default is False).
@@ -1630,7 +1633,8 @@ def get_destination_timeseries_data(self, dest_cells):
16301633
Parameters
16311634
----------
16321635
dest_cells : list or array of tuples
1633-
(k, i, j) or nodes of each destination cell (zero-based)
1636+
(k, i, j) of each destination cell for MODPATH versions less than
1637+
MODPATH 7 or node number of each destination cell. (zero based)
16341638
16351639
Returns
16361640
-------

0 commit comments

Comments
 (0)