diff --git a/flopy/mf6/mfmodel.py b/flopy/mf6/mfmodel.py index 5979333754..393179bd2e 100644 --- a/flopy/mf6/mfmodel.py +++ b/flopy/mf6/mfmodel.py @@ -800,7 +800,14 @@ def load_base( print(" loading package {}...".format(ftype)) # load package instance.load_package(ftype, fname, pname, strict, None) - + sim_data = simulation.simulation_data + if ftype == "dis" and not sim_data.max_columns_user_set: + # set column wrap to ncol + dis = instance.get_package("dis") + if dis is not None and hasattr(dis, "ncol"): + sim_data.max_columns_of_data = dis.ncol.get_data() + sim_data.max_columns_user_set = False + sim_data.max_columns_auto_set = True # load referenced packages if modelname in instance.simulation_data.referenced_files: for ref_file in instance.simulation_data.referenced_files[ @@ -981,6 +988,9 @@ def set_model_relative_path(self, model_ws): Model working folder relative to simulation working folder """ + # set all data internal + self.set_all_data_internal(False) + # update path in the file manager file_mgr = self.simulation_data.mfpath file_mgr.set_last_accessed_model_path() @@ -992,6 +1002,10 @@ def set_model_relative_path(self, model_ws): and model_ws != "." and self.simulation.name_file is not None ): + model_folder_path = file_mgr.get_model_path(self.name) + if not os.path.exists(model_folder_path): + # make new model folder + os.makedirs(model_folder_path) # update model name file location in simulation name file models = self.simulation.name_file.models models_data = models.get_data() @@ -1172,7 +1186,26 @@ def rename_all_packages(self, name): package.package_type, ) - def set_all_data_external(self, check_data=True): + def set_all_data_external( + self, check_data=True, external_data_folder=None + ): + """Sets the model's list and array data to be stored externally. + + Parameters + ---------- + check_data : bool + Determines if data error checking is enabled during this + process. + external_data_folder + Folder, relative to the simulation path or model relative path + (see use_model_relative_path parameter), where external data + will be stored + + """ + for package in self.packagelist: + package.set_all_data_external(check_data, external_data_folder) + + def set_all_data_internal(self, check_data=True): """Sets the model's list and array data to be stored externally. Parameters @@ -1183,7 +1216,7 @@ def set_all_data_external(self, check_data=True): """ for package in self.packagelist: - package.set_all_data_external(check_data) + package.set_all_data_internal(check_data) def register_package( self,