From 00e227044ec6bf0797ce0c23588b35f16897dc81 Mon Sep 17 00:00:00 2001 From: Ayman Alzraiee Date: Mon, 2 Sep 2019 17:08:07 -0700 Subject: [PATCH 1/2] Fix(mfmnw2): Fix a bug that causes mnw2 file writing to crash when when there multiple stress periods * Fix mfmnw2 file --- flopy/modflow/mfmnw2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flopy/modflow/mfmnw2.py b/flopy/modflow/mfmnw2.py index 8f359927a9..513298b804 100644 --- a/flopy/modflow/mfmnw2.py +++ b/flopy/modflow/mfmnw2.py @@ -1400,7 +1400,7 @@ def make_mnw_objects(self): mnwspd = Mnw.get_empty_stress_period_data(self.nper, aux_names=self.aux) for per, itmp in enumerate(self.itmp): - inds = stress_period_data[0].wellid == wellid + inds = stress_period_data[per].wellid == wellid if itmp > 0 and np.any(inds): names = [n for n in stress_period_data[per][inds].dtype.names if From 830afd479c6ffa7afe033c577453d4c194598f29 Mon Sep 17 00:00:00 2001 From: Ayman Alzraiee Date: Thu, 26 Sep 2019 15:37:21 -0700 Subject: [PATCH 2/2] fix(mflak): allow lak class to use -1 for previous transient lake stress --- flopy/modflow/mflak.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flopy/modflow/mflak.py b/flopy/modflow/mflak.py index 6bad67c0c4..851626fafc 100644 --- a/flopy/modflow/mflak.py +++ b/flopy/modflow/mflak.py @@ -518,6 +518,8 @@ def write_file(self): itmp2 = 0 if kper in ds9_keys: itmp2 = 1 + elif len(ds9_keys) > 0: + itmp2 = -1 if isinstance(self.lwrt, list): tmplwrt = self.lwrt[kper] else: