diff --git a/.docs/Notebooks/mf6_complex_model_example.py b/.docs/Notebooks/mf6_complex_model_example.py index f999b00d96..572626f87a 100644 --- a/.docs/Notebooks/mf6_complex_model_example.py +++ b/.docs/Notebooks/mf6_complex_model_example.py @@ -237,7 +237,6 @@ 0.5, 0.3, 0.1, - None, ) evt = flopy.mf6.ModflowGwfevt( gwf, diff --git a/autotest/regression/test_mf6.py b/autotest/regression/test_mf6.py index e1c5850887..96709436d9 100644 --- a/autotest/regression/test_mf6.py +++ b/autotest/regression/test_mf6.py @@ -1528,7 +1528,6 @@ def test005_create_tests_advgw_tidal(function_tmpdir, example_data_path): 50.0, 0.0004, 10.0, - None, ) evt_package_test = ModflowGwfevt( model, @@ -1554,7 +1553,6 @@ def test005_create_tests_advgw_tidal(function_tmpdir, example_data_path): 0.5, 0.3, 0.1, - None, ) evt_package = ModflowGwfevt( model, diff --git a/flopy/mf6/data/mfdatastorage.py b/flopy/mf6/data/mfdatastorage.py index 8a57413538..ec2094fdc8 100644 --- a/flopy/mf6/data/mfdatastorage.py +++ b/flopy/mf6/data/mfdatastorage.py @@ -2710,7 +2710,13 @@ def build_type_list( self._append_type_lists( aux_var_name, data_type, False ) - + elif data_item.name == "petm0" and resolve_data_shape: + for key in self._simulation_data.mfdata: + if "surf_rate_specified" in key: + if self._simulation_data.mfdata[key].get_data(): + self._append_type_lists( + data_item.name, data_type, False + ) elif data_item.type == DatumType.record: # record within a record, recurse self.build_type_list(data_item, True, data) diff --git a/flopy/mf6/data/mffileaccess.py b/flopy/mf6/data/mffileaccess.py index e64ed695d6..9127d8d4ec 100644 --- a/flopy/mf6/data/mffileaccess.py +++ b/flopy/mf6/data/mffileaccess.py @@ -1130,15 +1130,43 @@ def _get_header(self): else: header.append((di_struct.name, np_flt_type)) ext_index += 1 - elif di_struct.name == "aux": - aux_var_names = ( - self._data_dimensions.package_dim.get_aux_variables() - ) - if aux_var_names is not None: - for aux_var_name in aux_var_names[0]: - if aux_var_name.lower() != "auxiliary": - header.append((aux_var_name, np_flt_type)) - ext_index += 1 + else: + # optional tags + if di_struct.name == "aux": + aux_var_names = ( + self._data_dimensions.package_dim.get_aux_variables() + ) + if aux_var_names is not None: + for aux_var_name in aux_var_names[0]: + if aux_var_name.lower() != "auxiliary": + header.append((aux_var_name, np_flt_type)) + ext_index += 1 + elif di_struct.name == "petm0": + for key in self._simulation_data.mfdata: + if "surf_rate_specified" in key: + if self._simulation_data.mfdata[key].get_data(): + header.append((di_struct.name, np_flt_type)) + ext_index += 1 + elif di_struct.name == "pxdp" or di_struct.name == "petm": + for key in self._simulation_data.mfdata: + if "nseg" in key: + if ( + self._simulation_data.mfdata[key].get_data() + > 1 + ): + for seg in range( + self._simulation_data.mfdata[ + key + ].get_data() + - 1 + ): + header.append( + ( + f"{di_struct.name}{seg+1}", + np_flt_type, + ) + ) + ext_index += 1 return header, int_cellid_indexes, ext_cellid_indexes def _get_cell_header(self, data_item, data_set, index):