Skip to content

Commit

Permalink
fix(model_splitter): check keys in mftransient array
Browse files Browse the repository at this point in the history
  • Loading branch information
jdhughes-usgs committed Nov 12, 2023
1 parent 696a209 commit b9d236e
Showing 1 changed file with 22 additions and 12 deletions.
34 changes: 22 additions & 12 deletions flopy/mf6/utils/model_splitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1076,20 +1076,30 @@ def _remap_transient_array(self, item, mftransient, mapped_data):

d0 = {mkey: {} for mkey in self._model_dict.keys()}
for per, array in enumerate(mftransient.array):
storage = mftransient._data_storage[per]
how = [
i.data_storage_type.value
for i in storage.layer_storage.multi_dim_list
]
binary = [i.binary for i in storage.layer_storage.multi_dim_list]
fnames = [i.fname for i in storage.layer_storage.multi_dim_list]
if per in mftransient._data_storage.keys():
storage = mftransient._data_storage[per]
how = [
i.data_storage_type.value
for i in storage.layer_storage.multi_dim_list
]
binary = [
i.binary for i in storage.layer_storage.multi_dim_list
]
fnames = [
i.fname for i in storage.layer_storage.multi_dim_list
]

d = self._remap_array(
item, array, mapped_data, how=how, binary=binary, fnames=fnames
)
d = self._remap_array(
item,
array,
mapped_data,
how=how,
binary=binary,
fnames=fnames,
)

for mkey in d.keys():
d0[mkey][per] = d[mkey][item]
for mkey in d.keys():
d0[mkey][per] = d[mkey][item]

for mkey, values in d0.items():
mapped_data[mkey][item] = values
Expand Down

0 comments on commit b9d236e

Please sign in to comment.