Skip to content

Commit

Permalink
update(Modpath7): update path construction for modpath nam file (#1679)
Browse files Browse the repository at this point in the history
* update(Modpath7): update path construction for modflow model files in nam file

* create relative path to flow model from modpath sim path
  • Loading branch information
jlarsen-usgs committed Jan 20, 2023
1 parent 2e6a7e1 commit 3c2a93e
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions flopy/modpath/mp7.py
Expand Up @@ -128,6 +128,9 @@ def __init__(
# set flowmodel and flow_version attributes
self.flowmodel = flowmodel
self.flow_version = self.flowmodel.version
self._flowmodel_ws = os.path.relpath(
flowmodel.model_ws, self._model_ws
)

if self.flow_version == "mf6":
# get discretization package
Expand Down Expand Up @@ -380,13 +383,21 @@ def write_name_file(self):
if self.dis_file is not None:
f.write(f"DIS {self.dis_file}\n")
if self.grbdis_file is not None:
f.write(f"{self.grbtag:10s} {self.grbdis_file}\n")
f.write(
f"{self.grbtag:10s} {os.path.join(self._flowmodel_ws, self.grbdis_file)}\n"
)
if self.tdis_file is not None:
f.write(f"TDIS {self.tdis_file}\n")
f.write(
f"TDIS {os.path.join(self._flowmodel_ws, self.tdis_file)}\n"
)
if self.headfilename is not None:
f.write(f"HEAD {self.headfilename}\n")
f.write(
f"HEAD {os.path.join(self._flowmodel_ws, self.headfilename)}\n"
)
if self.budgetfilename is not None:
f.write(f"BUDGET {self.budgetfilename}\n")
f.write(
f"BUDGET {os.path.join(self._flowmodel_ws, self.budgetfilename)}\n"
)
f.close()

@classmethod
Expand Down

0 comments on commit 3c2a93e

Please sign in to comment.