Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(MFsetupMixin.setup_sfr): properly handle revised SFRmaker assign_… #78

Merged
merged 1 commit into from
Feb 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 7 additions & 14 deletions mfsetup/mfmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -1530,28 +1530,21 @@ def setup_sfr(self, **kwargs):
idomain=idomain)
sfr.reach_data['k'] = layers
if new_botm is not None:
if self.cfg['intermediate_data'].get('botm') is None:
f = os.path.normpath(os.path.join(self.model_ws,
self.external_path,
self.cfg['dis']['botm_filename_fmt'].format(self.nlay - 1)
))
else:
f = self.cfg['intermediate_data']['botm'][-1]
save_array(f, new_botm, fmt='%.2f')
print('(new model botm after assigning SFR reaches to layers)')
botm[-1] = new_botm
# run thru setup_array so that DIS input remains open/close
self._setup_array('dis', 'botm',
data={i: arr for i, arr in enumerate(botm)},
data={i: arr for i, arr in enumerate(new_botm)},
datatype='array3d', write_fmt='%.2f', dtype=int)
# reset the bottom array
# is this necessary?
self.dis.botm = botm
# reset the bottom array in flopy (and in memory)
# is this necessary? =
self.dis.botm = new_botm
# set bottom array to external files
if self.version == 'mf6':
self.dis.botm = self.cfg['dis']['griddata']['botm']
else:
self.dis.botm = self.cfg['dis']['botm']
print('\nModel cell bottom elevations adjusted after assigning '
'SFR reaches to layers\n(to accommodate SFR reach bottoms '
'below the previous model bottom)\n')

# option to convert reaches to the River Package
if self.cfg['sfr'].get('to_riv'):
Expand Down
Loading