diff --git a/.docs/Notebooks/dis_triangle_example.py b/.docs/Notebooks/dis_triangle_example.py index 1a43b94d4..91acdc9a6 100644 --- a/.docs/Notebooks/dis_triangle_example.py +++ b/.docs/Notebooks/dis_triangle_example.py @@ -204,8 +204,8 @@ sim, print_option="SUMMARY", complexity="complex", - outer_hclose=1.0e-8, - inner_hclose=1.0e-8, + outer_dvclose=1.0e-8, + inner_dvclose=1.0e-8, ) cell2d = tri.get_cell2d() vertices = tri.get_vertices() diff --git a/.docs/Notebooks/export_vtk_tutorial.py b/.docs/Notebooks/export_vtk_tutorial.py index a45c3b5b0..60dc80ac4 100644 --- a/.docs/Notebooks/export_vtk_tutorial.py +++ b/.docs/Notebooks/export_vtk_tutorial.py @@ -480,11 +480,11 @@ def run_vertex_grid_example(ws): pname="ims", print_option="SUMMARY", complexity="SIMPLE", - outer_hclose=1.0e-5, + outer_dvclose=1.0e-5, outer_maximum=100, under_relaxation="NONE", inner_maximum=100, - inner_hclose=1.0e-6, + inner_dvclose=1.0e-6, rcloserecord=0.1, linear_acceleration="BICGSTAB", scaling_method="NONE", diff --git a/.docs/Notebooks/mf6_data_tutorial10.py b/.docs/Notebooks/mf6_data_tutorial10.py index 4a74df676..de0631a10 100644 --- a/.docs/Notebooks/mf6_data_tutorial10.py +++ b/.docs/Notebooks/mf6_data_tutorial10.py @@ -62,11 +62,11 @@ sim, print_option="SUMMARY", complexity="SIMPLE", - outer_hclose=0.0001, + outer_dvclose=0.0001, outer_maximum=500, under_relaxation="NONE", inner_maximum=100, - inner_hclose=0.0001, + inner_dvclose=0.0001, rcloserecord=0.001, linear_acceleration="CG", scaling_method="NONE", diff --git a/.docs/Notebooks/modpath7_create_simulation_example.py b/.docs/Notebooks/modpath7_create_simulation_example.py index 7fd621bcc..7a4bdca65 100644 --- a/.docs/Notebooks/modpath7_create_simulation_example.py +++ b/.docs/Notebooks/modpath7_create_simulation_example.py @@ -100,8 +100,8 @@ def get_nodes(locs): sim, pname="ims", complexity="SIMPLE", - outer_hclose=1e-6, - inner_hclose=1e-6, + outer_dvclose=1e-6, + inner_dvclose=1e-6, rcloserecord=1e-6, ) diff --git a/.docs/Notebooks/plot_cross_section_example.py b/.docs/Notebooks/plot_cross_section_example.py index 38f3062bb..a5d28db87 100644 --- a/.docs/Notebooks/plot_cross_section_example.py +++ b/.docs/Notebooks/plot_cross_section_example.py @@ -685,11 +685,11 @@ def run_vertex_grid_example(ws): pname="ims", print_option="SUMMARY", complexity="SIMPLE", - outer_hclose=1.0e-5, + outer_dvclose=1.0e-5, outer_maximum=100, under_relaxation="NONE", inner_maximum=100, - inner_hclose=1.0e-6, + inner_dvclose=1.0e-6, rcloserecord=0.1, linear_acceleration="BICGSTAB", scaling_method="NONE", diff --git a/.docs/Notebooks/plot_map_view_example.py b/.docs/Notebooks/plot_map_view_example.py index 059881851..00dadcec9 100644 --- a/.docs/Notebooks/plot_map_view_example.py +++ b/.docs/Notebooks/plot_map_view_example.py @@ -863,11 +863,11 @@ def run_vertex_grid_example(ws): pname="ims", print_option="SUMMARY", complexity="SIMPLE", - outer_hclose=1.0e-5, + outer_dvclose=1.0e-5, outer_maximum=100, under_relaxation="NONE", inner_maximum=100, - inner_hclose=1.0e-6, + inner_dvclose=1.0e-6, rcloserecord=0.1, linear_acceleration="BICGSTAB", scaling_method="NONE", diff --git a/autotest/regression/test_mf6.py b/autotest/regression/test_mf6.py index 49a5fcf02..15ac19792 100644 --- a/autotest/regression/test_mf6.py +++ b/autotest/regression/test_mf6.py @@ -1897,7 +1897,7 @@ def test004_create_tests_bcfss(function_tmpdir, example_data_path): ims_package = ModflowIms( sim, print_option="ALL", - csv_output_filerecord="bcf2ss.ims.csv", + csv_outer_output_filerecord="bcf2ss.ims.csv", complexity="SIMPLE", outer_dvclose=0.000001, outer_maximum=500, diff --git a/autotest/test_modpathfile.py b/autotest/test_modpathfile.py index 883d11f1b..dcb606097 100644 --- a/autotest/test_modpathfile.py +++ b/autotest/test_modpathfile.py @@ -76,8 +76,8 @@ def get_nodes(locs): sim, pname="ims", complexity="SIMPLE", - outer_hclose=1e-6, - inner_hclose=1e-6, + outer_dvclose=1e-6, + inner_dvclose=1e-6, rcloserecord=1e-6, ) diff --git a/autotest/test_specific_discharge.py b/autotest/test_specific_discharge.py index 0b7045680..a029708db 100644 --- a/autotest/test_specific_discharge.py +++ b/autotest/test_specific_discharge.py @@ -211,11 +211,11 @@ def mf6_model(function_tmpdir): pname="ims", print_option="SUMMARY", complexity="SIMPLE", - outer_hclose=1.0e-5, + outer_dvclose=1.0e-5, outer_maximum=50, under_relaxation="NONE", inner_maximum=30, - inner_hclose=1.0e-5, + inner_dvclose=1.0e-5, rcloserecord=rcloserecord, linear_acceleration="CG", scaling_method="NONE", diff --git a/flopy/mf6/mfmodel.py b/flopy/mf6/mfmodel.py index 7f4b9ef23..ceeb59c85 100644 --- a/flopy/mf6/mfmodel.py +++ b/flopy/mf6/mfmodel.py @@ -744,7 +744,7 @@ def solver_tols(self): Returns ------- - inner_hclose, rclose : float, float + inner_dvclose, rclose : float, float """ ims = self.get_ims_package() @@ -752,7 +752,7 @@ def solver_tols(self): rclose = ims.rcloserecord.get_data() if rclose is not None: rclose = rclose[0][0] - return ims.inner_hclose.get_data(), rclose + return ims.inner_dvclose.get_data(), rclose return None @property diff --git a/flopy/mf6/utils/codegen/__init__.py b/flopy/mf6/utils/codegen/__init__.py index e70f86b5e..2b984e0fd 100644 --- a/flopy/mf6/utils/codegen/__init__.py +++ b/flopy/mf6/utils/codegen/__init__.py @@ -135,6 +135,10 @@ def _add_nam_suffix(dfn): # parsed haphazardly throughout the mf6 module. TODO: when # the legacy DFN is no longer needed at runtime, remove. if version == 2: + # import here instead of module so we don't + # expect optional deps at module init time + from boltons.dictutils import OMD + assert legacydir is not None, ( "legacydir must be provided for version 2 DFNs" ) @@ -144,6 +148,12 @@ def _add_nam_suffix(dfn): for dfn_name, dfn in dfns.items(): with open(legacydir / f"{dfn_name}.dfn") as df: legacy_dfn, legacy_meta = Dfn._load_v1_flat(df, common=common) + # drop fields removed as of this DFN's MF6 version + legacy_dfn = OMD( + (k, v) + for k, v in legacy_dfn.items(multi=True) + if not v.get("removed", False) + ) dfn["legacy_dfn"] = legacy_dfn dfn["legacy_meta"] = legacy_meta diff --git a/flopy/mf6/utils/codegen/filters.py b/flopy/mf6/utils/codegen/filters.py index af7dc75fd..62a7da6ac 100644 --- a/flopy/mf6/utils/codegen/filters.py +++ b/flopy/mf6/utils/codegen/filters.py @@ -23,6 +23,8 @@ def visit(p, k, v): if ( isinstance(v, dict) and "type" in v + # skip vars removed as of the DFN's MF6 version + and not v.get("removed", False) # support 'prerelease' for now but it's been deprecated for 'developmode' and (developmode or not v.get("developmode", v.get("prerelease", False))) ):