Skip to content

Commit

Permalink
refactor(MF6model.setup_ims): support inner and outer CSV file output…
Browse files Browse the repository at this point in the history
… in IMS options (remap input to work with Flopy)
  • Loading branch information
aleaf committed Jul 5, 2023
1 parent 38faadc commit 14fea2b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion mfsetup/mf6_defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ obs:
ims:
options:
print_option: 'all'
'csv_output fileout': '{}_solver_out.csv'
csv_outer_output: 'solver_outer_out.csv'
nonlinear:
outer_dvclose: 1.e-1
outer_maximum: 200
Expand Down
7 changes: 7 additions & 0 deletions mfsetup/mf6model.py
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,13 @@ def setup_ims(self):
print('\nSetting up {} package...'.format(package.upper()))
t0 = time.time()
kwargs = flatten(self.cfg[package])
# renames to cover difference between mf6: flopy input
renames = {'csv_outer_output': 'csv_outer_output_filerecord',
'csv_inner_output': 'csv_outer_inner_filerecord'
}
for k, v in renames.items():
if k in kwargs:
kwargs[v] = kwargs[k]
kwargs = get_input_arguments(kwargs, mf6.ModflowIms)
ims = mf6.ModflowIms(self.simulation, **kwargs)
#self.simulation.register_ims_package(ims, [self.name])
Expand Down
10 changes: 10 additions & 0 deletions mfsetup/tests/test_mf6_shellmound.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,16 @@ def test_namefile(shellmound_model_with_dis):
assert line.strip().split()[-1] == expected_listfile_name


def test_ims_setup(shellmound_model):
model = shellmound_model
ims = model.setup_ims()

assert ims.csv_outer_output_filerecord is not None

assert ims.csv_outer_output_filerecord.array[0][0] == \
'solver_outer_out.csv'


def test_snap_to_NHG(shellmound_cfg, shellmound_simulation):
cfg = deepcopy(shellmound_cfg)
#simulation = deepcopy(simulation)
Expand Down

0 comments on commit 14fea2b

Please sign in to comment.