From adbb4e56c291be799dddc1df9fc25714fdc7700d Mon Sep 17 00:00:00 2001 From: spaulins-usgs Date: Fri, 28 Jun 2019 14:11:23 -0700 Subject: [PATCH 1/9] fix(ja array): CellID now increments and decrements correctly. --- flopy/mf6/data/mfdataarray.py | 9 ++++++++- flopy/mf6/data/mfdatastorage.py | 2 +- flopy/mf6/data/mfdatautil.py | 2 ++ flopy/mf6/data/mffileaccess.py | 26 ++++++++++++++++++++++++-- 4 files changed, 35 insertions(+), 4 deletions(-) diff --git a/flopy/mf6/data/mfdataarray.py b/flopy/mf6/data/mfdataarray.py index 0cc353f790..0305888582 100644 --- a/flopy/mf6/data/mfdataarray.py +++ b/flopy/mf6/data/mfdataarray.py @@ -565,6 +565,10 @@ def get_file_entry(self, layer=None, inspect.stack()[0][3], type_, value_, traceback_, None, self._simulation_data.debug, ex) + if self.structure.data_item_structures[0].numeric_index or \ + self.structure.data_item_structures[0].is_cellid: + # for cellid and numeric indices convert from 0 base to 1 based + data = abs(data) + 1 file_entry_array.append('{}{}{}{}\n'.format(indent, self.structure.name, indent, @@ -746,13 +750,16 @@ def _get_data_layer_string(self, layer, data_indent): self._simulation_data.debug, ex) data_iter = datautil.PyListUtil.next_item(data) indent_str = self._simulation_data.indent_string + is_cellid = self.structure.data_item_structures[0].numeric_index or \ + self.structure.data_item_structures[0].is_cellid + for item, last_item, new_list, nesting_change in data_iter: # increment data/layer counts line_data_count += 1 try: data_lyr = to_string(item, self._data_type, self._simulation_data, - self._data_dimensions) + self._data_dimensions, is_cellid) except Exception as ex: type_, value_, traceback_ = sys.exc_info() comment = 'Could not convert data "{}" of type "{}" to a ' \ diff --git a/flopy/mf6/data/mfdatastorage.py b/flopy/mf6/data/mfdatastorage.py index 5a27bef22a..5bbdf7e50f 100644 --- a/flopy/mf6/data/mfdatastorage.py +++ b/flopy/mf6/data/mfdatastorage.py @@ -1096,7 +1096,7 @@ def store_external(self, file_path, layer=None, multiplier=None, data, fp, text, self._model_or_sim.modeldiscrit, self._model_or_sim.modeltime, stress_period=self._stress_period, precision='double', - write_multi_layer=(layer is None)) + write_multi_layer=(layer is None and self.layered)) else: file_access = MFFileAccessArray( self.data_dimensions.structure, self.data_dimensions, diff --git a/flopy/mf6/data/mfdatautil.py b/flopy/mf6/data/mfdatautil.py index f11edcc557..f6ac3435dd 100644 --- a/flopy/mf6/data/mfdatautil.py +++ b/flopy/mf6/data/mfdatautil.py @@ -122,6 +122,8 @@ def to_string(val, data_type, sim_data, data_dim, is_cellid=False, else: return sim_data.sci_format_str.format(val) elif is_cellid or (possible_cellid and isinstance(val, tuple)): + if isinstance(val, np.int32): + return str(val + 1) if len(val) > 0 and val[0] == 'none': # handle case that cellid is 'none' return val[0] diff --git a/flopy/mf6/data/mffileaccess.py b/flopy/mf6/data/mffileaccess.py index 34fbc208f1..faaa47ca6a 100644 --- a/flopy/mf6/data/mffileaccess.py +++ b/flopy/mf6/data/mffileaccess.py @@ -167,6 +167,7 @@ def __init__(self, structure, data_dimensions, simulation_data, path, def write_binary_file(self, data, fname, text, modelgrid=None, modeltime=None, stress_period=0, precision='double', write_multi_layer=False): + data = self._resolve_cellid_numbers_to_file(data) fd = self._open_ext_file(fname, binary=True, write=True) if write_multi_layer: for layer, value in enumerate(data): @@ -255,6 +256,7 @@ def write_text_file(self, data, fp, data_type, data_size): value_, traceback_, message, self._simulation_data.debug) current_size = 0 + is_cellid = self._is_cellid_or_numeric_index() for data_item in MultiListIter(data, True): if data_item[2] and current_size > 0: # new list/dimension, add appropriate formatting to @@ -262,7 +264,7 @@ def write_text_file(self, data, fp, data_type, data_size): fd.write('\n') fd.write('{} '.format(to_string(data_item[0], data_type, self._simulation_data, - self._data_dimensions))) + self._data_dimensions, is_cellid))) current_size += 1 if current_size != data_size: message = 'Not enough data for "{}" provided for file' \ @@ -289,7 +291,7 @@ def read_binary_data_from_file(self, fname, data_shape, data_size, numpy_type, name = self.datum_to_numpy_type(data_type) header_dtype = bf.BinaryHeader.set_dtype( bintype=self._get_bintype(modelgrid), - precision=name) + precision='double') if read_multi_layer and len(data_shape) > 1: all_data = np.empty(data_shape, numpy_type) headers = [] @@ -312,6 +314,7 @@ def _read_binary_file_layer(self, fd, fname, header_dtype, numpy_type, data_size, data_shape): header_data = np.fromfile(fd, dtype=header_dtype, count=1) data = np.fromfile(fd, dtype=numpy_type, count=data_size) + data = self._resolve_cellid_numbers_from_file(data) if data.size != data_size: message = 'Binary file {} does not contain expected data. ' \ 'Expected array size {} but found size ' \ @@ -364,6 +367,7 @@ def read_text_data_from_file(self, data_size, data_type, data_dim, layer, self._simulation_data.debug) data_out = np.fromiter(data_raw, dtype=data_type, count=data_size) + data_out = self._resolve_cellid_numbers_from_file(data_out) if close_file: fd.close() @@ -585,6 +589,24 @@ def _load_layer(self, layer, layer_size, storage, arr_line, file_handle, value_, traceback_, comment, self._simulation_data.debug, ex) + def _is_cellid_or_numeric_index(self): + if self.structure.data_item_structures[0].numeric_index or \ + self.structure.data_item_structures[0].is_cellid: + return True + return False + + def _resolve_cellid_numbers_to_file(self, data): + if self._is_cellid_or_numeric_index(): + return abs(data) + 1 + else: + return data + + def _resolve_cellid_numbers_from_file(self, data): + if self._is_cellid_or_numeric_index(): + return abs(data) - 1 + else: + return data + def _resolve_data_shape(self, data, layer_shape, storage): try: dimensions = storage.get_data_dimensions(layer_shape) From fc8a68418ca3af8d6820e0ca965bd818dbc07694 Mon Sep 17 00:00:00 2001 From: spaulins-usgs Date: Mon, 1 Jul 2019 09:27:48 -0700 Subject: [PATCH 2/9] feat(jagged arrays): format disu arrays (ja, cl12) as jagged arrays in output files --- flopy/mf6/data/dfn/gwf-disu.dfn | 5 + flopy/mf6/data/mfdata.py | 11 +- flopy/mf6/data/mfdataarray.py | 50 +- flopy/mf6/data/mfdatastorage.py | 2 +- flopy/mf6/data/mffileaccess.py | 86 +- flopy/mf6/data/mfstructure.py | 4 + flopy/mf6/modflow/__init__.py | 74 +- flopy/mf6/modflow/mfgnc.py | 266 +++--- flopy/mf6/modflow/mfgwf.py | 204 ++--- flopy/mf6/modflow/mfgwfchd.py | 384 ++++----- flopy/mf6/modflow/mfgwfdis.py | 282 +++---- flopy/mf6/modflow/mfgwfdisu.py | 539 ++++++------ flopy/mf6/modflow/mfgwfdisv.py | 366 ++++---- flopy/mf6/modflow/mfgwfdrn.py | 422 +++++----- flopy/mf6/modflow/mfgwfevt.py | 498 +++++------ flopy/mf6/modflow/mfgwfevta.py | 400 ++++----- flopy/mf6/modflow/mfgwfghb.py | 426 +++++----- flopy/mf6/modflow/mfgwfgnc.py | 268 +++--- flopy/mf6/modflow/mfgwfgwf.py | 544 ++++++------ flopy/mf6/modflow/mfgwfhfb.py | 190 ++--- flopy/mf6/modflow/mfgwfic.py | 112 +-- flopy/mf6/modflow/mfgwflak.py | 1340 +++++++++++++++--------------- flopy/mf6/modflow/mfgwfmaw.py | 1086 ++++++++++++------------ flopy/mf6/modflow/mfgwfmvr.py | 356 ++++---- flopy/mf6/modflow/mfgwfnam.py | 232 +++--- flopy/mf6/modflow/mfgwfnpf.py | 568 ++++++------- flopy/mf6/modflow/mfgwfoc.py | 378 ++++----- flopy/mf6/modflow/mfgwfrch.py | 406 ++++----- flopy/mf6/modflow/mfgwfrcha.py | 380 ++++----- flopy/mf6/modflow/mfgwfriv.py | 434 +++++----- flopy/mf6/modflow/mfgwfsfr.py | 1152 ++++++++++++------------- flopy/mf6/modflow/mfgwfsto.py | 206 ++--- flopy/mf6/modflow/mfgwfuzf.py | 830 +++++++++--------- flopy/mf6/modflow/mfgwfwel.py | 438 +++++----- flopy/mf6/modflow/mfims.py | 858 +++++++++---------- flopy/mf6/modflow/mfmvr.py | 352 ++++---- flopy/mf6/modflow/mfnam.py | 278 +++---- flopy/mf6/modflow/mftdis.py | 176 ++-- flopy/mf6/modflow/mfutllaktab.py | 158 ++-- flopy/mf6/modflow/mfutlobs.py | 258 +++--- flopy/mf6/modflow/mfutltas.py | 284 +++---- flopy/mf6/modflow/mfutlts.py | 372 ++++----- 42 files changed, 7844 insertions(+), 7831 deletions(-) diff --git a/flopy/mf6/data/dfn/gwf-disu.dfn b/flopy/mf6/data/dfn/gwf-disu.dfn index 623bdc2914..d65575983e 100644 --- a/flopy/mf6/data/dfn/gwf-disu.dfn +++ b/flopy/mf6/data/dfn/gwf-disu.dfn @@ -111,6 +111,7 @@ reader readarray longname grid connectivity description is a list of cell number (n) followed by its connecting cell numbers (m) for each of the m cells connected to cell n. The number of values to provide for cell n is IAC(n). This list is sequentially provided for the first to the last cell. The first value in the list must be cell n itself, and the remaining cells must be listed in an increasing order (sorted from lowest number to highest). Note that the cell and its connections are only supplied for the GWF cells and their connections to the other GWF cells. Also note that the JA list input may be divided such that every node and its connectivity list can be on a separate line for ease in readability of the file. To further ease readability of the file, the node number of the cell whose connectivity is subsequently listed, may be expressed as a negative number, the sign of which is subsequently converted to positive by the code. numeric_index true +jagged_array iac block connectiondata name ihc @@ -119,6 +120,7 @@ shape (nja) reader readarray longname connection type description is an index array indicating the direction between node n and all of its m connections. If IHC = 0 then cell n and cell m are connected in the vertical direction. Cell n overlies cell m if the cell number for n is less than m; cell m overlies cell n if the cell number for m is less than n. If IHC = 1 then cell n and cell m are connected in the horizontal direction. If IHC = 2 then cell n and cell m are connected in the horizontal direction, and the connection is vertically staggered. A vertically staggered connection is one in which a cell is horizontally connected to more than one cell in a horizontal connection. +jagged_array iac block connectiondata name cl12 @@ -127,6 +129,7 @@ shape (nja) reader readarray longname connection lengths description is the array containing connection lengths between the center of cell n and the shared face with each adjacent m cell. +jagged_array iac block connectiondata name hwva @@ -135,6 +138,7 @@ shape (nja) reader readarray longname connection lengths description is a symmetric array of size NJA. For horizontal connections, entries in HWVA are the horizontal width perpendicular to flow. For vertical connections, entries in HWVA are the vertical area for flow. Thus, values in the HWVA array contain dimensions of both length and area. Entries in the HWVA array have a one-to-one correspondence with the connections specified in the JA array. Likewise, there is a one-to-one correspondence between entries in the HWVA array and entries in the IHC array, which specifies the connection type (horizontal or vertical). Entries in the HWVA array must be symmetric; the program will terminate with an error if the value for HWVA for an n to m connection does not equal the value for HWVA for the corresponding n to m connection. +jagged_array iac block connectiondata name angldegx @@ -144,6 +148,7 @@ shape (nja) reader readarray longname angle of face normal to connection description is the angle (in degrees) between the horizontal x-axis and the outward normal to the face between a cell and its connecting cells. The angle varies between zero and 360.0 degrees, where zero degrees points in the positive x-axis direction, and 90 degrees points in the positive y-axis direction. ANGLDEGX is only needed if horizontal anisotropy is specified in the NPF Package, if the XT3D option is used in the NPF Package, or if the SAVE\_SPECIFIC\_DISCHARGE option is specifed in the NPF Package. ANGLDEGX does not need to be specified if these conditions are not met. ANGLDEGX is of size NJA; values specified for vertical connections and for the diagonal position are not used. Note that ANGLDEGX is read in degrees, which is different from MODFLOW-USG, which reads a similar variable (ANGLEX) in radians. +jagged_array iac # --------------------- gwf disu vertices --------------------- diff --git a/flopy/mf6/data/mfdata.py b/flopy/mf6/data/mfdata.py index c6ada632f9..2d6bb963fc 100644 --- a/flopy/mf6/data/mfdata.py +++ b/flopy/mf6/data/mfdata.py @@ -448,7 +448,10 @@ def _get_internal_formatting_string(self, layer): if storage.data_structure_type != DataStructureType.recarray: int_format.append('FACTOR') if layer_storage.factor is not None: - int_format.append(str(layer_storage.factor)) + if data_type == DatumType.integer: + int_format.append(str(int(layer_storage.factor))) + else: + int_format.append(str(layer_storage.factor)) else: if data_type == DatumType.double_precision: int_format.append('1.0') @@ -475,8 +478,12 @@ def _get_external_formatting_string(self, layer, ext_file_action): ext_format = ['OPEN/CLOSE', "'{}'".format(ext_file_path)] if storage.data_structure_type != DataStructureType.recarray: if layer_storage.factor is not None: + data_type = self.structure.get_datum_type(return_enum_type=True) ext_format.append('FACTOR') - ext_format.append(str(layer_storage.factor)) + if data_type == DatumType.integer: + ext_format.append(str(int(layer_storage.factor))) + else: + ext_format.append(str(layer_storage.factor)) if layer_storage.binary: ext_format.append('(BINARY)') if layer_storage.iprn is not None: diff --git a/flopy/mf6/data/mfdataarray.py b/flopy/mf6/data/mfdataarray.py index 0305888582..4074fd9f29 100644 --- a/flopy/mf6/data/mfdataarray.py +++ b/flopy/mf6/data/mfdataarray.py @@ -684,9 +684,8 @@ def _get_file_entry_layer(self, layer, data_indent, storage_type, # internal data header + data format_str = self._get_internal_formatting_string(layer).upper() lay_str = self._get_data_layer_string(layer, data_indent).upper() - file_entry = '{}{}{}\n{}{}'.format(file_entry, indent_string, - format_str, indent_string, - lay_str) + file_entry = '{}{}{}\n{}'.format(file_entry, indent_string, + format_str, lay_str) elif storage_type == DataStorageType.internal_constant: # constant data try: @@ -732,8 +731,6 @@ def _get_file_entry_layer(self, layer, data_indent, storage_type, return file_entry def _get_data_layer_string(self, layer, data_indent): - layer_data_string = [''] - line_data_count = 0 # iterate through data layer try: data = self._get_storage_obj().get_data(layer, False) @@ -748,45 +745,10 @@ def _get_data_layer_string(self, layer, data_indent): inspect.stack()[0][3], type_, value_, traceback_, comment, self._simulation_data.debug, ex) - data_iter = datautil.PyListUtil.next_item(data) - indent_str = self._simulation_data.indent_string - is_cellid = self.structure.data_item_structures[0].numeric_index or \ - self.structure.data_item_structures[0].is_cellid - - for item, last_item, new_list, nesting_change in data_iter: - # increment data/layer counts - line_data_count += 1 - try: - data_lyr = to_string(item, self._data_type, - self._simulation_data, - self._data_dimensions, is_cellid) - except Exception as ex: - type_, value_, traceback_ = sys.exc_info() - comment = 'Could not convert data "{}" of type "{}" to a ' \ - 'string.'.format(item, self._data_type) - raise MFDataException(self.structure.get_model(), - self.structure.get_package(), - self._path, - 'converting data', - self.structure.name, - inspect.stack()[0][3], type_, - value_, traceback_, comment, - self._simulation_data.debug, ex) - layer_data_string[-1] = '{}{}{}'.format(layer_data_string[-1], - indent_str, - data_lyr) - if self._simulation_data.wrap_multidim_arrays and \ - (line_data_count == self._simulation_data. - max_columns_of_data or last_item): - layer_data_string.append('{}'.format(data_indent)) - line_data_count = 0 - if len(layer_data_string) > 0: - # clean up the text at the end of the array - layer_data_string[-1] = layer_data_string[-1].strip() - if len(layer_data_string) == 1: - return '{}{}\n'.format(data_indent, layer_data_string[0].rstrip()) - else: - return '\n'.join(layer_data_string) + file_access = MFFileAccessArray(self.structure, self._data_dimensions, + self._simulation_data, self._path, + self._current_key) + return file_access.get_data_string(data, self._data_type, data_indent) def _resolve_layer_index(self, layer, allow_multiple_layers=False): # handle layered vs non-layered data diff --git a/flopy/mf6/data/mfdatastorage.py b/flopy/mf6/data/mfdatastorage.py index 5bbdf7e50f..df7cff52e0 100644 --- a/flopy/mf6/data/mfdatastorage.py +++ b/flopy/mf6/data/mfdatastorage.py @@ -1573,7 +1573,7 @@ def _build_full_data(self, apply_multiplier=False): if dimensions[0] < 0: return None all_none = True - np_data_type = self.data_dimensions.structure.get_datum_type() + np_data_type = self.data_dimensions.structure.get_datum_type() full_data = np.full(dimensions, np.nan, self.data_dimensions.structure.get_datum_type(True)) is_aux = self.data_dimensions.structure.name == 'aux' diff --git a/flopy/mf6/data/mffileaccess.py b/flopy/mf6/data/mffileaccess.py index faaa47ca6a..132da10492 100644 --- a/flopy/mf6/data/mffileaccess.py +++ b/flopy/mf6/data/mffileaccess.py @@ -255,32 +255,7 @@ def write_text_file(self, data, fp, data_type, data_size): self.structure.name, inspect.stack()[0][3], type_, value_, traceback_, message, self._simulation_data.debug) - current_size = 0 - is_cellid = self._is_cellid_or_numeric_index() - for data_item in MultiListIter(data, True): - if data_item[2] and current_size > 0: - # new list/dimension, add appropriate formatting to - # the file - fd.write('\n') - fd.write('{} '.format(to_string(data_item[0], data_type, - self._simulation_data, - self._data_dimensions, is_cellid))) - current_size += 1 - if current_size != data_size: - message = 'Not enough data for "{}" provided for file' \ - ' {}. Expected data size is {}, actual data ' \ - 'size is' \ - '{}.'.format(self.structure.path, fd.name, - data_size, current_size) - type_, value_, traceback_ = sys.exc_info() - fd.close() - raise MFDataException( - self._data_dimensions.structure.get_model(), - self._data_dimensions.structure.get_package(), - self._data_dimensions.structure.path, - 'storing external data', self.structure.name, - inspect.stack()[0][3], type_, value_, traceback_, - message, self._simulation_data.debug) + fd.write(self.get_data_string(data, data_type, '')) fd.close() def read_binary_data_from_file(self, fname, data_shape, data_size, @@ -310,6 +285,65 @@ def read_binary_data_from_file(self, fname, data_shape, data_size, fd.close() return bin_data + def get_data_string(self, data, data_type, data_indent=''): + layer_data_string = ['{}'.format(data_indent)] + line_data_count = 0 + indent_str = self._simulation_data.indent_string + data_iter = datautil.PyListUtil.next_item(data) + is_cellid = self.structure.data_item_structures[0].numeric_index or \ + self.structure.data_item_structures[0].is_cellid + + jag_arr = self.structure.data_item_structures[0].jagged_array + jagged_def = None + jagged_def_index = 0 + if jag_arr is not None: + # get jagged array definition + jagged_def_path = self._path[0:-1] + (jag_arr,) + if jagged_def_path in self._simulation_data.mfdata: + jagged_def = self._simulation_data.mfdata[jagged_def_path].array + + for item, last_item, new_list, nesting_change in data_iter: + # increment data/layer counts + line_data_count += 1 + try: + data_lyr = to_string(item, data_type, + self._simulation_data, + self._data_dimensions, is_cellid) + except Exception as ex: + type_, value_, traceback_ = sys.exc_info() + comment = 'Could not convert data "{}" of type "{}" to a ' \ + 'string.'.format(item, data_type) + raise MFDataException(self.structure.get_model(), + self.structure.get_package(), + self._path, + 'converting data', + self.structure.name, + inspect.stack()[0][3], type_, + value_, traceback_, comment, + self._simulation_data.debug, ex) + layer_data_string[-1] = '{}{}{}'.format(layer_data_string[-1], + indent_str, + data_lyr) + + if jagged_def is not None: + if line_data_count == jagged_def[jagged_def_index]: + layer_data_string.append('{}'.format(data_indent)) + line_data_count = 0 + jagged_def_index += 1 + else: + if self._simulation_data.wrap_multidim_arrays and \ + (line_data_count == self._simulation_data. + max_columns_of_data or last_item): + layer_data_string.append('{}'.format(data_indent)) + line_data_count = 0 + if len(layer_data_string) > 0: + # clean up the text at the end of the array + layer_data_string[-1] = layer_data_string[-1].strip() + if len(layer_data_string) == 1: + return '{}{}\n'.format(data_indent, layer_data_string[0].rstrip()) + else: + return '\n'.join(layer_data_string) + def _read_binary_file_layer(self, fd, fname, header_dtype, numpy_type, data_size, data_shape): header_data = np.fromfile(fd, dtype=header_dtype, count=1) diff --git a/flopy/mf6/data/mfstructure.py b/flopy/mf6/data/mfstructure.py index 87d5a48aba..d84526cdf0 100644 --- a/flopy/mf6/data/mfstructure.py +++ b/flopy/mf6/data/mfstructure.py @@ -778,6 +778,8 @@ def __init__(self): self.construct_data = None self.parameter_name = None self.one_per_pkg = False + self.jagged_array = None + def set_value(self, line, common): arr_line = line.strip().split() @@ -920,6 +922,8 @@ def set_value(self, line, common): self.parameter_name = arr_line[1] elif arr_line[0] == 'one_per_pkg': self.one_per_pkg = bool(arr_line[1]) + elif arr_line[0] == 'jagged_array': + self.jagged_array = arr_line[1] def get_type_string(self): return '[{}]'.format(self.type_string) diff --git a/flopy/mf6/modflow/__init__.py b/flopy/mf6/modflow/__init__.py index 8cdaf053b4..dbf5b3c71f 100644 --- a/flopy/mf6/modflow/__init__.py +++ b/flopy/mf6/modflow/__init__.py @@ -1,37 +1,37 @@ -# imports -from .mfsimulation import MFSimulation -from .mfnam import ModflowNam -from .mftdis import ModflowTdis -from .mfgwfgwf import ModflowGwfgwf -from .mfims import ModflowIms -from .mfmvr import ModflowMvr -from .mfgnc import ModflowGnc -from .mfutlobs import ModflowUtlobs -from .mfutlts import ModflowUtlts -from .mfutltas import ModflowUtltas -from .mfutllaktab import ModflowUtllaktab -from .mfgwfnam import ModflowGwfnam -from .mfgwf import ModflowGwf -from .mfgwfdis import ModflowGwfdis -from .mfgwfdisv import ModflowGwfdisv -from .mfgwfdisu import ModflowGwfdisu -from .mfgwfic import ModflowGwfic -from .mfgwfnpf import ModflowGwfnpf -from .mfgwfsto import ModflowGwfsto -from .mfgwfhfb import ModflowGwfhfb -from .mfgwfchd import ModflowGwfchd -from .mfgwfwel import ModflowGwfwel -from .mfgwfdrn import ModflowGwfdrn -from .mfgwfriv import ModflowGwfriv -from .mfgwfghb import ModflowGwfghb -from .mfgwfrch import ModflowGwfrch -from .mfgwfrcha import ModflowGwfrcha -from .mfgwfevt import ModflowGwfevt -from .mfgwfevta import ModflowGwfevta -from .mfgwfmaw import ModflowGwfmaw -from .mfgwfsfr import ModflowGwfsfr -from .mfgwflak import ModflowGwflak -from .mfgwfuzf import ModflowGwfuzf -from .mfgwfmvr import ModflowGwfmvr -from .mfgwfgnc import ModflowGwfgnc -from .mfgwfoc import ModflowGwfoc +# imports +from .mfsimulation import MFSimulation +from .mfnam import ModflowNam +from .mftdis import ModflowTdis +from .mfgwfgwf import ModflowGwfgwf +from .mfims import ModflowIms +from .mfmvr import ModflowMvr +from .mfgnc import ModflowGnc +from .mfutlobs import ModflowUtlobs +from .mfutlts import ModflowUtlts +from .mfutltas import ModflowUtltas +from .mfutllaktab import ModflowUtllaktab +from .mfgwfnam import ModflowGwfnam +from .mfgwf import ModflowGwf +from .mfgwfdis import ModflowGwfdis +from .mfgwfdisv import ModflowGwfdisv +from .mfgwfdisu import ModflowGwfdisu +from .mfgwfic import ModflowGwfic +from .mfgwfnpf import ModflowGwfnpf +from .mfgwfsto import ModflowGwfsto +from .mfgwfhfb import ModflowGwfhfb +from .mfgwfchd import ModflowGwfchd +from .mfgwfwel import ModflowGwfwel +from .mfgwfdrn import ModflowGwfdrn +from .mfgwfriv import ModflowGwfriv +from .mfgwfghb import ModflowGwfghb +from .mfgwfrch import ModflowGwfrch +from .mfgwfrcha import ModflowGwfrcha +from .mfgwfevt import ModflowGwfevt +from .mfgwfevta import ModflowGwfevta +from .mfgwfmaw import ModflowGwfmaw +from .mfgwfsfr import ModflowGwfsfr +from .mfgwflak import ModflowGwflak +from .mfgwfuzf import ModflowGwfuzf +from .mfgwfmvr import ModflowGwfmvr +from .mfgwfgnc import ModflowGwfgnc +from .mfgwfoc import ModflowGwfoc diff --git a/flopy/mf6/modflow/mfgnc.py b/flopy/mf6/modflow/mfgnc.py index febcc83967..522433a84c 100644 --- a/flopy/mf6/modflow/mfgnc.py +++ b/flopy/mf6/modflow/mfgnc.py @@ -1,133 +1,133 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ListTemplateGenerator - - -class ModflowGnc(mfpackage.MFPackage): - """ - ModflowGnc defines a gnc package. - - Parameters - ---------- - simulation : MFSimulation - Simulation that this package is a part of. Package is automatically - added to simulation when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - print_input : boolean - * print_input (boolean) keyword to indicate that the list of GNC - information will be written to the listing file immediately after it - is read. - print_flows : boolean - * print_flows (boolean) keyword to indicate that the list of GNC flow - rates will be printed to the listing file for every stress period - time step in which "BUDGET PRINT" is specified in Output Control. If - there is no Output Control option and "PRINT_FLOWS" is specified, - then flow rates are printed for the last time step of each stress - period. - explicit : boolean - * explicit (boolean) keyword to indicate that the ghost node correction - is applied in an explicit manner on the right-hand side of the - matrix. The explicit approach will likely require additional outer - iterations. If the keyword is not specified, then the correction will - be applied in an implicit manner on the left-hand side. The implicit - approach will likely converge better, but may require additional - memory. If the EXPLICIT keyword is not specified, then the BICGSTAB - linear acceleration option should be specified within the LINEAR - block of the Sparse Matrix Solver. - numgnc : integer - * numgnc (integer) is the number of GNC entries. - numalphaj : integer - * numalphaj (integer) is the number of contributing factors. - gncdata : [cellidn, cellidm, cellidsj, alphasj] - * cellidn ((integer, ...)) is the cellid of the cell, :math:`n`, in - which the ghost node is located. For a structured grid that uses the - DIS input file, CELLIDN is the layer, row, and column numbers of the - cell. For a grid that uses the DISV input file, CELLIDN is the layer - number and CELL2D number for the two cells. If the model uses the - unstructured discretization (DISU) input file, then CELLIDN is the - node number for the cell. - * cellidm ((integer, ...)) is the cellid of the connecting cell, - :math:`m`, to which flow occurs from the ghost node. For a structured - grid that uses the DIS input file, CELLIDM is the layer, row, and - column numbers of the cell. For a grid that uses the DISV input file, - CELLIDM is the layer number and CELL2D number for the two cells. If - the model uses the unstructured discretization (DISU) input file, - then CELLIDM is the node number for the cell. - * cellidsj ((integer, ...)) is the array of CELLIDS for the - contributing j cells, which contribute to the interpolated head value - at the ghost node. This item contains one CELLID for each of the - contributing cells of the ghost node. Note that if the number of - actual contributing cells needed by the user is less than NUMALPHAJ - for any ghost node, then a dummy CELLID of zero(s) should be inserted - with an associated contributing factor of zero. For a structured grid - that uses the DIS input file, CELLID is the layer, row, and column - numbers of the cell. For a grid that uses the DISV input file, CELLID - is the layer number and cell2d number for the two cells. If the model - uses the unstructured discretization (DISU) input file, then CELLID - is the node number for the cell. - * alphasj (double) is the contributing factors for each contributing - node in CELLIDSJ. Note that if the number of actual contributing - cells is less than NUMALPHAJ for any ghost node, then dummy CELLIDS - should be inserted with an associated contributing factor of zero. - The sum of ALPHASJ should be less than one. This is because one minus - the sum of ALPHASJ is equal to the alpha term (alpha n in equation - 4-61 of the GWF Model report) that is multiplied by the head in cell - n. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - gncdata = ListTemplateGenerator(('gnc', 'gncdata', 'gncdata')) - package_abbr = "gnc" - _package_type = "gnc" - dfn_file_name = "gwf-gnc.dfn" - - dfn = [["block options", "name print_input", "type keyword", - "reader urword", "optional true"], - ["block options", "name print_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name explicit", "type keyword", "tagged true", - "reader urword", "optional true"], - ["block dimensions", "name numgnc", "type integer", - "reader urword", "optional false"], - ["block dimensions", "name numalphaj", "type integer", - "reader urword", "optional false"], - ["block gncdata", "name gncdata", - "type recarray cellidn cellidm cellidsj alphasj", - "shape (maxbound)", "reader urword"], - ["block gncdata", "name cellidn", "type integer", "shape", - "tagged false", "in_record true", "reader urword", - "numeric_index true"], - ["block gncdata", "name cellidm", "type integer", "shape", - "tagged false", "in_record true", "reader urword", - "numeric_index true"], - ["block gncdata", "name cellidsj", "type integer", - "shape (numalphaj)", "tagged false", "in_record true", - "reader urword", "numeric_index true"], - ["block gncdata", "name alphasj", "type double precision", - "shape (numalphaj)", "tagged false", "in_record true", - "reader urword"]] - - def __init__(self, simulation, loading_package=False, print_input=None, - print_flows=None, explicit=None, numgnc=None, numalphaj=None, - gncdata=None, filename=None, pname=None, parent_file=None): - super(ModflowGnc, self).__init__(simulation, "gnc", filename, pname, - loading_package, parent_file) - - # set up variables - self.print_input = self.build_mfdata("print_input", print_input) - self.print_flows = self.build_mfdata("print_flows", print_flows) - self.explicit = self.build_mfdata("explicit", explicit) - self.numgnc = self.build_mfdata("numgnc", numgnc) - self.numalphaj = self.build_mfdata("numalphaj", numalphaj) - self.gncdata = self.build_mfdata("gncdata", gncdata) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ListTemplateGenerator + + +class ModflowGnc(mfpackage.MFPackage): + """ + ModflowGnc defines a gnc package. + + Parameters + ---------- + simulation : MFSimulation + Simulation that this package is a part of. Package is automatically + added to simulation when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + print_input : boolean + * print_input (boolean) keyword to indicate that the list of GNC + information will be written to the listing file immediately after it + is read. + print_flows : boolean + * print_flows (boolean) keyword to indicate that the list of GNC flow + rates will be printed to the listing file for every stress period + time step in which "BUDGET PRINT" is specified in Output Control. If + there is no Output Control option and "PRINT_FLOWS" is specified, + then flow rates are printed for the last time step of each stress + period. + explicit : boolean + * explicit (boolean) keyword to indicate that the ghost node correction + is applied in an explicit manner on the right-hand side of the + matrix. The explicit approach will likely require additional outer + iterations. If the keyword is not specified, then the correction will + be applied in an implicit manner on the left-hand side. The implicit + approach will likely converge better, but may require additional + memory. If the EXPLICIT keyword is not specified, then the BICGSTAB + linear acceleration option should be specified within the LINEAR + block of the Sparse Matrix Solver. + numgnc : integer + * numgnc (integer) is the number of GNC entries. + numalphaj : integer + * numalphaj (integer) is the number of contributing factors. + gncdata : [cellidn, cellidm, cellidsj, alphasj] + * cellidn ((integer, ...)) is the cellid of the cell, :math:`n`, in + which the ghost node is located. For a structured grid that uses the + DIS input file, CELLIDN is the layer, row, and column numbers of the + cell. For a grid that uses the DISV input file, CELLIDN is the layer + number and CELL2D number for the two cells. If the model uses the + unstructured discretization (DISU) input file, then CELLIDN is the + node number for the cell. + * cellidm ((integer, ...)) is the cellid of the connecting cell, + :math:`m`, to which flow occurs from the ghost node. For a structured + grid that uses the DIS input file, CELLIDM is the layer, row, and + column numbers of the cell. For a grid that uses the DISV input file, + CELLIDM is the layer number and CELL2D number for the two cells. If + the model uses the unstructured discretization (DISU) input file, + then CELLIDM is the node number for the cell. + * cellidsj ((integer, ...)) is the array of CELLIDS for the + contributing j cells, which contribute to the interpolated head value + at the ghost node. This item contains one CELLID for each of the + contributing cells of the ghost node. Note that if the number of + actual contributing cells needed by the user is less than NUMALPHAJ + for any ghost node, then a dummy CELLID of zero(s) should be inserted + with an associated contributing factor of zero. For a structured grid + that uses the DIS input file, CELLID is the layer, row, and column + numbers of the cell. For a grid that uses the DISV input file, CELLID + is the layer number and cell2d number for the two cells. If the model + uses the unstructured discretization (DISU) input file, then CELLID + is the node number for the cell. + * alphasj (double) is the contributing factors for each contributing + node in CELLIDSJ. Note that if the number of actual contributing + cells is less than NUMALPHAJ for any ghost node, then dummy CELLIDS + should be inserted with an associated contributing factor of zero. + The sum of ALPHASJ should be less than one. This is because one minus + the sum of ALPHASJ is equal to the alpha term (alpha n in equation + 4-61 of the GWF Model report) that is multiplied by the head in cell + n. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + gncdata = ListTemplateGenerator(('gnc', 'gncdata', 'gncdata')) + package_abbr = "gnc" + _package_type = "gnc" + dfn_file_name = "gwf-gnc.dfn" + + dfn = [["block options", "name print_input", "type keyword", + "reader urword", "optional true"], + ["block options", "name print_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name explicit", "type keyword", "tagged true", + "reader urword", "optional true"], + ["block dimensions", "name numgnc", "type integer", + "reader urword", "optional false"], + ["block dimensions", "name numalphaj", "type integer", + "reader urword", "optional false"], + ["block gncdata", "name gncdata", + "type recarray cellidn cellidm cellidsj alphasj", + "shape (maxbound)", "reader urword"], + ["block gncdata", "name cellidn", "type integer", "shape", + "tagged false", "in_record true", "reader urword", + "numeric_index true"], + ["block gncdata", "name cellidm", "type integer", "shape", + "tagged false", "in_record true", "reader urword", + "numeric_index true"], + ["block gncdata", "name cellidsj", "type integer", + "shape (numalphaj)", "tagged false", "in_record true", + "reader urword", "numeric_index true"], + ["block gncdata", "name alphasj", "type double precision", + "shape (numalphaj)", "tagged false", "in_record true", + "reader urword"]] + + def __init__(self, simulation, loading_package=False, print_input=None, + print_flows=None, explicit=None, numgnc=None, numalphaj=None, + gncdata=None, filename=None, pname=None, parent_file=None): + super(ModflowGnc, self).__init__(simulation, "gnc", filename, pname, + loading_package, parent_file) + + # set up variables + self.print_input = self.build_mfdata("print_input", print_input) + self.print_flows = self.build_mfdata("print_flows", print_flows) + self.explicit = self.build_mfdata("explicit", explicit) + self.numgnc = self.build_mfdata("numgnc", numgnc) + self.numalphaj = self.build_mfdata("numalphaj", numalphaj) + self.gncdata = self.build_mfdata("gncdata", gncdata) + self._init_complete = True diff --git a/flopy/mf6/modflow/mfgwf.py b/flopy/mf6/modflow/mfgwf.py index e6c2211dc0..2433ae9fd8 100644 --- a/flopy/mf6/modflow/mfgwf.py +++ b/flopy/mf6/modflow/mfgwf.py @@ -1,102 +1,102 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfmodel -from ..data.mfdatautil import ListTemplateGenerator, ArrayTemplateGenerator - - -class ModflowGwf(mfmodel.MFModel): - """ - Modflowgwf defines a gwf model - - Parameters - ---------- - modelname : string - name of the model - model_nam_file : string - relative path to the model name file from model working folder - version : string - version of modflow - exe_name : string - model executable name - model_ws : string - model working folder path - sim : MFSimulation - Simulation that this model is a part of. Model is automatically - added to simulation when it is initialized. - list : string - * list (string) is name of the listing file to create for this GWF - model. If not specified, then the name of the list file will be the - basename of the GWF model name file and the '.lst' extension. For - example, if the GWF name file is called "my.model.nam" then the list - file will be called "my.model.lst". - print_input : boolean - * print_input (boolean) keyword to indicate that the list of all model - stress package information will be written to the listing file - immediately after it is read. - print_flows : boolean - * print_flows (boolean) keyword to indicate that the list of all model - package flow rates will be printed to the listing file for every - stress period time step in which "BUDGET PRINT" is specified in - Output Control. If there is no Output Control option and - "PRINT_FLOWS" is specified, then flow rates are printed for the last - time step of each stress period. - save_flows : boolean - * save_flows (boolean) keyword to indicate that all model package flow - terms will be written to the file specified with "BUDGET FILEOUT" in - Output Control. - newtonoptions : [under_relaxation] - * under_relaxation (string) keyword that indicates whether the - groundwater head in a cell will be under-relaxed when water levels - fall below the bottom of the model below any given cell. By default, - Newton-Raphson UNDER_RELAXATION is not applied. - packages : [ftype, fname, pname] - * ftype (string) is the file type, which must be one of the following - character values shown in table~ref{table:ftype}. Ftype may be - entered in any combination of uppercase and lowercase. - * fname (string) is the name of the file containing the package input. - The path to the file should be included if the file is not located in - the folder where the program was run. - * pname (string) is the user-defined name for the package. PNAME is - restricted to 16 characters. No spaces are allowed in PNAME. PNAME - character values are read and stored by the program for stress - packages only. These names may be useful for labeling purposes when - multiple stress packages of the same type are located within a single - GWF Model. If PNAME is specified for a stress package, then PNAME - will be used in the flow budget table in the listing file; it will - also be used for the text entry in the cell-by-cell budget file. - PNAME is case insensitive and is stored in all upper case letters. - - Methods - ------- - load : (simulation : MFSimulationData, model_name : string, - namfile : string, version : string, exe_name : string, - model_ws : string, strict : boolean) : MFSimulation - a class method that loads a model from files - """ - model_type = 'gwf' - - def __init__(self, simulation, modelname='model', model_nam_file=None, - version='mf6', exe_name='mf6.exe', model_rel_path='.', - list=None, print_input=None, print_flows=None, - save_flows=None, newtonoptions=None, packages=None, **kwargs): - super(ModflowGwf, self).__init__(simulation, model_type='gwf6', - modelname=modelname, - model_nam_file=model_nam_file, - version=version, exe_name=exe_name, - model_rel_path=model_rel_path, - **kwargs) - - self.name_file.list.set_data(list) - self.name_file.print_input.set_data(print_input) - self.name_file.print_flows.set_data(print_flows) - self.name_file.save_flows.set_data(save_flows) - self.name_file.newtonoptions.set_data(newtonoptions) - self.name_file.packages.set_data(packages) - - @classmethod - def load(cls, simulation, structure, modelname='NewModel', - model_nam_file='modflowtest.nam', version='mf6', - exe_name='mf6.exe', strict=True, model_rel_path='.'): - return mfmodel.MFModel.load_base(simulation, structure, modelname, - model_nam_file, 'gwf', version, - exe_name, strict, model_rel_path) +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfmodel +from ..data.mfdatautil import ListTemplateGenerator, ArrayTemplateGenerator + + +class ModflowGwf(mfmodel.MFModel): + """ + Modflowgwf defines a gwf model + + Parameters + ---------- + modelname : string + name of the model + model_nam_file : string + relative path to the model name file from model working folder + version : string + version of modflow + exe_name : string + model executable name + model_ws : string + model working folder path + sim : MFSimulation + Simulation that this model is a part of. Model is automatically + added to simulation when it is initialized. + list : string + * list (string) is name of the listing file to create for this GWF + model. If not specified, then the name of the list file will be the + basename of the GWF model name file and the '.lst' extension. For + example, if the GWF name file is called "my.model.nam" then the list + file will be called "my.model.lst". + print_input : boolean + * print_input (boolean) keyword to indicate that the list of all model + stress package information will be written to the listing file + immediately after it is read. + print_flows : boolean + * print_flows (boolean) keyword to indicate that the list of all model + package flow rates will be printed to the listing file for every + stress period time step in which "BUDGET PRINT" is specified in + Output Control. If there is no Output Control option and + "PRINT_FLOWS" is specified, then flow rates are printed for the last + time step of each stress period. + save_flows : boolean + * save_flows (boolean) keyword to indicate that all model package flow + terms will be written to the file specified with "BUDGET FILEOUT" in + Output Control. + newtonoptions : [under_relaxation] + * under_relaxation (string) keyword that indicates whether the + groundwater head in a cell will be under-relaxed when water levels + fall below the bottom of the model below any given cell. By default, + Newton-Raphson UNDER_RELAXATION is not applied. + packages : [ftype, fname, pname] + * ftype (string) is the file type, which must be one of the following + character values shown in table~ref{table:ftype}. Ftype may be + entered in any combination of uppercase and lowercase. + * fname (string) is the name of the file containing the package input. + The path to the file should be included if the file is not located in + the folder where the program was run. + * pname (string) is the user-defined name for the package. PNAME is + restricted to 16 characters. No spaces are allowed in PNAME. PNAME + character values are read and stored by the program for stress + packages only. These names may be useful for labeling purposes when + multiple stress packages of the same type are located within a single + GWF Model. If PNAME is specified for a stress package, then PNAME + will be used in the flow budget table in the listing file; it will + also be used for the text entry in the cell-by-cell budget file. + PNAME is case insensitive and is stored in all upper case letters. + + Methods + ------- + load : (simulation : MFSimulationData, model_name : string, + namfile : string, version : string, exe_name : string, + model_ws : string, strict : boolean) : MFSimulation + a class method that loads a model from files + """ + model_type = 'gwf' + + def __init__(self, simulation, modelname='model', model_nam_file=None, + version='mf6', exe_name='mf6.exe', model_rel_path='.', + list=None, print_input=None, print_flows=None, + save_flows=None, newtonoptions=None, packages=None, **kwargs): + super(ModflowGwf, self).__init__(simulation, model_type='gwf6', + modelname=modelname, + model_nam_file=model_nam_file, + version=version, exe_name=exe_name, + model_rel_path=model_rel_path, + **kwargs) + + self.name_file.list.set_data(list) + self.name_file.print_input.set_data(print_input) + self.name_file.print_flows.set_data(print_flows) + self.name_file.save_flows.set_data(save_flows) + self.name_file.newtonoptions.set_data(newtonoptions) + self.name_file.packages.set_data(packages) + + @classmethod + def load(cls, simulation, structure, modelname='NewModel', + model_nam_file='modflowtest.nam', version='mf6', + exe_name='mf6.exe', strict=True, model_rel_path='.'): + return mfmodel.MFModel.load_base(simulation, structure, modelname, + model_nam_file, 'gwf', version, + exe_name, strict, model_rel_path) diff --git a/flopy/mf6/modflow/mfgwfchd.py b/flopy/mf6/modflow/mfgwfchd.py index 62ed689d9f..2eb2db6e59 100644 --- a/flopy/mf6/modflow/mfgwfchd.py +++ b/flopy/mf6/modflow/mfgwfchd.py @@ -1,192 +1,192 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ListTemplateGenerator - - -class ModflowGwfchd(mfpackage.MFPackage): - """ - ModflowGwfchd defines a chd package within a gwf6 model. - - Parameters - ---------- - model : MFModel - Model that this package is a part of. Package is automatically - added to model when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - auxiliary : [string] - * auxiliary (string) defines an array of one or more auxiliary variable - names. There is no limit on the number of auxiliary variables that - can be provided on this line; however, lists of information provided - in subsequent blocks must have a column of data for each auxiliary - variable name defined here. The number of auxiliary variables - detected on this line determines the value for naux. Comments cannot - be provided anywhere on this line as they will be interpreted as - auxiliary variable names. Auxiliary variables may not be used by the - package, but they will be available for use by other parts of the - program. The program will terminate with an error if auxiliary - variables are specified on more than one line in the options block. - auxmultname : string - * auxmultname (string) name of auxiliary variable to be used as - multiplier of CHD head value. - boundnames : boolean - * boundnames (boolean) keyword to indicate that boundary names may be - provided with the list of constant-head cells. - print_input : boolean - * print_input (boolean) keyword to indicate that the list of constant- - head information will be written to the listing file immediately - after it is read. - print_flows : boolean - * print_flows (boolean) keyword to indicate that the list of constant- - head flow rates will be printed to the listing file for every stress - period time step in which "BUDGET PRINT" is specified in Output - Control. If there is no Output Control option and "PRINT_FLOWS" is - specified, then flow rates are printed for the last time step of each - stress period. - save_flows : boolean - * save_flows (boolean) keyword to indicate that constant-head flow - terms will be written to the file specified with "BUDGET FILEOUT" in - Output Control. - timeseries : {varname:data} or timeseries data - * Contains data for the ts package. Data can be stored in a dictionary - containing data for the ts package with variable names as keys and - package data as values. Data just for the timeseries variable is also - acceptable. See ts package documentation for more information. - observations : {varname:data} or continuous data - * Contains data for the obs package. Data can be stored in a dictionary - containing data for the obs package with variable names as keys and - package data as values. Data just for the observations variable is - also acceptable. See obs package documentation for more information. - maxbound : integer - * maxbound (integer) integer value specifying the maximum number of - constant-head cells that will be specified for use during any stress - period. - stress_period_data : [cellid, head, aux, boundname] - * cellid ((integer, ...)) is the cell identifier, and depends on the - type of grid that is used for the simulation. For a structured grid - that uses the DIS input file, CELLID is the layer, row, and column. - For a grid that uses the DISV input file, CELLID is the layer and - CELL2D number. If the model uses the unstructured discretization - (DISU) input file, CELLID is the node number for the cell. - * head (double) is the head at the boundary. - * aux (double) represents the values of the auxiliary variables for - each constant head. The values of auxiliary variables must be present - for each constant head. The values must be specified in the order of - the auxiliary variables specified in the OPTIONS block. If the - package supports time series and the Options block includes a - TIMESERIESFILE entry (see the "Time-Variable Input" section), values - can be obtained from a time series by entering the time-series name - in place of a numeric value. - * boundname (string) name of the constant head boundary cell. BOUNDNAME - is an ASCII character variable that can contain as many as 40 - characters. If BOUNDNAME contains spaces in it, then the entire name - must be enclosed within single quotes. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - auxiliary = ListTemplateGenerator(('gwf6', 'chd', 'options', - 'auxiliary')) - ts_filerecord = ListTemplateGenerator(('gwf6', 'chd', 'options', - 'ts_filerecord')) - obs_filerecord = ListTemplateGenerator(('gwf6', 'chd', 'options', - 'obs_filerecord')) - stress_period_data = ListTemplateGenerator(('gwf6', 'chd', 'period', - 'stress_period_data')) - package_abbr = "gwfchd" - _package_type = "chd" - dfn_file_name = "gwf-chd.dfn" - - dfn = [["block options", "name auxiliary", "type string", - "shape (naux)", "reader urword", "optional true"], - ["block options", "name auxmultname", "type string", "shape", - "reader urword", "optional true"], - ["block options", "name boundnames", "type keyword", "shape", - "reader urword", "optional true"], - ["block options", "name print_input", "type keyword", - "reader urword", "optional true"], - ["block options", "name print_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name save_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name ts_filerecord", - "type record ts6 filein ts6_filename", "shape", "reader urword", - "tagged true", "optional true", "construct_package ts", - "construct_data timeseries", "parameter_name timeseries"], - ["block options", "name ts6", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name filein", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name ts6_filename", "type string", - "preserve_case true", "in_record true", "reader urword", - "optional false", "tagged false"], - ["block options", "name obs_filerecord", - "type record obs6 filein obs6_filename", "shape", "reader urword", - "tagged true", "optional true", "construct_package obs", - "construct_data continuous", "parameter_name observations"], - ["block options", "name obs6", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name obs6_filename", "type string", - "preserve_case true", "in_record true", "tagged false", - "reader urword", "optional false"], - ["block dimensions", "name maxbound", "type integer", - "reader urword", "optional false"], - ["block period", "name iper", "type integer", - "block_variable True", "in_record true", "tagged false", "shape", - "valid", "reader urword", "optional false"], - ["block period", "name stress_period_data", - "type recarray cellid head aux boundname", "shape (maxbound)", - "reader urword"], - ["block period", "name cellid", "type integer", - "shape (ncelldim)", "tagged false", "in_record true", - "reader urword"], - ["block period", "name head", "type double precision", "shape", - "tagged false", "in_record true", "reader urword", - "time_series true"], - ["block period", "name aux", "type double precision", - "in_record true", "tagged false", "shape (naux)", "reader urword", - "optional true", "time_series true"], - ["block period", "name boundname", "type string", "shape", - "tagged false", "in_record true", "reader urword", - "optional true"]] - - def __init__(self, model, loading_package=False, auxiliary=None, - auxmultname=None, boundnames=None, print_input=None, - print_flows=None, save_flows=None, timeseries=None, - observations=None, maxbound=None, stress_period_data=None, - filename=None, pname=None, parent_file=None): - super(ModflowGwfchd, self).__init__(model, "chd", filename, pname, - loading_package, parent_file) - - # set up variables - self.auxiliary = self.build_mfdata("auxiliary", auxiliary) - self.auxmultname = self.build_mfdata("auxmultname", auxmultname) - self.boundnames = self.build_mfdata("boundnames", boundnames) - self.print_input = self.build_mfdata("print_input", print_input) - self.print_flows = self.build_mfdata("print_flows", print_flows) - self.save_flows = self.build_mfdata("save_flows", save_flows) - self._ts_filerecord = self.build_mfdata("ts_filerecord", - None) - self._ts_package = self.build_child_package("ts", timeseries, - "timeseries", - self._ts_filerecord) - self._obs_filerecord = self.build_mfdata("obs_filerecord", - None) - self._obs_package = self.build_child_package("obs", observations, - "continuous", - self._obs_filerecord) - self.maxbound = self.build_mfdata("maxbound", maxbound) - self.stress_period_data = self.build_mfdata("stress_period_data", - stress_period_data) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ListTemplateGenerator + + +class ModflowGwfchd(mfpackage.MFPackage): + """ + ModflowGwfchd defines a chd package within a gwf6 model. + + Parameters + ---------- + model : MFModel + Model that this package is a part of. Package is automatically + added to model when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + auxiliary : [string] + * auxiliary (string) defines an array of one or more auxiliary variable + names. There is no limit on the number of auxiliary variables that + can be provided on this line; however, lists of information provided + in subsequent blocks must have a column of data for each auxiliary + variable name defined here. The number of auxiliary variables + detected on this line determines the value for naux. Comments cannot + be provided anywhere on this line as they will be interpreted as + auxiliary variable names. Auxiliary variables may not be used by the + package, but they will be available for use by other parts of the + program. The program will terminate with an error if auxiliary + variables are specified on more than one line in the options block. + auxmultname : string + * auxmultname (string) name of auxiliary variable to be used as + multiplier of CHD head value. + boundnames : boolean + * boundnames (boolean) keyword to indicate that boundary names may be + provided with the list of constant-head cells. + print_input : boolean + * print_input (boolean) keyword to indicate that the list of constant- + head information will be written to the listing file immediately + after it is read. + print_flows : boolean + * print_flows (boolean) keyword to indicate that the list of constant- + head flow rates will be printed to the listing file for every stress + period time step in which "BUDGET PRINT" is specified in Output + Control. If there is no Output Control option and "PRINT_FLOWS" is + specified, then flow rates are printed for the last time step of each + stress period. + save_flows : boolean + * save_flows (boolean) keyword to indicate that constant-head flow + terms will be written to the file specified with "BUDGET FILEOUT" in + Output Control. + timeseries : {varname:data} or timeseries data + * Contains data for the ts package. Data can be stored in a dictionary + containing data for the ts package with variable names as keys and + package data as values. Data just for the timeseries variable is also + acceptable. See ts package documentation for more information. + observations : {varname:data} or continuous data + * Contains data for the obs package. Data can be stored in a dictionary + containing data for the obs package with variable names as keys and + package data as values. Data just for the observations variable is + also acceptable. See obs package documentation for more information. + maxbound : integer + * maxbound (integer) integer value specifying the maximum number of + constant-head cells that will be specified for use during any stress + period. + stress_period_data : [cellid, head, aux, boundname] + * cellid ((integer, ...)) is the cell identifier, and depends on the + type of grid that is used for the simulation. For a structured grid + that uses the DIS input file, CELLID is the layer, row, and column. + For a grid that uses the DISV input file, CELLID is the layer and + CELL2D number. If the model uses the unstructured discretization + (DISU) input file, CELLID is the node number for the cell. + * head (double) is the head at the boundary. + * aux (double) represents the values of the auxiliary variables for + each constant head. The values of auxiliary variables must be present + for each constant head. The values must be specified in the order of + the auxiliary variables specified in the OPTIONS block. If the + package supports time series and the Options block includes a + TIMESERIESFILE entry (see the "Time-Variable Input" section), values + can be obtained from a time series by entering the time-series name + in place of a numeric value. + * boundname (string) name of the constant head boundary cell. BOUNDNAME + is an ASCII character variable that can contain as many as 40 + characters. If BOUNDNAME contains spaces in it, then the entire name + must be enclosed within single quotes. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + auxiliary = ListTemplateGenerator(('gwf6', 'chd', 'options', + 'auxiliary')) + ts_filerecord = ListTemplateGenerator(('gwf6', 'chd', 'options', + 'ts_filerecord')) + obs_filerecord = ListTemplateGenerator(('gwf6', 'chd', 'options', + 'obs_filerecord')) + stress_period_data = ListTemplateGenerator(('gwf6', 'chd', 'period', + 'stress_period_data')) + package_abbr = "gwfchd" + _package_type = "chd" + dfn_file_name = "gwf-chd.dfn" + + dfn = [["block options", "name auxiliary", "type string", + "shape (naux)", "reader urword", "optional true"], + ["block options", "name auxmultname", "type string", "shape", + "reader urword", "optional true"], + ["block options", "name boundnames", "type keyword", "shape", + "reader urword", "optional true"], + ["block options", "name print_input", "type keyword", + "reader urword", "optional true"], + ["block options", "name print_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name save_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name ts_filerecord", + "type record ts6 filein ts6_filename", "shape", "reader urword", + "tagged true", "optional true", "construct_package ts", + "construct_data timeseries", "parameter_name timeseries"], + ["block options", "name ts6", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name filein", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name ts6_filename", "type string", + "preserve_case true", "in_record true", "reader urword", + "optional false", "tagged false"], + ["block options", "name obs_filerecord", + "type record obs6 filein obs6_filename", "shape", "reader urword", + "tagged true", "optional true", "construct_package obs", + "construct_data continuous", "parameter_name observations"], + ["block options", "name obs6", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name obs6_filename", "type string", + "preserve_case true", "in_record true", "tagged false", + "reader urword", "optional false"], + ["block dimensions", "name maxbound", "type integer", + "reader urword", "optional false"], + ["block period", "name iper", "type integer", + "block_variable True", "in_record true", "tagged false", "shape", + "valid", "reader urword", "optional false"], + ["block period", "name stress_period_data", + "type recarray cellid head aux boundname", "shape (maxbound)", + "reader urword"], + ["block period", "name cellid", "type integer", + "shape (ncelldim)", "tagged false", "in_record true", + "reader urword"], + ["block period", "name head", "type double precision", "shape", + "tagged false", "in_record true", "reader urword", + "time_series true"], + ["block period", "name aux", "type double precision", + "in_record true", "tagged false", "shape (naux)", "reader urword", + "optional true", "time_series true"], + ["block period", "name boundname", "type string", "shape", + "tagged false", "in_record true", "reader urword", + "optional true"]] + + def __init__(self, model, loading_package=False, auxiliary=None, + auxmultname=None, boundnames=None, print_input=None, + print_flows=None, save_flows=None, timeseries=None, + observations=None, maxbound=None, stress_period_data=None, + filename=None, pname=None, parent_file=None): + super(ModflowGwfchd, self).__init__(model, "chd", filename, pname, + loading_package, parent_file) + + # set up variables + self.auxiliary = self.build_mfdata("auxiliary", auxiliary) + self.auxmultname = self.build_mfdata("auxmultname", auxmultname) + self.boundnames = self.build_mfdata("boundnames", boundnames) + self.print_input = self.build_mfdata("print_input", print_input) + self.print_flows = self.build_mfdata("print_flows", print_flows) + self.save_flows = self.build_mfdata("save_flows", save_flows) + self._ts_filerecord = self.build_mfdata("ts_filerecord", + None) + self._ts_package = self.build_child_package("ts", timeseries, + "timeseries", + self._ts_filerecord) + self._obs_filerecord = self.build_mfdata("obs_filerecord", + None) + self._obs_package = self.build_child_package("obs", observations, + "continuous", + self._obs_filerecord) + self.maxbound = self.build_mfdata("maxbound", maxbound) + self.stress_period_data = self.build_mfdata("stress_period_data", + stress_period_data) + self._init_complete = True diff --git a/flopy/mf6/modflow/mfgwfdis.py b/flopy/mf6/modflow/mfgwfdis.py index b879a32031..740e73b01e 100644 --- a/flopy/mf6/modflow/mfgwfdis.py +++ b/flopy/mf6/modflow/mfgwfdis.py @@ -1,141 +1,141 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ArrayTemplateGenerator - - -class ModflowGwfdis(mfpackage.MFPackage): - """ - ModflowGwfdis defines a dis package within a gwf6 model. - - Parameters - ---------- - model : MFModel - Model that this package is a part of. Package is automatically - added to model when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - length_units : string - * length_units (string) is the length units used for this model. Values - can be "FEET", "METERS", or "CENTIMETERS". If not specified, the - default is "UNKNOWN". - nogrb : boolean - * nogrb (boolean) keyword to deactivate writing of the binary grid - file. - xorigin : double - * xorigin (double) x-position of the lower-left corner of the model - grid. A default value of zero is assigned if not specified. The value - for XORIGIN does not affect the model simulation, but it is written - to the binary grid file so that postprocessors can locate the grid in - space. - yorigin : double - * yorigin (double) y-position of the lower-left corner of the model - grid. If not specified, then a default value equal to zero is used. - The value for YORIGIN does not affect the model simulation, but it is - written to the binary grid file so that postprocessors can locate the - grid in space. - angrot : double - * angrot (double) counter-clockwise rotation angle (in degrees) of the - lower-left corner of the model grid. If not specified, then a default - value of 0.0 is assigned. The value for ANGROT does not affect the - model simulation, but it is written to the binary grid file so that - postprocessors can locate the grid in space. - nlay : integer - * nlay (integer) is the number of layers in the model grid. - nrow : integer - * nrow (integer) is the number of rows in the model grid. - ncol : integer - * ncol (integer) is the number of columns in the model grid. - delr : [double] - * delr (double) is the is the column spacing in the row direction. - delc : [double] - * delc (double) is the is the row spacing in the column direction. - top : [double] - * top (double) is the top elevation for each cell in the top model - layer. - botm : [double] - * botm (double) is the bottom elevation for each cell. - idomain : [integer] - * idomain (integer) is an optional array that characterizes the - existence status of a cell. If the IDOMAIN array is not specified, - then all model cells exist within the solution. If the IDOMAIN value - for a cell is 0, the cell does not exist in the simulation. Input and - output values will be read and written for the cell, but internal to - the program, the cell is excluded from the solution. If the IDOMAIN - value for a cell is 1, the cell exists in the simulation. If the - IDOMAIN value for a cell is -1, the cell does not exist in the - simulation. Furthermore, the first existing cell above will be - connected to the first existing cell below. This type of cell is - referred to as a "vertical pass through" cell. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - delr = ArrayTemplateGenerator(('gwf6', 'dis', 'griddata', 'delr')) - delc = ArrayTemplateGenerator(('gwf6', 'dis', 'griddata', 'delc')) - top = ArrayTemplateGenerator(('gwf6', 'dis', 'griddata', 'top')) - botm = ArrayTemplateGenerator(('gwf6', 'dis', 'griddata', 'botm')) - idomain = ArrayTemplateGenerator(('gwf6', 'dis', 'griddata', - 'idomain')) - package_abbr = "gwfdis" - _package_type = "dis" - dfn_file_name = "gwf-dis.dfn" - - dfn = [["block options", "name length_units", "type string", - "reader urword", "optional true"], - ["block options", "name nogrb", "type keyword", "reader urword", - "optional true"], - ["block options", "name xorigin", "type double precision", - "reader urword", "optional true"], - ["block options", "name yorigin", "type double precision", - "reader urword", "optional true"], - ["block options", "name angrot", "type double precision", - "reader urword", "optional true"], - ["block dimensions", "name nlay", "type integer", - "reader urword", "optional false", "default_value 1"], - ["block dimensions", "name nrow", "type integer", - "reader urword", "optional false", "default_value 2"], - ["block dimensions", "name ncol", "type integer", - "reader urword", "optional false", "default_value 2"], - ["block griddata", "name delr", "type double precision", - "shape (ncol)", "reader readarray", "default_value 1.0"], - ["block griddata", "name delc", "type double precision", - "shape (nrow)", "reader readarray", "default_value 1.0"], - ["block griddata", "name top", "type double precision", - "shape (ncol, nrow)", "reader readarray", "default_value 1.0"], - ["block griddata", "name botm", "type double precision", - "shape (ncol, nrow, nlay)", "reader readarray", "layered true", - "default_value 0."], - ["block griddata", "name idomain", "type integer", - "shape (ncol, nrow, nlay)", "reader readarray", "layered true", - "optional true"]] - - def __init__(self, model, loading_package=False, length_units=None, - nogrb=None, xorigin=None, yorigin=None, angrot=None, nlay=1, - nrow=2, ncol=2, delr=1.0, delc=1.0, top=1.0, botm=0., - idomain=None, filename=None, pname=None, parent_file=None): - super(ModflowGwfdis, self).__init__(model, "dis", filename, pname, - loading_package, parent_file) - - # set up variables - self.length_units = self.build_mfdata("length_units", length_units) - self.nogrb = self.build_mfdata("nogrb", nogrb) - self.xorigin = self.build_mfdata("xorigin", xorigin) - self.yorigin = self.build_mfdata("yorigin", yorigin) - self.angrot = self.build_mfdata("angrot", angrot) - self.nlay = self.build_mfdata("nlay", nlay) - self.nrow = self.build_mfdata("nrow", nrow) - self.ncol = self.build_mfdata("ncol", ncol) - self.delr = self.build_mfdata("delr", delr) - self.delc = self.build_mfdata("delc", delc) - self.top = self.build_mfdata("top", top) - self.botm = self.build_mfdata("botm", botm) - self.idomain = self.build_mfdata("idomain", idomain) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ArrayTemplateGenerator + + +class ModflowGwfdis(mfpackage.MFPackage): + """ + ModflowGwfdis defines a dis package within a gwf6 model. + + Parameters + ---------- + model : MFModel + Model that this package is a part of. Package is automatically + added to model when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + length_units : string + * length_units (string) is the length units used for this model. Values + can be "FEET", "METERS", or "CENTIMETERS". If not specified, the + default is "UNKNOWN". + nogrb : boolean + * nogrb (boolean) keyword to deactivate writing of the binary grid + file. + xorigin : double + * xorigin (double) x-position of the lower-left corner of the model + grid. A default value of zero is assigned if not specified. The value + for XORIGIN does not affect the model simulation, but it is written + to the binary grid file so that postprocessors can locate the grid in + space. + yorigin : double + * yorigin (double) y-position of the lower-left corner of the model + grid. If not specified, then a default value equal to zero is used. + The value for YORIGIN does not affect the model simulation, but it is + written to the binary grid file so that postprocessors can locate the + grid in space. + angrot : double + * angrot (double) counter-clockwise rotation angle (in degrees) of the + lower-left corner of the model grid. If not specified, then a default + value of 0.0 is assigned. The value for ANGROT does not affect the + model simulation, but it is written to the binary grid file so that + postprocessors can locate the grid in space. + nlay : integer + * nlay (integer) is the number of layers in the model grid. + nrow : integer + * nrow (integer) is the number of rows in the model grid. + ncol : integer + * ncol (integer) is the number of columns in the model grid. + delr : [double] + * delr (double) is the is the column spacing in the row direction. + delc : [double] + * delc (double) is the is the row spacing in the column direction. + top : [double] + * top (double) is the top elevation for each cell in the top model + layer. + botm : [double] + * botm (double) is the bottom elevation for each cell. + idomain : [integer] + * idomain (integer) is an optional array that characterizes the + existence status of a cell. If the IDOMAIN array is not specified, + then all model cells exist within the solution. If the IDOMAIN value + for a cell is 0, the cell does not exist in the simulation. Input and + output values will be read and written for the cell, but internal to + the program, the cell is excluded from the solution. If the IDOMAIN + value for a cell is 1, the cell exists in the simulation. If the + IDOMAIN value for a cell is -1, the cell does not exist in the + simulation. Furthermore, the first existing cell above will be + connected to the first existing cell below. This type of cell is + referred to as a "vertical pass through" cell. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + delr = ArrayTemplateGenerator(('gwf6', 'dis', 'griddata', 'delr')) + delc = ArrayTemplateGenerator(('gwf6', 'dis', 'griddata', 'delc')) + top = ArrayTemplateGenerator(('gwf6', 'dis', 'griddata', 'top')) + botm = ArrayTemplateGenerator(('gwf6', 'dis', 'griddata', 'botm')) + idomain = ArrayTemplateGenerator(('gwf6', 'dis', 'griddata', + 'idomain')) + package_abbr = "gwfdis" + _package_type = "dis" + dfn_file_name = "gwf-dis.dfn" + + dfn = [["block options", "name length_units", "type string", + "reader urword", "optional true"], + ["block options", "name nogrb", "type keyword", "reader urword", + "optional true"], + ["block options", "name xorigin", "type double precision", + "reader urword", "optional true"], + ["block options", "name yorigin", "type double precision", + "reader urword", "optional true"], + ["block options", "name angrot", "type double precision", + "reader urword", "optional true"], + ["block dimensions", "name nlay", "type integer", + "reader urword", "optional false", "default_value 1"], + ["block dimensions", "name nrow", "type integer", + "reader urword", "optional false", "default_value 2"], + ["block dimensions", "name ncol", "type integer", + "reader urword", "optional false", "default_value 2"], + ["block griddata", "name delr", "type double precision", + "shape (ncol)", "reader readarray", "default_value 1.0"], + ["block griddata", "name delc", "type double precision", + "shape (nrow)", "reader readarray", "default_value 1.0"], + ["block griddata", "name top", "type double precision", + "shape (ncol, nrow)", "reader readarray", "default_value 1.0"], + ["block griddata", "name botm", "type double precision", + "shape (ncol, nrow, nlay)", "reader readarray", "layered true", + "default_value 0."], + ["block griddata", "name idomain", "type integer", + "shape (ncol, nrow, nlay)", "reader readarray", "layered true", + "optional true"]] + + def __init__(self, model, loading_package=False, length_units=None, + nogrb=None, xorigin=None, yorigin=None, angrot=None, nlay=1, + nrow=2, ncol=2, delr=1.0, delc=1.0, top=1.0, botm=0., + idomain=None, filename=None, pname=None, parent_file=None): + super(ModflowGwfdis, self).__init__(model, "dis", filename, pname, + loading_package, parent_file) + + # set up variables + self.length_units = self.build_mfdata("length_units", length_units) + self.nogrb = self.build_mfdata("nogrb", nogrb) + self.xorigin = self.build_mfdata("xorigin", xorigin) + self.yorigin = self.build_mfdata("yorigin", yorigin) + self.angrot = self.build_mfdata("angrot", angrot) + self.nlay = self.build_mfdata("nlay", nlay) + self.nrow = self.build_mfdata("nrow", nrow) + self.ncol = self.build_mfdata("ncol", ncol) + self.delr = self.build_mfdata("delr", delr) + self.delc = self.build_mfdata("delc", delc) + self.top = self.build_mfdata("top", top) + self.botm = self.build_mfdata("botm", botm) + self.idomain = self.build_mfdata("idomain", idomain) + self._init_complete = True diff --git a/flopy/mf6/modflow/mfgwfdisu.py b/flopy/mf6/modflow/mfgwfdisu.py index eb441fd2aa..e325959f1a 100644 --- a/flopy/mf6/modflow/mfgwfdisu.py +++ b/flopy/mf6/modflow/mfgwfdisu.py @@ -1,269 +1,270 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ArrayTemplateGenerator, ListTemplateGenerator - - -class ModflowGwfdisu(mfpackage.MFPackage): - """ - ModflowGwfdisu defines a disu package within a gwf6 model. - - Parameters - ---------- - model : MFModel - Model that this package is a part of. Package is automatically - added to model when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - length_units : string - * length_units (string) is the length units used for this model. Values - can be "FEET", "METERS", or "CENTIMETERS". If not specified, the - default is "UNKNOWN". - nogrb : boolean - * nogrb (boolean) keyword to deactivate writing of the binary grid - file. - xorigin : double - * xorigin (double) x-position of the origin used for model grid - vertices. This value should be provided in a real-world coordinate - system. A default value of zero is assigned if not specified. The - value for XORIGIN does not affect the model simulation, but it is - written to the binary grid file so that postprocessors can locate the - grid in space. - yorigin : double - * yorigin (double) y-position of the origin used for model grid - vertices. This value should be provided in a real-world coordinate - system. If not specified, then a default value equal to zero is used. - The value for YORIGIN does not affect the model simulation, but it is - written to the binary grid file so that postprocessors can locate the - grid in space. - angrot : double - * angrot (double) counter-clockwise rotation angle (in degrees) of the - model grid coordinate system relative to a real-world coordinate - system. If not specified, then a default value of 0.0 is assigned. - The value for ANGROT does not affect the model simulation, but it is - written to the binary grid file so that postprocessors can locate the - grid in space. - nodes : integer - * nodes (integer) is the number of cells in the model grid. - nja : integer - * nja (integer) is the sum of the number of connections and NODES. When - calculating the total number of connections, the connection between - cell n and cell m is considered to be different from the connection - between cell m and cell n. Thus, NJA is equal to the total number of - connections, including n to m and m to n, and the total number of - cells. - nvert : integer - * nvert (integer) is the total number of (x, y) vertex pairs used to - define the plan-view shape of each cell in the model grid. If NVERT - is not specified or is specified as zero, then the VERTICES and - CELL2D blocks below are not read. NVERT and the accompanying VERTICES - and CELL2D blocks should be specified for most simulations. If the - XT3D or SAVE_SPECIFIC_DISCHARGE options are specified in the NPF - Package, these this information is required. - top : [double] - * top (double) is the top elevation for each cell in the model grid. - bot : [double] - * bot (double) is the bottom elevation for each cell. - area : [double] - * area (double) is the cell surface area (in plan view). - iac : [integer] - * iac (integer) is the number of connections (plus 1) for each cell. - The sum of all the entries in IAC must be equal to NJA. - ja : [integer] - * ja (integer) is a list of cell number (n) followed by its connecting - cell numbers (m) for each of the m cells connected to cell n. The - number of values to provide for cell n is IAC(n). This list is - sequentially provided for the first to the last cell. The first value - in the list must be cell n itself, and the remaining cells must be - listed in an increasing order (sorted from lowest number to highest). - Note that the cell and its connections are only supplied for the GWF - cells and their connections to the other GWF cells. Also note that - the JA list input may be divided such that every node and its - connectivity list can be on a separate line for ease in readability - of the file. To further ease readability of the file, the node number - of the cell whose connectivity is subsequently listed, may be - expressed as a negative number, the sign of which is subsequently - converted to positive by the code. - ihc : [integer] - * ihc (integer) is an index array indicating the direction between node - n and all of its m connections. If IHC = 0 then cell n and cell m are - connected in the vertical direction. Cell n overlies cell m if the - cell number for n is less than m; cell m overlies cell n if the cell - number for m is less than n. If IHC = 1 then cell n and cell m are - connected in the horizontal direction. If IHC = 2 then cell n and - cell m are connected in the horizontal direction, and the connection - is vertically staggered. A vertically staggered connection is one in - which a cell is horizontally connected to more than one cell in a - horizontal connection. - cl12 : [double] - * cl12 (double) is the array containing connection lengths between the - center of cell n and the shared face with each adjacent m cell. - hwva : [double] - * hwva (double) is a symmetric array of size NJA. For horizontal - connections, entries in HWVA are the horizontal width perpendicular - to flow. For vertical connections, entries in HWVA are the vertical - area for flow. Thus, values in the HWVA array contain dimensions of - both length and area. Entries in the HWVA array have a one-to-one - correspondence with the connections specified in the JA array. - Likewise, there is a one-to-one correspondence between entries in the - HWVA array and entries in the IHC array, which specifies the - connection type (horizontal or vertical). Entries in the HWVA array - must be symmetric; the program will terminate with an error if the - value for HWVA for an n to m connection does not equal the value for - HWVA for the corresponding n to m connection. - angldegx : [double] - * angldegx (double) is the angle (in degrees) between the horizontal - x-axis and the outward normal to the face between a cell and its - connecting cells. The angle varies between zero and 360.0 degrees, - where zero degrees points in the positive x-axis direction, and 90 - degrees points in the positive y-axis direction. ANGLDEGX is only - needed if horizontal anisotropy is specified in the NPF Package, if - the XT3D option is used in the NPF Package, or if the - SAVE_SPECIFIC_DISCHARGE option is specifed in the NPF Package. - ANGLDEGX does not need to be specified if these conditions are not - met. ANGLDEGX is of size NJA; values specified for vertical - connections and for the diagonal position are not used. Note that - ANGLDEGX is read in degrees, which is different from MODFLOW-USG, - which reads a similar variable (ANGLEX) in radians. - vertices : [iv, xv, yv] - * iv (integer) is the vertex number. Records in the VERTICES block must - be listed in consecutive order from 1 to NVERT. - * xv (double) is the x-coordinate for the vertex. - * yv (double) is the y-coordinate for the vertex. - cell2d : [icell2d, xc, yc, ncvert, icvert] - * icell2d (integer) is the cell2d number. Records in the CELL2D block - must be listed in consecutive order from 1 to NODES. - * xc (double) is the x-coordinate for the cell center. - * yc (double) is the y-coordinate for the cell center. - * ncvert (integer) is the number of vertices required to define the - cell. There may be a different number of vertices for each cell. - * icvert (integer) is an array of integer values containing vertex - numbers (in the VERTICES block) used to define the cell. Vertices - must be listed in clockwise order. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - top = ArrayTemplateGenerator(('gwf6', 'disu', 'griddata', 'top')) - bot = ArrayTemplateGenerator(('gwf6', 'disu', 'griddata', 'bot')) - area = ArrayTemplateGenerator(('gwf6', 'disu', 'griddata', 'area')) - iac = ArrayTemplateGenerator(('gwf6', 'disu', 'connectiondata', - 'iac')) - ja = ArrayTemplateGenerator(('gwf6', 'disu', 'connectiondata', - 'ja')) - ihc = ArrayTemplateGenerator(('gwf6', 'disu', 'connectiondata', - 'ihc')) - cl12 = ArrayTemplateGenerator(('gwf6', 'disu', 'connectiondata', - 'cl12')) - hwva = ArrayTemplateGenerator(('gwf6', 'disu', 'connectiondata', - 'hwva')) - angldegx = ArrayTemplateGenerator(('gwf6', 'disu', 'connectiondata', - 'angldegx')) - vertices = ListTemplateGenerator(('gwf6', 'disu', 'vertices', - 'vertices')) - cell2d = ListTemplateGenerator(('gwf6', 'disu', 'cell2d', 'cell2d')) - package_abbr = "gwfdisu" - _package_type = "disu" - dfn_file_name = "gwf-disu.dfn" - - dfn = [["block options", "name length_units", "type string", - "reader urword", "optional true"], - ["block options", "name nogrb", "type keyword", "reader urword", - "optional true"], - ["block options", "name xorigin", "type double precision", - "reader urword", "optional true"], - ["block options", "name yorigin", "type double precision", - "reader urword", "optional true"], - ["block options", "name angrot", "type double precision", - "reader urword", "optional true"], - ["block dimensions", "name nodes", "type integer", - "reader urword", "optional false"], - ["block dimensions", "name nja", "type integer", "reader urword", - "optional false"], - ["block dimensions", "name nvert", "type integer", - "reader urword", "optional true"], - ["block griddata", "name top", "type double precision", - "shape (nodes)", "reader readarray"], - ["block griddata", "name bot", "type double precision", - "shape (nodes)", "reader readarray"], - ["block griddata", "name area", "type double precision", - "shape (nodes)", "reader readarray"], - ["block connectiondata", "name iac", "type integer", - "shape (nodes)", "reader readarray"], - ["block connectiondata", "name ja", "type integer", - "shape (nja)", "reader readarray", "numeric_index true"], - ["block connectiondata", "name ihc", "type integer", - "shape (nja)", "reader readarray"], - ["block connectiondata", "name cl12", "type double precision", - "shape (nja)", "reader readarray"], - ["block connectiondata", "name hwva", "type double precision", - "shape (nja)", "reader readarray"], - ["block connectiondata", "name angldegx", - "type double precision", "optional true", "shape (nja)", - "reader readarray"], - ["block vertices", "name vertices", "type recarray iv xv yv", - "reader urword", "optional false"], - ["block vertices", "name iv", "type integer", "in_record true", - "tagged false", "reader urword", "optional false", - "numeric_index true"], - ["block vertices", "name xv", "type double precision", - "in_record true", "tagged false", "reader urword", - "optional false"], - ["block vertices", "name yv", "type double precision", - "in_record true", "tagged false", "reader urword", - "optional false"], - ["block cell2d", "name cell2d", - "type recarray icell2d xc yc ncvert icvert", "reader urword", - "optional false"], - ["block cell2d", "name icell2d", "type integer", - "in_record true", "tagged false", "reader urword", - "optional false", "numeric_index true"], - ["block cell2d", "name xc", "type double precision", - "in_record true", "tagged false", "reader urword", - "optional false"], - ["block cell2d", "name yc", "type double precision", - "in_record true", "tagged false", "reader urword", - "optional false"], - ["block cell2d", "name ncvert", "type integer", "in_record true", - "tagged false", "reader urword", "optional false"], - ["block cell2d", "name icvert", "type integer", "shape (ncvert)", - "in_record true", "tagged false", "reader urword", - "optional false"]] - - def __init__(self, model, loading_package=False, length_units=None, - nogrb=None, xorigin=None, yorigin=None, angrot=None, - nodes=None, nja=None, nvert=None, top=None, bot=None, - area=None, iac=None, ja=None, ihc=None, cl12=None, hwva=None, - angldegx=None, vertices=None, cell2d=None, filename=None, - pname=None, parent_file=None): - super(ModflowGwfdisu, self).__init__(model, "disu", filename, pname, - loading_package, parent_file) - - # set up variables - self.length_units = self.build_mfdata("length_units", length_units) - self.nogrb = self.build_mfdata("nogrb", nogrb) - self.xorigin = self.build_mfdata("xorigin", xorigin) - self.yorigin = self.build_mfdata("yorigin", yorigin) - self.angrot = self.build_mfdata("angrot", angrot) - self.nodes = self.build_mfdata("nodes", nodes) - self.nja = self.build_mfdata("nja", nja) - self.nvert = self.build_mfdata("nvert", nvert) - self.top = self.build_mfdata("top", top) - self.bot = self.build_mfdata("bot", bot) - self.area = self.build_mfdata("area", area) - self.iac = self.build_mfdata("iac", iac) - self.ja = self.build_mfdata("ja", ja) - self.ihc = self.build_mfdata("ihc", ihc) - self.cl12 = self.build_mfdata("cl12", cl12) - self.hwva = self.build_mfdata("hwva", hwva) - self.angldegx = self.build_mfdata("angldegx", angldegx) - self.vertices = self.build_mfdata("vertices", vertices) - self.cell2d = self.build_mfdata("cell2d", cell2d) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ArrayTemplateGenerator, ListTemplateGenerator + + +class ModflowGwfdisu(mfpackage.MFPackage): + """ + ModflowGwfdisu defines a disu package within a gwf6 model. + + Parameters + ---------- + model : MFModel + Model that this package is a part of. Package is automatically + added to model when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + length_units : string + * length_units (string) is the length units used for this model. Values + can be "FEET", "METERS", or "CENTIMETERS". If not specified, the + default is "UNKNOWN". + nogrb : boolean + * nogrb (boolean) keyword to deactivate writing of the binary grid + file. + xorigin : double + * xorigin (double) x-position of the origin used for model grid + vertices. This value should be provided in a real-world coordinate + system. A default value of zero is assigned if not specified. The + value for XORIGIN does not affect the model simulation, but it is + written to the binary grid file so that postprocessors can locate the + grid in space. + yorigin : double + * yorigin (double) y-position of the origin used for model grid + vertices. This value should be provided in a real-world coordinate + system. If not specified, then a default value equal to zero is used. + The value for YORIGIN does not affect the model simulation, but it is + written to the binary grid file so that postprocessors can locate the + grid in space. + angrot : double + * angrot (double) counter-clockwise rotation angle (in degrees) of the + model grid coordinate system relative to a real-world coordinate + system. If not specified, then a default value of 0.0 is assigned. + The value for ANGROT does not affect the model simulation, but it is + written to the binary grid file so that postprocessors can locate the + grid in space. + nodes : integer + * nodes (integer) is the number of cells in the model grid. + nja : integer + * nja (integer) is the sum of the number of connections and NODES. When + calculating the total number of connections, the connection between + cell n and cell m is considered to be different from the connection + between cell m and cell n. Thus, NJA is equal to the total number of + connections, including n to m and m to n, and the total number of + cells. + nvert : integer + * nvert (integer) is the total number of (x, y) vertex pairs used to + define the plan-view shape of each cell in the model grid. If NVERT + is not specified or is specified as zero, then the VERTICES and + CELL2D blocks below are not read. NVERT and the accompanying VERTICES + and CELL2D blocks should be specified for most simulations. If the + XT3D or SAVE_SPECIFIC_DISCHARGE options are specified in the NPF + Package, these this information is required. + top : [double] + * top (double) is the top elevation for each cell in the model grid. + bot : [double] + * bot (double) is the bottom elevation for each cell. + area : [double] + * area (double) is the cell surface area (in plan view). + iac : [integer] + * iac (integer) is the number of connections (plus 1) for each cell. + The sum of all the entries in IAC must be equal to NJA. + ja : [integer] + * ja (integer) is a list of cell number (n) followed by its connecting + cell numbers (m) for each of the m cells connected to cell n. The + number of values to provide for cell n is IAC(n). This list is + sequentially provided for the first to the last cell. The first value + in the list must be cell n itself, and the remaining cells must be + listed in an increasing order (sorted from lowest number to highest). + Note that the cell and its connections are only supplied for the GWF + cells and their connections to the other GWF cells. Also note that + the JA list input may be divided such that every node and its + connectivity list can be on a separate line for ease in readability + of the file. To further ease readability of the file, the node number + of the cell whose connectivity is subsequently listed, may be + expressed as a negative number, the sign of which is subsequently + converted to positive by the code. + ihc : [integer] + * ihc (integer) is an index array indicating the direction between node + n and all of its m connections. If IHC = 0 then cell n and cell m are + connected in the vertical direction. Cell n overlies cell m if the + cell number for n is less than m; cell m overlies cell n if the cell + number for m is less than n. If IHC = 1 then cell n and cell m are + connected in the horizontal direction. If IHC = 2 then cell n and + cell m are connected in the horizontal direction, and the connection + is vertically staggered. A vertically staggered connection is one in + which a cell is horizontally connected to more than one cell in a + horizontal connection. + cl12 : [double] + * cl12 (double) is the array containing connection lengths between the + center of cell n and the shared face with each adjacent m cell. + hwva : [double] + * hwva (double) is a symmetric array of size NJA. For horizontal + connections, entries in HWVA are the horizontal width perpendicular + to flow. For vertical connections, entries in HWVA are the vertical + area for flow. Thus, values in the HWVA array contain dimensions of + both length and area. Entries in the HWVA array have a one-to-one + correspondence with the connections specified in the JA array. + Likewise, there is a one-to-one correspondence between entries in the + HWVA array and entries in the IHC array, which specifies the + connection type (horizontal or vertical). Entries in the HWVA array + must be symmetric; the program will terminate with an error if the + value for HWVA for an n to m connection does not equal the value for + HWVA for the corresponding n to m connection. + angldegx : [double] + * angldegx (double) is the angle (in degrees) between the horizontal + x-axis and the outward normal to the face between a cell and its + connecting cells. The angle varies between zero and 360.0 degrees, + where zero degrees points in the positive x-axis direction, and 90 + degrees points in the positive y-axis direction. ANGLDEGX is only + needed if horizontal anisotropy is specified in the NPF Package, if + the XT3D option is used in the NPF Package, or if the + SAVE_SPECIFIC_DISCHARGE option is specifed in the NPF Package. + ANGLDEGX does not need to be specified if these conditions are not + met. ANGLDEGX is of size NJA; values specified for vertical + connections and for the diagonal position are not used. Note that + ANGLDEGX is read in degrees, which is different from MODFLOW-USG, + which reads a similar variable (ANGLEX) in radians. + vertices : [iv, xv, yv] + * iv (integer) is the vertex number. Records in the VERTICES block must + be listed in consecutive order from 1 to NVERT. + * xv (double) is the x-coordinate for the vertex. + * yv (double) is the y-coordinate for the vertex. + cell2d : [icell2d, xc, yc, ncvert, icvert] + * icell2d (integer) is the cell2d number. Records in the CELL2D block + must be listed in consecutive order from 1 to NODES. + * xc (double) is the x-coordinate for the cell center. + * yc (double) is the y-coordinate for the cell center. + * ncvert (integer) is the number of vertices required to define the + cell. There may be a different number of vertices for each cell. + * icvert (integer) is an array of integer values containing vertex + numbers (in the VERTICES block) used to define the cell. Vertices + must be listed in clockwise order. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + top = ArrayTemplateGenerator(('gwf6', 'disu', 'griddata', 'top')) + bot = ArrayTemplateGenerator(('gwf6', 'disu', 'griddata', 'bot')) + area = ArrayTemplateGenerator(('gwf6', 'disu', 'griddata', 'area')) + iac = ArrayTemplateGenerator(('gwf6', 'disu', 'connectiondata', + 'iac')) + ja = ArrayTemplateGenerator(('gwf6', 'disu', 'connectiondata', + 'ja')) + ihc = ArrayTemplateGenerator(('gwf6', 'disu', 'connectiondata', + 'ihc')) + cl12 = ArrayTemplateGenerator(('gwf6', 'disu', 'connectiondata', + 'cl12')) + hwva = ArrayTemplateGenerator(('gwf6', 'disu', 'connectiondata', + 'hwva')) + angldegx = ArrayTemplateGenerator(('gwf6', 'disu', 'connectiondata', + 'angldegx')) + vertices = ListTemplateGenerator(('gwf6', 'disu', 'vertices', + 'vertices')) + cell2d = ListTemplateGenerator(('gwf6', 'disu', 'cell2d', 'cell2d')) + package_abbr = "gwfdisu" + _package_type = "disu" + dfn_file_name = "gwf-disu.dfn" + + dfn = [["block options", "name length_units", "type string", + "reader urword", "optional true"], + ["block options", "name nogrb", "type keyword", "reader urword", + "optional true"], + ["block options", "name xorigin", "type double precision", + "reader urword", "optional true"], + ["block options", "name yorigin", "type double precision", + "reader urword", "optional true"], + ["block options", "name angrot", "type double precision", + "reader urword", "optional true"], + ["block dimensions", "name nodes", "type integer", + "reader urword", "optional false"], + ["block dimensions", "name nja", "type integer", "reader urword", + "optional false"], + ["block dimensions", "name nvert", "type integer", + "reader urword", "optional true"], + ["block griddata", "name top", "type double precision", + "shape (nodes)", "reader readarray"], + ["block griddata", "name bot", "type double precision", + "shape (nodes)", "reader readarray"], + ["block griddata", "name area", "type double precision", + "shape (nodes)", "reader readarray"], + ["block connectiondata", "name iac", "type integer", + "shape (nodes)", "reader readarray"], + ["block connectiondata", "name ja", "type integer", + "shape (nja)", "reader readarray", "numeric_index true", + "jagged_array iac"], + ["block connectiondata", "name ihc", "type integer", + "shape (nja)", "reader readarray", "jagged_array iac"], + ["block connectiondata", "name cl12", "type double precision", + "shape (nja)", "reader readarray", "jagged_array iac"], + ["block connectiondata", "name hwva", "type double precision", + "shape (nja)", "reader readarray", "jagged_array iac"], + ["block connectiondata", "name angldegx", + "type double precision", "optional true", "shape (nja)", + "reader readarray", "jagged_array iac"], + ["block vertices", "name vertices", "type recarray iv xv yv", + "reader urword", "optional false"], + ["block vertices", "name iv", "type integer", "in_record true", + "tagged false", "reader urword", "optional false", + "numeric_index true"], + ["block vertices", "name xv", "type double precision", + "in_record true", "tagged false", "reader urword", + "optional false"], + ["block vertices", "name yv", "type double precision", + "in_record true", "tagged false", "reader urword", + "optional false"], + ["block cell2d", "name cell2d", + "type recarray icell2d xc yc ncvert icvert", "reader urword", + "optional false"], + ["block cell2d", "name icell2d", "type integer", + "in_record true", "tagged false", "reader urword", + "optional false", "numeric_index true"], + ["block cell2d", "name xc", "type double precision", + "in_record true", "tagged false", "reader urword", + "optional false"], + ["block cell2d", "name yc", "type double precision", + "in_record true", "tagged false", "reader urword", + "optional false"], + ["block cell2d", "name ncvert", "type integer", "in_record true", + "tagged false", "reader urword", "optional false"], + ["block cell2d", "name icvert", "type integer", "shape (ncvert)", + "in_record true", "tagged false", "reader urword", + "optional false"]] + + def __init__(self, model, loading_package=False, length_units=None, + nogrb=None, xorigin=None, yorigin=None, angrot=None, + nodes=None, nja=None, nvert=None, top=None, bot=None, + area=None, iac=None, ja=None, ihc=None, cl12=None, hwva=None, + angldegx=None, vertices=None, cell2d=None, filename=None, + pname=None, parent_file=None): + super(ModflowGwfdisu, self).__init__(model, "disu", filename, pname, + loading_package, parent_file) + + # set up variables + self.length_units = self.build_mfdata("length_units", length_units) + self.nogrb = self.build_mfdata("nogrb", nogrb) + self.xorigin = self.build_mfdata("xorigin", xorigin) + self.yorigin = self.build_mfdata("yorigin", yorigin) + self.angrot = self.build_mfdata("angrot", angrot) + self.nodes = self.build_mfdata("nodes", nodes) + self.nja = self.build_mfdata("nja", nja) + self.nvert = self.build_mfdata("nvert", nvert) + self.top = self.build_mfdata("top", top) + self.bot = self.build_mfdata("bot", bot) + self.area = self.build_mfdata("area", area) + self.iac = self.build_mfdata("iac", iac) + self.ja = self.build_mfdata("ja", ja) + self.ihc = self.build_mfdata("ihc", ihc) + self.cl12 = self.build_mfdata("cl12", cl12) + self.hwva = self.build_mfdata("hwva", hwva) + self.angldegx = self.build_mfdata("angldegx", angldegx) + self.vertices = self.build_mfdata("vertices", vertices) + self.cell2d = self.build_mfdata("cell2d", cell2d) + self._init_complete = True diff --git a/flopy/mf6/modflow/mfgwfdisv.py b/flopy/mf6/modflow/mfgwfdisv.py index c6df0d014e..6ae5d1e41f 100644 --- a/flopy/mf6/modflow/mfgwfdisv.py +++ b/flopy/mf6/modflow/mfgwfdisv.py @@ -1,183 +1,183 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ArrayTemplateGenerator, ListTemplateGenerator - - -class ModflowGwfdisv(mfpackage.MFPackage): - """ - ModflowGwfdisv defines a disv package within a gwf6 model. - - Parameters - ---------- - model : MFModel - Model that this package is a part of. Package is automatically - added to model when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - length_units : string - * length_units (string) is the length units used for this model. Values - can be "FEET", "METERS", or "CENTIMETERS". If not specified, the - default is "UNKNOWN". - nogrb : boolean - * nogrb (boolean) keyword to deactivate writing of the binary grid - file. - xorigin : double - * xorigin (double) x-position of the origin used for model grid - vertices. This value should be provided in a real-world coordinate - system. A default value of zero is assigned if not specified. The - value for XORIGIN does not affect the model simulation, but it is - written to the binary grid file so that postprocessors can locate the - grid in space. - yorigin : double - * yorigin (double) y-position of the origin used for model grid - vertices. This value should be provided in a real-world coordinate - system. If not specified, then a default value equal to zero is used. - The value for YORIGIN does not affect the model simulation, but it is - written to the binary grid file so that postprocessors can locate the - grid in space. - angrot : double - * angrot (double) counter-clockwise rotation angle (in degrees) of the - model grid coordinate system relative to a real-world coordinate - system. If not specified, then a default value of 0.0 is assigned. - The value for ANGROT does not affect the model simulation, but it is - written to the binary grid file so that postprocessors can locate the - grid in space. - nlay : integer - * nlay (integer) is the number of layers in the model grid. - ncpl : integer - * ncpl (integer) is the number of cells per layer. This is a constant - value for the grid and it applies to all layers. - nvert : integer - * nvert (integer) is the total number of (x, y) vertex pairs used to - characterize the horizontal configuration of the model grid. - top : [double] - * top (double) is the top elevation for each cell in the top model - layer. - botm : [double] - * botm (double) is the bottom elevation for each cell. - idomain : [integer] - * idomain (integer) is an optional array that characterizes the - existence status of a cell. If the IDOMAIN array is not specified, - then all model cells exist within the solution. If the IDOMAIN value - for a cell is 0, the cell does not exist in the simulation. Input and - output values will be read and written for the cell, but internal to - the program, the cell is excluded from the solution. If the IDOMAIN - value for a cell is 1, the cell exists in the simulation. If the - IDOMAIN value for a cell is -1, the cell does not exist in the - simulation. Furthermore, the first existing cell above will be - connected to the first existing cell below. This type of cell is - referred to as a "vertical pass through" cell. - vertices : [iv, xv, yv] - * iv (integer) is the vertex number. Records in the VERTICES block must - be listed in consecutive order from 1 to NVERT. - * xv (double) is the x-coordinate for the vertex. - * yv (double) is the y-coordinate for the vertex. - cell2d : [icell2d, xc, yc, ncvert, icvert] - * icell2d (integer) is the CELL2D number. Records in the CELL2D block - must be listed in consecutive order from the first to the last. - * xc (double) is the x-coordinate for the cell center. - * yc (double) is the y-coordinate for the cell center. - * ncvert (integer) is the number of vertices required to define the - cell. There may be a different number of vertices for each cell. - * icvert (integer) is an array of integer values containing vertex - numbers (in the VERTICES block) used to define the cell. Vertices - must be listed in clockwise order. Cells that are connected must - share vertices. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - top = ArrayTemplateGenerator(('gwf6', 'disv', 'griddata', 'top')) - botm = ArrayTemplateGenerator(('gwf6', 'disv', 'griddata', 'botm')) - idomain = ArrayTemplateGenerator(('gwf6', 'disv', 'griddata', - 'idomain')) - vertices = ListTemplateGenerator(('gwf6', 'disv', 'vertices', - 'vertices')) - cell2d = ListTemplateGenerator(('gwf6', 'disv', 'cell2d', 'cell2d')) - package_abbr = "gwfdisv" - _package_type = "disv" - dfn_file_name = "gwf-disv.dfn" - - dfn = [["block options", "name length_units", "type string", - "reader urword", "optional true"], - ["block options", "name nogrb", "type keyword", "reader urword", - "optional true"], - ["block options", "name xorigin", "type double precision", - "reader urword", "optional true"], - ["block options", "name yorigin", "type double precision", - "reader urword", "optional true"], - ["block options", "name angrot", "type double precision", - "reader urword", "optional true"], - ["block dimensions", "name nlay", "type integer", - "reader urword", "optional false"], - ["block dimensions", "name ncpl", "type integer", - "reader urword", "optional false"], - ["block dimensions", "name nvert", "type integer", - "reader urword", "optional false"], - ["block griddata", "name top", "type double precision", - "shape (ncpl)", "reader readarray"], - ["block griddata", "name botm", "type double precision", - "shape (nlay, ncpl)", "reader readarray", "layered true"], - ["block griddata", "name idomain", "type integer", - "shape (nlay, ncpl)", "reader readarray", "layered true", - "optional true"], - ["block vertices", "name vertices", "type recarray iv xv yv", - "reader urword", "optional false"], - ["block vertices", "name iv", "type integer", "in_record true", - "tagged false", "reader urword", "optional false", - "numeric_index true"], - ["block vertices", "name xv", "type double precision", - "in_record true", "tagged false", "reader urword", - "optional false"], - ["block vertices", "name yv", "type double precision", - "in_record true", "tagged false", "reader urword", - "optional false"], - ["block cell2d", "name cell2d", - "type recarray icell2d xc yc ncvert icvert", "reader urword", - "optional false"], - ["block cell2d", "name icell2d", "type integer", - "in_record true", "tagged false", "reader urword", - "optional false", "numeric_index true"], - ["block cell2d", "name xc", "type double precision", - "in_record true", "tagged false", "reader urword", - "optional false"], - ["block cell2d", "name yc", "type double precision", - "in_record true", "tagged false", "reader urword", - "optional false"], - ["block cell2d", "name ncvert", "type integer", "in_record true", - "tagged false", "reader urword", "optional false"], - ["block cell2d", "name icvert", "type integer", "shape (ncvert)", - "in_record true", "tagged false", "reader urword", - "optional false", "numeric_index true"]] - - def __init__(self, model, loading_package=False, length_units=None, - nogrb=None, xorigin=None, yorigin=None, angrot=None, - nlay=None, ncpl=None, nvert=None, top=None, botm=None, - idomain=None, vertices=None, cell2d=None, filename=None, - pname=None, parent_file=None): - super(ModflowGwfdisv, self).__init__(model, "disv", filename, pname, - loading_package, parent_file) - - # set up variables - self.length_units = self.build_mfdata("length_units", length_units) - self.nogrb = self.build_mfdata("nogrb", nogrb) - self.xorigin = self.build_mfdata("xorigin", xorigin) - self.yorigin = self.build_mfdata("yorigin", yorigin) - self.angrot = self.build_mfdata("angrot", angrot) - self.nlay = self.build_mfdata("nlay", nlay) - self.ncpl = self.build_mfdata("ncpl", ncpl) - self.nvert = self.build_mfdata("nvert", nvert) - self.top = self.build_mfdata("top", top) - self.botm = self.build_mfdata("botm", botm) - self.idomain = self.build_mfdata("idomain", idomain) - self.vertices = self.build_mfdata("vertices", vertices) - self.cell2d = self.build_mfdata("cell2d", cell2d) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ArrayTemplateGenerator, ListTemplateGenerator + + +class ModflowGwfdisv(mfpackage.MFPackage): + """ + ModflowGwfdisv defines a disv package within a gwf6 model. + + Parameters + ---------- + model : MFModel + Model that this package is a part of. Package is automatically + added to model when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + length_units : string + * length_units (string) is the length units used for this model. Values + can be "FEET", "METERS", or "CENTIMETERS". If not specified, the + default is "UNKNOWN". + nogrb : boolean + * nogrb (boolean) keyword to deactivate writing of the binary grid + file. + xorigin : double + * xorigin (double) x-position of the origin used for model grid + vertices. This value should be provided in a real-world coordinate + system. A default value of zero is assigned if not specified. The + value for XORIGIN does not affect the model simulation, but it is + written to the binary grid file so that postprocessors can locate the + grid in space. + yorigin : double + * yorigin (double) y-position of the origin used for model grid + vertices. This value should be provided in a real-world coordinate + system. If not specified, then a default value equal to zero is used. + The value for YORIGIN does not affect the model simulation, but it is + written to the binary grid file so that postprocessors can locate the + grid in space. + angrot : double + * angrot (double) counter-clockwise rotation angle (in degrees) of the + model grid coordinate system relative to a real-world coordinate + system. If not specified, then a default value of 0.0 is assigned. + The value for ANGROT does not affect the model simulation, but it is + written to the binary grid file so that postprocessors can locate the + grid in space. + nlay : integer + * nlay (integer) is the number of layers in the model grid. + ncpl : integer + * ncpl (integer) is the number of cells per layer. This is a constant + value for the grid and it applies to all layers. + nvert : integer + * nvert (integer) is the total number of (x, y) vertex pairs used to + characterize the horizontal configuration of the model grid. + top : [double] + * top (double) is the top elevation for each cell in the top model + layer. + botm : [double] + * botm (double) is the bottom elevation for each cell. + idomain : [integer] + * idomain (integer) is an optional array that characterizes the + existence status of a cell. If the IDOMAIN array is not specified, + then all model cells exist within the solution. If the IDOMAIN value + for a cell is 0, the cell does not exist in the simulation. Input and + output values will be read and written for the cell, but internal to + the program, the cell is excluded from the solution. If the IDOMAIN + value for a cell is 1, the cell exists in the simulation. If the + IDOMAIN value for a cell is -1, the cell does not exist in the + simulation. Furthermore, the first existing cell above will be + connected to the first existing cell below. This type of cell is + referred to as a "vertical pass through" cell. + vertices : [iv, xv, yv] + * iv (integer) is the vertex number. Records in the VERTICES block must + be listed in consecutive order from 1 to NVERT. + * xv (double) is the x-coordinate for the vertex. + * yv (double) is the y-coordinate for the vertex. + cell2d : [icell2d, xc, yc, ncvert, icvert] + * icell2d (integer) is the CELL2D number. Records in the CELL2D block + must be listed in consecutive order from the first to the last. + * xc (double) is the x-coordinate for the cell center. + * yc (double) is the y-coordinate for the cell center. + * ncvert (integer) is the number of vertices required to define the + cell. There may be a different number of vertices for each cell. + * icvert (integer) is an array of integer values containing vertex + numbers (in the VERTICES block) used to define the cell. Vertices + must be listed in clockwise order. Cells that are connected must + share vertices. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + top = ArrayTemplateGenerator(('gwf6', 'disv', 'griddata', 'top')) + botm = ArrayTemplateGenerator(('gwf6', 'disv', 'griddata', 'botm')) + idomain = ArrayTemplateGenerator(('gwf6', 'disv', 'griddata', + 'idomain')) + vertices = ListTemplateGenerator(('gwf6', 'disv', 'vertices', + 'vertices')) + cell2d = ListTemplateGenerator(('gwf6', 'disv', 'cell2d', 'cell2d')) + package_abbr = "gwfdisv" + _package_type = "disv" + dfn_file_name = "gwf-disv.dfn" + + dfn = [["block options", "name length_units", "type string", + "reader urword", "optional true"], + ["block options", "name nogrb", "type keyword", "reader urword", + "optional true"], + ["block options", "name xorigin", "type double precision", + "reader urword", "optional true"], + ["block options", "name yorigin", "type double precision", + "reader urword", "optional true"], + ["block options", "name angrot", "type double precision", + "reader urword", "optional true"], + ["block dimensions", "name nlay", "type integer", + "reader urword", "optional false"], + ["block dimensions", "name ncpl", "type integer", + "reader urword", "optional false"], + ["block dimensions", "name nvert", "type integer", + "reader urword", "optional false"], + ["block griddata", "name top", "type double precision", + "shape (ncpl)", "reader readarray"], + ["block griddata", "name botm", "type double precision", + "shape (nlay, ncpl)", "reader readarray", "layered true"], + ["block griddata", "name idomain", "type integer", + "shape (nlay, ncpl)", "reader readarray", "layered true", + "optional true"], + ["block vertices", "name vertices", "type recarray iv xv yv", + "reader urword", "optional false"], + ["block vertices", "name iv", "type integer", "in_record true", + "tagged false", "reader urword", "optional false", + "numeric_index true"], + ["block vertices", "name xv", "type double precision", + "in_record true", "tagged false", "reader urword", + "optional false"], + ["block vertices", "name yv", "type double precision", + "in_record true", "tagged false", "reader urword", + "optional false"], + ["block cell2d", "name cell2d", + "type recarray icell2d xc yc ncvert icvert", "reader urword", + "optional false"], + ["block cell2d", "name icell2d", "type integer", + "in_record true", "tagged false", "reader urword", + "optional false", "numeric_index true"], + ["block cell2d", "name xc", "type double precision", + "in_record true", "tagged false", "reader urword", + "optional false"], + ["block cell2d", "name yc", "type double precision", + "in_record true", "tagged false", "reader urword", + "optional false"], + ["block cell2d", "name ncvert", "type integer", "in_record true", + "tagged false", "reader urword", "optional false"], + ["block cell2d", "name icvert", "type integer", "shape (ncvert)", + "in_record true", "tagged false", "reader urword", + "optional false", "numeric_index true"]] + + def __init__(self, model, loading_package=False, length_units=None, + nogrb=None, xorigin=None, yorigin=None, angrot=None, + nlay=None, ncpl=None, nvert=None, top=None, botm=None, + idomain=None, vertices=None, cell2d=None, filename=None, + pname=None, parent_file=None): + super(ModflowGwfdisv, self).__init__(model, "disv", filename, pname, + loading_package, parent_file) + + # set up variables + self.length_units = self.build_mfdata("length_units", length_units) + self.nogrb = self.build_mfdata("nogrb", nogrb) + self.xorigin = self.build_mfdata("xorigin", xorigin) + self.yorigin = self.build_mfdata("yorigin", yorigin) + self.angrot = self.build_mfdata("angrot", angrot) + self.nlay = self.build_mfdata("nlay", nlay) + self.ncpl = self.build_mfdata("ncpl", ncpl) + self.nvert = self.build_mfdata("nvert", nvert) + self.top = self.build_mfdata("top", top) + self.botm = self.build_mfdata("botm", botm) + self.idomain = self.build_mfdata("idomain", idomain) + self.vertices = self.build_mfdata("vertices", vertices) + self.cell2d = self.build_mfdata("cell2d", cell2d) + self._init_complete = True diff --git a/flopy/mf6/modflow/mfgwfdrn.py b/flopy/mf6/modflow/mfgwfdrn.py index 353921d8f4..2a64e313e5 100644 --- a/flopy/mf6/modflow/mfgwfdrn.py +++ b/flopy/mf6/modflow/mfgwfdrn.py @@ -1,211 +1,211 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ListTemplateGenerator - - -class ModflowGwfdrn(mfpackage.MFPackage): - """ - ModflowGwfdrn defines a drn package within a gwf6 model. - - Parameters - ---------- - model : MFModel - Model that this package is a part of. Package is automatically - added to model when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - auxiliary : [string] - * auxiliary (string) defines an array of one or more auxiliary variable - names. There is no limit on the number of auxiliary variables that - can be provided on this line; however, lists of information provided - in subsequent blocks must have a column of data for each auxiliary - variable name defined here. The number of auxiliary variables - detected on this line determines the value for naux. Comments cannot - be provided anywhere on this line as they will be interpreted as - auxiliary variable names. Auxiliary variables may not be used by the - package, but they will be available for use by other parts of the - program. The program will terminate with an error if auxiliary - variables are specified on more than one line in the options block. - auxmultname : string - * auxmultname (string) name of auxiliary variable to be used as - multiplier of drain conductance. - boundnames : boolean - * boundnames (boolean) keyword to indicate that boundary names may be - provided with the list of drain cells. - print_input : boolean - * print_input (boolean) keyword to indicate that the list of drain - information will be written to the listing file immediately after it - is read. - print_flows : boolean - * print_flows (boolean) keyword to indicate that the list of drain flow - rates will be printed to the listing file for every stress period - time step in which "BUDGET PRINT" is specified in Output Control. If - there is no Output Control option and "PRINT_FLOWS" is specified, - then flow rates are printed for the last time step of each stress - period. - save_flows : boolean - * save_flows (boolean) keyword to indicate that drain flow terms will - be written to the file specified with "BUDGET FILEOUT" in Output - Control. - timeseries : {varname:data} or timeseries data - * Contains data for the ts package. Data can be stored in a dictionary - containing data for the ts package with variable names as keys and - package data as values. Data just for the timeseries variable is also - acceptable. See ts package documentation for more information. - observations : {varname:data} or continuous data - * Contains data for the obs package. Data can be stored in a dictionary - containing data for the obs package with variable names as keys and - package data as values. Data just for the observations variable is - also acceptable. See obs package documentation for more information. - mover : boolean - * mover (boolean) keyword to indicate that this instance of the Drain - Package can be used with the Water Mover (MVR) Package. When the - MOVER option is specified, additional memory is allocated within the - package to store the available, provided, and received water. - maxbound : integer - * maxbound (integer) integer value specifying the maximum number of - drains cells that will be specified for use during any stress period. - stress_period_data : [cellid, elev, cond, aux, boundname] - * cellid ((integer, ...)) is the cell identifier, and depends on the - type of grid that is used for the simulation. For a structured grid - that uses the DIS input file, CELLID is the layer, row, and column. - For a grid that uses the DISV input file, CELLID is the layer and - CELL2D number. If the model uses the unstructured discretization - (DISU) input file, CELLID is the node number for the cell. - * elev (double) is the elevation of the drain. If the Options block - includes a TIMESERIESFILE entry (see the "Time-Variable Input" - section), values can be obtained from a time series by entering the - time-series name in place of a numeric value. - * cond (double) is the hydraulic conductance of the interface between - the aquifer and the drain. If the Options block includes a - TIMESERIESFILE entry (see the "Time-Variable Input" section), values - can be obtained from a time series by entering the time-series name - in place of a numeric value. - * aux (double) represents the values of the auxiliary variables for - each drain. The values of auxiliary variables must be present for - each drain. The values must be specified in the order of the - auxiliary variables specified in the OPTIONS block. If the package - supports time series and the Options block includes a TIMESERIESFILE - entry (see the "Time-Variable Input" section), values can be obtained - from a time series by entering the time-series name in place of a - numeric value. - * boundname (string) name of the drain cell. BOUNDNAME is an ASCII - character variable that can contain as many as 40 characters. If - BOUNDNAME contains spaces in it, then the entire name must be - enclosed within single quotes. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - auxiliary = ListTemplateGenerator(('gwf6', 'drn', 'options', - 'auxiliary')) - ts_filerecord = ListTemplateGenerator(('gwf6', 'drn', 'options', - 'ts_filerecord')) - obs_filerecord = ListTemplateGenerator(('gwf6', 'drn', 'options', - 'obs_filerecord')) - stress_period_data = ListTemplateGenerator(('gwf6', 'drn', 'period', - 'stress_period_data')) - package_abbr = "gwfdrn" - _package_type = "drn" - dfn_file_name = "gwf-drn.dfn" - - dfn = [["block options", "name auxiliary", "type string", - "shape (naux)", "reader urword", "optional true"], - ["block options", "name auxmultname", "type string", "shape", - "reader urword", "optional true"], - ["block options", "name boundnames", "type keyword", "shape", - "reader urword", "optional true"], - ["block options", "name print_input", "type keyword", - "reader urword", "optional true"], - ["block options", "name print_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name save_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name ts_filerecord", - "type record ts6 filein ts6_filename", "shape", "reader urword", - "tagged true", "optional true", "construct_package ts", - "construct_data timeseries", "parameter_name timeseries"], - ["block options", "name ts6", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name filein", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name ts6_filename", "type string", - "preserve_case true", "in_record true", "reader urword", - "optional false", "tagged false"], - ["block options", "name obs_filerecord", - "type record obs6 filein obs6_filename", "shape", "reader urword", - "tagged true", "optional true", "construct_package obs", - "construct_data continuous", "parameter_name observations"], - ["block options", "name obs6", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name obs6_filename", "type string", - "preserve_case true", "in_record true", "tagged false", - "reader urword", "optional false"], - ["block options", "name mover", "type keyword", "tagged true", - "reader urword", "optional true"], - ["block dimensions", "name maxbound", "type integer", - "reader urword", "optional false"], - ["block period", "name iper", "type integer", - "block_variable True", "in_record true", "tagged false", "shape", - "valid", "reader urword", "optional false"], - ["block period", "name stress_period_data", - "type recarray cellid elev cond aux boundname", - "shape (maxbound)", "reader urword"], - ["block period", "name cellid", "type integer", - "shape (ncelldim)", "tagged false", "in_record true", - "reader urword"], - ["block period", "name elev", "type double precision", "shape", - "tagged false", "in_record true", "reader urword", - "time_series true"], - ["block period", "name cond", "type double precision", "shape", - "tagged false", "in_record true", "reader urword", - "time_series true"], - ["block period", "name aux", "type double precision", - "in_record true", "tagged false", "shape (naux)", "reader urword", - "optional true", "time_series true"], - ["block period", "name boundname", "type string", "shape", - "tagged false", "in_record true", "reader urword", - "optional true"]] - - def __init__(self, model, loading_package=False, auxiliary=None, - auxmultname=None, boundnames=None, print_input=None, - print_flows=None, save_flows=None, timeseries=None, - observations=None, mover=None, maxbound=None, - stress_period_data=None, filename=None, pname=None, - parent_file=None): - super(ModflowGwfdrn, self).__init__(model, "drn", filename, pname, - loading_package, parent_file) - - # set up variables - self.auxiliary = self.build_mfdata("auxiliary", auxiliary) - self.auxmultname = self.build_mfdata("auxmultname", auxmultname) - self.boundnames = self.build_mfdata("boundnames", boundnames) - self.print_input = self.build_mfdata("print_input", print_input) - self.print_flows = self.build_mfdata("print_flows", print_flows) - self.save_flows = self.build_mfdata("save_flows", save_flows) - self._ts_filerecord = self.build_mfdata("ts_filerecord", - None) - self._ts_package = self.build_child_package("ts", timeseries, - "timeseries", - self._ts_filerecord) - self._obs_filerecord = self.build_mfdata("obs_filerecord", - None) - self._obs_package = self.build_child_package("obs", observations, - "continuous", - self._obs_filerecord) - self.mover = self.build_mfdata("mover", mover) - self.maxbound = self.build_mfdata("maxbound", maxbound) - self.stress_period_data = self.build_mfdata("stress_period_data", - stress_period_data) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ListTemplateGenerator + + +class ModflowGwfdrn(mfpackage.MFPackage): + """ + ModflowGwfdrn defines a drn package within a gwf6 model. + + Parameters + ---------- + model : MFModel + Model that this package is a part of. Package is automatically + added to model when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + auxiliary : [string] + * auxiliary (string) defines an array of one or more auxiliary variable + names. There is no limit on the number of auxiliary variables that + can be provided on this line; however, lists of information provided + in subsequent blocks must have a column of data for each auxiliary + variable name defined here. The number of auxiliary variables + detected on this line determines the value for naux. Comments cannot + be provided anywhere on this line as they will be interpreted as + auxiliary variable names. Auxiliary variables may not be used by the + package, but they will be available for use by other parts of the + program. The program will terminate with an error if auxiliary + variables are specified on more than one line in the options block. + auxmultname : string + * auxmultname (string) name of auxiliary variable to be used as + multiplier of drain conductance. + boundnames : boolean + * boundnames (boolean) keyword to indicate that boundary names may be + provided with the list of drain cells. + print_input : boolean + * print_input (boolean) keyword to indicate that the list of drain + information will be written to the listing file immediately after it + is read. + print_flows : boolean + * print_flows (boolean) keyword to indicate that the list of drain flow + rates will be printed to the listing file for every stress period + time step in which "BUDGET PRINT" is specified in Output Control. If + there is no Output Control option and "PRINT_FLOWS" is specified, + then flow rates are printed for the last time step of each stress + period. + save_flows : boolean + * save_flows (boolean) keyword to indicate that drain flow terms will + be written to the file specified with "BUDGET FILEOUT" in Output + Control. + timeseries : {varname:data} or timeseries data + * Contains data for the ts package. Data can be stored in a dictionary + containing data for the ts package with variable names as keys and + package data as values. Data just for the timeseries variable is also + acceptable. See ts package documentation for more information. + observations : {varname:data} or continuous data + * Contains data for the obs package. Data can be stored in a dictionary + containing data for the obs package with variable names as keys and + package data as values. Data just for the observations variable is + also acceptable. See obs package documentation for more information. + mover : boolean + * mover (boolean) keyword to indicate that this instance of the Drain + Package can be used with the Water Mover (MVR) Package. When the + MOVER option is specified, additional memory is allocated within the + package to store the available, provided, and received water. + maxbound : integer + * maxbound (integer) integer value specifying the maximum number of + drains cells that will be specified for use during any stress period. + stress_period_data : [cellid, elev, cond, aux, boundname] + * cellid ((integer, ...)) is the cell identifier, and depends on the + type of grid that is used for the simulation. For a structured grid + that uses the DIS input file, CELLID is the layer, row, and column. + For a grid that uses the DISV input file, CELLID is the layer and + CELL2D number. If the model uses the unstructured discretization + (DISU) input file, CELLID is the node number for the cell. + * elev (double) is the elevation of the drain. If the Options block + includes a TIMESERIESFILE entry (see the "Time-Variable Input" + section), values can be obtained from a time series by entering the + time-series name in place of a numeric value. + * cond (double) is the hydraulic conductance of the interface between + the aquifer and the drain. If the Options block includes a + TIMESERIESFILE entry (see the "Time-Variable Input" section), values + can be obtained from a time series by entering the time-series name + in place of a numeric value. + * aux (double) represents the values of the auxiliary variables for + each drain. The values of auxiliary variables must be present for + each drain. The values must be specified in the order of the + auxiliary variables specified in the OPTIONS block. If the package + supports time series and the Options block includes a TIMESERIESFILE + entry (see the "Time-Variable Input" section), values can be obtained + from a time series by entering the time-series name in place of a + numeric value. + * boundname (string) name of the drain cell. BOUNDNAME is an ASCII + character variable that can contain as many as 40 characters. If + BOUNDNAME contains spaces in it, then the entire name must be + enclosed within single quotes. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + auxiliary = ListTemplateGenerator(('gwf6', 'drn', 'options', + 'auxiliary')) + ts_filerecord = ListTemplateGenerator(('gwf6', 'drn', 'options', + 'ts_filerecord')) + obs_filerecord = ListTemplateGenerator(('gwf6', 'drn', 'options', + 'obs_filerecord')) + stress_period_data = ListTemplateGenerator(('gwf6', 'drn', 'period', + 'stress_period_data')) + package_abbr = "gwfdrn" + _package_type = "drn" + dfn_file_name = "gwf-drn.dfn" + + dfn = [["block options", "name auxiliary", "type string", + "shape (naux)", "reader urword", "optional true"], + ["block options", "name auxmultname", "type string", "shape", + "reader urword", "optional true"], + ["block options", "name boundnames", "type keyword", "shape", + "reader urword", "optional true"], + ["block options", "name print_input", "type keyword", + "reader urword", "optional true"], + ["block options", "name print_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name save_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name ts_filerecord", + "type record ts6 filein ts6_filename", "shape", "reader urword", + "tagged true", "optional true", "construct_package ts", + "construct_data timeseries", "parameter_name timeseries"], + ["block options", "name ts6", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name filein", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name ts6_filename", "type string", + "preserve_case true", "in_record true", "reader urword", + "optional false", "tagged false"], + ["block options", "name obs_filerecord", + "type record obs6 filein obs6_filename", "shape", "reader urword", + "tagged true", "optional true", "construct_package obs", + "construct_data continuous", "parameter_name observations"], + ["block options", "name obs6", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name obs6_filename", "type string", + "preserve_case true", "in_record true", "tagged false", + "reader urword", "optional false"], + ["block options", "name mover", "type keyword", "tagged true", + "reader urword", "optional true"], + ["block dimensions", "name maxbound", "type integer", + "reader urword", "optional false"], + ["block period", "name iper", "type integer", + "block_variable True", "in_record true", "tagged false", "shape", + "valid", "reader urword", "optional false"], + ["block period", "name stress_period_data", + "type recarray cellid elev cond aux boundname", + "shape (maxbound)", "reader urword"], + ["block period", "name cellid", "type integer", + "shape (ncelldim)", "tagged false", "in_record true", + "reader urword"], + ["block period", "name elev", "type double precision", "shape", + "tagged false", "in_record true", "reader urword", + "time_series true"], + ["block period", "name cond", "type double precision", "shape", + "tagged false", "in_record true", "reader urword", + "time_series true"], + ["block period", "name aux", "type double precision", + "in_record true", "tagged false", "shape (naux)", "reader urword", + "optional true", "time_series true"], + ["block period", "name boundname", "type string", "shape", + "tagged false", "in_record true", "reader urword", + "optional true"]] + + def __init__(self, model, loading_package=False, auxiliary=None, + auxmultname=None, boundnames=None, print_input=None, + print_flows=None, save_flows=None, timeseries=None, + observations=None, mover=None, maxbound=None, + stress_period_data=None, filename=None, pname=None, + parent_file=None): + super(ModflowGwfdrn, self).__init__(model, "drn", filename, pname, + loading_package, parent_file) + + # set up variables + self.auxiliary = self.build_mfdata("auxiliary", auxiliary) + self.auxmultname = self.build_mfdata("auxmultname", auxmultname) + self.boundnames = self.build_mfdata("boundnames", boundnames) + self.print_input = self.build_mfdata("print_input", print_input) + self.print_flows = self.build_mfdata("print_flows", print_flows) + self.save_flows = self.build_mfdata("save_flows", save_flows) + self._ts_filerecord = self.build_mfdata("ts_filerecord", + None) + self._ts_package = self.build_child_package("ts", timeseries, + "timeseries", + self._ts_filerecord) + self._obs_filerecord = self.build_mfdata("obs_filerecord", + None) + self._obs_package = self.build_child_package("obs", observations, + "continuous", + self._obs_filerecord) + self.mover = self.build_mfdata("mover", mover) + self.maxbound = self.build_mfdata("maxbound", maxbound) + self.stress_period_data = self.build_mfdata("stress_period_data", + stress_period_data) + self._init_complete = True diff --git a/flopy/mf6/modflow/mfgwfevt.py b/flopy/mf6/modflow/mfgwfevt.py index 1fb1c1710e..ef3ed840b8 100644 --- a/flopy/mf6/modflow/mfgwfevt.py +++ b/flopy/mf6/modflow/mfgwfevt.py @@ -1,249 +1,249 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ListTemplateGenerator - - -class ModflowGwfevt(mfpackage.MFPackage): - """ - ModflowGwfevt defines a evt package within a gwf6 model. - - Parameters - ---------- - model : MFModel - Model that this package is a part of. Package is automatically - added to model when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - fixed_cell : boolean - * fixed_cell (boolean) indicates that evapotranspiration will not be - reassigned to a cell underlying the cell specified in the list if the - specified cell is inactive. - auxiliary : [string] - * auxiliary (string) defines an array of one or more auxiliary variable - names. There is no limit on the number of auxiliary variables that - can be provided on this line; however, lists of information provided - in subsequent blocks must have a column of data for each auxiliary - variable name defined here. The number of auxiliary variables - detected on this line determines the value for naux. Comments cannot - be provided anywhere on this line as they will be interpreted as - auxiliary variable names. Auxiliary variables may not be used by the - package, but they will be available for use by other parts of the - program. The program will terminate with an error if auxiliary - variables are specified on more than one line in the options block. - auxmultname : string - * auxmultname (string) name of auxiliary variable to be used as - multiplier of evapotranspiration rate. - boundnames : boolean - * boundnames (boolean) keyword to indicate that boundary names may be - provided with the list of evapotranspiration cells. - print_input : boolean - * print_input (boolean) keyword to indicate that the list of - evapotranspiration information will be written to the listing file - immediately after it is read. - print_flows : boolean - * print_flows (boolean) keyword to indicate that the list of - evapotranspiration flow rates will be printed to the listing file for - every stress period time step in which "BUDGET PRINT" is specified in - Output Control. If there is no Output Control option and - "PRINT_FLOWS" is specified, then flow rates are printed for the last - time step of each stress period. - save_flows : boolean - * save_flows (boolean) keyword to indicate that evapotranspiration flow - terms will be written to the file specified with "BUDGET FILEOUT" in - Output Control. - timeseries : {varname:data} or timeseries data - * Contains data for the ts package. Data can be stored in a dictionary - containing data for the ts package with variable names as keys and - package data as values. Data just for the timeseries variable is also - acceptable. See ts package documentation for more information. - observations : {varname:data} or continuous data - * Contains data for the obs package. Data can be stored in a dictionary - containing data for the obs package with variable names as keys and - package data as values. Data just for the observations variable is - also acceptable. See obs package documentation for more information. - surf_rate_specified : boolean - * surf_rate_specified (boolean) indicates that the evapotranspiration - rate at the ET surface will be specified as PETM0 in list input. - maxbound : integer - * maxbound (integer) integer value specifying the maximum number of - evapotranspiration cells cells that will be specified for use during - any stress period. - nseg : integer - * nseg (integer) number of ET segments. Default is one. When NSEG is - greater than 1, PXDP and PETM arrays must be specified NSEG - 1 times - each, in order from the uppermost segment down. PXDP defines the - extinction-depth proportion at the bottom of a segment. PETM defines - the proportion of the maximum ET flux rate at the bottom of a - segment. - stress_period_data : [cellid, surface, rate, depth, pxdp, petm, petm0, aux, - boundname] - * cellid ((integer, ...)) is the cell identifier, and depends on the - type of grid that is used for the simulation. For a structured grid - that uses the DIS input file, CELLID is the layer, row, and column. - For a grid that uses the DISV input file, CELLID is the layer and - CELL2D number. If the model uses the unstructured discretization - (DISU) input file, CELLID is the node number for the cell. - * surface (double) is the elevation of the ET surface (:math:`L`). A - time-series name may be specified. - * rate (double) is the maximum ET flux rate (:math:`LT^{-1}`). A time- - series name may be specified. - * depth (double) is the ET extinction depth (:math:`L`). A time-series - name may be specified. - * pxdp (double) is the proportion of the ET extinction depth at the - bottom of a segment (dimensionless). A time-series name may be - specified. - * petm (double) is the proportion of the maximum ET flux rate at the - bottom of a segment (dimensionless). A time-series name may be - specified. - * petm0 (double) is the proportion of the maximum ET flux rate that - will apply when head is at or above the ET surface (dimensionless). - PETM0 is read only when the SURF_RATE_SPECIFIED option is used. A - time-series name may be specified. - * aux (double) represents the values of the auxiliary variables for - each evapotranspiration. The values of auxiliary variables must be - present for each evapotranspiration. The values must be specified in - the order of the auxiliary variables specified in the OPTIONS block. - If the package supports time series and the Options block includes a - TIMESERIESFILE entry (see the "Time-Variable Input" section), values - can be obtained from a time series by entering the time-series name - in place of a numeric value. - * boundname (string) name of the evapotranspiration cell. BOUNDNAME is - an ASCII character variable that can contain as many as 40 - characters. If BOUNDNAME contains spaces in it, then the entire name - must be enclosed within single quotes. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - auxiliary = ListTemplateGenerator(('gwf6', 'evt', 'options', - 'auxiliary')) - ts_filerecord = ListTemplateGenerator(('gwf6', 'evt', 'options', - 'ts_filerecord')) - obs_filerecord = ListTemplateGenerator(('gwf6', 'evt', 'options', - 'obs_filerecord')) - stress_period_data = ListTemplateGenerator(('gwf6', 'evt', 'period', - 'stress_period_data')) - package_abbr = "gwfevt" - _package_type = "evt" - dfn_file_name = "gwf-evt.dfn" - - dfn = [["block options", "name fixed_cell", "type keyword", "shape", - "reader urword", "optional true"], - ["block options", "name auxiliary", "type string", - "shape (naux)", "reader urword", "optional true"], - ["block options", "name auxmultname", "type string", "shape", - "reader urword", "optional true"], - ["block options", "name boundnames", "type keyword", "shape", - "reader urword", "optional true"], - ["block options", "name print_input", "type keyword", - "reader urword", "optional true"], - ["block options", "name print_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name save_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name ts_filerecord", - "type record ts6 filein ts6_filename", "shape", "reader urword", - "tagged true", "optional true", "construct_package ts", - "construct_data timeseries", "parameter_name timeseries"], - ["block options", "name ts6", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name filein", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name ts6_filename", "type string", - "preserve_case true", "in_record true", "reader urword", - "optional false", "tagged false"], - ["block options", "name obs_filerecord", - "type record obs6 filein obs6_filename", "shape", "reader urword", - "tagged true", "optional true", "construct_package obs", - "construct_data continuous", "parameter_name observations"], - ["block options", "name obs6", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name obs6_filename", "type string", - "preserve_case true", "in_record true", "tagged false", - "reader urword", "optional false"], - ["block options", "name surf_rate_specified", "type keyword", - "reader urword", "optional true"], - ["block dimensions", "name maxbound", "type integer", - "reader urword", "optional false"], - ["block dimensions", "name nseg", "type integer", - "reader urword", "optional false"], - ["block period", "name iper", "type integer", - "block_variable True", "in_record true", "tagged false", "shape", - "valid", "reader urword", "optional false"], - ["block period", "name stress_period_data", - "type recarray cellid surface rate depth pxdp petm petm0 aux " - "boundname", - "shape (maxbound)", "reader urword"], - ["block period", "name cellid", "type integer", - "shape (ncelldim)", "tagged false", "in_record true", - "reader urword"], - ["block period", "name surface", "type double precision", - "shape", "tagged false", "in_record true", "reader urword", - "time_series true"], - ["block period", "name rate", "type double precision", "shape", - "tagged false", "in_record true", "reader urword", - "time_series true"], - ["block period", "name depth", "type double precision", "shape", - "tagged false", "in_record true", "reader urword", - "time_series true"], - ["block period", "name pxdp", "type double precision", - "shape (nseg-1)", "tagged false", "in_record true", - "reader urword", "time_series true"], - ["block period", "name petm", "type double precision", - "shape (nseg-1)", "tagged false", "in_record true", - "reader urword", "time_series true"], - ["block period", "name petm0", "type double precision", "shape", - "tagged false", "in_record true", "reader urword", - "optional true", "time_series true"], - ["block period", "name aux", "type double precision", - "in_record true", "tagged false", "shape (naux)", "reader urword", - "optional true", "time_series true"], - ["block period", "name boundname", "type string", "shape", - "tagged false", "in_record true", "reader urword", - "optional true"]] - - def __init__(self, model, loading_package=False, fixed_cell=None, - auxiliary=None, auxmultname=None, boundnames=None, - print_input=None, print_flows=None, save_flows=None, - timeseries=None, observations=None, surf_rate_specified=None, - maxbound=None, nseg=None, stress_period_data=None, - filename=None, pname=None, parent_file=None): - super(ModflowGwfevt, self).__init__(model, "evt", filename, pname, - loading_package, parent_file) - - # set up variables - self.fixed_cell = self.build_mfdata("fixed_cell", fixed_cell) - self.auxiliary = self.build_mfdata("auxiliary", auxiliary) - self.auxmultname = self.build_mfdata("auxmultname", auxmultname) - self.boundnames = self.build_mfdata("boundnames", boundnames) - self.print_input = self.build_mfdata("print_input", print_input) - self.print_flows = self.build_mfdata("print_flows", print_flows) - self.save_flows = self.build_mfdata("save_flows", save_flows) - self._ts_filerecord = self.build_mfdata("ts_filerecord", - None) - self._ts_package = self.build_child_package("ts", timeseries, - "timeseries", - self._ts_filerecord) - self._obs_filerecord = self.build_mfdata("obs_filerecord", - None) - self._obs_package = self.build_child_package("obs", observations, - "continuous", - self._obs_filerecord) - self.surf_rate_specified = self.build_mfdata("surf_rate_specified", - surf_rate_specified) - self.maxbound = self.build_mfdata("maxbound", maxbound) - self.nseg = self.build_mfdata("nseg", nseg) - self.stress_period_data = self.build_mfdata("stress_period_data", - stress_period_data) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ListTemplateGenerator + + +class ModflowGwfevt(mfpackage.MFPackage): + """ + ModflowGwfevt defines a evt package within a gwf6 model. + + Parameters + ---------- + model : MFModel + Model that this package is a part of. Package is automatically + added to model when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + fixed_cell : boolean + * fixed_cell (boolean) indicates that evapotranspiration will not be + reassigned to a cell underlying the cell specified in the list if the + specified cell is inactive. + auxiliary : [string] + * auxiliary (string) defines an array of one or more auxiliary variable + names. There is no limit on the number of auxiliary variables that + can be provided on this line; however, lists of information provided + in subsequent blocks must have a column of data for each auxiliary + variable name defined here. The number of auxiliary variables + detected on this line determines the value for naux. Comments cannot + be provided anywhere on this line as they will be interpreted as + auxiliary variable names. Auxiliary variables may not be used by the + package, but they will be available for use by other parts of the + program. The program will terminate with an error if auxiliary + variables are specified on more than one line in the options block. + auxmultname : string + * auxmultname (string) name of auxiliary variable to be used as + multiplier of evapotranspiration rate. + boundnames : boolean + * boundnames (boolean) keyword to indicate that boundary names may be + provided with the list of evapotranspiration cells. + print_input : boolean + * print_input (boolean) keyword to indicate that the list of + evapotranspiration information will be written to the listing file + immediately after it is read. + print_flows : boolean + * print_flows (boolean) keyword to indicate that the list of + evapotranspiration flow rates will be printed to the listing file for + every stress period time step in which "BUDGET PRINT" is specified in + Output Control. If there is no Output Control option and + "PRINT_FLOWS" is specified, then flow rates are printed for the last + time step of each stress period. + save_flows : boolean + * save_flows (boolean) keyword to indicate that evapotranspiration flow + terms will be written to the file specified with "BUDGET FILEOUT" in + Output Control. + timeseries : {varname:data} or timeseries data + * Contains data for the ts package. Data can be stored in a dictionary + containing data for the ts package with variable names as keys and + package data as values. Data just for the timeseries variable is also + acceptable. See ts package documentation for more information. + observations : {varname:data} or continuous data + * Contains data for the obs package. Data can be stored in a dictionary + containing data for the obs package with variable names as keys and + package data as values. Data just for the observations variable is + also acceptable. See obs package documentation for more information. + surf_rate_specified : boolean + * surf_rate_specified (boolean) indicates that the evapotranspiration + rate at the ET surface will be specified as PETM0 in list input. + maxbound : integer + * maxbound (integer) integer value specifying the maximum number of + evapotranspiration cells cells that will be specified for use during + any stress period. + nseg : integer + * nseg (integer) number of ET segments. Default is one. When NSEG is + greater than 1, PXDP and PETM arrays must be specified NSEG - 1 times + each, in order from the uppermost segment down. PXDP defines the + extinction-depth proportion at the bottom of a segment. PETM defines + the proportion of the maximum ET flux rate at the bottom of a + segment. + stress_period_data : [cellid, surface, rate, depth, pxdp, petm, petm0, aux, + boundname] + * cellid ((integer, ...)) is the cell identifier, and depends on the + type of grid that is used for the simulation. For a structured grid + that uses the DIS input file, CELLID is the layer, row, and column. + For a grid that uses the DISV input file, CELLID is the layer and + CELL2D number. If the model uses the unstructured discretization + (DISU) input file, CELLID is the node number for the cell. + * surface (double) is the elevation of the ET surface (:math:`L`). A + time-series name may be specified. + * rate (double) is the maximum ET flux rate (:math:`LT^{-1}`). A time- + series name may be specified. + * depth (double) is the ET extinction depth (:math:`L`). A time-series + name may be specified. + * pxdp (double) is the proportion of the ET extinction depth at the + bottom of a segment (dimensionless). A time-series name may be + specified. + * petm (double) is the proportion of the maximum ET flux rate at the + bottom of a segment (dimensionless). A time-series name may be + specified. + * petm0 (double) is the proportion of the maximum ET flux rate that + will apply when head is at or above the ET surface (dimensionless). + PETM0 is read only when the SURF_RATE_SPECIFIED option is used. A + time-series name may be specified. + * aux (double) represents the values of the auxiliary variables for + each evapotranspiration. The values of auxiliary variables must be + present for each evapotranspiration. The values must be specified in + the order of the auxiliary variables specified in the OPTIONS block. + If the package supports time series and the Options block includes a + TIMESERIESFILE entry (see the "Time-Variable Input" section), values + can be obtained from a time series by entering the time-series name + in place of a numeric value. + * boundname (string) name of the evapotranspiration cell. BOUNDNAME is + an ASCII character variable that can contain as many as 40 + characters. If BOUNDNAME contains spaces in it, then the entire name + must be enclosed within single quotes. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + auxiliary = ListTemplateGenerator(('gwf6', 'evt', 'options', + 'auxiliary')) + ts_filerecord = ListTemplateGenerator(('gwf6', 'evt', 'options', + 'ts_filerecord')) + obs_filerecord = ListTemplateGenerator(('gwf6', 'evt', 'options', + 'obs_filerecord')) + stress_period_data = ListTemplateGenerator(('gwf6', 'evt', 'period', + 'stress_period_data')) + package_abbr = "gwfevt" + _package_type = "evt" + dfn_file_name = "gwf-evt.dfn" + + dfn = [["block options", "name fixed_cell", "type keyword", "shape", + "reader urword", "optional true"], + ["block options", "name auxiliary", "type string", + "shape (naux)", "reader urword", "optional true"], + ["block options", "name auxmultname", "type string", "shape", + "reader urword", "optional true"], + ["block options", "name boundnames", "type keyword", "shape", + "reader urword", "optional true"], + ["block options", "name print_input", "type keyword", + "reader urword", "optional true"], + ["block options", "name print_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name save_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name ts_filerecord", + "type record ts6 filein ts6_filename", "shape", "reader urword", + "tagged true", "optional true", "construct_package ts", + "construct_data timeseries", "parameter_name timeseries"], + ["block options", "name ts6", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name filein", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name ts6_filename", "type string", + "preserve_case true", "in_record true", "reader urword", + "optional false", "tagged false"], + ["block options", "name obs_filerecord", + "type record obs6 filein obs6_filename", "shape", "reader urword", + "tagged true", "optional true", "construct_package obs", + "construct_data continuous", "parameter_name observations"], + ["block options", "name obs6", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name obs6_filename", "type string", + "preserve_case true", "in_record true", "tagged false", + "reader urword", "optional false"], + ["block options", "name surf_rate_specified", "type keyword", + "reader urword", "optional true"], + ["block dimensions", "name maxbound", "type integer", + "reader urword", "optional false"], + ["block dimensions", "name nseg", "type integer", + "reader urword", "optional false"], + ["block period", "name iper", "type integer", + "block_variable True", "in_record true", "tagged false", "shape", + "valid", "reader urword", "optional false"], + ["block period", "name stress_period_data", + "type recarray cellid surface rate depth pxdp petm petm0 aux " + "boundname", + "shape (maxbound)", "reader urword"], + ["block period", "name cellid", "type integer", + "shape (ncelldim)", "tagged false", "in_record true", + "reader urword"], + ["block period", "name surface", "type double precision", + "shape", "tagged false", "in_record true", "reader urword", + "time_series true"], + ["block period", "name rate", "type double precision", "shape", + "tagged false", "in_record true", "reader urword", + "time_series true"], + ["block period", "name depth", "type double precision", "shape", + "tagged false", "in_record true", "reader urword", + "time_series true"], + ["block period", "name pxdp", "type double precision", + "shape (nseg-1)", "tagged false", "in_record true", + "reader urword", "time_series true"], + ["block period", "name petm", "type double precision", + "shape (nseg-1)", "tagged false", "in_record true", + "reader urword", "time_series true"], + ["block period", "name petm0", "type double precision", "shape", + "tagged false", "in_record true", "reader urword", + "optional true", "time_series true"], + ["block period", "name aux", "type double precision", + "in_record true", "tagged false", "shape (naux)", "reader urword", + "optional true", "time_series true"], + ["block period", "name boundname", "type string", "shape", + "tagged false", "in_record true", "reader urword", + "optional true"]] + + def __init__(self, model, loading_package=False, fixed_cell=None, + auxiliary=None, auxmultname=None, boundnames=None, + print_input=None, print_flows=None, save_flows=None, + timeseries=None, observations=None, surf_rate_specified=None, + maxbound=None, nseg=None, stress_period_data=None, + filename=None, pname=None, parent_file=None): + super(ModflowGwfevt, self).__init__(model, "evt", filename, pname, + loading_package, parent_file) + + # set up variables + self.fixed_cell = self.build_mfdata("fixed_cell", fixed_cell) + self.auxiliary = self.build_mfdata("auxiliary", auxiliary) + self.auxmultname = self.build_mfdata("auxmultname", auxmultname) + self.boundnames = self.build_mfdata("boundnames", boundnames) + self.print_input = self.build_mfdata("print_input", print_input) + self.print_flows = self.build_mfdata("print_flows", print_flows) + self.save_flows = self.build_mfdata("save_flows", save_flows) + self._ts_filerecord = self.build_mfdata("ts_filerecord", + None) + self._ts_package = self.build_child_package("ts", timeseries, + "timeseries", + self._ts_filerecord) + self._obs_filerecord = self.build_mfdata("obs_filerecord", + None) + self._obs_package = self.build_child_package("obs", observations, + "continuous", + self._obs_filerecord) + self.surf_rate_specified = self.build_mfdata("surf_rate_specified", + surf_rate_specified) + self.maxbound = self.build_mfdata("maxbound", maxbound) + self.nseg = self.build_mfdata("nseg", nseg) + self.stress_period_data = self.build_mfdata("stress_period_data", + stress_period_data) + self._init_complete = True diff --git a/flopy/mf6/modflow/mfgwfevta.py b/flopy/mf6/modflow/mfgwfevta.py index b1d0049f50..d09ce3f74d 100644 --- a/flopy/mf6/modflow/mfgwfevta.py +++ b/flopy/mf6/modflow/mfgwfevta.py @@ -1,200 +1,200 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ListTemplateGenerator, ArrayTemplateGenerator - - -class ModflowGwfevta(mfpackage.MFPackage): - """ - ModflowGwfevta defines a evta package within a gwf6 model. - - Parameters - ---------- - model : MFModel - Model that this package is a part of. Package is automatically - added to model when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - readasarrays : boolean - * readasarrays (boolean) indicates that array-based input will be used - for the Evapotranspiration Package. This keyword must be specified to - use array-based input. - fixed_cell : boolean - * fixed_cell (boolean) indicates that evapotranspiration will not be - reassigned to a cell underlying the cell specified in the list if the - specified cell is inactive. - auxiliary : [string] - * auxiliary (string) defines an array of one or more auxiliary variable - names. There is no limit on the number of auxiliary variables that - can be provided on this line; however, lists of information provided - in subsequent blocks must have a column of data for each auxiliary - variable name defined here. The number of auxiliary variables - detected on this line determines the value for naux. Comments cannot - be provided anywhere on this line as they will be interpreted as - auxiliary variable names. Auxiliary variables may not be used by the - package, but they will be available for use by other parts of the - program. The program will terminate with an error if auxiliary - variables are specified on more than one line in the options block. - auxmultname : string - * auxmultname (string) name of auxiliary variable to be used as - multiplier of evapotranspiration rate. - print_input : boolean - * print_input (boolean) keyword to indicate that the list of - evapotranspiration information will be written to the listing file - immediately after it is read. - print_flows : boolean - * print_flows (boolean) keyword to indicate that the list of - evapotranspiration flow rates will be printed to the listing file for - every stress period time step in which "BUDGET PRINT" is specified in - Output Control. If there is no Output Control option and - "PRINT_FLOWS" is specified, then flow rates are printed for the last - time step of each stress period. - save_flows : boolean - * save_flows (boolean) keyword to indicate that evapotranspiration flow - terms will be written to the file specified with "BUDGET FILEOUT" in - Output Control. - timearrayseries : {varname:data} or tas_array data - * Contains data for the tas package. Data can be stored in a dictionary - containing data for the tas package with variable names as keys and - package data as values. Data just for the timearrayseries variable is - also acceptable. See tas package documentation for more information. - observations : {varname:data} or continuous data - * Contains data for the obs package. Data can be stored in a dictionary - containing data for the obs package with variable names as keys and - package data as values. Data just for the observations variable is - also acceptable. See obs package documentation for more information. - ievt : [integer] - * ievt (integer) IEVT is the layer number that defines the layer in - each vertical column where evapotranspiration is applied. If IEVT is - omitted, evapotranspiration by default is applied to cells in layer - 1. If IEVT is specified, it must be specified as the first variable - in the PERIOD block or MODFLOW will terminate with an error. - surface : [double] - * surface (double) is the elevation of the ET surface (:math:`L`). - rate : [double] - * rate (double) is the maximum ET flux rate (:math:`LT^{-1}`). - depth : [double] - * depth (double) is the ET extinction depth (:math:`L`). - aux(iaux) : [double] - * aux(iaux) (double) is an array of values for auxiliary variable - AUX(IAUX), where iaux is a value from 1 to NAUX, and AUX(IAUX) must - be listed as part of the auxiliary variables. A separate array can be - specified for each auxiliary variable. If an array is not specified - for an auxiliary variable, then a value of zero is assigned. If the - value specified here for the auxiliary variable is the same as - auxmultname, then the evapotranspiration rate will be multiplied by - this array. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - auxiliary = ListTemplateGenerator(('gwf6', 'evta', 'options', - 'auxiliary')) - tas_filerecord = ListTemplateGenerator(('gwf6', 'evta', 'options', - 'tas_filerecord')) - obs_filerecord = ListTemplateGenerator(('gwf6', 'evta', 'options', - 'obs_filerecord')) - ievt = ArrayTemplateGenerator(('gwf6', 'evta', 'period', 'ievt')) - surface = ArrayTemplateGenerator(('gwf6', 'evta', 'period', - 'surface')) - rate = ArrayTemplateGenerator(('gwf6', 'evta', 'period', 'rate')) - depth = ArrayTemplateGenerator(('gwf6', 'evta', 'period', 'depth')) - aux = ArrayTemplateGenerator(('gwf6', 'evta', 'period', - 'aux(iaux)')) - package_abbr = "gwfevta" - _package_type = "evta" - dfn_file_name = "gwf-evta.dfn" - - dfn = [["block options", "name readasarrays", "type keyword", "shape", - "reader urword", "optional false", "default_value True"], - ["block options", "name fixed_cell", "type keyword", "shape", - "reader urword", "optional true"], - ["block options", "name auxiliary", "type string", - "shape (naux)", "reader urword", "optional true"], - ["block options", "name auxmultname", "type string", "shape", - "reader urword", "optional true"], - ["block options", "name print_input", "type keyword", - "reader urword", "optional true"], - ["block options", "name print_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name save_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name tas_filerecord", - "type record tas6 filein tas6_filename", "shape", "reader urword", - "tagged true", "optional true", "construct_package tas", - "construct_data tas_array", "parameter_name timearrayseries"], - ["block options", "name tas6", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name filein", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name tas6_filename", "type string", - "preserve_case true", "in_record true", "reader urword", - "optional false", "tagged false"], - ["block options", "name obs_filerecord", - "type record obs6 filein obs6_filename", "shape", "reader urword", - "tagged true", "optional true", "construct_package obs", - "construct_data continuous", "parameter_name observations"], - ["block options", "name obs6", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name obs6_filename", "type string", - "preserve_case true", "in_record true", "tagged false", - "reader urword", "optional false"], - ["block period", "name iper", "type integer", - "block_variable True", "in_record true", "tagged false", "shape", - "valid", "reader urword", "optional false"], - ["block period", "name ievt", "type integer", - "shape (ncol*nrow; ncpl)", "reader readarray", "optional true"], - ["block period", "name surface", "type double precision", - "shape (ncol*nrow; ncpl)", "reader readarray", "default_value 0."], - ["block period", "name rate", "type double precision", - "shape (ncol*nrow; ncpl)", "reader readarray", - "default_value 1.e-3"], - ["block period", "name depth", "type double precision", - "shape (ncol*nrow; ncpl)", "reader readarray", - "default_value 1.0"], - ["block period", "name aux(iaux)", "type double precision", - "shape (ncol*nrow; ncpl)", "reader readarray"]] - - def __init__(self, model, loading_package=False, readasarrays=True, - fixed_cell=None, auxiliary=None, auxmultname=None, - print_input=None, print_flows=None, save_flows=None, - timearrayseries=None, observations=None, ievt=None, - surface=0., rate=1.e-3, depth=1.0, aux=None, filename=None, - pname=None, parent_file=None): - super(ModflowGwfevta, self).__init__(model, "evta", filename, pname, - loading_package, parent_file) - - # set up variables - self.readasarrays = self.build_mfdata("readasarrays", readasarrays) - self.fixed_cell = self.build_mfdata("fixed_cell", fixed_cell) - self.auxiliary = self.build_mfdata("auxiliary", auxiliary) - self.auxmultname = self.build_mfdata("auxmultname", auxmultname) - self.print_input = self.build_mfdata("print_input", print_input) - self.print_flows = self.build_mfdata("print_flows", print_flows) - self.save_flows = self.build_mfdata("save_flows", save_flows) - self._tas_filerecord = self.build_mfdata("tas_filerecord", - None) - self._tas_package = self.build_child_package("tas", timearrayseries, - "tas_array", - self._tas_filerecord) - self._obs_filerecord = self.build_mfdata("obs_filerecord", - None) - self._obs_package = self.build_child_package("obs", observations, - "continuous", - self._obs_filerecord) - self.ievt = self.build_mfdata("ievt", ievt) - self.surface = self.build_mfdata("surface", surface) - self.rate = self.build_mfdata("rate", rate) - self.depth = self.build_mfdata("depth", depth) - self.aux = self.build_mfdata("aux(iaux)", aux) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ListTemplateGenerator, ArrayTemplateGenerator + + +class ModflowGwfevta(mfpackage.MFPackage): + """ + ModflowGwfevta defines a evta package within a gwf6 model. + + Parameters + ---------- + model : MFModel + Model that this package is a part of. Package is automatically + added to model when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + readasarrays : boolean + * readasarrays (boolean) indicates that array-based input will be used + for the Evapotranspiration Package. This keyword must be specified to + use array-based input. + fixed_cell : boolean + * fixed_cell (boolean) indicates that evapotranspiration will not be + reassigned to a cell underlying the cell specified in the list if the + specified cell is inactive. + auxiliary : [string] + * auxiliary (string) defines an array of one or more auxiliary variable + names. There is no limit on the number of auxiliary variables that + can be provided on this line; however, lists of information provided + in subsequent blocks must have a column of data for each auxiliary + variable name defined here. The number of auxiliary variables + detected on this line determines the value for naux. Comments cannot + be provided anywhere on this line as they will be interpreted as + auxiliary variable names. Auxiliary variables may not be used by the + package, but they will be available for use by other parts of the + program. The program will terminate with an error if auxiliary + variables are specified on more than one line in the options block. + auxmultname : string + * auxmultname (string) name of auxiliary variable to be used as + multiplier of evapotranspiration rate. + print_input : boolean + * print_input (boolean) keyword to indicate that the list of + evapotranspiration information will be written to the listing file + immediately after it is read. + print_flows : boolean + * print_flows (boolean) keyword to indicate that the list of + evapotranspiration flow rates will be printed to the listing file for + every stress period time step in which "BUDGET PRINT" is specified in + Output Control. If there is no Output Control option and + "PRINT_FLOWS" is specified, then flow rates are printed for the last + time step of each stress period. + save_flows : boolean + * save_flows (boolean) keyword to indicate that evapotranspiration flow + terms will be written to the file specified with "BUDGET FILEOUT" in + Output Control. + timearrayseries : {varname:data} or tas_array data + * Contains data for the tas package. Data can be stored in a dictionary + containing data for the tas package with variable names as keys and + package data as values. Data just for the timearrayseries variable is + also acceptable. See tas package documentation for more information. + observations : {varname:data} or continuous data + * Contains data for the obs package. Data can be stored in a dictionary + containing data for the obs package with variable names as keys and + package data as values. Data just for the observations variable is + also acceptable. See obs package documentation for more information. + ievt : [integer] + * ievt (integer) IEVT is the layer number that defines the layer in + each vertical column where evapotranspiration is applied. If IEVT is + omitted, evapotranspiration by default is applied to cells in layer + 1. If IEVT is specified, it must be specified as the first variable + in the PERIOD block or MODFLOW will terminate with an error. + surface : [double] + * surface (double) is the elevation of the ET surface (:math:`L`). + rate : [double] + * rate (double) is the maximum ET flux rate (:math:`LT^{-1}`). + depth : [double] + * depth (double) is the ET extinction depth (:math:`L`). + aux(iaux) : [double] + * aux(iaux) (double) is an array of values for auxiliary variable + AUX(IAUX), where iaux is a value from 1 to NAUX, and AUX(IAUX) must + be listed as part of the auxiliary variables. A separate array can be + specified for each auxiliary variable. If an array is not specified + for an auxiliary variable, then a value of zero is assigned. If the + value specified here for the auxiliary variable is the same as + auxmultname, then the evapotranspiration rate will be multiplied by + this array. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + auxiliary = ListTemplateGenerator(('gwf6', 'evta', 'options', + 'auxiliary')) + tas_filerecord = ListTemplateGenerator(('gwf6', 'evta', 'options', + 'tas_filerecord')) + obs_filerecord = ListTemplateGenerator(('gwf6', 'evta', 'options', + 'obs_filerecord')) + ievt = ArrayTemplateGenerator(('gwf6', 'evta', 'period', 'ievt')) + surface = ArrayTemplateGenerator(('gwf6', 'evta', 'period', + 'surface')) + rate = ArrayTemplateGenerator(('gwf6', 'evta', 'period', 'rate')) + depth = ArrayTemplateGenerator(('gwf6', 'evta', 'period', 'depth')) + aux = ArrayTemplateGenerator(('gwf6', 'evta', 'period', + 'aux(iaux)')) + package_abbr = "gwfevta" + _package_type = "evta" + dfn_file_name = "gwf-evta.dfn" + + dfn = [["block options", "name readasarrays", "type keyword", "shape", + "reader urword", "optional false", "default_value True"], + ["block options", "name fixed_cell", "type keyword", "shape", + "reader urword", "optional true"], + ["block options", "name auxiliary", "type string", + "shape (naux)", "reader urword", "optional true"], + ["block options", "name auxmultname", "type string", "shape", + "reader urword", "optional true"], + ["block options", "name print_input", "type keyword", + "reader urword", "optional true"], + ["block options", "name print_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name save_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name tas_filerecord", + "type record tas6 filein tas6_filename", "shape", "reader urword", + "tagged true", "optional true", "construct_package tas", + "construct_data tas_array", "parameter_name timearrayseries"], + ["block options", "name tas6", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name filein", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name tas6_filename", "type string", + "preserve_case true", "in_record true", "reader urword", + "optional false", "tagged false"], + ["block options", "name obs_filerecord", + "type record obs6 filein obs6_filename", "shape", "reader urword", + "tagged true", "optional true", "construct_package obs", + "construct_data continuous", "parameter_name observations"], + ["block options", "name obs6", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name obs6_filename", "type string", + "preserve_case true", "in_record true", "tagged false", + "reader urword", "optional false"], + ["block period", "name iper", "type integer", + "block_variable True", "in_record true", "tagged false", "shape", + "valid", "reader urword", "optional false"], + ["block period", "name ievt", "type integer", + "shape (ncol*nrow; ncpl)", "reader readarray", "optional true"], + ["block period", "name surface", "type double precision", + "shape (ncol*nrow; ncpl)", "reader readarray", "default_value 0."], + ["block period", "name rate", "type double precision", + "shape (ncol*nrow; ncpl)", "reader readarray", + "default_value 1.e-3"], + ["block period", "name depth", "type double precision", + "shape (ncol*nrow; ncpl)", "reader readarray", + "default_value 1.0"], + ["block period", "name aux(iaux)", "type double precision", + "shape (ncol*nrow; ncpl)", "reader readarray"]] + + def __init__(self, model, loading_package=False, readasarrays=True, + fixed_cell=None, auxiliary=None, auxmultname=None, + print_input=None, print_flows=None, save_flows=None, + timearrayseries=None, observations=None, ievt=None, + surface=0., rate=1.e-3, depth=1.0, aux=None, filename=None, + pname=None, parent_file=None): + super(ModflowGwfevta, self).__init__(model, "evta", filename, pname, + loading_package, parent_file) + + # set up variables + self.readasarrays = self.build_mfdata("readasarrays", readasarrays) + self.fixed_cell = self.build_mfdata("fixed_cell", fixed_cell) + self.auxiliary = self.build_mfdata("auxiliary", auxiliary) + self.auxmultname = self.build_mfdata("auxmultname", auxmultname) + self.print_input = self.build_mfdata("print_input", print_input) + self.print_flows = self.build_mfdata("print_flows", print_flows) + self.save_flows = self.build_mfdata("save_flows", save_flows) + self._tas_filerecord = self.build_mfdata("tas_filerecord", + None) + self._tas_package = self.build_child_package("tas", timearrayseries, + "tas_array", + self._tas_filerecord) + self._obs_filerecord = self.build_mfdata("obs_filerecord", + None) + self._obs_package = self.build_child_package("obs", observations, + "continuous", + self._obs_filerecord) + self.ievt = self.build_mfdata("ievt", ievt) + self.surface = self.build_mfdata("surface", surface) + self.rate = self.build_mfdata("rate", rate) + self.depth = self.build_mfdata("depth", depth) + self.aux = self.build_mfdata("aux(iaux)", aux) + self._init_complete = True diff --git a/flopy/mf6/modflow/mfgwfghb.py b/flopy/mf6/modflow/mfgwfghb.py index 9e2068df9b..7ecd0dd976 100644 --- a/flopy/mf6/modflow/mfgwfghb.py +++ b/flopy/mf6/modflow/mfgwfghb.py @@ -1,213 +1,213 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ListTemplateGenerator - - -class ModflowGwfghb(mfpackage.MFPackage): - """ - ModflowGwfghb defines a ghb package within a gwf6 model. - - Parameters - ---------- - model : MFModel - Model that this package is a part of. Package is automatically - added to model when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - auxiliary : [string] - * auxiliary (string) defines an array of one or more auxiliary variable - names. There is no limit on the number of auxiliary variables that - can be provided on this line; however, lists of information provided - in subsequent blocks must have a column of data for each auxiliary - variable name defined here. The number of auxiliary variables - detected on this line determines the value for naux. Comments cannot - be provided anywhere on this line as they will be interpreted as - auxiliary variable names. Auxiliary variables may not be used by the - package, but they will be available for use by other parts of the - program. The program will terminate with an error if auxiliary - variables are specified on more than one line in the options block. - auxmultname : string - * auxmultname (string) name of auxiliary variable to be used as - multiplier of general-head boundary conductance. - boundnames : boolean - * boundnames (boolean) keyword to indicate that boundary names may be - provided with the list of general-head boundary cells. - print_input : boolean - * print_input (boolean) keyword to indicate that the list of general- - head boundary information will be written to the listing file - immediately after it is read. - print_flows : boolean - * print_flows (boolean) keyword to indicate that the list of general- - head boundary flow rates will be printed to the listing file for - every stress period time step in which "BUDGET PRINT" is specified in - Output Control. If there is no Output Control option and - "PRINT_FLOWS" is specified, then flow rates are printed for the last - time step of each stress period. - save_flows : boolean - * save_flows (boolean) keyword to indicate that general-head boundary - flow terms will be written to the file specified with "BUDGET - FILEOUT" in Output Control. - timeseries : {varname:data} or timeseries data - * Contains data for the ts package. Data can be stored in a dictionary - containing data for the ts package with variable names as keys and - package data as values. Data just for the timeseries variable is also - acceptable. See ts package documentation for more information. - observations : {varname:data} or continuous data - * Contains data for the obs package. Data can be stored in a dictionary - containing data for the obs package with variable names as keys and - package data as values. Data just for the observations variable is - also acceptable. See obs package documentation for more information. - mover : boolean - * mover (boolean) keyword to indicate that this instance of the - General-Head Boundary Package can be used with the Water Mover (MVR) - Package. When the MOVER option is specified, additional memory is - allocated within the package to store the available, provided, and - received water. - maxbound : integer - * maxbound (integer) integer value specifying the maximum number of - general-head boundary cells that will be specified for use during any - stress period. - stress_period_data : [cellid, bhead, cond, aux, boundname] - * cellid ((integer, ...)) is the cell identifier, and depends on the - type of grid that is used for the simulation. For a structured grid - that uses the DIS input file, CELLID is the layer, row, and column. - For a grid that uses the DISV input file, CELLID is the layer and - CELL2D number. If the model uses the unstructured discretization - (DISU) input file, CELLID is the node number for the cell. - * bhead (double) is the boundary head. If the Options block includes a - TIMESERIESFILE entry (see the "Time-Variable Input" section), values - can be obtained from a time series by entering the time-series name - in place of a numeric value. - * cond (double) is the hydraulic conductance of the interface between - the aquifer cell and the boundary. If the Options block includes a - TIMESERIESFILE entry (see the "Time-Variable Input" section), values - can be obtained from a time series by entering the time-series name - in place of a numeric value. - * aux (double) represents the values of the auxiliary variables for - each general-head boundary. The values of auxiliary variables must be - present for each general-head boundary. The values must be specified - in the order of the auxiliary variables specified in the OPTIONS - block. If the package supports time series and the Options block - includes a TIMESERIESFILE entry (see the "Time-Variable Input" - section), values can be obtained from a time series by entering the - time-series name in place of a numeric value. - * boundname (string) name of the general-head boundary cell. BOUNDNAME - is an ASCII character variable that can contain as many as 40 - characters. If BOUNDNAME contains spaces in it, then the entire name - must be enclosed within single quotes. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - auxiliary = ListTemplateGenerator(('gwf6', 'ghb', 'options', - 'auxiliary')) - ts_filerecord = ListTemplateGenerator(('gwf6', 'ghb', 'options', - 'ts_filerecord')) - obs_filerecord = ListTemplateGenerator(('gwf6', 'ghb', 'options', - 'obs_filerecord')) - stress_period_data = ListTemplateGenerator(('gwf6', 'ghb', 'period', - 'stress_period_data')) - package_abbr = "gwfghb" - _package_type = "ghb" - dfn_file_name = "gwf-ghb.dfn" - - dfn = [["block options", "name auxiliary", "type string", - "shape (naux)", "reader urword", "optional true"], - ["block options", "name auxmultname", "type string", "shape", - "reader urword", "optional true"], - ["block options", "name boundnames", "type keyword", "shape", - "reader urword", "optional true"], - ["block options", "name print_input", "type keyword", - "reader urword", "optional true"], - ["block options", "name print_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name save_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name ts_filerecord", - "type record ts6 filein ts6_filename", "shape", "reader urword", - "tagged true", "optional true", "construct_package ts", - "construct_data timeseries", "parameter_name timeseries"], - ["block options", "name ts6", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name filein", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name ts6_filename", "type string", - "preserve_case true", "in_record true", "reader urword", - "optional false", "tagged false"], - ["block options", "name obs_filerecord", - "type record obs6 filein obs6_filename", "shape", "reader urword", - "tagged true", "optional true", "construct_package obs", - "construct_data continuous", "parameter_name observations"], - ["block options", "name obs6", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name obs6_filename", "type string", - "preserve_case true", "in_record true", "tagged false", - "reader urword", "optional false"], - ["block options", "name mover", "type keyword", "tagged true", - "reader urword", "optional true"], - ["block dimensions", "name maxbound", "type integer", - "reader urword", "optional false"], - ["block period", "name iper", "type integer", - "block_variable True", "in_record true", "tagged false", "shape", - "valid", "reader urword", "optional false"], - ["block period", "name stress_period_data", - "type recarray cellid bhead cond aux boundname", - "shape (maxbound)", "reader urword"], - ["block period", "name cellid", "type integer", - "shape (ncelldim)", "tagged false", "in_record true", - "reader urword"], - ["block period", "name bhead", "type double precision", "shape", - "tagged false", "in_record true", "reader urword", - "time_series true"], - ["block period", "name cond", "type double precision", "shape", - "tagged false", "in_record true", "reader urword", - "time_series true"], - ["block period", "name aux", "type double precision", - "in_record true", "tagged false", "shape (naux)", "reader urword", - "optional true", "time_series true"], - ["block period", "name boundname", "type string", "shape", - "tagged false", "in_record true", "reader urword", - "optional true"]] - - def __init__(self, model, loading_package=False, auxiliary=None, - auxmultname=None, boundnames=None, print_input=None, - print_flows=None, save_flows=None, timeseries=None, - observations=None, mover=None, maxbound=None, - stress_period_data=None, filename=None, pname=None, - parent_file=None): - super(ModflowGwfghb, self).__init__(model, "ghb", filename, pname, - loading_package, parent_file) - - # set up variables - self.auxiliary = self.build_mfdata("auxiliary", auxiliary) - self.auxmultname = self.build_mfdata("auxmultname", auxmultname) - self.boundnames = self.build_mfdata("boundnames", boundnames) - self.print_input = self.build_mfdata("print_input", print_input) - self.print_flows = self.build_mfdata("print_flows", print_flows) - self.save_flows = self.build_mfdata("save_flows", save_flows) - self._ts_filerecord = self.build_mfdata("ts_filerecord", - None) - self._ts_package = self.build_child_package("ts", timeseries, - "timeseries", - self._ts_filerecord) - self._obs_filerecord = self.build_mfdata("obs_filerecord", - None) - self._obs_package = self.build_child_package("obs", observations, - "continuous", - self._obs_filerecord) - self.mover = self.build_mfdata("mover", mover) - self.maxbound = self.build_mfdata("maxbound", maxbound) - self.stress_period_data = self.build_mfdata("stress_period_data", - stress_period_data) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ListTemplateGenerator + + +class ModflowGwfghb(mfpackage.MFPackage): + """ + ModflowGwfghb defines a ghb package within a gwf6 model. + + Parameters + ---------- + model : MFModel + Model that this package is a part of. Package is automatically + added to model when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + auxiliary : [string] + * auxiliary (string) defines an array of one or more auxiliary variable + names. There is no limit on the number of auxiliary variables that + can be provided on this line; however, lists of information provided + in subsequent blocks must have a column of data for each auxiliary + variable name defined here. The number of auxiliary variables + detected on this line determines the value for naux. Comments cannot + be provided anywhere on this line as they will be interpreted as + auxiliary variable names. Auxiliary variables may not be used by the + package, but they will be available for use by other parts of the + program. The program will terminate with an error if auxiliary + variables are specified on more than one line in the options block. + auxmultname : string + * auxmultname (string) name of auxiliary variable to be used as + multiplier of general-head boundary conductance. + boundnames : boolean + * boundnames (boolean) keyword to indicate that boundary names may be + provided with the list of general-head boundary cells. + print_input : boolean + * print_input (boolean) keyword to indicate that the list of general- + head boundary information will be written to the listing file + immediately after it is read. + print_flows : boolean + * print_flows (boolean) keyword to indicate that the list of general- + head boundary flow rates will be printed to the listing file for + every stress period time step in which "BUDGET PRINT" is specified in + Output Control. If there is no Output Control option and + "PRINT_FLOWS" is specified, then flow rates are printed for the last + time step of each stress period. + save_flows : boolean + * save_flows (boolean) keyword to indicate that general-head boundary + flow terms will be written to the file specified with "BUDGET + FILEOUT" in Output Control. + timeseries : {varname:data} or timeseries data + * Contains data for the ts package. Data can be stored in a dictionary + containing data for the ts package with variable names as keys and + package data as values. Data just for the timeseries variable is also + acceptable. See ts package documentation for more information. + observations : {varname:data} or continuous data + * Contains data for the obs package. Data can be stored in a dictionary + containing data for the obs package with variable names as keys and + package data as values. Data just for the observations variable is + also acceptable. See obs package documentation for more information. + mover : boolean + * mover (boolean) keyword to indicate that this instance of the + General-Head Boundary Package can be used with the Water Mover (MVR) + Package. When the MOVER option is specified, additional memory is + allocated within the package to store the available, provided, and + received water. + maxbound : integer + * maxbound (integer) integer value specifying the maximum number of + general-head boundary cells that will be specified for use during any + stress period. + stress_period_data : [cellid, bhead, cond, aux, boundname] + * cellid ((integer, ...)) is the cell identifier, and depends on the + type of grid that is used for the simulation. For a structured grid + that uses the DIS input file, CELLID is the layer, row, and column. + For a grid that uses the DISV input file, CELLID is the layer and + CELL2D number. If the model uses the unstructured discretization + (DISU) input file, CELLID is the node number for the cell. + * bhead (double) is the boundary head. If the Options block includes a + TIMESERIESFILE entry (see the "Time-Variable Input" section), values + can be obtained from a time series by entering the time-series name + in place of a numeric value. + * cond (double) is the hydraulic conductance of the interface between + the aquifer cell and the boundary. If the Options block includes a + TIMESERIESFILE entry (see the "Time-Variable Input" section), values + can be obtained from a time series by entering the time-series name + in place of a numeric value. + * aux (double) represents the values of the auxiliary variables for + each general-head boundary. The values of auxiliary variables must be + present for each general-head boundary. The values must be specified + in the order of the auxiliary variables specified in the OPTIONS + block. If the package supports time series and the Options block + includes a TIMESERIESFILE entry (see the "Time-Variable Input" + section), values can be obtained from a time series by entering the + time-series name in place of a numeric value. + * boundname (string) name of the general-head boundary cell. BOUNDNAME + is an ASCII character variable that can contain as many as 40 + characters. If BOUNDNAME contains spaces in it, then the entire name + must be enclosed within single quotes. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + auxiliary = ListTemplateGenerator(('gwf6', 'ghb', 'options', + 'auxiliary')) + ts_filerecord = ListTemplateGenerator(('gwf6', 'ghb', 'options', + 'ts_filerecord')) + obs_filerecord = ListTemplateGenerator(('gwf6', 'ghb', 'options', + 'obs_filerecord')) + stress_period_data = ListTemplateGenerator(('gwf6', 'ghb', 'period', + 'stress_period_data')) + package_abbr = "gwfghb" + _package_type = "ghb" + dfn_file_name = "gwf-ghb.dfn" + + dfn = [["block options", "name auxiliary", "type string", + "shape (naux)", "reader urword", "optional true"], + ["block options", "name auxmultname", "type string", "shape", + "reader urword", "optional true"], + ["block options", "name boundnames", "type keyword", "shape", + "reader urword", "optional true"], + ["block options", "name print_input", "type keyword", + "reader urword", "optional true"], + ["block options", "name print_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name save_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name ts_filerecord", + "type record ts6 filein ts6_filename", "shape", "reader urword", + "tagged true", "optional true", "construct_package ts", + "construct_data timeseries", "parameter_name timeseries"], + ["block options", "name ts6", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name filein", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name ts6_filename", "type string", + "preserve_case true", "in_record true", "reader urword", + "optional false", "tagged false"], + ["block options", "name obs_filerecord", + "type record obs6 filein obs6_filename", "shape", "reader urword", + "tagged true", "optional true", "construct_package obs", + "construct_data continuous", "parameter_name observations"], + ["block options", "name obs6", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name obs6_filename", "type string", + "preserve_case true", "in_record true", "tagged false", + "reader urword", "optional false"], + ["block options", "name mover", "type keyword", "tagged true", + "reader urword", "optional true"], + ["block dimensions", "name maxbound", "type integer", + "reader urword", "optional false"], + ["block period", "name iper", "type integer", + "block_variable True", "in_record true", "tagged false", "shape", + "valid", "reader urword", "optional false"], + ["block period", "name stress_period_data", + "type recarray cellid bhead cond aux boundname", + "shape (maxbound)", "reader urword"], + ["block period", "name cellid", "type integer", + "shape (ncelldim)", "tagged false", "in_record true", + "reader urword"], + ["block period", "name bhead", "type double precision", "shape", + "tagged false", "in_record true", "reader urword", + "time_series true"], + ["block period", "name cond", "type double precision", "shape", + "tagged false", "in_record true", "reader urword", + "time_series true"], + ["block period", "name aux", "type double precision", + "in_record true", "tagged false", "shape (naux)", "reader urword", + "optional true", "time_series true"], + ["block period", "name boundname", "type string", "shape", + "tagged false", "in_record true", "reader urword", + "optional true"]] + + def __init__(self, model, loading_package=False, auxiliary=None, + auxmultname=None, boundnames=None, print_input=None, + print_flows=None, save_flows=None, timeseries=None, + observations=None, mover=None, maxbound=None, + stress_period_data=None, filename=None, pname=None, + parent_file=None): + super(ModflowGwfghb, self).__init__(model, "ghb", filename, pname, + loading_package, parent_file) + + # set up variables + self.auxiliary = self.build_mfdata("auxiliary", auxiliary) + self.auxmultname = self.build_mfdata("auxmultname", auxmultname) + self.boundnames = self.build_mfdata("boundnames", boundnames) + self.print_input = self.build_mfdata("print_input", print_input) + self.print_flows = self.build_mfdata("print_flows", print_flows) + self.save_flows = self.build_mfdata("save_flows", save_flows) + self._ts_filerecord = self.build_mfdata("ts_filerecord", + None) + self._ts_package = self.build_child_package("ts", timeseries, + "timeseries", + self._ts_filerecord) + self._obs_filerecord = self.build_mfdata("obs_filerecord", + None) + self._obs_package = self.build_child_package("obs", observations, + "continuous", + self._obs_filerecord) + self.mover = self.build_mfdata("mover", mover) + self.maxbound = self.build_mfdata("maxbound", maxbound) + self.stress_period_data = self.build_mfdata("stress_period_data", + stress_period_data) + self._init_complete = True diff --git a/flopy/mf6/modflow/mfgwfgnc.py b/flopy/mf6/modflow/mfgwfgnc.py index 6f2c788cc1..4dbf62deba 100644 --- a/flopy/mf6/modflow/mfgwfgnc.py +++ b/flopy/mf6/modflow/mfgwfgnc.py @@ -1,134 +1,134 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ListTemplateGenerator - - -class ModflowGwfgnc(mfpackage.MFPackage): - """ - ModflowGwfgnc defines a gnc package within a gwf6 model. - - Parameters - ---------- - model : MFModel - Model that this package is a part of. Package is automatically - added to model when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - print_input : boolean - * print_input (boolean) keyword to indicate that the list of GNC - information will be written to the listing file immediately after it - is read. - print_flows : boolean - * print_flows (boolean) keyword to indicate that the list of GNC flow - rates will be printed to the listing file for every stress period - time step in which "BUDGET PRINT" is specified in Output Control. If - there is no Output Control option and "PRINT_FLOWS" is specified, - then flow rates are printed for the last time step of each stress - period. - explicit : boolean - * explicit (boolean) keyword to indicate that the ghost node correction - is applied in an explicit manner on the right-hand side of the - matrix. The explicit approach will likely require additional outer - iterations. If the keyword is not specified, then the correction will - be applied in an implicit manner on the left-hand side. The implicit - approach will likely converge better, but may require additional - memory. If the EXPLICIT keyword is not specified, then the BICGSTAB - linear acceleration option should be specified within the LINEAR - block of the Sparse Matrix Solver. - numgnc : integer - * numgnc (integer) is the number of GNC entries. - numalphaj : integer - * numalphaj (integer) is the number of contributing factors. - gncdata : [cellidn, cellidm, cellidsj, alphasj] - * cellidn ((integer, ...)) is the cellid of the cell, :math:`n`, in - which the ghost node is located. For a structured grid that uses the - DIS input file, CELLIDN is the layer, row, and column numbers of the - cell. For a grid that uses the DISV input file, CELLIDN is the layer - number and CELL2D number for the two cells. If the model uses the - unstructured discretization (DISU) input file, then CELLIDN is the - node number for the cell. - * cellidm ((integer, ...)) is the cellid of the connecting cell, - :math:`m`, to which flow occurs from the ghost node. For a structured - grid that uses the DIS input file, CELLIDM is the layer, row, and - column numbers of the cell. For a grid that uses the DISV input file, - CELLIDM is the layer number and CELL2D number for the two cells. If - the model uses the unstructured discretization (DISU) input file, - then CELLIDM is the node number for the cell. - * cellidsj ((integer, ...)) is the array of CELLIDS for the - contributing j cells, which contribute to the interpolated head value - at the ghost node. This item contains one CELLID for each of the - contributing cells of the ghost node. Note that if the number of - actual contributing cells needed by the user is less than NUMALPHAJ - for any ghost node, then a dummy CELLID of zero(s) should be inserted - with an associated contributing factor of zero. For a structured grid - that uses the DIS input file, CELLID is the layer, row, and column - numbers of the cell. For a grid that uses the DISV input file, CELLID - is the layer number and cell2d number for the two cells. If the model - uses the unstructured discretization (DISU) input file, then CELLID - is the node number for the cell. - * alphasj (double) is the contributing factors for each contributing - node in CELLIDSJ. Note that if the number of actual contributing - cells is less than NUMALPHAJ for any ghost node, then dummy CELLIDS - should be inserted with an associated contributing factor of zero. - The sum of ALPHASJ should be less than one. This is because one minus - the sum of ALPHASJ is equal to the alpha term (alpha n in equation - 4-61 of the GWF Model report) that is multiplied by the head in cell - n. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - gncdata = ListTemplateGenerator(('gwf6', 'gnc', 'gncdata', - 'gncdata')) - package_abbr = "gwfgnc" - _package_type = "gnc" - dfn_file_name = "gwf-gnc.dfn" - - dfn = [["block options", "name print_input", "type keyword", - "reader urword", "optional true"], - ["block options", "name print_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name explicit", "type keyword", "tagged true", - "reader urword", "optional true"], - ["block dimensions", "name numgnc", "type integer", - "reader urword", "optional false"], - ["block dimensions", "name numalphaj", "type integer", - "reader urword", "optional false"], - ["block gncdata", "name gncdata", - "type recarray cellidn cellidm cellidsj alphasj", - "shape (maxbound)", "reader urword"], - ["block gncdata", "name cellidn", "type integer", "shape", - "tagged false", "in_record true", "reader urword", - "numeric_index true"], - ["block gncdata", "name cellidm", "type integer", "shape", - "tagged false", "in_record true", "reader urword", - "numeric_index true"], - ["block gncdata", "name cellidsj", "type integer", - "shape (numalphaj)", "tagged false", "in_record true", - "reader urword", "numeric_index true"], - ["block gncdata", "name alphasj", "type double precision", - "shape (numalphaj)", "tagged false", "in_record true", - "reader urword"]] - - def __init__(self, model, loading_package=False, print_input=None, - print_flows=None, explicit=None, numgnc=None, numalphaj=None, - gncdata=None, filename=None, pname=None, parent_file=None): - super(ModflowGwfgnc, self).__init__(model, "gnc", filename, pname, - loading_package, parent_file) - - # set up variables - self.print_input = self.build_mfdata("print_input", print_input) - self.print_flows = self.build_mfdata("print_flows", print_flows) - self.explicit = self.build_mfdata("explicit", explicit) - self.numgnc = self.build_mfdata("numgnc", numgnc) - self.numalphaj = self.build_mfdata("numalphaj", numalphaj) - self.gncdata = self.build_mfdata("gncdata", gncdata) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ListTemplateGenerator + + +class ModflowGwfgnc(mfpackage.MFPackage): + """ + ModflowGwfgnc defines a gnc package within a gwf6 model. + + Parameters + ---------- + model : MFModel + Model that this package is a part of. Package is automatically + added to model when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + print_input : boolean + * print_input (boolean) keyword to indicate that the list of GNC + information will be written to the listing file immediately after it + is read. + print_flows : boolean + * print_flows (boolean) keyword to indicate that the list of GNC flow + rates will be printed to the listing file for every stress period + time step in which "BUDGET PRINT" is specified in Output Control. If + there is no Output Control option and "PRINT_FLOWS" is specified, + then flow rates are printed for the last time step of each stress + period. + explicit : boolean + * explicit (boolean) keyword to indicate that the ghost node correction + is applied in an explicit manner on the right-hand side of the + matrix. The explicit approach will likely require additional outer + iterations. If the keyword is not specified, then the correction will + be applied in an implicit manner on the left-hand side. The implicit + approach will likely converge better, but may require additional + memory. If the EXPLICIT keyword is not specified, then the BICGSTAB + linear acceleration option should be specified within the LINEAR + block of the Sparse Matrix Solver. + numgnc : integer + * numgnc (integer) is the number of GNC entries. + numalphaj : integer + * numalphaj (integer) is the number of contributing factors. + gncdata : [cellidn, cellidm, cellidsj, alphasj] + * cellidn ((integer, ...)) is the cellid of the cell, :math:`n`, in + which the ghost node is located. For a structured grid that uses the + DIS input file, CELLIDN is the layer, row, and column numbers of the + cell. For a grid that uses the DISV input file, CELLIDN is the layer + number and CELL2D number for the two cells. If the model uses the + unstructured discretization (DISU) input file, then CELLIDN is the + node number for the cell. + * cellidm ((integer, ...)) is the cellid of the connecting cell, + :math:`m`, to which flow occurs from the ghost node. For a structured + grid that uses the DIS input file, CELLIDM is the layer, row, and + column numbers of the cell. For a grid that uses the DISV input file, + CELLIDM is the layer number and CELL2D number for the two cells. If + the model uses the unstructured discretization (DISU) input file, + then CELLIDM is the node number for the cell. + * cellidsj ((integer, ...)) is the array of CELLIDS for the + contributing j cells, which contribute to the interpolated head value + at the ghost node. This item contains one CELLID for each of the + contributing cells of the ghost node. Note that if the number of + actual contributing cells needed by the user is less than NUMALPHAJ + for any ghost node, then a dummy CELLID of zero(s) should be inserted + with an associated contributing factor of zero. For a structured grid + that uses the DIS input file, CELLID is the layer, row, and column + numbers of the cell. For a grid that uses the DISV input file, CELLID + is the layer number and cell2d number for the two cells. If the model + uses the unstructured discretization (DISU) input file, then CELLID + is the node number for the cell. + * alphasj (double) is the contributing factors for each contributing + node in CELLIDSJ. Note that if the number of actual contributing + cells is less than NUMALPHAJ for any ghost node, then dummy CELLIDS + should be inserted with an associated contributing factor of zero. + The sum of ALPHASJ should be less than one. This is because one minus + the sum of ALPHASJ is equal to the alpha term (alpha n in equation + 4-61 of the GWF Model report) that is multiplied by the head in cell + n. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + gncdata = ListTemplateGenerator(('gwf6', 'gnc', 'gncdata', + 'gncdata')) + package_abbr = "gwfgnc" + _package_type = "gnc" + dfn_file_name = "gwf-gnc.dfn" + + dfn = [["block options", "name print_input", "type keyword", + "reader urword", "optional true"], + ["block options", "name print_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name explicit", "type keyword", "tagged true", + "reader urword", "optional true"], + ["block dimensions", "name numgnc", "type integer", + "reader urword", "optional false"], + ["block dimensions", "name numalphaj", "type integer", + "reader urword", "optional false"], + ["block gncdata", "name gncdata", + "type recarray cellidn cellidm cellidsj alphasj", + "shape (maxbound)", "reader urword"], + ["block gncdata", "name cellidn", "type integer", "shape", + "tagged false", "in_record true", "reader urword", + "numeric_index true"], + ["block gncdata", "name cellidm", "type integer", "shape", + "tagged false", "in_record true", "reader urword", + "numeric_index true"], + ["block gncdata", "name cellidsj", "type integer", + "shape (numalphaj)", "tagged false", "in_record true", + "reader urword", "numeric_index true"], + ["block gncdata", "name alphasj", "type double precision", + "shape (numalphaj)", "tagged false", "in_record true", + "reader urword"]] + + def __init__(self, model, loading_package=False, print_input=None, + print_flows=None, explicit=None, numgnc=None, numalphaj=None, + gncdata=None, filename=None, pname=None, parent_file=None): + super(ModflowGwfgnc, self).__init__(model, "gnc", filename, pname, + loading_package, parent_file) + + # set up variables + self.print_input = self.build_mfdata("print_input", print_input) + self.print_flows = self.build_mfdata("print_flows", print_flows) + self.explicit = self.build_mfdata("explicit", explicit) + self.numgnc = self.build_mfdata("numgnc", numgnc) + self.numalphaj = self.build_mfdata("numalphaj", numalphaj) + self.gncdata = self.build_mfdata("gncdata", gncdata) + self._init_complete = True diff --git a/flopy/mf6/modflow/mfgwfgwf.py b/flopy/mf6/modflow/mfgwfgwf.py index 8364715059..54d7c90705 100644 --- a/flopy/mf6/modflow/mfgwfgwf.py +++ b/flopy/mf6/modflow/mfgwfgwf.py @@ -1,272 +1,272 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ListTemplateGenerator - - -class ModflowGwfgwf(mfpackage.MFPackage): - """ - ModflowGwfgwf defines a gwfgwf package. - - Parameters - ---------- - simulation : MFSimulation - Simulation that this package is a part of. Package is automatically - added to simulation when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - exgtype : - * is the exchange type (GWF-GWF or GWF-GWT). - exgmnamea : - * is the name of the first model that is part of this exchange. - exgmnameb : - * is the name of the second model that is part of this exchange. - auxiliary : [string] - * auxiliary (string) an array of auxiliary variable names. There is no - limit on the number of auxiliary variables that can be provided. Most - auxiliary variables will not be used by the GWF-GWF Exchange, but - they will be available for use by other parts of the program. If an - auxiliary variable with the name "ANGLDEGX" is found, then this - information will be used as the angle (provided in degrees) between - the connection face normal and the x axis, where a value of zero - indicates that a normal vector points directly along the positive x - axis. The connection face normal is a normal vector on the cell face - shared between the cell in model 1 and the cell in model 2 pointing - away from the model 1 cell. Additional information on "ANGLDEGX" is - provided in the description of the DISU Package. If an auxiliary - variable with the name "CDIST" is found, then this information will - be used as the straight-line connection distance, including the - vertical component, between the two cell centers. Both ANGLDEGX and - CDIST are required if specific discharge is calculated for either of - the groundwater models. - print_input : boolean - * print_input (boolean) keyword to indicate that the list of exchange - entries will be echoed to the listing file immediately after it is - read. - print_flows : boolean - * print_flows (boolean) keyword to indicate that the list of exchange - flow rates will be printed to the listing file for every stress - period in which "SAVE BUDGET" is specified in Output Control. - save_flows : boolean - * save_flows (boolean) keyword to indicate that cell-by-cell flow terms - will be written to the budget file for each model provided that the - Output Control for the models are set up with the "BUDGET SAVE FILE" - option. - cell_averaging : string - * cell_averaging (string) is a keyword and text keyword to indicate the - method that will be used for calculating the conductance for - horizontal cell connections. The text value for CELL_AVERAGING can be - "HARMONIC", "LOGARITHMIC", or "AMT-LMK", which means "arithmetic-mean - thickness and logarithmic-mean hydraulic conductivity". If the user - does not specify a value for CELL_AVERAGING, then the harmonic-mean - method will be used. - cvoptions : [dewatered] - * dewatered (string) If the DEWATERED keyword is specified, then the - vertical conductance is calculated using only the saturated thickness - and properties of the overlying cell if the head in the underlying - cell is below its top. - newton : boolean - * newton (boolean) keyword that activates the Newton-Raphson - formulation for groundwater flow between connected, convertible - groundwater cells. Cells will not dry when this option is used. - gnc_filerecord : [gnc6_filename] - * gnc6_filename (string) is the file name for ghost node correction - input file. Information for the ghost nodes are provided in the file - provided with these keywords. The format for specifying the ghost - nodes is the same as described for the GNC Package of the GWF Model. - This includes specifying OPTIONS, DIMENSIONS, and GNCDATA blocks. The - order of the ghost nodes must follow the same order as the order of - the cells in the EXCHANGEDATA block. For the GNCDATA, noden and all - of the nodej values are assumed to be located in model 1, and nodem - is assumed to be in model 2. - mvr_filerecord : [mvr6_filename] - * mvr6_filename (string) is the file name of the water mover input file - to apply to this exchange. Information for the water mover are - provided in the file provided with these keywords. The format for - specifying the water mover information is the same as described for - the Water Mover (MVR) Package of the GWF Model, with two exceptions. - First, in the PACKAGES block, the model name must be included as a - separate string before each package. Second, the appropriate model - name must be included before package name 1 and package name 2 in the - BEGIN PERIOD block. This allows providers and receivers to be located - in both models listed as part of this exchange. - observations : {varname:data} or continuous data - * Contains data for the obs package. Data can be stored in a dictionary - containing data for the obs package with variable names as keys and - package data as values. Data just for the observations variable is - also acceptable. See obs package documentation for more information. - nexg : integer - * nexg (integer) keyword and integer value specifying the number of - GWF-GWF exchanges. - exchangedata : [cellidm1, cellidm2, ihc, cl1, cl2, hwva, aux] - * cellidm1 ((integer, ...)) is the cellid of the cell in model 1 as - specified in the simulation name file. For a structured grid that - uses the DIS input file, CELLIDM1 is the layer, row, and column - numbers of the cell. For a grid that uses the DISV input file, - CELLIDM1 is the layer number and CELL2D number for the two cells. If - the model uses the unstructured discretization (DISU) input file, - then CELLIDM1 is the node number for the cell. - * cellidm2 ((integer, ...)) is the cellid of the cell in model 2 as - specified in the simulation name file. For a structured grid that - uses the DIS input file, CELLIDM2 is the layer, row, and column - numbers of the cell. For a grid that uses the DISV input file, - CELLIDM2 is the layer number and CELL2D number for the two cells. If - the model uses the unstructured discretization (DISU) input file, - then CELLIDM2 is the node number for the cell. - * ihc (integer) is an integer flag indicating the direction between - node n and all of its m connections. If IHC = 0 then the connection - is vertical. If IHC = 1 then the connection is horizontal. If IHC = 2 - then the connection is horizontal for a vertically staggered grid. - * cl1 (double) is the distance between the center of cell 1 and the its - shared face with cell 2. - * cl2 (double) is the distance between the center of cell 2 and the its - shared face with cell 1. - * hwva (double) is the horizontal width of the flow connection between - cell 1 and cell 2 if IHC :math:`>` 0, or it is the area perpendicular - to flow of the vertical connection between cell 1 and cell 2 if IHC = - 0. - * aux (double) represents the values of the auxiliary variables for - each GWFGWF Exchange. The values of auxiliary variables must be - present for each exchange. The values must be specified in the order - of the auxiliary variables specified in the OPTIONS block. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - auxiliary = ListTemplateGenerator(('gwfgwf', 'options', 'auxiliary')) - gnc_filerecord = ListTemplateGenerator(('gwfgwf', 'options', - 'gnc_filerecord')) - mvr_filerecord = ListTemplateGenerator(('gwfgwf', 'options', - 'mvr_filerecord')) - obs_filerecord = ListTemplateGenerator(('gwfgwf', 'options', - 'obs_filerecord')) - exchangedata = ListTemplateGenerator(('gwfgwf', 'exchangedata', - 'exchangedata')) - package_abbr = "gwfgwf" - _package_type = "gwfgwf" - dfn_file_name = "exg-gwfgwf.dfn" - - dfn = [["block options", "name auxiliary", "type string", - "shape (naux)", "reader urword", "optional true"], - ["block options", "name print_input", "type keyword", - "reader urword", "optional true"], - ["block options", "name print_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name save_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name cell_averaging", "type string", - "valid harmonic logarithmic amt-lmk", "reader urword", - "optional true"], - ["block options", "name cvoptions", - "type record variablecv dewatered", "reader urword", - "optional true"], - ["block options", "name variablecv", "in_record true", - "type keyword", "reader urword"], - ["block options", "name dewatered", "in_record true", - "type keyword", "reader urword", "optional true"], - ["block options", "name newton", "type keyword", "reader urword", - "optional true"], - ["block options", "name gnc_filerecord", - "type record gnc6 filein gnc6_filename", "shape", "reader urword", - "tagged true", "optional true"], - ["block options", "name filein", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name gnc6", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name gnc6_filename", "type string", - "preserve_case true", "in_record true", "tagged false", - "reader urword", "optional false"], - ["block options", "name mvr_filerecord", - "type record mvr6 filein mvr6_filename", "shape", "reader urword", - "tagged true", "optional true"], - ["block options", "name mvr6", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name mvr6_filename", "type string", - "preserve_case true", "in_record true", "tagged false", - "reader urword", "optional false"], - ["block options", "name obs_filerecord", - "type record obs6 filein obs6_filename", "shape", "reader urword", - "tagged true", "optional true", "construct_package obs", - "construct_data continuous", "parameter_name observations"], - ["block options", "name obs6", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name obs6_filename", "type string", - "preserve_case true", "in_record true", "tagged false", - "reader urword", "optional false"], - ["block dimensions", "name nexg", "type integer", - "reader urword", "optional false"], - ["block exchangedata", "name exchangedata", - "type recarray cellidm1 cellidm2 ihc cl1 cl2 hwva aux", - "reader urword", "optional false"], - ["block exchangedata", "name cellidm1", "type integer", - "in_record true", "tagged false", "reader urword", - "optional false", "numeric_index true"], - ["block exchangedata", "name cellidm2", "type integer", - "in_record true", "tagged false", "reader urword", - "optional false", "numeric_index true"], - ["block exchangedata", "name ihc", "type integer", - "in_record true", "tagged false", "reader urword", - "optional false"], - ["block exchangedata", "name cl1", "type double precision", - "in_record true", "tagged false", "reader urword", - "optional false"], - ["block exchangedata", "name cl2", "type double precision", - "in_record true", "tagged false", "reader urword", - "optional false"], - ["block exchangedata", "name hwva", "type double precision", - "in_record true", "tagged false", "reader urword", - "optional false"], - ["block exchangedata", "name aux", "type double precision", - "in_record true", "tagged false", "shape (naux)", "reader urword", - "optional true"]] - - def __init__(self, simulation, loading_package=False, exgtype=None, - exgmnamea=None, exgmnameb=None, auxiliary=None, - print_input=None, print_flows=None, save_flows=None, - cell_averaging=None, cvoptions=None, newton=None, - gnc_filerecord=None, mvr_filerecord=None, observations=None, - nexg=None, exchangedata=None, filename=None, pname=None, - parent_file=None): - super(ModflowGwfgwf, self).__init__(simulation, "gwfgwf", filename, pname, - loading_package, parent_file) - - # set up variables - self.exgtype = exgtype - - self.exgmnamea = exgmnamea - - self.exgmnameb = exgmnameb - - simulation.register_exchange_file(self) - - self.auxiliary = self.build_mfdata("auxiliary", auxiliary) - self.print_input = self.build_mfdata("print_input", print_input) - self.print_flows = self.build_mfdata("print_flows", print_flows) - self.save_flows = self.build_mfdata("save_flows", save_flows) - self.cell_averaging = self.build_mfdata("cell_averaging", - cell_averaging) - self.cvoptions = self.build_mfdata("cvoptions", cvoptions) - self.newton = self.build_mfdata("newton", newton) - self.gnc_filerecord = self.build_mfdata("gnc_filerecord", - gnc_filerecord) - self.mvr_filerecord = self.build_mfdata("mvr_filerecord", - mvr_filerecord) - self._obs_filerecord = self.build_mfdata("obs_filerecord", - None) - self._obs_package = self.build_child_package("obs", observations, - "continuous", - self._obs_filerecord) - self.nexg = self.build_mfdata("nexg", nexg) - self.exchangedata = self.build_mfdata("exchangedata", exchangedata) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ListTemplateGenerator + + +class ModflowGwfgwf(mfpackage.MFPackage): + """ + ModflowGwfgwf defines a gwfgwf package. + + Parameters + ---------- + simulation : MFSimulation + Simulation that this package is a part of. Package is automatically + added to simulation when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + exgtype : + * is the exchange type (GWF-GWF or GWF-GWT). + exgmnamea : + * is the name of the first model that is part of this exchange. + exgmnameb : + * is the name of the second model that is part of this exchange. + auxiliary : [string] + * auxiliary (string) an array of auxiliary variable names. There is no + limit on the number of auxiliary variables that can be provided. Most + auxiliary variables will not be used by the GWF-GWF Exchange, but + they will be available for use by other parts of the program. If an + auxiliary variable with the name "ANGLDEGX" is found, then this + information will be used as the angle (provided in degrees) between + the connection face normal and the x axis, where a value of zero + indicates that a normal vector points directly along the positive x + axis. The connection face normal is a normal vector on the cell face + shared between the cell in model 1 and the cell in model 2 pointing + away from the model 1 cell. Additional information on "ANGLDEGX" is + provided in the description of the DISU Package. If an auxiliary + variable with the name "CDIST" is found, then this information will + be used as the straight-line connection distance, including the + vertical component, between the two cell centers. Both ANGLDEGX and + CDIST are required if specific discharge is calculated for either of + the groundwater models. + print_input : boolean + * print_input (boolean) keyword to indicate that the list of exchange + entries will be echoed to the listing file immediately after it is + read. + print_flows : boolean + * print_flows (boolean) keyword to indicate that the list of exchange + flow rates will be printed to the listing file for every stress + period in which "SAVE BUDGET" is specified in Output Control. + save_flows : boolean + * save_flows (boolean) keyword to indicate that cell-by-cell flow terms + will be written to the budget file for each model provided that the + Output Control for the models are set up with the "BUDGET SAVE FILE" + option. + cell_averaging : string + * cell_averaging (string) is a keyword and text keyword to indicate the + method that will be used for calculating the conductance for + horizontal cell connections. The text value for CELL_AVERAGING can be + "HARMONIC", "LOGARITHMIC", or "AMT-LMK", which means "arithmetic-mean + thickness and logarithmic-mean hydraulic conductivity". If the user + does not specify a value for CELL_AVERAGING, then the harmonic-mean + method will be used. + cvoptions : [dewatered] + * dewatered (string) If the DEWATERED keyword is specified, then the + vertical conductance is calculated using only the saturated thickness + and properties of the overlying cell if the head in the underlying + cell is below its top. + newton : boolean + * newton (boolean) keyword that activates the Newton-Raphson + formulation for groundwater flow between connected, convertible + groundwater cells. Cells will not dry when this option is used. + gnc_filerecord : [gnc6_filename] + * gnc6_filename (string) is the file name for ghost node correction + input file. Information for the ghost nodes are provided in the file + provided with these keywords. The format for specifying the ghost + nodes is the same as described for the GNC Package of the GWF Model. + This includes specifying OPTIONS, DIMENSIONS, and GNCDATA blocks. The + order of the ghost nodes must follow the same order as the order of + the cells in the EXCHANGEDATA block. For the GNCDATA, noden and all + of the nodej values are assumed to be located in model 1, and nodem + is assumed to be in model 2. + mvr_filerecord : [mvr6_filename] + * mvr6_filename (string) is the file name of the water mover input file + to apply to this exchange. Information for the water mover are + provided in the file provided with these keywords. The format for + specifying the water mover information is the same as described for + the Water Mover (MVR) Package of the GWF Model, with two exceptions. + First, in the PACKAGES block, the model name must be included as a + separate string before each package. Second, the appropriate model + name must be included before package name 1 and package name 2 in the + BEGIN PERIOD block. This allows providers and receivers to be located + in both models listed as part of this exchange. + observations : {varname:data} or continuous data + * Contains data for the obs package. Data can be stored in a dictionary + containing data for the obs package with variable names as keys and + package data as values. Data just for the observations variable is + also acceptable. See obs package documentation for more information. + nexg : integer + * nexg (integer) keyword and integer value specifying the number of + GWF-GWF exchanges. + exchangedata : [cellidm1, cellidm2, ihc, cl1, cl2, hwva, aux] + * cellidm1 ((integer, ...)) is the cellid of the cell in model 1 as + specified in the simulation name file. For a structured grid that + uses the DIS input file, CELLIDM1 is the layer, row, and column + numbers of the cell. For a grid that uses the DISV input file, + CELLIDM1 is the layer number and CELL2D number for the two cells. If + the model uses the unstructured discretization (DISU) input file, + then CELLIDM1 is the node number for the cell. + * cellidm2 ((integer, ...)) is the cellid of the cell in model 2 as + specified in the simulation name file. For a structured grid that + uses the DIS input file, CELLIDM2 is the layer, row, and column + numbers of the cell. For a grid that uses the DISV input file, + CELLIDM2 is the layer number and CELL2D number for the two cells. If + the model uses the unstructured discretization (DISU) input file, + then CELLIDM2 is the node number for the cell. + * ihc (integer) is an integer flag indicating the direction between + node n and all of its m connections. If IHC = 0 then the connection + is vertical. If IHC = 1 then the connection is horizontal. If IHC = 2 + then the connection is horizontal for a vertically staggered grid. + * cl1 (double) is the distance between the center of cell 1 and the its + shared face with cell 2. + * cl2 (double) is the distance between the center of cell 2 and the its + shared face with cell 1. + * hwva (double) is the horizontal width of the flow connection between + cell 1 and cell 2 if IHC :math:`>` 0, or it is the area perpendicular + to flow of the vertical connection between cell 1 and cell 2 if IHC = + 0. + * aux (double) represents the values of the auxiliary variables for + each GWFGWF Exchange. The values of auxiliary variables must be + present for each exchange. The values must be specified in the order + of the auxiliary variables specified in the OPTIONS block. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + auxiliary = ListTemplateGenerator(('gwfgwf', 'options', 'auxiliary')) + gnc_filerecord = ListTemplateGenerator(('gwfgwf', 'options', + 'gnc_filerecord')) + mvr_filerecord = ListTemplateGenerator(('gwfgwf', 'options', + 'mvr_filerecord')) + obs_filerecord = ListTemplateGenerator(('gwfgwf', 'options', + 'obs_filerecord')) + exchangedata = ListTemplateGenerator(('gwfgwf', 'exchangedata', + 'exchangedata')) + package_abbr = "gwfgwf" + _package_type = "gwfgwf" + dfn_file_name = "exg-gwfgwf.dfn" + + dfn = [["block options", "name auxiliary", "type string", + "shape (naux)", "reader urword", "optional true"], + ["block options", "name print_input", "type keyword", + "reader urword", "optional true"], + ["block options", "name print_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name save_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name cell_averaging", "type string", + "valid harmonic logarithmic amt-lmk", "reader urword", + "optional true"], + ["block options", "name cvoptions", + "type record variablecv dewatered", "reader urword", + "optional true"], + ["block options", "name variablecv", "in_record true", + "type keyword", "reader urword"], + ["block options", "name dewatered", "in_record true", + "type keyword", "reader urword", "optional true"], + ["block options", "name newton", "type keyword", "reader urword", + "optional true"], + ["block options", "name gnc_filerecord", + "type record gnc6 filein gnc6_filename", "shape", "reader urword", + "tagged true", "optional true"], + ["block options", "name filein", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name gnc6", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name gnc6_filename", "type string", + "preserve_case true", "in_record true", "tagged false", + "reader urword", "optional false"], + ["block options", "name mvr_filerecord", + "type record mvr6 filein mvr6_filename", "shape", "reader urword", + "tagged true", "optional true"], + ["block options", "name mvr6", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name mvr6_filename", "type string", + "preserve_case true", "in_record true", "tagged false", + "reader urword", "optional false"], + ["block options", "name obs_filerecord", + "type record obs6 filein obs6_filename", "shape", "reader urword", + "tagged true", "optional true", "construct_package obs", + "construct_data continuous", "parameter_name observations"], + ["block options", "name obs6", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name obs6_filename", "type string", + "preserve_case true", "in_record true", "tagged false", + "reader urword", "optional false"], + ["block dimensions", "name nexg", "type integer", + "reader urword", "optional false"], + ["block exchangedata", "name exchangedata", + "type recarray cellidm1 cellidm2 ihc cl1 cl2 hwva aux", + "reader urword", "optional false"], + ["block exchangedata", "name cellidm1", "type integer", + "in_record true", "tagged false", "reader urword", + "optional false", "numeric_index true"], + ["block exchangedata", "name cellidm2", "type integer", + "in_record true", "tagged false", "reader urword", + "optional false", "numeric_index true"], + ["block exchangedata", "name ihc", "type integer", + "in_record true", "tagged false", "reader urword", + "optional false"], + ["block exchangedata", "name cl1", "type double precision", + "in_record true", "tagged false", "reader urword", + "optional false"], + ["block exchangedata", "name cl2", "type double precision", + "in_record true", "tagged false", "reader urword", + "optional false"], + ["block exchangedata", "name hwva", "type double precision", + "in_record true", "tagged false", "reader urword", + "optional false"], + ["block exchangedata", "name aux", "type double precision", + "in_record true", "tagged false", "shape (naux)", "reader urword", + "optional true"]] + + def __init__(self, simulation, loading_package=False, exgtype=None, + exgmnamea=None, exgmnameb=None, auxiliary=None, + print_input=None, print_flows=None, save_flows=None, + cell_averaging=None, cvoptions=None, newton=None, + gnc_filerecord=None, mvr_filerecord=None, observations=None, + nexg=None, exchangedata=None, filename=None, pname=None, + parent_file=None): + super(ModflowGwfgwf, self).__init__(simulation, "gwfgwf", filename, pname, + loading_package, parent_file) + + # set up variables + self.exgtype = exgtype + + self.exgmnamea = exgmnamea + + self.exgmnameb = exgmnameb + + simulation.register_exchange_file(self) + + self.auxiliary = self.build_mfdata("auxiliary", auxiliary) + self.print_input = self.build_mfdata("print_input", print_input) + self.print_flows = self.build_mfdata("print_flows", print_flows) + self.save_flows = self.build_mfdata("save_flows", save_flows) + self.cell_averaging = self.build_mfdata("cell_averaging", + cell_averaging) + self.cvoptions = self.build_mfdata("cvoptions", cvoptions) + self.newton = self.build_mfdata("newton", newton) + self.gnc_filerecord = self.build_mfdata("gnc_filerecord", + gnc_filerecord) + self.mvr_filerecord = self.build_mfdata("mvr_filerecord", + mvr_filerecord) + self._obs_filerecord = self.build_mfdata("obs_filerecord", + None) + self._obs_package = self.build_child_package("obs", observations, + "continuous", + self._obs_filerecord) + self.nexg = self.build_mfdata("nexg", nexg) + self.exchangedata = self.build_mfdata("exchangedata", exchangedata) + self._init_complete = True diff --git a/flopy/mf6/modflow/mfgwfhfb.py b/flopy/mf6/modflow/mfgwfhfb.py index b111d4405a..038ea7f9bc 100644 --- a/flopy/mf6/modflow/mfgwfhfb.py +++ b/flopy/mf6/modflow/mfgwfhfb.py @@ -1,95 +1,95 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ListTemplateGenerator - - -class ModflowGwfhfb(mfpackage.MFPackage): - """ - ModflowGwfhfb defines a hfb package within a gwf6 model. - - Parameters - ---------- - model : MFModel - Model that this package is a part of. Package is automatically - added to model when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - print_input : boolean - * print_input (boolean) keyword to indicate that the list of horizontal - flow barriers will be written to the listing file immediately after - it is read. - maxhfb : integer - * maxhfb (integer) integer value specifying the maximum number of - horizontal flow barriers that will be entered in this input file. The - value of MAXHFB is used to allocate memory for the horizontal flow - barriers. - stress_period_data : [cellid1, cellid2, hydchr] - * cellid1 ((integer, ...)) identifier for the first cell. For a - structured grid that uses the DIS input file, CELLID1 is the layer, - row, and column numbers of the cell. For a grid that uses the DISV - input file, CELLID1 is the layer number and CELL2D number for the two - cells. If the model uses the unstructured discretization (DISU) input - file, then CELLID1 is the node numbers for the cell. The barrier is - located between cells designated as CELLID1 and CELLID2. For models - that use the DIS and DISV grid types, the layer number for CELLID1 - and CELLID2 must be the same. For all grid types, cells must be - horizontally adjacent or the program will terminate with an error. - * cellid2 ((integer, ...)) identifier for the second cell. See CELLID1 - for description of how to specify. - * hydchr (double) is the hydraulic characteristic of the horizontal- - flow barrier. The hydraulic characteristic is the barrier hydraulic - conductivity divided by the width of the horizontal-flow barrier. If - the hydraulic characteristic is negative, then the absolute value of - HYDCHR acts as a multiplier to the conductance between the two model - cells specified as containing the barrier. For example, if the value - for HYDCHR was specified as -1.5, the conductance calculated for the - two cells would be multiplied by 1.5. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - stress_period_data = ListTemplateGenerator(('gwf6', 'hfb', 'period', - 'stress_period_data')) - package_abbr = "gwfhfb" - _package_type = "hfb" - dfn_file_name = "gwf-hfb.dfn" - - dfn = [["block options", "name print_input", "type keyword", - "reader urword", "optional true"], - ["block dimensions", "name maxhfb", "type integer", - "reader urword", "optional false"], - ["block period", "name iper", "type integer", - "block_variable True", "in_record true", "tagged false", "shape", - "valid", "reader urword", "optional false"], - ["block period", "name stress_period_data", - "type recarray cellid1 cellid2 hydchr", "shape (maxhfb)", - "reader urword"], - ["block period", "name cellid1", "type integer", - "shape (ncelldim)", "tagged false", "in_record true", - "reader urword"], - ["block period", "name cellid2", "type integer", - "shape (ncelldim)", "tagged false", "in_record true", - "reader urword"], - ["block period", "name hydchr", "type double precision", "shape", - "tagged false", "in_record true", "reader urword"]] - - def __init__(self, model, loading_package=False, print_input=None, - maxhfb=None, stress_period_data=None, filename=None, - pname=None, parent_file=None): - super(ModflowGwfhfb, self).__init__(model, "hfb", filename, pname, - loading_package, parent_file) - - # set up variables - self.print_input = self.build_mfdata("print_input", print_input) - self.maxhfb = self.build_mfdata("maxhfb", maxhfb) - self.stress_period_data = self.build_mfdata("stress_period_data", - stress_period_data) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ListTemplateGenerator + + +class ModflowGwfhfb(mfpackage.MFPackage): + """ + ModflowGwfhfb defines a hfb package within a gwf6 model. + + Parameters + ---------- + model : MFModel + Model that this package is a part of. Package is automatically + added to model when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + print_input : boolean + * print_input (boolean) keyword to indicate that the list of horizontal + flow barriers will be written to the listing file immediately after + it is read. + maxhfb : integer + * maxhfb (integer) integer value specifying the maximum number of + horizontal flow barriers that will be entered in this input file. The + value of MAXHFB is used to allocate memory for the horizontal flow + barriers. + stress_period_data : [cellid1, cellid2, hydchr] + * cellid1 ((integer, ...)) identifier for the first cell. For a + structured grid that uses the DIS input file, CELLID1 is the layer, + row, and column numbers of the cell. For a grid that uses the DISV + input file, CELLID1 is the layer number and CELL2D number for the two + cells. If the model uses the unstructured discretization (DISU) input + file, then CELLID1 is the node numbers for the cell. The barrier is + located between cells designated as CELLID1 and CELLID2. For models + that use the DIS and DISV grid types, the layer number for CELLID1 + and CELLID2 must be the same. For all grid types, cells must be + horizontally adjacent or the program will terminate with an error. + * cellid2 ((integer, ...)) identifier for the second cell. See CELLID1 + for description of how to specify. + * hydchr (double) is the hydraulic characteristic of the horizontal- + flow barrier. The hydraulic characteristic is the barrier hydraulic + conductivity divided by the width of the horizontal-flow barrier. If + the hydraulic characteristic is negative, then the absolute value of + HYDCHR acts as a multiplier to the conductance between the two model + cells specified as containing the barrier. For example, if the value + for HYDCHR was specified as -1.5, the conductance calculated for the + two cells would be multiplied by 1.5. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + stress_period_data = ListTemplateGenerator(('gwf6', 'hfb', 'period', + 'stress_period_data')) + package_abbr = "gwfhfb" + _package_type = "hfb" + dfn_file_name = "gwf-hfb.dfn" + + dfn = [["block options", "name print_input", "type keyword", + "reader urword", "optional true"], + ["block dimensions", "name maxhfb", "type integer", + "reader urword", "optional false"], + ["block period", "name iper", "type integer", + "block_variable True", "in_record true", "tagged false", "shape", + "valid", "reader urword", "optional false"], + ["block period", "name stress_period_data", + "type recarray cellid1 cellid2 hydchr", "shape (maxhfb)", + "reader urword"], + ["block period", "name cellid1", "type integer", + "shape (ncelldim)", "tagged false", "in_record true", + "reader urword"], + ["block period", "name cellid2", "type integer", + "shape (ncelldim)", "tagged false", "in_record true", + "reader urword"], + ["block period", "name hydchr", "type double precision", "shape", + "tagged false", "in_record true", "reader urword"]] + + def __init__(self, model, loading_package=False, print_input=None, + maxhfb=None, stress_period_data=None, filename=None, + pname=None, parent_file=None): + super(ModflowGwfhfb, self).__init__(model, "hfb", filename, pname, + loading_package, parent_file) + + # set up variables + self.print_input = self.build_mfdata("print_input", print_input) + self.maxhfb = self.build_mfdata("maxhfb", maxhfb) + self.stress_period_data = self.build_mfdata("stress_period_data", + stress_period_data) + self._init_complete = True diff --git a/flopy/mf6/modflow/mfgwfic.py b/flopy/mf6/modflow/mfgwfic.py index 0a0e33168a..5b7ac8531b 100644 --- a/flopy/mf6/modflow/mfgwfic.py +++ b/flopy/mf6/modflow/mfgwfic.py @@ -1,56 +1,56 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ArrayTemplateGenerator - - -class ModflowGwfic(mfpackage.MFPackage): - """ - ModflowGwfic defines a ic package within a gwf6 model. - - Parameters - ---------- - model : MFModel - Model that this package is a part of. Package is automatically - added to model when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - strt : [double] - * strt (double) is the initial (starting) head---that is, head at the - beginning of the GWF Model simulation. STRT must be specified for all - simulations, including steady-state simulations. One value is read - for every model cell. For simulations in which the first stress - period is steady state, the values used for STRT generally do not - affect the simulation (exceptions may occur if cells go dry and (or) - rewet). The execution time, however, will be less if STRT includes - hydraulic heads that are close to the steady-state solution. A head - value lower than the cell bottom can be provided if a cell should - start as dry. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - strt = ArrayTemplateGenerator(('gwf6', 'ic', 'griddata', 'strt')) - package_abbr = "gwfic" - _package_type = "ic" - dfn_file_name = "gwf-ic.dfn" - - dfn = [["block griddata", "name strt", "type double precision", - "shape (nodes)", "reader readarray", "layered true", - "default_value 1.0"]] - - def __init__(self, model, loading_package=False, strt=1.0, filename=None, - pname=None, parent_file=None): - super(ModflowGwfic, self).__init__(model, "ic", filename, pname, - loading_package, parent_file) - - # set up variables - self.strt = self.build_mfdata("strt", strt) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ArrayTemplateGenerator + + +class ModflowGwfic(mfpackage.MFPackage): + """ + ModflowGwfic defines a ic package within a gwf6 model. + + Parameters + ---------- + model : MFModel + Model that this package is a part of. Package is automatically + added to model when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + strt : [double] + * strt (double) is the initial (starting) head---that is, head at the + beginning of the GWF Model simulation. STRT must be specified for all + simulations, including steady-state simulations. One value is read + for every model cell. For simulations in which the first stress + period is steady state, the values used for STRT generally do not + affect the simulation (exceptions may occur if cells go dry and (or) + rewet). The execution time, however, will be less if STRT includes + hydraulic heads that are close to the steady-state solution. A head + value lower than the cell bottom can be provided if a cell should + start as dry. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + strt = ArrayTemplateGenerator(('gwf6', 'ic', 'griddata', 'strt')) + package_abbr = "gwfic" + _package_type = "ic" + dfn_file_name = "gwf-ic.dfn" + + dfn = [["block griddata", "name strt", "type double precision", + "shape (nodes)", "reader readarray", "layered true", + "default_value 1.0"]] + + def __init__(self, model, loading_package=False, strt=1.0, filename=None, + pname=None, parent_file=None): + super(ModflowGwfic, self).__init__(model, "ic", filename, pname, + loading_package, parent_file) + + # set up variables + self.strt = self.build_mfdata("strt", strt) + self._init_complete = True diff --git a/flopy/mf6/modflow/mfgwflak.py b/flopy/mf6/modflow/mfgwflak.py index a44e23f3c9..3f7bbaed73 100644 --- a/flopy/mf6/modflow/mfgwflak.py +++ b/flopy/mf6/modflow/mfgwflak.py @@ -1,670 +1,670 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ListTemplateGenerator - - -class ModflowGwflak(mfpackage.MFPackage): - """ - ModflowGwflak defines a lak package within a gwf6 model. - - Parameters - ---------- - model : MFModel - Model that this package is a part of. Package is automatically - added to model when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - auxiliary : [string] - * auxiliary (string) defines an array of one or more auxiliary variable - names. There is no limit on the number of auxiliary variables that - can be provided on this line; however, lists of information provided - in subsequent blocks must have a column of data for each auxiliary - variable name defined here. The number of auxiliary variables - detected on this line determines the value for naux. Comments cannot - be provided anywhere on this line as they will be interpreted as - auxiliary variable names. Auxiliary variables may not be used by the - package, but they will be available for use by other parts of the - program. The program will terminate with an error if auxiliary - variables are specified on more than one line in the options block. - boundnames : boolean - * boundnames (boolean) keyword to indicate that boundary names may be - provided with the list of lake cells. - print_input : boolean - * print_input (boolean) keyword to indicate that the list of lake - information will be written to the listing file immediately after it - is read. - print_stage : boolean - * print_stage (boolean) keyword to indicate that the list of lake - stages will be printed to the listing file for every stress period in - which "HEAD PRINT" is specified in Output Control. If there is no - Output Control option and PRINT_STAGE is specified, then stages are - printed for the last time step of each stress period. - print_flows : boolean - * print_flows (boolean) keyword to indicate that the list of lake flow - rates will be printed to the listing file for every stress period - time step in which "BUDGET PRINT" is specified in Output Control. If - there is no Output Control option and "PRINT_FLOWS" is specified, - then flow rates are printed for the last time step of each stress - period. - save_flows : boolean - * save_flows (boolean) keyword to indicate that lake flow terms will be - written to the file specified with "BUDGET FILEOUT" in Output - Control. - stage_filerecord : [stagefile] - * stagefile (string) name of the binary output file to write stage - information. - budget_filerecord : [budgetfile] - * budgetfile (string) name of the binary output file to write budget - information. - timeseries : {varname:data} or timeseries data - * Contains data for the ts package. Data can be stored in a dictionary - containing data for the ts package with variable names as keys and - package data as values. Data just for the timeseries variable is also - acceptable. See ts package documentation for more information. - observations : {varname:data} or continuous data - * Contains data for the obs package. Data can be stored in a dictionary - containing data for the obs package with variable names as keys and - package data as values. Data just for the observations variable is - also acceptable. See obs package documentation for more information. - mover : boolean - * mover (boolean) keyword to indicate that this instance of the LAK - Package can be used with the Water Mover (MVR) Package. When the - MOVER option is specified, additional memory is allocated within the - package to store the available, provided, and received water. - surfdep : double - * surfdep (double) real value that defines the surface depression depth - for VERTICAL lake-GWF connections. If specified, SURFDEP must be - greater than or equal to zero. If SURFDEP is not specified, a default - value of zero is used for all vertical lake-GWF connections. - time_conversion : double - * time_conversion (double) value that is used in converting outlet flow - terms that use Manning's equation or gravitational acceleration to - consistent time units. TIME_CONVERSION should be set to 1.0, 60.0, - 3,600.0, 86,400.0, and 31,557,600.0 when using time units - (TIME_UNITS) of seconds, minutes, hours, days, or years in the - simulation, respectively. CONVTIME does not need to be specified if - no lake outlets are specified or TIME_UNITS are seconds. - length_conversion : double - * length_conversion (double) real value that is used in converting - outlet flow terms that use Manning's equation or gravitational - acceleration to consistent length units. LENGTH_CONVERSION should be - set to 3.28081, 1.0, and 100.0 when using length units (LENGTH_UNITS) - of feet, meters, or centimeters in the simulation, respectively. - LENGTH_CONVERSION does not need to be specified if no lake outlets - are specified or LENGTH_UNITS are meters. - nlakes : integer - * nlakes (integer) value specifying the number of lakes that will be - simulated for all stress periods. - noutlets : integer - * noutlets (integer) value specifying the number of outlets that will - be simulated for all stress periods. If NOUTLETS is not specified, a - default value of zero is used. - ntables : integer - * ntables (integer) value specifying the number of lakes tables that - will be used to define the lake stage, volume relation, and surface - area. If NTABLES is not specified, a default value of zero is used. - packagedata : [lakeno, strt, nlakeconn, aux, boundname] - * lakeno (integer) integer value that defines the lake number - associated with the specified PACKAGEDATA data on the line. LAKENO - must be greater than zero and less than or equal to NLAKES. Lake - information must be specified for every lake or the program will - terminate with an error. The program will also terminate with an - error if information for a lake is specified more than once. - * strt (double) real value that defines the starting stage for the - lake. - * nlakeconn (integer) integer value that defines the number of GWF - cells connected to this (LAKENO) lake. There can only be one vertical - lake connection to each GWF cell. NLAKECONN must be greater than - zero. - * aux (double) represents the values of the auxiliary variables for - each lake. The values of auxiliary variables must be present for each - lake. The values must be specified in the order of the auxiliary - variables specified in the OPTIONS block. If the package supports - time series and the Options block includes a TIMESERIESFILE entry - (see the "Time-Variable Input" section), values can be obtained from - a time series by entering the time-series name in place of a numeric - value. - * boundname (string) name of the lake cell. BOUNDNAME is an ASCII - character variable that can contain as many as 40 characters. If - BOUNDNAME contains spaces in it, then the entire name must be - enclosed within single quotes. - connectiondata : [lakeno, iconn, cellid, claktype, bedleak, belev, telev, - connlen, connwidth] - * lakeno (integer) integer value that defines the lake number - associated with the specified CONNECTIONDATA data on the line. LAKENO - must be greater than zero and less than or equal to NLAKES. Lake - connection information must be specified for every lake connection to - the GWF model (NLAKECONN) or the program will terminate with an - error. The program will also terminate with an error if connection - information for a lake connection to the GWF model is specified more - than once. - * iconn (integer) integer value that defines the GWF connection number - for this lake connection entry. ICONN must be greater than zero and - less than or equal to NLAKECONN for lake LAKENO. - * cellid ((integer, ...)) is the cell identifier, and depends on the - type of grid that is used for the simulation. For a structured grid - that uses the DIS input file, CELLID is the layer, row, and column. - For a grid that uses the DISV input file, CELLID is the layer and - CELL2D number. If the model uses the unstructured discretization - (DISU) input file, CELLID is the node number for the cell. - * claktype (string) character string that defines the lake-GWF - connection type for the lake connection. Possible lake-GWF connection - type strings include: VERTICAL--character keyword to indicate the - lake-GWF connection is vertical and connection conductance - calculations use the hydraulic conductivity corresponding to the - :math:`K_{33}` tensor component defined for CELLID in the NPF - package. HORIZONTAL--character keyword to indicate the lake-GWF - connection is horizontal and connection conductance calculations use - the hydraulic conductivity corresponding to the :math:`K_{11}` tensor - component defined for CELLID in the NPF package. EMBEDDEDH--character - keyword to indicate the lake-GWF connection is embedded in a single - cell and connection conductance calculations use the hydraulic - conductivity corresponding to the :math:`K_{11}` tensor component - defined for CELLID in the NPF package. EMBEDDEDV--character keyword - to indicate the lake-GWF connection is embedded in a single cell and - connection conductance calculations use the hydraulic conductivity - corresponding to the :math:`K_{33}` tensor component defined for - CELLID in the NPF package. Embedded lakes can only be connected to a - single cell (NLAKECONN = 1) and there must be a lake table associated - with each embedded lake. - * bedleak (double) character string or real value that defines the bed - leakance for the lake-GWF connection. BEDLEAK must be greater than or - equal to zero or specified to be NONE. If BEDLEAK is specified to be - NONE, the lake-GWF connection conductance is solely a function of - aquifer properties in the connected GWF cell and lakebed sediments - are assumed to be absent. - * belev (double) real value that defines the bottom elevation for a - HORIZONTAL lake-GWF connection. Any value can be specified if - CLAKTYPE is VERTICAL, EMBEDDEDH, or EMBEDDEDV. If CLAKTYPE is - HORIZONTAL and BELEV is not equal to TELEV, BELEV must be greater - than or equal to the bottom of the GWF cell CELLID. If BELEV is equal - to TELEV, BELEV is reset to the bottom of the GWF cell CELLID. - * telev (double) real value that defines the top elevation for a - HORIZONTAL lake-GWF connection. Any value can be specified if - CLAKTYPE is VERTICAL, EMBEDDEDH, or EMBEDDEDV. If CLAKTYPE is - HORIZONTAL and TELEV is not equal to BELEV, TELEV must be less than - or equal to the top of the GWF cell CELLID. If TELEV is equal to - BELEV, TELEV is reset to the top of the GWF cell CELLID. - * connlen (double) real value that defines the distance between the - connected GWF CELLID node and the lake for a HORIZONTAL, EMBEDDEDH, - or EMBEDDEDV lake-GWF connection. CONLENN must be greater than zero - for a HORIZONTAL, EMBEDDEDH, or EMBEDDEDV lake-GWF connection. Any - value can be specified if CLAKTYPE is VERTICAL. - * connwidth (double) real value that defines the connection face width - for a HORIZONTAL lake-GWF connection. CONNWIDTH must be greater than - zero for a HORIZONTAL lake-GWF connection. Any value can be specified - if CLAKTYPE is VERTICAL, EMBEDDEDH, or EMBEDDEDV. - tables : [lakeno, tab6_filename] - * lakeno (integer) integer value that defines the lake number - associated with the specified TABLES data on the line. LAKENO must be - greater than zero and less than or equal to NLAKES. The program will - terminate with an error if table information for a lake is specified - more than once or the number of specified tables is less than - NTABLES. - * tab6_filename (string) character string that defines the path and - filename for the file containing lake table data for the lake - connection. The CTABNAME file includes the number of entries in the - file and the relation between stage, surface area, and volume for - each entry in the file. Lake table files for EMBEDDEDH and EMBEDDEDV - lake-GWF connections also include lake-GWF exchange area data for - each entry in the file. Input instructions for the CTABNAME file is - included at the LAK package lake table file input instructions - section. - outlets : [outletno, lakein, lakeout, couttype, invert, width, rough, - slope] - * outletno (integer) integer value that defines the outlet number - associated with the specified OUTLETS data on the line. OUTLETNO must - be greater than zero and less than or equal to NOUTLETS. Outlet - information must be specified for every outlet or the program will - terminate with an error. The program will also terminate with an - error if information for a outlet is specified more than once. - * lakein (integer) integer value that defines the lake number that - outlet is connected to. LAKEIN must be greater than zero and less - than or equal to NLAKES. - * lakeout (integer) integer value that defines the lake number that - outlet discharge from lake outlet OUTLETNO is routed to. LAKEOUT must - be greater than or equal to zero and less than or equal to NLAKES. If - LAKEOUT is zero, outlet discharge from lake outlet OUTLETNO is - discharged to an external boundary. - * couttype (string) character string that defines the outlet type for - the outlet OUTLETNO. Possible COUTTYPE strings include: SPECIFIED-- - character keyword to indicate the outlet is defined as a specified - flow. MANNING--character keyword to indicate the outlet is defined - using Manning's equation. WEIR--character keyword to indicate the - outlet is defined using a sharp weir equation. - * invert (double) real value that defines the invert elevation for the - lake outlet. Any value can be specified if COUTTYPE is SPECIFIED. If - the Options block includes a TIMESERIESFILE entry (see the "Time- - Variable Input" section), values can be obtained from a time series - by entering the time-series name in place of a numeric value. - * width (double) real value that defines the width of the lake outlet. - Any value can be specified if COUTTYPE is SPECIFIED. If the Options - block includes a TIMESERIESFILE entry (see the "Time-Variable Input" - section), values can be obtained from a time series by entering the - time-series name in place of a numeric value. - * rough (double) real value that defines the roughness coefficient for - the lake outlet. Any value can be specified if COUTTYPE is not - MANNING. If the Options block includes a TIMESERIESFILE entry (see - the "Time-Variable Input" section), values can be obtained from a - time series by entering the time-series name in place of a numeric - value. - * slope (double) real value that defines the bed slope for the lake - outlet. Any value can be specified if COUTTYPE is not MANNING. If the - Options block includes a TIMESERIESFILE entry (see the "Time-Variable - Input" section), values can be obtained from a time series by - entering the time-series name in place of a numeric value. - lakeperioddata : [lakeno, laksetting] - * lakeno (integer) integer value that defines the lake number - associated with the specified PERIOD data on the line. LAKENO must be - greater than zero and less than or equal to NLAKES. - * laksetting (keystring) line of information that is parsed into a - keyword and values. Keyword values that can be used to start the - LAKSETTING string include: STATUS, STAGE, RAINFALL, EVAPORATION, - RUNOFFON, WITHDRAWAL, and AUXILIARY. - status : [string] - * status (string) keyword option to define lake status. STATUS - can be ACTIVE, INACTIVE, or CONSTANT. By default, STATUS is - ACTIVE. - stage : [string] - * stage (string) real or character value that defines the stage - for the lake. The specified STAGE is only applied if the lake - is a constant stage lake. If the Options block includes a - TIMESERIESFILE entry (see the "Time-Variable Input" section), - values can be obtained from a time series by entering the - time-series name in place of a numeric value. - rainfall : [string] - * rainfall (string) real or character value that defines the - rainfall rate :math:`(LT^{-1})` for the lake. Value must be - greater than or equal to zero. If the Options block includes - a TIMESERIESFILE entry (see the "Time-Variable Input" - section), values can be obtained from a time series by - entering the time-series name in place of a numeric value. - evaporation : [string] - * evaporation (string) real or character value that defines the - maximum evaporation rate :math:`(LT^{-1})` for the lake. - Value must be greater than or equal to zero. If the Options - block includes a TIMESERIESFILE entry (see the "Time-Variable - Input" section), values can be obtained from a time series by - entering the time-series name in place of a numeric value. - runoff : [string] - * runoff (string) real or character value that defines the - runoff rate :math:`(L^3 T^{-1})` for the lake. Value must be - greater than or equal to zero. If the Options block includes - a TIMESERIESFILE entry (see the "Time-Variable Input" - section), values can be obtained from a time series by - entering the time-series name in place of a numeric value. - withdrawal : [string] - * withdrawal (string) real or character value that defines the - maximum withdrawal rate :math:`(L^3 T^{-1})` for the lake. - Value must be greater than or equal to zero. If the Options - block includes a TIMESERIESFILE entry (see the "Time-Variable - Input" section), values can be obtained from a time series by - entering the time-series name in place of a numeric value. - auxiliaryrecord : [auxname, auxval] - * auxname (string) name for the auxiliary variable to be - assigned AUXVAL. AUXNAME must match one of the auxiliary - variable names defined in the OPTIONS block. If AUXNAME does - not match one of the auxiliary variable names defined in the - OPTIONS block the data are ignored. - * auxval (double) value for the auxiliary variable. If the - Options block includes a TIMESERIESFILE entry (see the "Time- - Variable Input" section), values can be obtained from a time - series by entering the time-series name in place of a numeric - value. - outletperioddata : [outletno, outletsetting] - * outletno (integer) integer value that defines the outlet number - associated with the specified PERIOD data on the line. OUTLETNO must - be greater than zero and less than or equal to NOUTLETS. - * outletsetting (keystring) line of information that is parsed into a - keyword and values. Keyword values that can be used to start the - OUTLETSETTING string include: RATE, INVERT, WIDTH, SLOPE, and ROUGH. - rate : [string] - * rate (string) real or character value that defines the - extraction rate for the lake outflow. A positive value - indicates inflow and a negative value indicates outflow from - the lake. RATE only applies to active (IBOUND :math:`>` 0) - lakes. A specified RATE is only applied if COUTTYPE for the - OUTLETNO is SPECIFIED. If the Options block includes a - TIMESERIESFILE entry (see the "Time-Variable Input" section), - values can be obtained from a time series by entering the - time-series name in place of a numeric value. By default, the - RATE for each SPECIFIED lake outlet is zero. - invert : [string] - * invert (string) real or character value that defines the - invert elevation for the lake outlet. A specified INVERT - value is only used for active lakes if COUTTYPE for lake - outlet OUTLETNO is not SPECIFIED. If the Options block - includes a TIMESERIESFILE entry (see the "Time-Variable - Input" section), values can be obtained from a time series by - entering the time-series name in place of a numeric value. - width : [string] - * width (string) real or character value that defines the width - of the lake outlet. A specified WIDTH value is only used for - active lakes if COUTTYPE for lake outlet OUTLETNO is not - SPECIFIED. If the Options block includes a TIMESERIESFILE - entry (see the "Time-Variable Input" section), values can be - obtained from a time series by entering the time-series name - in place of a numeric value. - slope : [string] - * slope (string) real or character value that defines the bed - slope for the lake outlet. A specified SLOPE value is only - used for active lakes if COUTTYPE for lake outlet OUTLETNO is - MANNING. If the Options block includes a TIMESERIESFILE entry - (see the "Time-Variable Input" section), values can be - obtained from a time series by entering the time-series name - in place of a numeric value. - rough : [string] - * rough (string) real value that defines the roughness - coefficient for the lake outlet. Any value can be specified - if COUTTYPE is not MANNING. If the Options block includes a - TIMESERIESFILE entry (see the "Time-Variable Input" section), - values can be obtained from a time series by entering the - time-series name in place of a numeric value. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - auxiliary = ListTemplateGenerator(('gwf6', 'lak', 'options', - 'auxiliary')) - stage_filerecord = ListTemplateGenerator(('gwf6', 'lak', 'options', - 'stage_filerecord')) - budget_filerecord = ListTemplateGenerator(('gwf6', 'lak', 'options', - 'budget_filerecord')) - ts_filerecord = ListTemplateGenerator(('gwf6', 'lak', 'options', - 'ts_filerecord')) - obs_filerecord = ListTemplateGenerator(('gwf6', 'lak', 'options', - 'obs_filerecord')) - packagedata = ListTemplateGenerator(('gwf6', 'lak', 'packagedata', - 'packagedata')) - connectiondata = ListTemplateGenerator(('gwf6', 'lak', - 'connectiondata', - 'connectiondata')) - tables = ListTemplateGenerator(('gwf6', 'lak', 'tables', 'tables')) - outlets = ListTemplateGenerator(('gwf6', 'lak', 'outlets', - 'outlets')) - lakeperioddata = ListTemplateGenerator(('gwf6', 'lak', 'period', - 'lakeperioddata')) - outletperioddata = ListTemplateGenerator(('gwf6', 'lak', 'period', - 'outletperioddata')) - package_abbr = "gwflak" - _package_type = "lak" - dfn_file_name = "gwf-lak.dfn" - - dfn = [["block options", "name auxiliary", "type string", - "shape (naux)", "reader urword", "optional true"], - ["block options", "name boundnames", "type keyword", "shape", - "reader urword", "optional true"], - ["block options", "name print_input", "type keyword", - "reader urword", "optional true"], - ["block options", "name print_stage", "type keyword", - "reader urword", "optional true"], - ["block options", "name print_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name save_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name stage_filerecord", - "type record stage fileout stagefile", "shape", "reader urword", - "tagged true", "optional true"], - ["block options", "name stage", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name stagefile", "type string", - "preserve_case true", "shape", "in_record true", "reader urword", - "tagged false", "optional false"], - ["block options", "name budget_filerecord", - "type record budget fileout budgetfile", "shape", "reader urword", - "tagged true", "optional true"], - ["block options", "name budget", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name fileout", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name budgetfile", "type string", - "preserve_case true", "shape", "in_record true", "reader urword", - "tagged false", "optional false"], - ["block options", "name ts_filerecord", - "type record ts6 filein ts6_filename", "shape", "reader urword", - "tagged true", "optional true", "construct_package ts", - "construct_data timeseries", "parameter_name timeseries"], - ["block options", "name ts6", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name filein", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name ts6_filename", "type string", - "preserve_case true", "in_record true", "reader urword", - "optional false", "tagged false"], - ["block options", "name obs_filerecord", - "type record obs6 filein obs6_filename", "shape", "reader urword", - "tagged true", "optional true", "construct_package obs", - "construct_data continuous", "parameter_name observations"], - ["block options", "name obs6", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name obs6_filename", "type string", - "preserve_case true", "in_record true", "tagged false", - "reader urword", "optional false"], - ["block options", "name mover", "type keyword", "tagged true", - "reader urword", "optional true"], - ["block options", "name surfdep", "type double precision", - "reader urword", "optional true"], - ["block options", "name time_conversion", - "type double precision", "reader urword", "optional true"], - ["block options", "name length_conversion", - "type double precision", "reader urword", "optional true"], - ["block dimensions", "name nlakes", "type integer", - "reader urword", "optional false"], - ["block dimensions", "name noutlets", "type integer", - "reader urword", "optional false"], - ["block dimensions", "name ntables", "type integer", - "reader urword", "optional false"], - ["block packagedata", "name packagedata", - "type recarray lakeno strt nlakeconn aux boundname", - "shape (maxbound)", "reader urword"], - ["block packagedata", "name lakeno", "type integer", "shape", - "tagged false", "in_record true", "reader urword", - "numeric_index true"], - ["block packagedata", "name strt", "type double precision", - "shape", "tagged false", "in_record true", "reader urword"], - ["block packagedata", "name nlakeconn", "type integer", "shape", - "tagged false", "in_record true", "reader urword"], - ["block packagedata", "name aux", "type double precision", - "in_record true", "tagged false", "shape (naux)", "reader urword", - "time_series true", "optional true"], - ["block packagedata", "name boundname", "type string", "shape", - "tagged false", "in_record true", "reader urword", - "optional true"], - ["block connectiondata", "name connectiondata", - "type recarray lakeno iconn cellid claktype bedleak belev telev " - "connlen connwidth", - "shape (sum(nlakeconn))", "reader urword"], - ["block connectiondata", "name lakeno", "type integer", "shape", - "tagged false", "in_record true", "reader urword", - "numeric_index true"], - ["block connectiondata", "name iconn", "type integer", "shape", - "tagged false", "in_record true", "reader urword", - "numeric_index true"], - ["block connectiondata", "name cellid", "type integer", - "shape (ncelldim)", "tagged false", "in_record true", - "reader urword"], - ["block connectiondata", "name claktype", "type string", "shape", - "tagged false", "in_record true", "reader urword"], - ["block connectiondata", "name bedleak", "type double precision", - "shape", "tagged false", "in_record true", "reader urword"], - ["block connectiondata", "name belev", "type double precision", - "shape", "tagged false", "in_record true", "reader urword"], - ["block connectiondata", "name telev", "type double precision", - "shape", "tagged false", "in_record true", "reader urword"], - ["block connectiondata", "name connlen", "type double precision", - "shape", "tagged false", "in_record true", "reader urword"], - ["block connectiondata", "name connwidth", - "type double precision", "shape", "tagged false", - "in_record true", "reader urword"], - ["block tables", "name tables", - "type recarray lakeno tab6 filein tab6_filename", - "shape (ntables)", "reader urword"], - ["block tables", "name lakeno", "type integer", "shape", - "tagged false", "in_record true", "reader urword", - "numeric_index true"], - ["block tables", "name tab6", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block tables", "name filein", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block tables", "name tab6_filename", "type string", - "preserve_case true", "in_record true", "reader urword", - "optional false", "tagged false"], - ["block outlets", "name outlets", - "type recarray outletno lakein lakeout couttype invert width " - "rough slope", - "shape (noutlets)", "reader urword"], - ["block outlets", "name outletno", "type integer", "shape", - "tagged false", "in_record true", "reader urword", - "numeric_index true"], - ["block outlets", "name lakein", "type integer", "shape", - "tagged false", "in_record true", "reader urword", - "numeric_index true"], - ["block outlets", "name lakeout", "type integer", "shape", - "tagged false", "in_record true", "reader urword", - "numeric_index true"], - ["block outlets", "name couttype", "type string", "shape", - "tagged false", "in_record true", "reader urword"], - ["block outlets", "name invert", "type double precision", - "shape", "tagged false", "in_record true", "reader urword", - "time_series true"], - ["block outlets", "name width", "type double precision", "shape", - "tagged false", "in_record true", "reader urword", - "time_series true"], - ["block outlets", "name rough", "type double precision", "shape", - "tagged false", "in_record true", "reader urword", - "time_series true"], - ["block outlets", "name slope", "type double precision", "shape", - "tagged false", "in_record true", "reader urword", - "time_series true"], - ["block period", "name iper", "type integer", - "block_variable True", "in_record true", "tagged false", "shape", - "valid", "reader urword", "optional false"], - ["block period", "name lakeperioddata", - "type recarray lakeno laksetting", "shape", "reader urword"], - ["block period", "name lakeno", "type integer", "shape", - "tagged false", "in_record true", "reader urword", - "numeric_index true"], - ["block period", "name laksetting", - "type keystring status stage rainfall evaporation runoff " - "withdrawal auxiliaryrecord", - "shape", "tagged false", "in_record true", "reader urword"], - ["block period", "name status", "type string", "shape", - "tagged true", "in_record true", "reader urword"], - ["block period", "name stage", "type string", "shape", - "tagged true", "in_record true", "time_series true", - "reader urword"], - ["block period", "name rainfall", "type string", "shape", - "tagged true", "in_record true", "reader urword", - "time_series true"], - ["block period", "name evaporation", "type string", "shape", - "tagged true", "in_record true", "reader urword", - "time_series true"], - ["block period", "name runoff", "type string", "shape", - "tagged true", "in_record true", "reader urword", - "time_series true"], - ["block period", "name withdrawal", "type string", "shape", - "tagged true", "in_record true", "reader urword", - "time_series true"], - ["block period", "name auxiliaryrecord", - "type record auxiliary auxname auxval", "shape", "tagged", - "in_record true", "reader urword"], - ["block period", "name auxiliary", "type keyword", "shape", - "in_record true", "reader urword"], - ["block period", "name auxname", "type string", "shape", - "tagged false", "in_record true", "reader urword"], - ["block period", "name auxval", "type double precision", "shape", - "tagged false", "in_record true", "reader urword", - "time_series true"], - ["block period", "name outletperioddata", - "type recarray outletno outletsetting", "shape", "reader urword"], - ["block period", "name outletno", "type integer", "shape", - "tagged false", "in_record true", "reader urword", - "numeric_index true"], - ["block period", "name outletsetting", - "type keystring rate invert width slope rough", "shape", - "tagged false", "in_record true", "reader urword"], - ["block period", "name rate", "type string", "shape", - "tagged true", "in_record true", "reader urword", - "time_series true"], - ["block period", "name invert", "type string", "shape", - "tagged true", "in_record true", "reader urword", - "time_series true"], - ["block period", "name rough", "type string", "shape", - "tagged true", "in_record true", "reader urword", - "time_series true"], - ["block period", "name width", "type string", "shape", - "tagged true", "in_record true", "reader urword", - "time_series true"], - ["block period", "name slope", "type string", "shape", - "tagged true", "in_record true", "reader urword", - "time_series true"]] - - def __init__(self, model, loading_package=False, auxiliary=None, - boundnames=None, print_input=None, print_stage=None, - print_flows=None, save_flows=None, stage_filerecord=None, - budget_filerecord=None, timeseries=None, observations=None, - mover=None, surfdep=None, time_conversion=None, - length_conversion=None, nlakes=None, noutlets=None, - ntables=None, packagedata=None, connectiondata=None, - tables=None, outlets=None, lakeperioddata=None, - outletperioddata=None, filename=None, pname=None, - parent_file=None): - super(ModflowGwflak, self).__init__(model, "lak", filename, pname, - loading_package, parent_file) - - # set up variables - self.auxiliary = self.build_mfdata("auxiliary", auxiliary) - self.boundnames = self.build_mfdata("boundnames", boundnames) - self.print_input = self.build_mfdata("print_input", print_input) - self.print_stage = self.build_mfdata("print_stage", print_stage) - self.print_flows = self.build_mfdata("print_flows", print_flows) - self.save_flows = self.build_mfdata("save_flows", save_flows) - self.stage_filerecord = self.build_mfdata("stage_filerecord", - stage_filerecord) - self.budget_filerecord = self.build_mfdata("budget_filerecord", - budget_filerecord) - self._ts_filerecord = self.build_mfdata("ts_filerecord", - None) - self._ts_package = self.build_child_package("ts", timeseries, - "timeseries", - self._ts_filerecord) - self._obs_filerecord = self.build_mfdata("obs_filerecord", - None) - self._obs_package = self.build_child_package("obs", observations, - "continuous", - self._obs_filerecord) - self.mover = self.build_mfdata("mover", mover) - self.surfdep = self.build_mfdata("surfdep", surfdep) - self.time_conversion = self.build_mfdata("time_conversion", - time_conversion) - self.length_conversion = self.build_mfdata("length_conversion", - length_conversion) - self.nlakes = self.build_mfdata("nlakes", nlakes) - self.noutlets = self.build_mfdata("noutlets", noutlets) - self.ntables = self.build_mfdata("ntables", ntables) - self.packagedata = self.build_mfdata("packagedata", packagedata) - self.connectiondata = self.build_mfdata("connectiondata", - connectiondata) - self.tables = self.build_mfdata("tables", tables) - self.outlets = self.build_mfdata("outlets", outlets) - self.lakeperioddata = self.build_mfdata("lakeperioddata", - lakeperioddata) - self.outletperioddata = self.build_mfdata("outletperioddata", - outletperioddata) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ListTemplateGenerator + + +class ModflowGwflak(mfpackage.MFPackage): + """ + ModflowGwflak defines a lak package within a gwf6 model. + + Parameters + ---------- + model : MFModel + Model that this package is a part of. Package is automatically + added to model when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + auxiliary : [string] + * auxiliary (string) defines an array of one or more auxiliary variable + names. There is no limit on the number of auxiliary variables that + can be provided on this line; however, lists of information provided + in subsequent blocks must have a column of data for each auxiliary + variable name defined here. The number of auxiliary variables + detected on this line determines the value for naux. Comments cannot + be provided anywhere on this line as they will be interpreted as + auxiliary variable names. Auxiliary variables may not be used by the + package, but they will be available for use by other parts of the + program. The program will terminate with an error if auxiliary + variables are specified on more than one line in the options block. + boundnames : boolean + * boundnames (boolean) keyword to indicate that boundary names may be + provided with the list of lake cells. + print_input : boolean + * print_input (boolean) keyword to indicate that the list of lake + information will be written to the listing file immediately after it + is read. + print_stage : boolean + * print_stage (boolean) keyword to indicate that the list of lake + stages will be printed to the listing file for every stress period in + which "HEAD PRINT" is specified in Output Control. If there is no + Output Control option and PRINT_STAGE is specified, then stages are + printed for the last time step of each stress period. + print_flows : boolean + * print_flows (boolean) keyword to indicate that the list of lake flow + rates will be printed to the listing file for every stress period + time step in which "BUDGET PRINT" is specified in Output Control. If + there is no Output Control option and "PRINT_FLOWS" is specified, + then flow rates are printed for the last time step of each stress + period. + save_flows : boolean + * save_flows (boolean) keyword to indicate that lake flow terms will be + written to the file specified with "BUDGET FILEOUT" in Output + Control. + stage_filerecord : [stagefile] + * stagefile (string) name of the binary output file to write stage + information. + budget_filerecord : [budgetfile] + * budgetfile (string) name of the binary output file to write budget + information. + timeseries : {varname:data} or timeseries data + * Contains data for the ts package. Data can be stored in a dictionary + containing data for the ts package with variable names as keys and + package data as values. Data just for the timeseries variable is also + acceptable. See ts package documentation for more information. + observations : {varname:data} or continuous data + * Contains data for the obs package. Data can be stored in a dictionary + containing data for the obs package with variable names as keys and + package data as values. Data just for the observations variable is + also acceptable. See obs package documentation for more information. + mover : boolean + * mover (boolean) keyword to indicate that this instance of the LAK + Package can be used with the Water Mover (MVR) Package. When the + MOVER option is specified, additional memory is allocated within the + package to store the available, provided, and received water. + surfdep : double + * surfdep (double) real value that defines the surface depression depth + for VERTICAL lake-GWF connections. If specified, SURFDEP must be + greater than or equal to zero. If SURFDEP is not specified, a default + value of zero is used for all vertical lake-GWF connections. + time_conversion : double + * time_conversion (double) value that is used in converting outlet flow + terms that use Manning's equation or gravitational acceleration to + consistent time units. TIME_CONVERSION should be set to 1.0, 60.0, + 3,600.0, 86,400.0, and 31,557,600.0 when using time units + (TIME_UNITS) of seconds, minutes, hours, days, or years in the + simulation, respectively. CONVTIME does not need to be specified if + no lake outlets are specified or TIME_UNITS are seconds. + length_conversion : double + * length_conversion (double) real value that is used in converting + outlet flow terms that use Manning's equation or gravitational + acceleration to consistent length units. LENGTH_CONVERSION should be + set to 3.28081, 1.0, and 100.0 when using length units (LENGTH_UNITS) + of feet, meters, or centimeters in the simulation, respectively. + LENGTH_CONVERSION does not need to be specified if no lake outlets + are specified or LENGTH_UNITS are meters. + nlakes : integer + * nlakes (integer) value specifying the number of lakes that will be + simulated for all stress periods. + noutlets : integer + * noutlets (integer) value specifying the number of outlets that will + be simulated for all stress periods. If NOUTLETS is not specified, a + default value of zero is used. + ntables : integer + * ntables (integer) value specifying the number of lakes tables that + will be used to define the lake stage, volume relation, and surface + area. If NTABLES is not specified, a default value of zero is used. + packagedata : [lakeno, strt, nlakeconn, aux, boundname] + * lakeno (integer) integer value that defines the lake number + associated with the specified PACKAGEDATA data on the line. LAKENO + must be greater than zero and less than or equal to NLAKES. Lake + information must be specified for every lake or the program will + terminate with an error. The program will also terminate with an + error if information for a lake is specified more than once. + * strt (double) real value that defines the starting stage for the + lake. + * nlakeconn (integer) integer value that defines the number of GWF + cells connected to this (LAKENO) lake. There can only be one vertical + lake connection to each GWF cell. NLAKECONN must be greater than + zero. + * aux (double) represents the values of the auxiliary variables for + each lake. The values of auxiliary variables must be present for each + lake. The values must be specified in the order of the auxiliary + variables specified in the OPTIONS block. If the package supports + time series and the Options block includes a TIMESERIESFILE entry + (see the "Time-Variable Input" section), values can be obtained from + a time series by entering the time-series name in place of a numeric + value. + * boundname (string) name of the lake cell. BOUNDNAME is an ASCII + character variable that can contain as many as 40 characters. If + BOUNDNAME contains spaces in it, then the entire name must be + enclosed within single quotes. + connectiondata : [lakeno, iconn, cellid, claktype, bedleak, belev, telev, + connlen, connwidth] + * lakeno (integer) integer value that defines the lake number + associated with the specified CONNECTIONDATA data on the line. LAKENO + must be greater than zero and less than or equal to NLAKES. Lake + connection information must be specified for every lake connection to + the GWF model (NLAKECONN) or the program will terminate with an + error. The program will also terminate with an error if connection + information for a lake connection to the GWF model is specified more + than once. + * iconn (integer) integer value that defines the GWF connection number + for this lake connection entry. ICONN must be greater than zero and + less than or equal to NLAKECONN for lake LAKENO. + * cellid ((integer, ...)) is the cell identifier, and depends on the + type of grid that is used for the simulation. For a structured grid + that uses the DIS input file, CELLID is the layer, row, and column. + For a grid that uses the DISV input file, CELLID is the layer and + CELL2D number. If the model uses the unstructured discretization + (DISU) input file, CELLID is the node number for the cell. + * claktype (string) character string that defines the lake-GWF + connection type for the lake connection. Possible lake-GWF connection + type strings include: VERTICAL--character keyword to indicate the + lake-GWF connection is vertical and connection conductance + calculations use the hydraulic conductivity corresponding to the + :math:`K_{33}` tensor component defined for CELLID in the NPF + package. HORIZONTAL--character keyword to indicate the lake-GWF + connection is horizontal and connection conductance calculations use + the hydraulic conductivity corresponding to the :math:`K_{11}` tensor + component defined for CELLID in the NPF package. EMBEDDEDH--character + keyword to indicate the lake-GWF connection is embedded in a single + cell and connection conductance calculations use the hydraulic + conductivity corresponding to the :math:`K_{11}` tensor component + defined for CELLID in the NPF package. EMBEDDEDV--character keyword + to indicate the lake-GWF connection is embedded in a single cell and + connection conductance calculations use the hydraulic conductivity + corresponding to the :math:`K_{33}` tensor component defined for + CELLID in the NPF package. Embedded lakes can only be connected to a + single cell (NLAKECONN = 1) and there must be a lake table associated + with each embedded lake. + * bedleak (double) character string or real value that defines the bed + leakance for the lake-GWF connection. BEDLEAK must be greater than or + equal to zero or specified to be NONE. If BEDLEAK is specified to be + NONE, the lake-GWF connection conductance is solely a function of + aquifer properties in the connected GWF cell and lakebed sediments + are assumed to be absent. + * belev (double) real value that defines the bottom elevation for a + HORIZONTAL lake-GWF connection. Any value can be specified if + CLAKTYPE is VERTICAL, EMBEDDEDH, or EMBEDDEDV. If CLAKTYPE is + HORIZONTAL and BELEV is not equal to TELEV, BELEV must be greater + than or equal to the bottom of the GWF cell CELLID. If BELEV is equal + to TELEV, BELEV is reset to the bottom of the GWF cell CELLID. + * telev (double) real value that defines the top elevation for a + HORIZONTAL lake-GWF connection. Any value can be specified if + CLAKTYPE is VERTICAL, EMBEDDEDH, or EMBEDDEDV. If CLAKTYPE is + HORIZONTAL and TELEV is not equal to BELEV, TELEV must be less than + or equal to the top of the GWF cell CELLID. If TELEV is equal to + BELEV, TELEV is reset to the top of the GWF cell CELLID. + * connlen (double) real value that defines the distance between the + connected GWF CELLID node and the lake for a HORIZONTAL, EMBEDDEDH, + or EMBEDDEDV lake-GWF connection. CONLENN must be greater than zero + for a HORIZONTAL, EMBEDDEDH, or EMBEDDEDV lake-GWF connection. Any + value can be specified if CLAKTYPE is VERTICAL. + * connwidth (double) real value that defines the connection face width + for a HORIZONTAL lake-GWF connection. CONNWIDTH must be greater than + zero for a HORIZONTAL lake-GWF connection. Any value can be specified + if CLAKTYPE is VERTICAL, EMBEDDEDH, or EMBEDDEDV. + tables : [lakeno, tab6_filename] + * lakeno (integer) integer value that defines the lake number + associated with the specified TABLES data on the line. LAKENO must be + greater than zero and less than or equal to NLAKES. The program will + terminate with an error if table information for a lake is specified + more than once or the number of specified tables is less than + NTABLES. + * tab6_filename (string) character string that defines the path and + filename for the file containing lake table data for the lake + connection. The CTABNAME file includes the number of entries in the + file and the relation between stage, surface area, and volume for + each entry in the file. Lake table files for EMBEDDEDH and EMBEDDEDV + lake-GWF connections also include lake-GWF exchange area data for + each entry in the file. Input instructions for the CTABNAME file is + included at the LAK package lake table file input instructions + section. + outlets : [outletno, lakein, lakeout, couttype, invert, width, rough, + slope] + * outletno (integer) integer value that defines the outlet number + associated with the specified OUTLETS data on the line. OUTLETNO must + be greater than zero and less than or equal to NOUTLETS. Outlet + information must be specified for every outlet or the program will + terminate with an error. The program will also terminate with an + error if information for a outlet is specified more than once. + * lakein (integer) integer value that defines the lake number that + outlet is connected to. LAKEIN must be greater than zero and less + than or equal to NLAKES. + * lakeout (integer) integer value that defines the lake number that + outlet discharge from lake outlet OUTLETNO is routed to. LAKEOUT must + be greater than or equal to zero and less than or equal to NLAKES. If + LAKEOUT is zero, outlet discharge from lake outlet OUTLETNO is + discharged to an external boundary. + * couttype (string) character string that defines the outlet type for + the outlet OUTLETNO. Possible COUTTYPE strings include: SPECIFIED-- + character keyword to indicate the outlet is defined as a specified + flow. MANNING--character keyword to indicate the outlet is defined + using Manning's equation. WEIR--character keyword to indicate the + outlet is defined using a sharp weir equation. + * invert (double) real value that defines the invert elevation for the + lake outlet. Any value can be specified if COUTTYPE is SPECIFIED. If + the Options block includes a TIMESERIESFILE entry (see the "Time- + Variable Input" section), values can be obtained from a time series + by entering the time-series name in place of a numeric value. + * width (double) real value that defines the width of the lake outlet. + Any value can be specified if COUTTYPE is SPECIFIED. If the Options + block includes a TIMESERIESFILE entry (see the "Time-Variable Input" + section), values can be obtained from a time series by entering the + time-series name in place of a numeric value. + * rough (double) real value that defines the roughness coefficient for + the lake outlet. Any value can be specified if COUTTYPE is not + MANNING. If the Options block includes a TIMESERIESFILE entry (see + the "Time-Variable Input" section), values can be obtained from a + time series by entering the time-series name in place of a numeric + value. + * slope (double) real value that defines the bed slope for the lake + outlet. Any value can be specified if COUTTYPE is not MANNING. If the + Options block includes a TIMESERIESFILE entry (see the "Time-Variable + Input" section), values can be obtained from a time series by + entering the time-series name in place of a numeric value. + lakeperioddata : [lakeno, laksetting] + * lakeno (integer) integer value that defines the lake number + associated with the specified PERIOD data on the line. LAKENO must be + greater than zero and less than or equal to NLAKES. + * laksetting (keystring) line of information that is parsed into a + keyword and values. Keyword values that can be used to start the + LAKSETTING string include: STATUS, STAGE, RAINFALL, EVAPORATION, + RUNOFFON, WITHDRAWAL, and AUXILIARY. + status : [string] + * status (string) keyword option to define lake status. STATUS + can be ACTIVE, INACTIVE, or CONSTANT. By default, STATUS is + ACTIVE. + stage : [string] + * stage (string) real or character value that defines the stage + for the lake. The specified STAGE is only applied if the lake + is a constant stage lake. If the Options block includes a + TIMESERIESFILE entry (see the "Time-Variable Input" section), + values can be obtained from a time series by entering the + time-series name in place of a numeric value. + rainfall : [string] + * rainfall (string) real or character value that defines the + rainfall rate :math:`(LT^{-1})` for the lake. Value must be + greater than or equal to zero. If the Options block includes + a TIMESERIESFILE entry (see the "Time-Variable Input" + section), values can be obtained from a time series by + entering the time-series name in place of a numeric value. + evaporation : [string] + * evaporation (string) real or character value that defines the + maximum evaporation rate :math:`(LT^{-1})` for the lake. + Value must be greater than or equal to zero. If the Options + block includes a TIMESERIESFILE entry (see the "Time-Variable + Input" section), values can be obtained from a time series by + entering the time-series name in place of a numeric value. + runoff : [string] + * runoff (string) real or character value that defines the + runoff rate :math:`(L^3 T^{-1})` for the lake. Value must be + greater than or equal to zero. If the Options block includes + a TIMESERIESFILE entry (see the "Time-Variable Input" + section), values can be obtained from a time series by + entering the time-series name in place of a numeric value. + withdrawal : [string] + * withdrawal (string) real or character value that defines the + maximum withdrawal rate :math:`(L^3 T^{-1})` for the lake. + Value must be greater than or equal to zero. If the Options + block includes a TIMESERIESFILE entry (see the "Time-Variable + Input" section), values can be obtained from a time series by + entering the time-series name in place of a numeric value. + auxiliaryrecord : [auxname, auxval] + * auxname (string) name for the auxiliary variable to be + assigned AUXVAL. AUXNAME must match one of the auxiliary + variable names defined in the OPTIONS block. If AUXNAME does + not match one of the auxiliary variable names defined in the + OPTIONS block the data are ignored. + * auxval (double) value for the auxiliary variable. If the + Options block includes a TIMESERIESFILE entry (see the "Time- + Variable Input" section), values can be obtained from a time + series by entering the time-series name in place of a numeric + value. + outletperioddata : [outletno, outletsetting] + * outletno (integer) integer value that defines the outlet number + associated with the specified PERIOD data on the line. OUTLETNO must + be greater than zero and less than or equal to NOUTLETS. + * outletsetting (keystring) line of information that is parsed into a + keyword and values. Keyword values that can be used to start the + OUTLETSETTING string include: RATE, INVERT, WIDTH, SLOPE, and ROUGH. + rate : [string] + * rate (string) real or character value that defines the + extraction rate for the lake outflow. A positive value + indicates inflow and a negative value indicates outflow from + the lake. RATE only applies to active (IBOUND :math:`>` 0) + lakes. A specified RATE is only applied if COUTTYPE for the + OUTLETNO is SPECIFIED. If the Options block includes a + TIMESERIESFILE entry (see the "Time-Variable Input" section), + values can be obtained from a time series by entering the + time-series name in place of a numeric value. By default, the + RATE for each SPECIFIED lake outlet is zero. + invert : [string] + * invert (string) real or character value that defines the + invert elevation for the lake outlet. A specified INVERT + value is only used for active lakes if COUTTYPE for lake + outlet OUTLETNO is not SPECIFIED. If the Options block + includes a TIMESERIESFILE entry (see the "Time-Variable + Input" section), values can be obtained from a time series by + entering the time-series name in place of a numeric value. + width : [string] + * width (string) real or character value that defines the width + of the lake outlet. A specified WIDTH value is only used for + active lakes if COUTTYPE for lake outlet OUTLETNO is not + SPECIFIED. If the Options block includes a TIMESERIESFILE + entry (see the "Time-Variable Input" section), values can be + obtained from a time series by entering the time-series name + in place of a numeric value. + slope : [string] + * slope (string) real or character value that defines the bed + slope for the lake outlet. A specified SLOPE value is only + used for active lakes if COUTTYPE for lake outlet OUTLETNO is + MANNING. If the Options block includes a TIMESERIESFILE entry + (see the "Time-Variable Input" section), values can be + obtained from a time series by entering the time-series name + in place of a numeric value. + rough : [string] + * rough (string) real value that defines the roughness + coefficient for the lake outlet. Any value can be specified + if COUTTYPE is not MANNING. If the Options block includes a + TIMESERIESFILE entry (see the "Time-Variable Input" section), + values can be obtained from a time series by entering the + time-series name in place of a numeric value. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + auxiliary = ListTemplateGenerator(('gwf6', 'lak', 'options', + 'auxiliary')) + stage_filerecord = ListTemplateGenerator(('gwf6', 'lak', 'options', + 'stage_filerecord')) + budget_filerecord = ListTemplateGenerator(('gwf6', 'lak', 'options', + 'budget_filerecord')) + ts_filerecord = ListTemplateGenerator(('gwf6', 'lak', 'options', + 'ts_filerecord')) + obs_filerecord = ListTemplateGenerator(('gwf6', 'lak', 'options', + 'obs_filerecord')) + packagedata = ListTemplateGenerator(('gwf6', 'lak', 'packagedata', + 'packagedata')) + connectiondata = ListTemplateGenerator(('gwf6', 'lak', + 'connectiondata', + 'connectiondata')) + tables = ListTemplateGenerator(('gwf6', 'lak', 'tables', 'tables')) + outlets = ListTemplateGenerator(('gwf6', 'lak', 'outlets', + 'outlets')) + lakeperioddata = ListTemplateGenerator(('gwf6', 'lak', 'period', + 'lakeperioddata')) + outletperioddata = ListTemplateGenerator(('gwf6', 'lak', 'period', + 'outletperioddata')) + package_abbr = "gwflak" + _package_type = "lak" + dfn_file_name = "gwf-lak.dfn" + + dfn = [["block options", "name auxiliary", "type string", + "shape (naux)", "reader urword", "optional true"], + ["block options", "name boundnames", "type keyword", "shape", + "reader urword", "optional true"], + ["block options", "name print_input", "type keyword", + "reader urword", "optional true"], + ["block options", "name print_stage", "type keyword", + "reader urword", "optional true"], + ["block options", "name print_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name save_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name stage_filerecord", + "type record stage fileout stagefile", "shape", "reader urword", + "tagged true", "optional true"], + ["block options", "name stage", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name stagefile", "type string", + "preserve_case true", "shape", "in_record true", "reader urword", + "tagged false", "optional false"], + ["block options", "name budget_filerecord", + "type record budget fileout budgetfile", "shape", "reader urword", + "tagged true", "optional true"], + ["block options", "name budget", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name fileout", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name budgetfile", "type string", + "preserve_case true", "shape", "in_record true", "reader urword", + "tagged false", "optional false"], + ["block options", "name ts_filerecord", + "type record ts6 filein ts6_filename", "shape", "reader urword", + "tagged true", "optional true", "construct_package ts", + "construct_data timeseries", "parameter_name timeseries"], + ["block options", "name ts6", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name filein", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name ts6_filename", "type string", + "preserve_case true", "in_record true", "reader urword", + "optional false", "tagged false"], + ["block options", "name obs_filerecord", + "type record obs6 filein obs6_filename", "shape", "reader urword", + "tagged true", "optional true", "construct_package obs", + "construct_data continuous", "parameter_name observations"], + ["block options", "name obs6", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name obs6_filename", "type string", + "preserve_case true", "in_record true", "tagged false", + "reader urword", "optional false"], + ["block options", "name mover", "type keyword", "tagged true", + "reader urword", "optional true"], + ["block options", "name surfdep", "type double precision", + "reader urword", "optional true"], + ["block options", "name time_conversion", + "type double precision", "reader urword", "optional true"], + ["block options", "name length_conversion", + "type double precision", "reader urword", "optional true"], + ["block dimensions", "name nlakes", "type integer", + "reader urword", "optional false"], + ["block dimensions", "name noutlets", "type integer", + "reader urword", "optional false"], + ["block dimensions", "name ntables", "type integer", + "reader urword", "optional false"], + ["block packagedata", "name packagedata", + "type recarray lakeno strt nlakeconn aux boundname", + "shape (maxbound)", "reader urword"], + ["block packagedata", "name lakeno", "type integer", "shape", + "tagged false", "in_record true", "reader urword", + "numeric_index true"], + ["block packagedata", "name strt", "type double precision", + "shape", "tagged false", "in_record true", "reader urword"], + ["block packagedata", "name nlakeconn", "type integer", "shape", + "tagged false", "in_record true", "reader urword"], + ["block packagedata", "name aux", "type double precision", + "in_record true", "tagged false", "shape (naux)", "reader urword", + "time_series true", "optional true"], + ["block packagedata", "name boundname", "type string", "shape", + "tagged false", "in_record true", "reader urword", + "optional true"], + ["block connectiondata", "name connectiondata", + "type recarray lakeno iconn cellid claktype bedleak belev telev " + "connlen connwidth", + "shape (sum(nlakeconn))", "reader urword"], + ["block connectiondata", "name lakeno", "type integer", "shape", + "tagged false", "in_record true", "reader urword", + "numeric_index true"], + ["block connectiondata", "name iconn", "type integer", "shape", + "tagged false", "in_record true", "reader urword", + "numeric_index true"], + ["block connectiondata", "name cellid", "type integer", + "shape (ncelldim)", "tagged false", "in_record true", + "reader urword"], + ["block connectiondata", "name claktype", "type string", "shape", + "tagged false", "in_record true", "reader urword"], + ["block connectiondata", "name bedleak", "type double precision", + "shape", "tagged false", "in_record true", "reader urword"], + ["block connectiondata", "name belev", "type double precision", + "shape", "tagged false", "in_record true", "reader urword"], + ["block connectiondata", "name telev", "type double precision", + "shape", "tagged false", "in_record true", "reader urword"], + ["block connectiondata", "name connlen", "type double precision", + "shape", "tagged false", "in_record true", "reader urword"], + ["block connectiondata", "name connwidth", + "type double precision", "shape", "tagged false", + "in_record true", "reader urword"], + ["block tables", "name tables", + "type recarray lakeno tab6 filein tab6_filename", + "shape (ntables)", "reader urword"], + ["block tables", "name lakeno", "type integer", "shape", + "tagged false", "in_record true", "reader urword", + "numeric_index true"], + ["block tables", "name tab6", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block tables", "name filein", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block tables", "name tab6_filename", "type string", + "preserve_case true", "in_record true", "reader urword", + "optional false", "tagged false"], + ["block outlets", "name outlets", + "type recarray outletno lakein lakeout couttype invert width " + "rough slope", + "shape (noutlets)", "reader urword"], + ["block outlets", "name outletno", "type integer", "shape", + "tagged false", "in_record true", "reader urword", + "numeric_index true"], + ["block outlets", "name lakein", "type integer", "shape", + "tagged false", "in_record true", "reader urword", + "numeric_index true"], + ["block outlets", "name lakeout", "type integer", "shape", + "tagged false", "in_record true", "reader urword", + "numeric_index true"], + ["block outlets", "name couttype", "type string", "shape", + "tagged false", "in_record true", "reader urword"], + ["block outlets", "name invert", "type double precision", + "shape", "tagged false", "in_record true", "reader urword", + "time_series true"], + ["block outlets", "name width", "type double precision", "shape", + "tagged false", "in_record true", "reader urword", + "time_series true"], + ["block outlets", "name rough", "type double precision", "shape", + "tagged false", "in_record true", "reader urword", + "time_series true"], + ["block outlets", "name slope", "type double precision", "shape", + "tagged false", "in_record true", "reader urword", + "time_series true"], + ["block period", "name iper", "type integer", + "block_variable True", "in_record true", "tagged false", "shape", + "valid", "reader urword", "optional false"], + ["block period", "name lakeperioddata", + "type recarray lakeno laksetting", "shape", "reader urword"], + ["block period", "name lakeno", "type integer", "shape", + "tagged false", "in_record true", "reader urword", + "numeric_index true"], + ["block period", "name laksetting", + "type keystring status stage rainfall evaporation runoff " + "withdrawal auxiliaryrecord", + "shape", "tagged false", "in_record true", "reader urword"], + ["block period", "name status", "type string", "shape", + "tagged true", "in_record true", "reader urword"], + ["block period", "name stage", "type string", "shape", + "tagged true", "in_record true", "time_series true", + "reader urword"], + ["block period", "name rainfall", "type string", "shape", + "tagged true", "in_record true", "reader urword", + "time_series true"], + ["block period", "name evaporation", "type string", "shape", + "tagged true", "in_record true", "reader urword", + "time_series true"], + ["block period", "name runoff", "type string", "shape", + "tagged true", "in_record true", "reader urword", + "time_series true"], + ["block period", "name withdrawal", "type string", "shape", + "tagged true", "in_record true", "reader urword", + "time_series true"], + ["block period", "name auxiliaryrecord", + "type record auxiliary auxname auxval", "shape", "tagged", + "in_record true", "reader urword"], + ["block period", "name auxiliary", "type keyword", "shape", + "in_record true", "reader urword"], + ["block period", "name auxname", "type string", "shape", + "tagged false", "in_record true", "reader urword"], + ["block period", "name auxval", "type double precision", "shape", + "tagged false", "in_record true", "reader urword", + "time_series true"], + ["block period", "name outletperioddata", + "type recarray outletno outletsetting", "shape", "reader urword"], + ["block period", "name outletno", "type integer", "shape", + "tagged false", "in_record true", "reader urword", + "numeric_index true"], + ["block period", "name outletsetting", + "type keystring rate invert width slope rough", "shape", + "tagged false", "in_record true", "reader urword"], + ["block period", "name rate", "type string", "shape", + "tagged true", "in_record true", "reader urword", + "time_series true"], + ["block period", "name invert", "type string", "shape", + "tagged true", "in_record true", "reader urword", + "time_series true"], + ["block period", "name rough", "type string", "shape", + "tagged true", "in_record true", "reader urword", + "time_series true"], + ["block period", "name width", "type string", "shape", + "tagged true", "in_record true", "reader urword", + "time_series true"], + ["block period", "name slope", "type string", "shape", + "tagged true", "in_record true", "reader urword", + "time_series true"]] + + def __init__(self, model, loading_package=False, auxiliary=None, + boundnames=None, print_input=None, print_stage=None, + print_flows=None, save_flows=None, stage_filerecord=None, + budget_filerecord=None, timeseries=None, observations=None, + mover=None, surfdep=None, time_conversion=None, + length_conversion=None, nlakes=None, noutlets=None, + ntables=None, packagedata=None, connectiondata=None, + tables=None, outlets=None, lakeperioddata=None, + outletperioddata=None, filename=None, pname=None, + parent_file=None): + super(ModflowGwflak, self).__init__(model, "lak", filename, pname, + loading_package, parent_file) + + # set up variables + self.auxiliary = self.build_mfdata("auxiliary", auxiliary) + self.boundnames = self.build_mfdata("boundnames", boundnames) + self.print_input = self.build_mfdata("print_input", print_input) + self.print_stage = self.build_mfdata("print_stage", print_stage) + self.print_flows = self.build_mfdata("print_flows", print_flows) + self.save_flows = self.build_mfdata("save_flows", save_flows) + self.stage_filerecord = self.build_mfdata("stage_filerecord", + stage_filerecord) + self.budget_filerecord = self.build_mfdata("budget_filerecord", + budget_filerecord) + self._ts_filerecord = self.build_mfdata("ts_filerecord", + None) + self._ts_package = self.build_child_package("ts", timeseries, + "timeseries", + self._ts_filerecord) + self._obs_filerecord = self.build_mfdata("obs_filerecord", + None) + self._obs_package = self.build_child_package("obs", observations, + "continuous", + self._obs_filerecord) + self.mover = self.build_mfdata("mover", mover) + self.surfdep = self.build_mfdata("surfdep", surfdep) + self.time_conversion = self.build_mfdata("time_conversion", + time_conversion) + self.length_conversion = self.build_mfdata("length_conversion", + length_conversion) + self.nlakes = self.build_mfdata("nlakes", nlakes) + self.noutlets = self.build_mfdata("noutlets", noutlets) + self.ntables = self.build_mfdata("ntables", ntables) + self.packagedata = self.build_mfdata("packagedata", packagedata) + self.connectiondata = self.build_mfdata("connectiondata", + connectiondata) + self.tables = self.build_mfdata("tables", tables) + self.outlets = self.build_mfdata("outlets", outlets) + self.lakeperioddata = self.build_mfdata("lakeperioddata", + lakeperioddata) + self.outletperioddata = self.build_mfdata("outletperioddata", + outletperioddata) + self._init_complete = True diff --git a/flopy/mf6/modflow/mfgwfmaw.py b/flopy/mf6/modflow/mfgwfmaw.py index b77f4376c9..057adc6b16 100644 --- a/flopy/mf6/modflow/mfgwfmaw.py +++ b/flopy/mf6/modflow/mfgwfmaw.py @@ -1,543 +1,543 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ListTemplateGenerator - - -class ModflowGwfmaw(mfpackage.MFPackage): - """ - ModflowGwfmaw defines a maw package within a gwf6 model. - - Parameters - ---------- - model : MFModel - Model that this package is a part of. Package is automatically - added to model when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - auxiliary : [string] - * auxiliary (string) defines an array of one or more auxiliary variable - names. There is no limit on the number of auxiliary variables that - can be provided on this line; however, lists of information provided - in subsequent blocks must have a column of data for each auxiliary - variable name defined here. The number of auxiliary variables - detected on this line determines the value for naux. Comments cannot - be provided anywhere on this line as they will be interpreted as - auxiliary variable names. Auxiliary variables may not be used by the - package, but they will be available for use by other parts of the - program. The program will terminate with an error if auxiliary - variables are specified on more than one line in the options block. - boundnames : boolean - * boundnames (boolean) keyword to indicate that boundary names may be - provided with the list of multi-aquifer well cells. - print_input : boolean - * print_input (boolean) keyword to indicate that the list of multi- - aquifer well information will be written to the listing file - immediately after it is read. - print_head : boolean - * print_head (boolean) keyword to indicate that the list of multi- - aquifer well heads will be printed to the listing file for every - stress period in which "HEAD PRINT" is specified in Output Control. - If there is no Output Control option and PRINT_HEAD is specified, - then heads are printed for the last time step of each stress period. - print_flows : boolean - * print_flows (boolean) keyword to indicate that the list of multi- - aquifer well flow rates will be printed to the listing file for every - stress period time step in which "BUDGET PRINT" is specified in - Output Control. If there is no Output Control option and - "PRINT_FLOWS" is specified, then flow rates are printed for the last - time step of each stress period. - save_flows : boolean - * save_flows (boolean) keyword to indicate that multi-aquifer well flow - terms will be written to the file specified with "BUDGET FILEOUT" in - Output Control. - stage_filerecord : [headfile] - * headfile (string) name of the binary output file to write stage - information. - budget_filerecord : [budgetfile] - * budgetfile (string) name of the binary output file to write budget - information. - no_well_storage : boolean - * no_well_storage (boolean) keyword that deactivates inclusion of well - storage contributions to the multi-aquifer well package continuity - equation. - flowing_wells : boolean - * flowing_wells (boolean) keyword that activates the flowing wells - option for the multi-aquifer well package. - shutdown_theta : double - * shutdown_theta (double) value that defines the weight applied to - discharge rate for wells that limit the water level in a discharging - well (defined using the HEAD_LIMIT keyword in the stress period - data). SHUTDOWN_THETA is used to control discharge rate oscillations - when the flow rate from the aquifer is less than the specified flow - rate from the aquifer to the well. Values range between 0.0 and 1.0, - and larger values increase the weight (decrease under-relaxation) - applied to the well discharge rate. The HEAD_LIMIT option has been - included to facilitate backward compatibility with previous versions - of MODFLOW but use of the RATE_SCALING option instead of the - HEAD_LIMIT option is recommended. By default, SHUTDOWN_THETA is 0.7. - shutdown_kappa : double - * shutdown_kappa (double) value that defines the weight applied to - discharge rate for wells that limit the water level in a discharging - well (defined using the HEAD_LIMIT keyword in the stress period - data). SHUTDOWN_KAPPA is used to control discharge rate oscillations - when the flow rate from the aquifer is less than the specified flow - rate from the aquifer to the well. Values range between 0.0 and 1.0, - and larger values increase the weight applied to the well discharge - rate. The HEAD_LIMIT option has been included to facilitate backward - compatibility with previous versions of MODFLOW but use of the - RATE_SCALING option instead of the HEAD_LIMIT option is recommended. - By default, SHUTDOWN_KAPPA is 0.0001. - timeseries : {varname:data} or timeseries data - * Contains data for the ts package. Data can be stored in a dictionary - containing data for the ts package with variable names as keys and - package data as values. Data just for the timeseries variable is also - acceptable. See ts package documentation for more information. - observations : {varname:data} or continuous data - * Contains data for the obs package. Data can be stored in a dictionary - containing data for the obs package with variable names as keys and - package data as values. Data just for the observations variable is - also acceptable. See obs package documentation for more information. - mover : boolean - * mover (boolean) keyword to indicate that this instance of the MAW - Package can be used with the Water Mover (MVR) Package. When the - MOVER option is specified, additional memory is allocated within the - package to store the available, provided, and received water. - nmawwells : integer - * nmawwells (integer) integer value specifying the number of multi- - aquifer wells that will be simulated for all stress periods. - packagedata : [wellno, radius, bottom, strt, condeqn, ngwfnodes, aux, - boundname] - * wellno (integer) integer value that defines the well number - associated with the specified PACKAGEDATA data on the line. WELLNO - must be greater than zero and less than or equal to NMAWWELLS. Multi- - aquifer well information must be specified for every multi-aquifer - well or the program will terminate with an error. The program will - also terminate with an error if information for a multi-aquifer well - is specified more than once. - * radius (double) radius for the multi-aquifer well. - * bottom (double) bottom elevation of the multi-aquifer well. The well - bottom is reset to the cell bottom in the lowermost GWF cell - connection in cases where the specified well bottom is above the - bottom of this GWF cell. - * strt (double) starting head for the multi-aquifer well. - * condeqn (string) character string that defines the conductance - equation that is used to calculate the saturated conductance for the - multi-aquifer well. Possible multi-aquifer well CONDEQN strings - include: SPECIFIED--character keyword to indicate the multi-aquifer - well saturated conductance will be specified. THIEM--character - keyword to indicate the multi-aquifer well saturated conductance will - be calculated using the Thiem equation, which considers the cell top - and bottom, aquifer hydraulic conductivity, and effective cell and - well radius. SKIN--character keyword to indicate that the multi- - aquifer well saturated conductance will be calculated using the cell - top and bottom, aquifer and screen hydraulic conductivity, and well - and skin radius. CUMULATIVE--character keyword to indicate that the - multi-aquifer well saturated conductance will be calculated using a - combination of the Thiem and SKIN equations. MEAN--character keyword - to indicate the multi-aquifer well saturated conductance will be - calculated using the aquifer and screen top and bottom, aquifer and - screen hydraulic conductivity, and well and skin radius. - * ngwfnodes (integer) integer value that defines the number of GWF - nodes connected to this (WELLNO) multi-aquifer well. NGWFNODES must - be greater than zero. - * aux (double) represents the values of the auxiliary variables for - each multi-aquifer well. The values of auxiliary variables must be - present for each multi-aquifer well. The values must be specified in - the order of the auxiliary variables specified in the OPTIONS block. - If the package supports time series and the Options block includes a - TIMESERIESFILE entry (see the "Time-Variable Input" section), values - can be obtained from a time series by entering the time-series name - in place of a numeric value. - * boundname (string) name of the multi-aquifer well cell. BOUNDNAME is - an ASCII character variable that can contain as many as 40 - characters. If BOUNDNAME contains spaces in it, then the entire name - must be enclosed within single quotes. - connectiondata : [wellno, icon, cellid, scrn_top, scrn_bot, hk_skin, - radius_skin] - * wellno (integer) integer value that defines the well number - associated with the specified CONNECTIONDATA data on the line. WELLNO - must be greater than zero and less than or equal to NMAWWELLS. Multi- - aquifer well connection information must be specified for every - multi-aquifer well connection to the GWF model (NGWFNODES) or the - program will terminate with an error. The program will also terminate - with an error if connection information for a multi-aquifer well - connection to the GWF model is specified more than once. - * icon (integer) integer value that defines the GWF connection number - for this multi-aquifer well connection entry. ICONN must be greater - than zero and less than or equal to NGWFNODES for multi-aquifer well - WELLNO. - * cellid ((integer, ...)) is the cell identifier, and depends on the - type of grid that is used for the simulation. For a structured grid - that uses the DIS input file, CELLID is the layer, row, and column. - For a grid that uses the DISV input file, CELLID is the layer and - CELL2D number. If the model uses the unstructured discretization - (DISU) input file, CELLID is the node number for the cell. One or - more screened intervals can be connected to the same CELLID if - CONDEQN for a well is MEAN. The program will terminate with an error - if MAW wells using SPECIFIED, THIEM, SKIN, or CUMULATIVE conductance - equations have more than one connection to the same CELLID. - * scrn_top (double) value that defines the top elevation of the screen - for the multi-aquifer well connection. If the specified SCRN_TOP is - greater than the top of the GWF cell it is set equal to the top of - the cell. SCRN_TOP can be any value if CONDEQN is SPECIFIED, THIEM, - SKIN, or COMPOSITE and SCRN_TOP is set to the top of the cell. - * scrn_bot (double) value that defines the bottom elevation of the - screen for the multi-aquifer well connection. If the specified - SCRN_BOT is less than the bottom of the GWF cell it is set equal to - the bottom of the cell. SCRN_BOT can be any value if CONDEQN is - SPECIFIED, THIEM, SKIN, or COMPOSITE and SCRN_BOT is set to the - bottom of the cell. - * hk_skin (double) value that defines the skin (filter pack) hydraulic - conductivity (if CONDEQN for the multi-aquifer well is SKIN, - CUMULATIVE, or MEAN) or conductance (if CONDEQN for the multi-aquifer - well is SPECIFIED) for each GWF node connected to the multi-aquifer - well (NGWFNODES). HK_SKIN can be any value if CONDEQN is THIEM. - * radius_skin (double) real value that defines the skin radius (filter - pack radius) for the multi-aquifer well. RADIUS_SKIN can be any value - if CONDEQN is SPECIFIED or THIEM. Otherwise, RADIUS_SKIN must be - greater than RADIUS for the multi-aquifer well. - perioddata : [wellno, mawsetting] - * wellno (integer) integer value that defines the well number - associated with the specified PERIOD data on the line. WELLNO must be - greater than zero and less than or equal to NMAWWELLS. - * mawsetting (keystring) line of information that is parsed into a - keyword and values. Keyword values that can be used to start the - MAWSETTING string include: STATUS, FLOWING_WELL, RATE, WELL_HEAD, - HEAD_LIMIT, SHUT_OFF, RATE_SCALING, and AUXILIARY. - status : [string] - * status (string) keyword option to define well status. STATUS - can be ACTIVE, INACTIVE, or CONSTANT. By default, STATUS is - ACTIVE. - flowing_wellrecord : [fwelev, fwcond, fwrlen] - * fwelev (double) elevation used to determine whether or not - the well is flowing. - * fwcond (double) conductance used to calculate the discharge - of a free flowing well. Flow occurs when the head in the well - is above the well top elevation (FWELEV). - * fwrlen (double) length used to reduce the conductance of the - flowing well. When the head in the well drops below the well - top plus the reduction length, then the conductance is - reduced. This reduction length can be used to improve the - stability of simulations with flowing wells so that there is - not an abrupt change in flowing well rates. - rate : [double] - * rate (double) is the volumetric pumping rate for the multi- - aquifer well. A positive value indicates recharge and a - negative value indicates discharge (pumping). RATE only - applies to active (IBOUND :math:`>` 0) multi-aquifer wells. - If the Options block includes a TIMESERIESFILE entry (see the - "Time-Variable Input" section), values can be obtained from a - time series by entering the time-series name in place of a - numeric value. By default, the RATE for each multi-aquifer - well is zero. - well_head : [double] - * well_head (double) is the head in the multi-aquifer well. - WELL_HEAD is only applied to constant head (STATUS is - CONSTANT) and inactive (STATUS is INACTIVE) multi-aquifer - wells. If the Options block includes a TIMESERIESFILE entry - (see the "Time-Variable Input" section), values can be - obtained from a time series by entering the time-series name - in place of a numeric value. - head_limit : [string] - * head_limit (string) is the limiting water level (head) in the - well, which is the minimum of the well RATE or the well - inflow rate from the aquifer. HEAD_LIMIT can be applied to - extraction wells (RATE :math:`<` 0) or injection wells (RATE - :math:`>` 0). HEAD\_LIMIT can be deactivated by specifying - the text string `OFF'. The HEAD\_LIMIT option is based on the - HEAD\_LIMIT functionality available in the - MNW2~\citep{konikow2009} package for MODFLOW-2005. The - HEAD\_LIMIT option has been included to facilitate backward - compatibility with previous versions of MODFLOW but use of - the RATE\_SCALING option instead of the HEAD\_LIMIT option is - recommended. By default, HEAD\_LIMIT is `OFF'. - shutoffrecord : [minrate, maxrate] - * minrate (double) is the minimum rate that a well must exceed - to shutoff a well during a stress period. The well will shut - down during a time step if the flow rate to the well from the - aquifer is less than MINRATE. If a well is shut down during a - time step, reactivation of the well cannot occur until the - next time step to reduce oscillations. MINRATE must be less - than maxrate. - * maxrate (double) is the maximum rate that a well must exceed - to reactivate a well during a stress period. The well will - reactivate during a timestep if the well was shutdown during - the previous time step and the flow rate to the well from the - aquifer exceeds maxrate. Reactivation of the well cannot - occur until the next time step if a well is shutdown to - reduce oscillations. maxrate must be greater than MINRATE. - rate_scalingrecord : [pump_elevation, scaling_length] - * pump_elevation (double) is the elevation of the multi-aquifer - well pump (PUMP_ELEVATION). PUMP_ELEVATION should not be less - than the bottom elevation (BOTTOM) of the multi-aquifer well. - * scaling_length (double) height above the pump elevation - (SCALING_LENGTH). If the simulated well head is below this - elevation (pump elevation plus the scaling length), then the - pumping rate is reduced. - auxiliaryrecord : [auxname, auxval] - * auxname (string) name for the auxiliary variable to be - assigned AUXVAL. AUXNAME must match one of the auxiliary - variable names defined in the OPTIONS block. If AUXNAME does - not match one of the auxiliary variable names defined in the - OPTIONS block the data are ignored. - * auxval (double) value for the auxiliary variable. If the - Options block includes a TIMESERIESFILE entry (see the "Time- - Variable Input" section), values can be obtained from a time - series by entering the time-series name in place of a numeric - value. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - auxiliary = ListTemplateGenerator(('gwf6', 'maw', 'options', - 'auxiliary')) - stage_filerecord = ListTemplateGenerator(('gwf6', 'maw', 'options', - 'stage_filerecord')) - budget_filerecord = ListTemplateGenerator(('gwf6', 'maw', 'options', - 'budget_filerecord')) - ts_filerecord = ListTemplateGenerator(('gwf6', 'maw', 'options', - 'ts_filerecord')) - obs_filerecord = ListTemplateGenerator(('gwf6', 'maw', 'options', - 'obs_filerecord')) - packagedata = ListTemplateGenerator(('gwf6', 'maw', 'packagedata', - 'packagedata')) - connectiondata = ListTemplateGenerator(('gwf6', 'maw', - 'connectiondata', - 'connectiondata')) - perioddata = ListTemplateGenerator(('gwf6', 'maw', 'period', - 'perioddata')) - package_abbr = "gwfmaw" - _package_type = "maw" - dfn_file_name = "gwf-maw.dfn" - - dfn = [["block options", "name auxiliary", "type string", - "shape (naux)", "reader urword", "optional true"], - ["block options", "name boundnames", "type keyword", "shape", - "reader urword", "optional true"], - ["block options", "name print_input", "type keyword", - "reader urword", "optional true"], - ["block options", "name print_head", "type keyword", - "reader urword", "optional true"], - ["block options", "name print_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name save_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name stage_filerecord", - "type record head fileout headfile", "shape", "reader urword", - "tagged true", "optional true"], - ["block options", "name head", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name headfile", "type string", - "preserve_case true", "shape", "in_record true", "reader urword", - "tagged false", "optional false"], - ["block options", "name budget_filerecord", - "type record budget fileout budgetfile", "shape", "reader urword", - "tagged true", "optional true"], - ["block options", "name budget", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name fileout", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name budgetfile", "type string", - "preserve_case true", "shape", "in_record true", "reader urword", - "tagged false", "optional false"], - ["block options", "name no_well_storage", "type keyword", - "reader urword", "optional true"], - ["block options", "name flowing_wells", "type keyword", - "reader urword", "optional true"], - ["block options", "name shutdown_theta", "type double precision", - "reader urword", "optional true"], - ["block options", "name shutdown_kappa", "type double precision", - "reader urword", "optional true"], - ["block options", "name ts_filerecord", - "type record ts6 filein ts6_filename", "shape", "reader urword", - "tagged true", "optional true", "construct_package ts", - "construct_data timeseries", "parameter_name timeseries"], - ["block options", "name ts6", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name filein", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name ts6_filename", "type string", - "preserve_case true", "in_record true", "reader urword", - "optional false", "tagged false"], - ["block options", "name obs_filerecord", - "type record obs6 filein obs6_filename", "shape", "reader urword", - "tagged true", "optional true", "construct_package obs", - "construct_data continuous", "parameter_name observations"], - ["block options", "name obs6", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name obs6_filename", "type string", - "preserve_case true", "in_record true", "tagged false", - "reader urword", "optional false"], - ["block options", "name mover", "type keyword", "tagged true", - "reader urword", "optional true"], - ["block dimensions", "name nmawwells", "type integer", - "reader urword", "optional false"], - ["block packagedata", "name packagedata", - "type recarray wellno radius bottom strt condeqn ngwfnodes aux " - "boundname", - "shape (nmawwells)", "reader urword"], - ["block packagedata", "name wellno", "type integer", "shape", - "tagged false", "in_record true", "reader urword", - "numeric_index true"], - ["block packagedata", "name radius", "type double precision", - "shape", "tagged false", "in_record true", "reader urword"], - ["block packagedata", "name bottom", "type double precision", - "shape", "tagged false", "in_record true", "reader urword"], - ["block packagedata", "name strt", "type double precision", - "shape", "tagged false", "in_record true", "reader urword"], - ["block packagedata", "name condeqn", "type string", "shape", - "tagged false", "in_record true", "reader urword"], - ["block packagedata", "name ngwfnodes", "type integer", "shape", - "tagged false", "in_record true", "reader urword"], - ["block packagedata", "name aux", "type double precision", - "in_record true", "tagged false", "shape (naux)", "reader urword", - "time_series true", "optional true"], - ["block packagedata", "name boundname", "type string", "shape", - "tagged false", "in_record true", "reader urword", - "optional true"], - ["block connectiondata", "name connectiondata", - "type recarray wellno icon cellid scrn_top scrn_bot hk_skin " - "radius_skin", - "reader urword"], - ["block connectiondata", "name wellno", "type integer", "shape", - "tagged false", "in_record true", "reader urword", - "numeric_index true"], - ["block connectiondata", "name icon", "type integer", "shape", - "tagged false", "in_record true", "reader urword", - "numeric_index true"], - ["block connectiondata", "name cellid", "type integer", - "shape (ncelldim)", "tagged false", "in_record true", - "reader urword"], - ["block connectiondata", "name scrn_top", - "type double precision", "shape", "tagged false", - "in_record true", "reader urword"], - ["block connectiondata", "name scrn_bot", - "type double precision", "shape", "tagged false", - "in_record true", "reader urword"], - ["block connectiondata", "name hk_skin", "type double precision", - "shape", "tagged false", "in_record true", "reader urword"], - ["block connectiondata", "name radius_skin", - "type double precision", "shape", "tagged false", - "in_record true", "reader urword"], - ["block period", "name iper", "type integer", - "block_variable True", "in_record true", "tagged false", "shape", - "valid", "reader urword", "optional false"], - ["block period", "name perioddata", - "type recarray wellno mawsetting", "shape", "reader urword"], - ["block period", "name wellno", "type integer", "shape", - "tagged false", "in_record true", "reader urword", - "numeric_index true"], - ["block period", "name mawsetting", - "type keystring status flowing_wellrecord rate well_head " - "head_limit shutoffrecord rate_scalingrecord auxiliaryrecord", - "shape", "tagged false", "in_record true", "reader urword"], - ["block period", "name status", "type string", "shape", - "tagged true", "in_record true", "reader urword"], - ["block period", "name flowing_wellrecord", - "type record flowing_well fwelev fwcond fwrlen", "shape", - "tagged", "in_record true", "reader urword"], - ["block period", "name flowing_well", "type keyword", "shape", - "in_record true", "reader urword"], - ["block period", "name fwelev", "type double precision", "shape", - "tagged false", "in_record true", "reader urword"], - ["block period", "name fwcond", "type double precision", "shape", - "tagged false", "in_record true", "reader urword"], - ["block period", "name fwrlen", "type double precision", "shape", - "tagged false", "in_record true", "reader urword"], - ["block period", "name rate", "type double precision", "shape", - "tagged true", "in_record true", "reader urword", - "time_series true"], - ["block period", "name well_head", "type double precision", - "shape", "tagged true", "in_record true", "reader urword", - "time_series true"], - ["block period", "name head_limit", "type string", "shape", - "tagged true", "in_record true", "reader urword"], - ["block period", "name shutoffrecord", - "type record shut_off minrate maxrate", "shape", "tagged", - "in_record true", "reader urword"], - ["block period", "name shut_off", "type keyword", "shape", - "in_record true", "reader urword"], - ["block period", "name minrate", "type double precision", - "shape", "tagged false", "in_record true", "reader urword"], - ["block period", "name maxrate", "type double precision", - "shape", "tagged false", "in_record true", "reader urword"], - ["block period", "name rate_scalingrecord", - "type record rate_scaling pump_elevation scaling_length", "shape", - "tagged", "in_record true", "reader urword"], - ["block period", "name rate_scaling", "type keyword", "shape", - "in_record true", "reader urword"], - ["block period", "name pump_elevation", "type double precision", - "shape", "tagged false", "in_record true", "reader urword"], - ["block period", "name scaling_length", "type double precision", - "shape", "tagged false", "in_record true", "reader urword"], - ["block period", "name auxiliaryrecord", - "type record auxiliary auxname auxval", "shape", "tagged", - "in_record true", "reader urword"], - ["block period", "name auxiliary", "type keyword", "shape", - "in_record true", "reader urword"], - ["block period", "name auxname", "type string", "shape", - "tagged false", "in_record true", "reader urword"], - ["block period", "name auxval", "type double precision", "shape", - "tagged false", "in_record true", "reader urword", - "time_series true"]] - - def __init__(self, model, loading_package=False, auxiliary=None, - boundnames=None, print_input=None, print_head=None, - print_flows=None, save_flows=None, stage_filerecord=None, - budget_filerecord=None, no_well_storage=None, - flowing_wells=None, shutdown_theta=None, shutdown_kappa=None, - timeseries=None, observations=None, mover=None, - nmawwells=None, packagedata=None, connectiondata=None, - perioddata=None, filename=None, pname=None, parent_file=None): - super(ModflowGwfmaw, self).__init__(model, "maw", filename, pname, - loading_package, parent_file) - - # set up variables - self.auxiliary = self.build_mfdata("auxiliary", auxiliary) - self.boundnames = self.build_mfdata("boundnames", boundnames) - self.print_input = self.build_mfdata("print_input", print_input) - self.print_head = self.build_mfdata("print_head", print_head) - self.print_flows = self.build_mfdata("print_flows", print_flows) - self.save_flows = self.build_mfdata("save_flows", save_flows) - self.stage_filerecord = self.build_mfdata("stage_filerecord", - stage_filerecord) - self.budget_filerecord = self.build_mfdata("budget_filerecord", - budget_filerecord) - self.no_well_storage = self.build_mfdata("no_well_storage", - no_well_storage) - self.flowing_wells = self.build_mfdata("flowing_wells", flowing_wells) - self.shutdown_theta = self.build_mfdata("shutdown_theta", - shutdown_theta) - self.shutdown_kappa = self.build_mfdata("shutdown_kappa", - shutdown_kappa) - self._ts_filerecord = self.build_mfdata("ts_filerecord", - None) - self._ts_package = self.build_child_package("ts", timeseries, - "timeseries", - self._ts_filerecord) - self._obs_filerecord = self.build_mfdata("obs_filerecord", - None) - self._obs_package = self.build_child_package("obs", observations, - "continuous", - self._obs_filerecord) - self.mover = self.build_mfdata("mover", mover) - self.nmawwells = self.build_mfdata("nmawwells", nmawwells) - self.packagedata = self.build_mfdata("packagedata", packagedata) - self.connectiondata = self.build_mfdata("connectiondata", - connectiondata) - self.perioddata = self.build_mfdata("perioddata", perioddata) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ListTemplateGenerator + + +class ModflowGwfmaw(mfpackage.MFPackage): + """ + ModflowGwfmaw defines a maw package within a gwf6 model. + + Parameters + ---------- + model : MFModel + Model that this package is a part of. Package is automatically + added to model when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + auxiliary : [string] + * auxiliary (string) defines an array of one or more auxiliary variable + names. There is no limit on the number of auxiliary variables that + can be provided on this line; however, lists of information provided + in subsequent blocks must have a column of data for each auxiliary + variable name defined here. The number of auxiliary variables + detected on this line determines the value for naux. Comments cannot + be provided anywhere on this line as they will be interpreted as + auxiliary variable names. Auxiliary variables may not be used by the + package, but they will be available for use by other parts of the + program. The program will terminate with an error if auxiliary + variables are specified on more than one line in the options block. + boundnames : boolean + * boundnames (boolean) keyword to indicate that boundary names may be + provided with the list of multi-aquifer well cells. + print_input : boolean + * print_input (boolean) keyword to indicate that the list of multi- + aquifer well information will be written to the listing file + immediately after it is read. + print_head : boolean + * print_head (boolean) keyword to indicate that the list of multi- + aquifer well heads will be printed to the listing file for every + stress period in which "HEAD PRINT" is specified in Output Control. + If there is no Output Control option and PRINT_HEAD is specified, + then heads are printed for the last time step of each stress period. + print_flows : boolean + * print_flows (boolean) keyword to indicate that the list of multi- + aquifer well flow rates will be printed to the listing file for every + stress period time step in which "BUDGET PRINT" is specified in + Output Control. If there is no Output Control option and + "PRINT_FLOWS" is specified, then flow rates are printed for the last + time step of each stress period. + save_flows : boolean + * save_flows (boolean) keyword to indicate that multi-aquifer well flow + terms will be written to the file specified with "BUDGET FILEOUT" in + Output Control. + stage_filerecord : [headfile] + * headfile (string) name of the binary output file to write stage + information. + budget_filerecord : [budgetfile] + * budgetfile (string) name of the binary output file to write budget + information. + no_well_storage : boolean + * no_well_storage (boolean) keyword that deactivates inclusion of well + storage contributions to the multi-aquifer well package continuity + equation. + flowing_wells : boolean + * flowing_wells (boolean) keyword that activates the flowing wells + option for the multi-aquifer well package. + shutdown_theta : double + * shutdown_theta (double) value that defines the weight applied to + discharge rate for wells that limit the water level in a discharging + well (defined using the HEAD_LIMIT keyword in the stress period + data). SHUTDOWN_THETA is used to control discharge rate oscillations + when the flow rate from the aquifer is less than the specified flow + rate from the aquifer to the well. Values range between 0.0 and 1.0, + and larger values increase the weight (decrease under-relaxation) + applied to the well discharge rate. The HEAD_LIMIT option has been + included to facilitate backward compatibility with previous versions + of MODFLOW but use of the RATE_SCALING option instead of the + HEAD_LIMIT option is recommended. By default, SHUTDOWN_THETA is 0.7. + shutdown_kappa : double + * shutdown_kappa (double) value that defines the weight applied to + discharge rate for wells that limit the water level in a discharging + well (defined using the HEAD_LIMIT keyword in the stress period + data). SHUTDOWN_KAPPA is used to control discharge rate oscillations + when the flow rate from the aquifer is less than the specified flow + rate from the aquifer to the well. Values range between 0.0 and 1.0, + and larger values increase the weight applied to the well discharge + rate. The HEAD_LIMIT option has been included to facilitate backward + compatibility with previous versions of MODFLOW but use of the + RATE_SCALING option instead of the HEAD_LIMIT option is recommended. + By default, SHUTDOWN_KAPPA is 0.0001. + timeseries : {varname:data} or timeseries data + * Contains data for the ts package. Data can be stored in a dictionary + containing data for the ts package with variable names as keys and + package data as values. Data just for the timeseries variable is also + acceptable. See ts package documentation for more information. + observations : {varname:data} or continuous data + * Contains data for the obs package. Data can be stored in a dictionary + containing data for the obs package with variable names as keys and + package data as values. Data just for the observations variable is + also acceptable. See obs package documentation for more information. + mover : boolean + * mover (boolean) keyword to indicate that this instance of the MAW + Package can be used with the Water Mover (MVR) Package. When the + MOVER option is specified, additional memory is allocated within the + package to store the available, provided, and received water. + nmawwells : integer + * nmawwells (integer) integer value specifying the number of multi- + aquifer wells that will be simulated for all stress periods. + packagedata : [wellno, radius, bottom, strt, condeqn, ngwfnodes, aux, + boundname] + * wellno (integer) integer value that defines the well number + associated with the specified PACKAGEDATA data on the line. WELLNO + must be greater than zero and less than or equal to NMAWWELLS. Multi- + aquifer well information must be specified for every multi-aquifer + well or the program will terminate with an error. The program will + also terminate with an error if information for a multi-aquifer well + is specified more than once. + * radius (double) radius for the multi-aquifer well. + * bottom (double) bottom elevation of the multi-aquifer well. The well + bottom is reset to the cell bottom in the lowermost GWF cell + connection in cases where the specified well bottom is above the + bottom of this GWF cell. + * strt (double) starting head for the multi-aquifer well. + * condeqn (string) character string that defines the conductance + equation that is used to calculate the saturated conductance for the + multi-aquifer well. Possible multi-aquifer well CONDEQN strings + include: SPECIFIED--character keyword to indicate the multi-aquifer + well saturated conductance will be specified. THIEM--character + keyword to indicate the multi-aquifer well saturated conductance will + be calculated using the Thiem equation, which considers the cell top + and bottom, aquifer hydraulic conductivity, and effective cell and + well radius. SKIN--character keyword to indicate that the multi- + aquifer well saturated conductance will be calculated using the cell + top and bottom, aquifer and screen hydraulic conductivity, and well + and skin radius. CUMULATIVE--character keyword to indicate that the + multi-aquifer well saturated conductance will be calculated using a + combination of the Thiem and SKIN equations. MEAN--character keyword + to indicate the multi-aquifer well saturated conductance will be + calculated using the aquifer and screen top and bottom, aquifer and + screen hydraulic conductivity, and well and skin radius. + * ngwfnodes (integer) integer value that defines the number of GWF + nodes connected to this (WELLNO) multi-aquifer well. NGWFNODES must + be greater than zero. + * aux (double) represents the values of the auxiliary variables for + each multi-aquifer well. The values of auxiliary variables must be + present for each multi-aquifer well. The values must be specified in + the order of the auxiliary variables specified in the OPTIONS block. + If the package supports time series and the Options block includes a + TIMESERIESFILE entry (see the "Time-Variable Input" section), values + can be obtained from a time series by entering the time-series name + in place of a numeric value. + * boundname (string) name of the multi-aquifer well cell. BOUNDNAME is + an ASCII character variable that can contain as many as 40 + characters. If BOUNDNAME contains spaces in it, then the entire name + must be enclosed within single quotes. + connectiondata : [wellno, icon, cellid, scrn_top, scrn_bot, hk_skin, + radius_skin] + * wellno (integer) integer value that defines the well number + associated with the specified CONNECTIONDATA data on the line. WELLNO + must be greater than zero and less than or equal to NMAWWELLS. Multi- + aquifer well connection information must be specified for every + multi-aquifer well connection to the GWF model (NGWFNODES) or the + program will terminate with an error. The program will also terminate + with an error if connection information for a multi-aquifer well + connection to the GWF model is specified more than once. + * icon (integer) integer value that defines the GWF connection number + for this multi-aquifer well connection entry. ICONN must be greater + than zero and less than or equal to NGWFNODES for multi-aquifer well + WELLNO. + * cellid ((integer, ...)) is the cell identifier, and depends on the + type of grid that is used for the simulation. For a structured grid + that uses the DIS input file, CELLID is the layer, row, and column. + For a grid that uses the DISV input file, CELLID is the layer and + CELL2D number. If the model uses the unstructured discretization + (DISU) input file, CELLID is the node number for the cell. One or + more screened intervals can be connected to the same CELLID if + CONDEQN for a well is MEAN. The program will terminate with an error + if MAW wells using SPECIFIED, THIEM, SKIN, or CUMULATIVE conductance + equations have more than one connection to the same CELLID. + * scrn_top (double) value that defines the top elevation of the screen + for the multi-aquifer well connection. If the specified SCRN_TOP is + greater than the top of the GWF cell it is set equal to the top of + the cell. SCRN_TOP can be any value if CONDEQN is SPECIFIED, THIEM, + SKIN, or COMPOSITE and SCRN_TOP is set to the top of the cell. + * scrn_bot (double) value that defines the bottom elevation of the + screen for the multi-aquifer well connection. If the specified + SCRN_BOT is less than the bottom of the GWF cell it is set equal to + the bottom of the cell. SCRN_BOT can be any value if CONDEQN is + SPECIFIED, THIEM, SKIN, or COMPOSITE and SCRN_BOT is set to the + bottom of the cell. + * hk_skin (double) value that defines the skin (filter pack) hydraulic + conductivity (if CONDEQN for the multi-aquifer well is SKIN, + CUMULATIVE, or MEAN) or conductance (if CONDEQN for the multi-aquifer + well is SPECIFIED) for each GWF node connected to the multi-aquifer + well (NGWFNODES). HK_SKIN can be any value if CONDEQN is THIEM. + * radius_skin (double) real value that defines the skin radius (filter + pack radius) for the multi-aquifer well. RADIUS_SKIN can be any value + if CONDEQN is SPECIFIED or THIEM. Otherwise, RADIUS_SKIN must be + greater than RADIUS for the multi-aquifer well. + perioddata : [wellno, mawsetting] + * wellno (integer) integer value that defines the well number + associated with the specified PERIOD data on the line. WELLNO must be + greater than zero and less than or equal to NMAWWELLS. + * mawsetting (keystring) line of information that is parsed into a + keyword and values. Keyword values that can be used to start the + MAWSETTING string include: STATUS, FLOWING_WELL, RATE, WELL_HEAD, + HEAD_LIMIT, SHUT_OFF, RATE_SCALING, and AUXILIARY. + status : [string] + * status (string) keyword option to define well status. STATUS + can be ACTIVE, INACTIVE, or CONSTANT. By default, STATUS is + ACTIVE. + flowing_wellrecord : [fwelev, fwcond, fwrlen] + * fwelev (double) elevation used to determine whether or not + the well is flowing. + * fwcond (double) conductance used to calculate the discharge + of a free flowing well. Flow occurs when the head in the well + is above the well top elevation (FWELEV). + * fwrlen (double) length used to reduce the conductance of the + flowing well. When the head in the well drops below the well + top plus the reduction length, then the conductance is + reduced. This reduction length can be used to improve the + stability of simulations with flowing wells so that there is + not an abrupt change in flowing well rates. + rate : [double] + * rate (double) is the volumetric pumping rate for the multi- + aquifer well. A positive value indicates recharge and a + negative value indicates discharge (pumping). RATE only + applies to active (IBOUND :math:`>` 0) multi-aquifer wells. + If the Options block includes a TIMESERIESFILE entry (see the + "Time-Variable Input" section), values can be obtained from a + time series by entering the time-series name in place of a + numeric value. By default, the RATE for each multi-aquifer + well is zero. + well_head : [double] + * well_head (double) is the head in the multi-aquifer well. + WELL_HEAD is only applied to constant head (STATUS is + CONSTANT) and inactive (STATUS is INACTIVE) multi-aquifer + wells. If the Options block includes a TIMESERIESFILE entry + (see the "Time-Variable Input" section), values can be + obtained from a time series by entering the time-series name + in place of a numeric value. + head_limit : [string] + * head_limit (string) is the limiting water level (head) in the + well, which is the minimum of the well RATE or the well + inflow rate from the aquifer. HEAD_LIMIT can be applied to + extraction wells (RATE :math:`<` 0) or injection wells (RATE + :math:`>` 0). HEAD\_LIMIT can be deactivated by specifying + the text string `OFF'. The HEAD\_LIMIT option is based on the + HEAD\_LIMIT functionality available in the + MNW2~\citep{konikow2009} package for MODFLOW-2005. The + HEAD\_LIMIT option has been included to facilitate backward + compatibility with previous versions of MODFLOW but use of + the RATE\_SCALING option instead of the HEAD\_LIMIT option is + recommended. By default, HEAD\_LIMIT is `OFF'. + shutoffrecord : [minrate, maxrate] + * minrate (double) is the minimum rate that a well must exceed + to shutoff a well during a stress period. The well will shut + down during a time step if the flow rate to the well from the + aquifer is less than MINRATE. If a well is shut down during a + time step, reactivation of the well cannot occur until the + next time step to reduce oscillations. MINRATE must be less + than maxrate. + * maxrate (double) is the maximum rate that a well must exceed + to reactivate a well during a stress period. The well will + reactivate during a timestep if the well was shutdown during + the previous time step and the flow rate to the well from the + aquifer exceeds maxrate. Reactivation of the well cannot + occur until the next time step if a well is shutdown to + reduce oscillations. maxrate must be greater than MINRATE. + rate_scalingrecord : [pump_elevation, scaling_length] + * pump_elevation (double) is the elevation of the multi-aquifer + well pump (PUMP_ELEVATION). PUMP_ELEVATION should not be less + than the bottom elevation (BOTTOM) of the multi-aquifer well. + * scaling_length (double) height above the pump elevation + (SCALING_LENGTH). If the simulated well head is below this + elevation (pump elevation plus the scaling length), then the + pumping rate is reduced. + auxiliaryrecord : [auxname, auxval] + * auxname (string) name for the auxiliary variable to be + assigned AUXVAL. AUXNAME must match one of the auxiliary + variable names defined in the OPTIONS block. If AUXNAME does + not match one of the auxiliary variable names defined in the + OPTIONS block the data are ignored. + * auxval (double) value for the auxiliary variable. If the + Options block includes a TIMESERIESFILE entry (see the "Time- + Variable Input" section), values can be obtained from a time + series by entering the time-series name in place of a numeric + value. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + auxiliary = ListTemplateGenerator(('gwf6', 'maw', 'options', + 'auxiliary')) + stage_filerecord = ListTemplateGenerator(('gwf6', 'maw', 'options', + 'stage_filerecord')) + budget_filerecord = ListTemplateGenerator(('gwf6', 'maw', 'options', + 'budget_filerecord')) + ts_filerecord = ListTemplateGenerator(('gwf6', 'maw', 'options', + 'ts_filerecord')) + obs_filerecord = ListTemplateGenerator(('gwf6', 'maw', 'options', + 'obs_filerecord')) + packagedata = ListTemplateGenerator(('gwf6', 'maw', 'packagedata', + 'packagedata')) + connectiondata = ListTemplateGenerator(('gwf6', 'maw', + 'connectiondata', + 'connectiondata')) + perioddata = ListTemplateGenerator(('gwf6', 'maw', 'period', + 'perioddata')) + package_abbr = "gwfmaw" + _package_type = "maw" + dfn_file_name = "gwf-maw.dfn" + + dfn = [["block options", "name auxiliary", "type string", + "shape (naux)", "reader urword", "optional true"], + ["block options", "name boundnames", "type keyword", "shape", + "reader urword", "optional true"], + ["block options", "name print_input", "type keyword", + "reader urword", "optional true"], + ["block options", "name print_head", "type keyword", + "reader urword", "optional true"], + ["block options", "name print_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name save_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name stage_filerecord", + "type record head fileout headfile", "shape", "reader urword", + "tagged true", "optional true"], + ["block options", "name head", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name headfile", "type string", + "preserve_case true", "shape", "in_record true", "reader urword", + "tagged false", "optional false"], + ["block options", "name budget_filerecord", + "type record budget fileout budgetfile", "shape", "reader urword", + "tagged true", "optional true"], + ["block options", "name budget", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name fileout", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name budgetfile", "type string", + "preserve_case true", "shape", "in_record true", "reader urword", + "tagged false", "optional false"], + ["block options", "name no_well_storage", "type keyword", + "reader urword", "optional true"], + ["block options", "name flowing_wells", "type keyword", + "reader urword", "optional true"], + ["block options", "name shutdown_theta", "type double precision", + "reader urword", "optional true"], + ["block options", "name shutdown_kappa", "type double precision", + "reader urword", "optional true"], + ["block options", "name ts_filerecord", + "type record ts6 filein ts6_filename", "shape", "reader urword", + "tagged true", "optional true", "construct_package ts", + "construct_data timeseries", "parameter_name timeseries"], + ["block options", "name ts6", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name filein", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name ts6_filename", "type string", + "preserve_case true", "in_record true", "reader urword", + "optional false", "tagged false"], + ["block options", "name obs_filerecord", + "type record obs6 filein obs6_filename", "shape", "reader urword", + "tagged true", "optional true", "construct_package obs", + "construct_data continuous", "parameter_name observations"], + ["block options", "name obs6", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name obs6_filename", "type string", + "preserve_case true", "in_record true", "tagged false", + "reader urword", "optional false"], + ["block options", "name mover", "type keyword", "tagged true", + "reader urword", "optional true"], + ["block dimensions", "name nmawwells", "type integer", + "reader urword", "optional false"], + ["block packagedata", "name packagedata", + "type recarray wellno radius bottom strt condeqn ngwfnodes aux " + "boundname", + "shape (nmawwells)", "reader urword"], + ["block packagedata", "name wellno", "type integer", "shape", + "tagged false", "in_record true", "reader urword", + "numeric_index true"], + ["block packagedata", "name radius", "type double precision", + "shape", "tagged false", "in_record true", "reader urword"], + ["block packagedata", "name bottom", "type double precision", + "shape", "tagged false", "in_record true", "reader urword"], + ["block packagedata", "name strt", "type double precision", + "shape", "tagged false", "in_record true", "reader urword"], + ["block packagedata", "name condeqn", "type string", "shape", + "tagged false", "in_record true", "reader urword"], + ["block packagedata", "name ngwfnodes", "type integer", "shape", + "tagged false", "in_record true", "reader urword"], + ["block packagedata", "name aux", "type double precision", + "in_record true", "tagged false", "shape (naux)", "reader urword", + "time_series true", "optional true"], + ["block packagedata", "name boundname", "type string", "shape", + "tagged false", "in_record true", "reader urword", + "optional true"], + ["block connectiondata", "name connectiondata", + "type recarray wellno icon cellid scrn_top scrn_bot hk_skin " + "radius_skin", + "reader urword"], + ["block connectiondata", "name wellno", "type integer", "shape", + "tagged false", "in_record true", "reader urword", + "numeric_index true"], + ["block connectiondata", "name icon", "type integer", "shape", + "tagged false", "in_record true", "reader urword", + "numeric_index true"], + ["block connectiondata", "name cellid", "type integer", + "shape (ncelldim)", "tagged false", "in_record true", + "reader urword"], + ["block connectiondata", "name scrn_top", + "type double precision", "shape", "tagged false", + "in_record true", "reader urword"], + ["block connectiondata", "name scrn_bot", + "type double precision", "shape", "tagged false", + "in_record true", "reader urword"], + ["block connectiondata", "name hk_skin", "type double precision", + "shape", "tagged false", "in_record true", "reader urword"], + ["block connectiondata", "name radius_skin", + "type double precision", "shape", "tagged false", + "in_record true", "reader urword"], + ["block period", "name iper", "type integer", + "block_variable True", "in_record true", "tagged false", "shape", + "valid", "reader urword", "optional false"], + ["block period", "name perioddata", + "type recarray wellno mawsetting", "shape", "reader urword"], + ["block period", "name wellno", "type integer", "shape", + "tagged false", "in_record true", "reader urword", + "numeric_index true"], + ["block period", "name mawsetting", + "type keystring status flowing_wellrecord rate well_head " + "head_limit shutoffrecord rate_scalingrecord auxiliaryrecord", + "shape", "tagged false", "in_record true", "reader urword"], + ["block period", "name status", "type string", "shape", + "tagged true", "in_record true", "reader urword"], + ["block period", "name flowing_wellrecord", + "type record flowing_well fwelev fwcond fwrlen", "shape", + "tagged", "in_record true", "reader urword"], + ["block period", "name flowing_well", "type keyword", "shape", + "in_record true", "reader urword"], + ["block period", "name fwelev", "type double precision", "shape", + "tagged false", "in_record true", "reader urword"], + ["block period", "name fwcond", "type double precision", "shape", + "tagged false", "in_record true", "reader urword"], + ["block period", "name fwrlen", "type double precision", "shape", + "tagged false", "in_record true", "reader urword"], + ["block period", "name rate", "type double precision", "shape", + "tagged true", "in_record true", "reader urword", + "time_series true"], + ["block period", "name well_head", "type double precision", + "shape", "tagged true", "in_record true", "reader urword", + "time_series true"], + ["block period", "name head_limit", "type string", "shape", + "tagged true", "in_record true", "reader urword"], + ["block period", "name shutoffrecord", + "type record shut_off minrate maxrate", "shape", "tagged", + "in_record true", "reader urword"], + ["block period", "name shut_off", "type keyword", "shape", + "in_record true", "reader urword"], + ["block period", "name minrate", "type double precision", + "shape", "tagged false", "in_record true", "reader urword"], + ["block period", "name maxrate", "type double precision", + "shape", "tagged false", "in_record true", "reader urword"], + ["block period", "name rate_scalingrecord", + "type record rate_scaling pump_elevation scaling_length", "shape", + "tagged", "in_record true", "reader urword"], + ["block period", "name rate_scaling", "type keyword", "shape", + "in_record true", "reader urword"], + ["block period", "name pump_elevation", "type double precision", + "shape", "tagged false", "in_record true", "reader urword"], + ["block period", "name scaling_length", "type double precision", + "shape", "tagged false", "in_record true", "reader urword"], + ["block period", "name auxiliaryrecord", + "type record auxiliary auxname auxval", "shape", "tagged", + "in_record true", "reader urword"], + ["block period", "name auxiliary", "type keyword", "shape", + "in_record true", "reader urword"], + ["block period", "name auxname", "type string", "shape", + "tagged false", "in_record true", "reader urword"], + ["block period", "name auxval", "type double precision", "shape", + "tagged false", "in_record true", "reader urword", + "time_series true"]] + + def __init__(self, model, loading_package=False, auxiliary=None, + boundnames=None, print_input=None, print_head=None, + print_flows=None, save_flows=None, stage_filerecord=None, + budget_filerecord=None, no_well_storage=None, + flowing_wells=None, shutdown_theta=None, shutdown_kappa=None, + timeseries=None, observations=None, mover=None, + nmawwells=None, packagedata=None, connectiondata=None, + perioddata=None, filename=None, pname=None, parent_file=None): + super(ModflowGwfmaw, self).__init__(model, "maw", filename, pname, + loading_package, parent_file) + + # set up variables + self.auxiliary = self.build_mfdata("auxiliary", auxiliary) + self.boundnames = self.build_mfdata("boundnames", boundnames) + self.print_input = self.build_mfdata("print_input", print_input) + self.print_head = self.build_mfdata("print_head", print_head) + self.print_flows = self.build_mfdata("print_flows", print_flows) + self.save_flows = self.build_mfdata("save_flows", save_flows) + self.stage_filerecord = self.build_mfdata("stage_filerecord", + stage_filerecord) + self.budget_filerecord = self.build_mfdata("budget_filerecord", + budget_filerecord) + self.no_well_storage = self.build_mfdata("no_well_storage", + no_well_storage) + self.flowing_wells = self.build_mfdata("flowing_wells", flowing_wells) + self.shutdown_theta = self.build_mfdata("shutdown_theta", + shutdown_theta) + self.shutdown_kappa = self.build_mfdata("shutdown_kappa", + shutdown_kappa) + self._ts_filerecord = self.build_mfdata("ts_filerecord", + None) + self._ts_package = self.build_child_package("ts", timeseries, + "timeseries", + self._ts_filerecord) + self._obs_filerecord = self.build_mfdata("obs_filerecord", + None) + self._obs_package = self.build_child_package("obs", observations, + "continuous", + self._obs_filerecord) + self.mover = self.build_mfdata("mover", mover) + self.nmawwells = self.build_mfdata("nmawwells", nmawwells) + self.packagedata = self.build_mfdata("packagedata", packagedata) + self.connectiondata = self.build_mfdata("connectiondata", + connectiondata) + self.perioddata = self.build_mfdata("perioddata", perioddata) + self._init_complete = True diff --git a/flopy/mf6/modflow/mfgwfmvr.py b/flopy/mf6/modflow/mfgwfmvr.py index 14309afb72..0260eda2a6 100644 --- a/flopy/mf6/modflow/mfgwfmvr.py +++ b/flopy/mf6/modflow/mfgwfmvr.py @@ -1,178 +1,178 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ListTemplateGenerator - - -class ModflowGwfmvr(mfpackage.MFPackage): - """ - ModflowGwfmvr defines a mvr package within a gwf6 model. - - Parameters - ---------- - model : MFModel - Model that this package is a part of. Package is automatically - added to model when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - print_input : boolean - * print_input (boolean) keyword to indicate that the list of MVR - information will be written to the listing file immediately after it - is read. - print_flows : boolean - * print_flows (boolean) keyword to indicate that the list of MVR flow - rates will be printed to the listing file for every stress period - time step in which "BUDGET PRINT" is specified in Output Control. If - there is no Output Control option and "PRINT_FLOWS" is specified, - then flow rates are printed for the last time step of each stress - period. - modelnames : boolean - * modelnames (boolean) keyword to indicate that all package names will - be preceded by the model name for the package. Model names are - required when the Mover Package is used with a GWF-GWF Exchange. The - MODELNAME keyword should not be used for a Mover Package that is for - a single GWF Model. - budget_filerecord : [budgetfile] - * budgetfile (string) name of the output file to write budget - information. - maxmvr : integer - * maxmvr (integer) integer value specifying the maximum number of water - mover entries that will specified for any stress period. - maxpackages : integer - * maxpackages (integer) integer value specifying the number of unique - packages that are included in this water mover input file. - packages : [mname, pname] - * mname (string) name of model containing the package. Model names are - assigned by the user in the simulation name file. - * pname (string) is the name of a package that may be included in a - subsequent stress period block. The package name is assigned in the - name file for the GWF Model. Package names are optionally provided in - the name file. If they are not provided by the user, then packages - are assigned a default value, which is the package acronym followed - by a hyphen and the package number. For example, the first Drain - Package is named DRN-1. The second Drain Package is named DRN-2, and - so forth. - perioddata : [mname1, pname1, id1, mname2, pname2, id2, mvrtype, value] - * mname1 (string) name of model containing the package, PNAME1. - * pname1 (string) is the package name for the provider. The package - PNAME1 must be designated to provide water through the MVR Package by - specifying the keyword "MOVER" in its OPTIONS block. - * id1 (integer) is the identifier for the provider. For the standard - boundary packages, the provider identifier is the number of the - boundary as it is listed in the package input file. (Note that the - order of these boundaries may change by stress period, which must be - accounted for in the Mover Package.) So the first well has an - identifier of one. The second is two, and so forth. For the advanced - packages, the identifier is the reach number (SFR Package), well - number (MAW Package), or UZF cell number. For the Lake Package, ID1 - is the lake outlet number. Thus, outflows from a single lake can be - routed to different streams, for example. - * mname2 (string) name of model containing the package, PNAME2. - * pname2 (string) is the package name for the receiver. The package - PNAME2 must be designated to receive water from the MVR Package by - specifying the keyword "MOVER" in its OPTIONS block. - * id2 (integer) is the identifier for the receiver. The receiver - identifier is the reach number (SFR Package), Lake number (LAK - Package), well number (MAW Package), or UZF cell number. - * mvrtype (string) is the character string signifying the method for - determining how much water will be moved. Supported values are - "FACTOR" "EXCESS" "THRESHOLD" and "UPTO". These four options - determine how the receiver flow rate, :math:`Q_R`, is calculated. - These options are based the options available in the SFR2 Package for - diverting stream flow. - * value (double) is the value to be used in the equation for - calculating the amount of water to move. For the "FACTOR" option, - VALUE is the :math:`\\alpha` factor. For the remaining options, VALUE - is the specified flow rate, :math:`Q_S`. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - budget_filerecord = ListTemplateGenerator(('gwf6', 'mvr', 'options', - 'budget_filerecord')) - packages = ListTemplateGenerator(('gwf6', 'mvr', 'packages', - 'packages')) - perioddata = ListTemplateGenerator(('gwf6', 'mvr', 'period', - 'perioddata')) - package_abbr = "gwfmvr" - _package_type = "mvr" - dfn_file_name = "gwf-mvr.dfn" - - dfn = [["block options", "name print_input", "type keyword", - "reader urword", "optional true"], - ["block options", "name print_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name modelnames", "type keyword", - "reader urword", "optional true"], - ["block options", "name budget_filerecord", - "type record budget fileout budgetfile", "shape", "reader urword", - "tagged true", "optional true"], - ["block options", "name budget", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name fileout", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name budgetfile", "type string", - "preserve_case true", "shape", "in_record true", "reader urword", - "tagged false", "optional false"], - ["block dimensions", "name maxmvr", "type integer", - "reader urword", "optional false"], - ["block dimensions", "name maxpackages", "type integer", - "reader urword", "optional false"], - ["block packages", "name packages", "type recarray mname pname", - "reader urword", "shape (npackages)", "optional false"], - ["block packages", "name mname", "type string", "reader urword", - "shape", "tagged false", "in_record true", "optional true"], - ["block packages", "name pname", "type string", "reader urword", - "shape", "tagged false", "in_record true", "optional false"], - ["block period", "name iper", "type integer", - "block_variable True", "in_record true", "tagged false", "shape", - "valid", "reader urword", "optional false"], - ["block period", "name perioddata", - "type recarray mname1 pname1 id1 mname2 pname2 id2 mvrtype value", - "shape (maxbound)", "reader urword"], - ["block period", "name mname1", "type string", "reader urword", - "shape", "tagged false", "in_record true", "optional true"], - ["block period", "name pname1", "type string", "shape", - "tagged false", "in_record true", "reader urword"], - ["block period", "name id1", "type integer", "shape", - "tagged false", "in_record true", "reader urword", - "numeric_index true"], - ["block period", "name mname2", "type string", "reader urword", - "shape", "tagged false", "in_record true", "optional true"], - ["block period", "name pname2", "type string", "shape", - "tagged false", "in_record true", "reader urword"], - ["block period", "name id2", "type integer", "shape", - "tagged false", "in_record true", "reader urword", - "numeric_index true"], - ["block period", "name mvrtype", "type string", "shape", - "tagged false", "in_record true", "reader urword"], - ["block period", "name value", "type double precision", "shape", - "tagged false", "in_record true", "reader urword"]] - - def __init__(self, model, loading_package=False, print_input=None, - print_flows=None, modelnames=None, budget_filerecord=None, - maxmvr=None, maxpackages=None, packages=None, perioddata=None, - filename=None, pname=None, parent_file=None): - super(ModflowGwfmvr, self).__init__(model, "mvr", filename, pname, - loading_package, parent_file) - - # set up variables - self.print_input = self.build_mfdata("print_input", print_input) - self.print_flows = self.build_mfdata("print_flows", print_flows) - self.modelnames = self.build_mfdata("modelnames", modelnames) - self.budget_filerecord = self.build_mfdata("budget_filerecord", - budget_filerecord) - self.maxmvr = self.build_mfdata("maxmvr", maxmvr) - self.maxpackages = self.build_mfdata("maxpackages", maxpackages) - self.packages = self.build_mfdata("packages", packages) - self.perioddata = self.build_mfdata("perioddata", perioddata) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ListTemplateGenerator + + +class ModflowGwfmvr(mfpackage.MFPackage): + """ + ModflowGwfmvr defines a mvr package within a gwf6 model. + + Parameters + ---------- + model : MFModel + Model that this package is a part of. Package is automatically + added to model when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + print_input : boolean + * print_input (boolean) keyword to indicate that the list of MVR + information will be written to the listing file immediately after it + is read. + print_flows : boolean + * print_flows (boolean) keyword to indicate that the list of MVR flow + rates will be printed to the listing file for every stress period + time step in which "BUDGET PRINT" is specified in Output Control. If + there is no Output Control option and "PRINT_FLOWS" is specified, + then flow rates are printed for the last time step of each stress + period. + modelnames : boolean + * modelnames (boolean) keyword to indicate that all package names will + be preceded by the model name for the package. Model names are + required when the Mover Package is used with a GWF-GWF Exchange. The + MODELNAME keyword should not be used for a Mover Package that is for + a single GWF Model. + budget_filerecord : [budgetfile] + * budgetfile (string) name of the output file to write budget + information. + maxmvr : integer + * maxmvr (integer) integer value specifying the maximum number of water + mover entries that will specified for any stress period. + maxpackages : integer + * maxpackages (integer) integer value specifying the number of unique + packages that are included in this water mover input file. + packages : [mname, pname] + * mname (string) name of model containing the package. Model names are + assigned by the user in the simulation name file. + * pname (string) is the name of a package that may be included in a + subsequent stress period block. The package name is assigned in the + name file for the GWF Model. Package names are optionally provided in + the name file. If they are not provided by the user, then packages + are assigned a default value, which is the package acronym followed + by a hyphen and the package number. For example, the first Drain + Package is named DRN-1. The second Drain Package is named DRN-2, and + so forth. + perioddata : [mname1, pname1, id1, mname2, pname2, id2, mvrtype, value] + * mname1 (string) name of model containing the package, PNAME1. + * pname1 (string) is the package name for the provider. The package + PNAME1 must be designated to provide water through the MVR Package by + specifying the keyword "MOVER" in its OPTIONS block. + * id1 (integer) is the identifier for the provider. For the standard + boundary packages, the provider identifier is the number of the + boundary as it is listed in the package input file. (Note that the + order of these boundaries may change by stress period, which must be + accounted for in the Mover Package.) So the first well has an + identifier of one. The second is two, and so forth. For the advanced + packages, the identifier is the reach number (SFR Package), well + number (MAW Package), or UZF cell number. For the Lake Package, ID1 + is the lake outlet number. Thus, outflows from a single lake can be + routed to different streams, for example. + * mname2 (string) name of model containing the package, PNAME2. + * pname2 (string) is the package name for the receiver. The package + PNAME2 must be designated to receive water from the MVR Package by + specifying the keyword "MOVER" in its OPTIONS block. + * id2 (integer) is the identifier for the receiver. The receiver + identifier is the reach number (SFR Package), Lake number (LAK + Package), well number (MAW Package), or UZF cell number. + * mvrtype (string) is the character string signifying the method for + determining how much water will be moved. Supported values are + "FACTOR" "EXCESS" "THRESHOLD" and "UPTO". These four options + determine how the receiver flow rate, :math:`Q_R`, is calculated. + These options are based the options available in the SFR2 Package for + diverting stream flow. + * value (double) is the value to be used in the equation for + calculating the amount of water to move. For the "FACTOR" option, + VALUE is the :math:`\\alpha` factor. For the remaining options, VALUE + is the specified flow rate, :math:`Q_S`. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + budget_filerecord = ListTemplateGenerator(('gwf6', 'mvr', 'options', + 'budget_filerecord')) + packages = ListTemplateGenerator(('gwf6', 'mvr', 'packages', + 'packages')) + perioddata = ListTemplateGenerator(('gwf6', 'mvr', 'period', + 'perioddata')) + package_abbr = "gwfmvr" + _package_type = "mvr" + dfn_file_name = "gwf-mvr.dfn" + + dfn = [["block options", "name print_input", "type keyword", + "reader urword", "optional true"], + ["block options", "name print_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name modelnames", "type keyword", + "reader urword", "optional true"], + ["block options", "name budget_filerecord", + "type record budget fileout budgetfile", "shape", "reader urword", + "tagged true", "optional true"], + ["block options", "name budget", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name fileout", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name budgetfile", "type string", + "preserve_case true", "shape", "in_record true", "reader urword", + "tagged false", "optional false"], + ["block dimensions", "name maxmvr", "type integer", + "reader urword", "optional false"], + ["block dimensions", "name maxpackages", "type integer", + "reader urword", "optional false"], + ["block packages", "name packages", "type recarray mname pname", + "reader urword", "shape (npackages)", "optional false"], + ["block packages", "name mname", "type string", "reader urword", + "shape", "tagged false", "in_record true", "optional true"], + ["block packages", "name pname", "type string", "reader urword", + "shape", "tagged false", "in_record true", "optional false"], + ["block period", "name iper", "type integer", + "block_variable True", "in_record true", "tagged false", "shape", + "valid", "reader urword", "optional false"], + ["block period", "name perioddata", + "type recarray mname1 pname1 id1 mname2 pname2 id2 mvrtype value", + "shape (maxbound)", "reader urword"], + ["block period", "name mname1", "type string", "reader urword", + "shape", "tagged false", "in_record true", "optional true"], + ["block period", "name pname1", "type string", "shape", + "tagged false", "in_record true", "reader urword"], + ["block period", "name id1", "type integer", "shape", + "tagged false", "in_record true", "reader urword", + "numeric_index true"], + ["block period", "name mname2", "type string", "reader urword", + "shape", "tagged false", "in_record true", "optional true"], + ["block period", "name pname2", "type string", "shape", + "tagged false", "in_record true", "reader urword"], + ["block period", "name id2", "type integer", "shape", + "tagged false", "in_record true", "reader urword", + "numeric_index true"], + ["block period", "name mvrtype", "type string", "shape", + "tagged false", "in_record true", "reader urword"], + ["block period", "name value", "type double precision", "shape", + "tagged false", "in_record true", "reader urword"]] + + def __init__(self, model, loading_package=False, print_input=None, + print_flows=None, modelnames=None, budget_filerecord=None, + maxmvr=None, maxpackages=None, packages=None, perioddata=None, + filename=None, pname=None, parent_file=None): + super(ModflowGwfmvr, self).__init__(model, "mvr", filename, pname, + loading_package, parent_file) + + # set up variables + self.print_input = self.build_mfdata("print_input", print_input) + self.print_flows = self.build_mfdata("print_flows", print_flows) + self.modelnames = self.build_mfdata("modelnames", modelnames) + self.budget_filerecord = self.build_mfdata("budget_filerecord", + budget_filerecord) + self.maxmvr = self.build_mfdata("maxmvr", maxmvr) + self.maxpackages = self.build_mfdata("maxpackages", maxpackages) + self.packages = self.build_mfdata("packages", packages) + self.perioddata = self.build_mfdata("perioddata", perioddata) + self._init_complete = True diff --git a/flopy/mf6/modflow/mfgwfnam.py b/flopy/mf6/modflow/mfgwfnam.py index 93fe13820f..ee1218cfe5 100644 --- a/flopy/mf6/modflow/mfgwfnam.py +++ b/flopy/mf6/modflow/mfgwfnam.py @@ -1,116 +1,116 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ListTemplateGenerator - - -class ModflowGwfnam(mfpackage.MFPackage): - """ - ModflowGwfnam defines a nam package within a gwf6 model. - - Parameters - ---------- - model : MFModel - Model that this package is a part of. Package is automatically - added to model when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - list : string - * list (string) is name of the listing file to create for this GWF - model. If not specified, then the name of the list file will be the - basename of the GWF model name file and the '.lst' extension. For - example, if the GWF name file is called "my.model.nam" then the list - file will be called "my.model.lst". - print_input : boolean - * print_input (boolean) keyword to indicate that the list of all model - stress package information will be written to the listing file - immediately after it is read. - print_flows : boolean - * print_flows (boolean) keyword to indicate that the list of all model - package flow rates will be printed to the listing file for every - stress period time step in which "BUDGET PRINT" is specified in - Output Control. If there is no Output Control option and - "PRINT_FLOWS" is specified, then flow rates are printed for the last - time step of each stress period. - save_flows : boolean - * save_flows (boolean) keyword to indicate that all model package flow - terms will be written to the file specified with "BUDGET FILEOUT" in - Output Control. - newtonoptions : [under_relaxation] - * under_relaxation (string) keyword that indicates whether the - groundwater head in a cell will be under-relaxed when water levels - fall below the bottom of the model below any given cell. By default, - Newton-Raphson UNDER_RELAXATION is not applied. - packages : [ftype, fname, pname] - * ftype (string) is the file type, which must be one of the following - character values shown in table~ref{table:ftype}. Ftype may be - entered in any combination of uppercase and lowercase. - * fname (string) is the name of the file containing the package input. - The path to the file should be included if the file is not located in - the folder where the program was run. - * pname (string) is the user-defined name for the package. PNAME is - restricted to 16 characters. No spaces are allowed in PNAME. PNAME - character values are read and stored by the program for stress - packages only. These names may be useful for labeling purposes when - multiple stress packages of the same type are located within a single - GWF Model. If PNAME is specified for a stress package, then PNAME - will be used in the flow budget table in the listing file; it will - also be used for the text entry in the cell-by-cell budget file. - PNAME is case insensitive and is stored in all upper case letters. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - packages = ListTemplateGenerator(('gwf6', 'nam', 'packages', - 'packages')) - package_abbr = "gwfnam" - _package_type = "nam" - dfn_file_name = "gwf-nam.dfn" - - dfn = [["block options", "name list", "type string", "reader urword", - "optional true"], - ["block options", "name print_input", "type keyword", - "reader urword", "optional true"], - ["block options", "name print_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name save_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name newtonoptions", - "type record newton under_relaxation", "reader urword", - "optional true"], - ["block options", "name newton", "in_record true", - "type keyword", "reader urword"], - ["block options", "name under_relaxation", "in_record true", - "type keyword", "reader urword", "optional true"], - ["block packages", "name packages", - "type recarray ftype fname pname", "reader urword", - "optional false"], - ["block packages", "name ftype", "in_record true", "type string", - "tagged false", "reader urword"], - ["block packages", "name fname", "in_record true", "type string", - "preserve_case true", "tagged false", "reader urword"], - ["block packages", "name pname", "in_record true", "type string", - "tagged false", "reader urword", "optional true"]] - - def __init__(self, model, loading_package=False, list=None, - print_input=None, print_flows=None, save_flows=None, - newtonoptions=None, packages=None, filename=None, pname=None, - parent_file=None): - super(ModflowGwfnam, self).__init__(model, "nam", filename, pname, - loading_package, parent_file) - - # set up variables - self.list = self.build_mfdata("list", list) - self.print_input = self.build_mfdata("print_input", print_input) - self.print_flows = self.build_mfdata("print_flows", print_flows) - self.save_flows = self.build_mfdata("save_flows", save_flows) - self.newtonoptions = self.build_mfdata("newtonoptions", newtonoptions) - self.packages = self.build_mfdata("packages", packages) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ListTemplateGenerator + + +class ModflowGwfnam(mfpackage.MFPackage): + """ + ModflowGwfnam defines a nam package within a gwf6 model. + + Parameters + ---------- + model : MFModel + Model that this package is a part of. Package is automatically + added to model when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + list : string + * list (string) is name of the listing file to create for this GWF + model. If not specified, then the name of the list file will be the + basename of the GWF model name file and the '.lst' extension. For + example, if the GWF name file is called "my.model.nam" then the list + file will be called "my.model.lst". + print_input : boolean + * print_input (boolean) keyword to indicate that the list of all model + stress package information will be written to the listing file + immediately after it is read. + print_flows : boolean + * print_flows (boolean) keyword to indicate that the list of all model + package flow rates will be printed to the listing file for every + stress period time step in which "BUDGET PRINT" is specified in + Output Control. If there is no Output Control option and + "PRINT_FLOWS" is specified, then flow rates are printed for the last + time step of each stress period. + save_flows : boolean + * save_flows (boolean) keyword to indicate that all model package flow + terms will be written to the file specified with "BUDGET FILEOUT" in + Output Control. + newtonoptions : [under_relaxation] + * under_relaxation (string) keyword that indicates whether the + groundwater head in a cell will be under-relaxed when water levels + fall below the bottom of the model below any given cell. By default, + Newton-Raphson UNDER_RELAXATION is not applied. + packages : [ftype, fname, pname] + * ftype (string) is the file type, which must be one of the following + character values shown in table~ref{table:ftype}. Ftype may be + entered in any combination of uppercase and lowercase. + * fname (string) is the name of the file containing the package input. + The path to the file should be included if the file is not located in + the folder where the program was run. + * pname (string) is the user-defined name for the package. PNAME is + restricted to 16 characters. No spaces are allowed in PNAME. PNAME + character values are read and stored by the program for stress + packages only. These names may be useful for labeling purposes when + multiple stress packages of the same type are located within a single + GWF Model. If PNAME is specified for a stress package, then PNAME + will be used in the flow budget table in the listing file; it will + also be used for the text entry in the cell-by-cell budget file. + PNAME is case insensitive and is stored in all upper case letters. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + packages = ListTemplateGenerator(('gwf6', 'nam', 'packages', + 'packages')) + package_abbr = "gwfnam" + _package_type = "nam" + dfn_file_name = "gwf-nam.dfn" + + dfn = [["block options", "name list", "type string", "reader urword", + "optional true"], + ["block options", "name print_input", "type keyword", + "reader urword", "optional true"], + ["block options", "name print_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name save_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name newtonoptions", + "type record newton under_relaxation", "reader urword", + "optional true"], + ["block options", "name newton", "in_record true", + "type keyword", "reader urword"], + ["block options", "name under_relaxation", "in_record true", + "type keyword", "reader urword", "optional true"], + ["block packages", "name packages", + "type recarray ftype fname pname", "reader urword", + "optional false"], + ["block packages", "name ftype", "in_record true", "type string", + "tagged false", "reader urword"], + ["block packages", "name fname", "in_record true", "type string", + "preserve_case true", "tagged false", "reader urword"], + ["block packages", "name pname", "in_record true", "type string", + "tagged false", "reader urword", "optional true"]] + + def __init__(self, model, loading_package=False, list=None, + print_input=None, print_flows=None, save_flows=None, + newtonoptions=None, packages=None, filename=None, pname=None, + parent_file=None): + super(ModflowGwfnam, self).__init__(model, "nam", filename, pname, + loading_package, parent_file) + + # set up variables + self.list = self.build_mfdata("list", list) + self.print_input = self.build_mfdata("print_input", print_input) + self.print_flows = self.build_mfdata("print_flows", print_flows) + self.save_flows = self.build_mfdata("save_flows", save_flows) + self.newtonoptions = self.build_mfdata("newtonoptions", newtonoptions) + self.packages = self.build_mfdata("packages", packages) + self._init_complete = True diff --git a/flopy/mf6/modflow/mfgwfnpf.py b/flopy/mf6/modflow/mfgwfnpf.py index 22caa29086..2017f520bb 100644 --- a/flopy/mf6/modflow/mfgwfnpf.py +++ b/flopy/mf6/modflow/mfgwfnpf.py @@ -1,284 +1,284 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ListTemplateGenerator, ArrayTemplateGenerator - - -class ModflowGwfnpf(mfpackage.MFPackage): - """ - ModflowGwfnpf defines a npf package within a gwf6 model. - - Parameters - ---------- - model : MFModel - Model that this package is a part of. Package is automatically - added to model when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - save_flows : boolean - * save_flows (boolean) keyword to indicate that cell-by-cell flow terms - will be written to the file specified with "BUDGET SAVE FILE" in - Output Control. - alternative_cell_averaging : string - * alternative_cell_averaging (string) is a text keyword to indicate - that an alternative method will be used for calculating the - conductance for horizontal cell connections. The text value for - ALTERNATIVE_CELL_AVERAGING can be "LOGARITHMIC", "AMT-LMK", or "AMT- - HMK". "AMT-LMK" signifies that the conductance will be calculated - using arithmetic-mean thickness and logarithmic-mean hydraulic - conductivity. "AMT-HMK" signifies that the conductance will be - calculated using arithmetic-mean thickness and harmonic-mean - hydraulic conductivity. If the user does not specify a value for - ALTERNATIVE_CELL_AVERAGING, then the harmonic-mean method will be - used. This option cannot be used if the XT3D option is invoked. - thickstrt : boolean - * thickstrt (boolean) indicates that cells having a negative ICELLTYPE - are confined, and their cell thickness for conductance calculations - will be computed as STRT-BOT rather than TOP-BOT. - cvoptions : [dewatered] - * dewatered (string) If the DEWATERED keyword is specified, then the - vertical conductance is calculated using only the saturated thickness - and properties of the overlying cell if the head in the underlying - cell is below its top. - perched : boolean - * perched (boolean) keyword to indicate that when a cell is overlying a - dewatered convertible cell, the head difference used in Darcy's Law - is equal to the head in the overlying cell minus the bottom elevation - of the overlying cell. If not specified, then the default is to use - the head difference between the two cells. - rewet_record : [wetfct, iwetit, ihdwet] - * wetfct (double) is a keyword and factor that is included in the - calculation of the head that is initially established at a cell when - that cell is converted from dry to wet. - * iwetit (integer) is a keyword and iteration interval for attempting - to wet cells. Wetting is attempted every IWETIT iteration. This - applies to outer iterations and not inner iterations. If IWETIT is - specified as zero or less, then the value is changed to 1. - * ihdwet (integer) is a keyword and integer flag that determines which - equation is used to define the initial head at cells that become wet. - If IHDWET is 0, h = BOT + WETFCT (hm - BOT). If IHDWET is not 0, h = - BOT + WETFCT (THRESH). - xt3doptions : [rhs] - * rhs (string) If the RHS keyword is also included, then the XT3D - additional terms will be added to the right-hand side. If the RHS - keyword is excluded, then the XT3D terms will be put into the - coefficient matrix. - save_specific_discharge : boolean - * save_specific_discharge (boolean) keyword to indicate that x, y, and - z components of specific discharge will be calculated at cell centers - and written to the cell-by-cell flow file, which is specified with - "BUDGET SAVE FILE" in Output Control. If this option is activated, - then additional information may be required in the discretization - packages and the GWF Exchange package (if GWF models are coupled). - Specifically, ANGLDEGX must be specified in the CONNECTIONDATA block - of the DISU Package; ANGLDEGX must also be specified for the GWF - Exchange as an auxiliary variable. - icelltype : [integer] - * icelltype (integer) flag for each cell that specifies how saturated - thickness is treated. 0 means saturated thickness is held constant; - :math:`>`0 means saturated thickness varies with computed head when - head is below the cell top; :math:`<`0 means saturated thickness - varies with computed head unless the THICKSTRT option is in effect. - When THICKSTRT is in effect, a negative value of icelltype indicates - that saturated thickness will be computed as STRT-BOT and held - constant. - k : [double] - * k (double) is the hydraulic conductivity. For the common case in - which the user would like to specify the horizontal hydraulic - conductivity and the vertical hydraulic conductivity, then K should - be assigned as the horizontal hydraulic conductivity, K33 should be - assigned as the vertical hydraulic conductivity, and texttt{K22} and - the three rotation angles should not be specified. When more - sophisticated anisotropy is required, then K corresponds to the K11 - hydraulic conductivity axis. All included cells (IDOMAIN :math:`>` 0) - must have a K value greater than zero. - k22 : [double] - * k22 (double) is the hydraulic conductivity of the second ellipsoid - axis; for an unrotated case this is the hydraulic conductivity in the - y direction. If K22 is not included in the GRIDDATA block, then K22 - is set equal to K. For a regular MODFLOW grid (DIS Package is used) - in which no rotation angles are specified, K22 is the hydraulic - conductivity along columns in the y direction. For an unstructured - DISU grid, the user must assign principal x and y axes and provide - the angle for each cell face relative to the assigned x direction. - All included cells (IDOMAIN :math:`>` 0) must have a K22 value - greater than zero. - k33 : [double] - * k33 (double) is the hydraulic conductivity of the third ellipsoid - axis; for an unrotated case, this is the vertical hydraulic - conductivity. When anisotropy is applied, K33 corresponds to the K33 - tensor component. All included cells (IDOMAIN :math:`>` 0) must have - a K33 value greater than zero. - angle1 : [double] - * angle1 (double) is a rotation angle of the hydraulic conductivity - tensor in degrees. The angle represents the first of three sequential - rotations of the hydraulic conductivity ellipsoid. With the K11, K22, - and K33 axes of the ellipsoid initially aligned with the x, y, and z - coordinate axes, respectively, ANGLE1 rotates the ellipsoid about its - K33 axis (within the x - y plane). A positive value represents - counter-clockwise rotation when viewed from any point on the positive - K33 axis, looking toward the center of the ellipsoid. A value of zero - indicates that the K11 axis lies within the x - z plane. If ANGLE1 is - not specified, default values of zero are assigned to ANGLE1, ANGLE2, - and ANGLE3, in which case the K11, K22, and K33 axes are aligned with - the x, y, and z axes, respectively. - angle2 : [double] - * angle2 (double) is a rotation angle of the hydraulic conductivity - tensor in degrees. The angle represents the second of three - sequential rotations of the hydraulic conductivity ellipsoid. - Following the rotation by ANGLE1 described above, ANGLE2 rotates the - ellipsoid about its K22 axis (out of the x - y plane). An array can - be specified for ANGLE2 only if ANGLE1 is also specified. A positive - value of ANGLE2 represents clockwise rotation when viewed from any - point on the positive K22 axis, looking toward the center of the - ellipsoid. A value of zero indicates that the K11 axis lies within - the x - y plane. If ANGLE2 is not specified, default values of zero - are assigned to ANGLE2 and ANGLE3; connections that are not user- - designated as vertical are assumed to be strictly horizontal (that - is, to have no z component to their orientation); and connection - lengths are based on horizontal distances. - angle3 : [double] - * angle3 (double) is a rotation angle of the hydraulic conductivity - tensor in degrees. The angle represents the third of three sequential - rotations of the hydraulic conductivity ellipsoid. Following the - rotations by ANGLE1 and ANGLE2 described above, ANGLE3 rotates the - ellipsoid about its K11 axis. An array can be specified for ANGLE3 - only if ANGLE1 and ANGLE2 are also specified. An array must be - specified for ANGLE3 if ANGLE2 is specified. A positive value of - ANGLE3 represents clockwise rotation when viewed from any point on - the positive K11 axis, looking toward the center of the ellipsoid. A - value of zero indicates that the K22 axis lies within the x - y - plane. - wetdry : [double] - * wetdry (double) is a combination of the wetting threshold and a flag - to indicate which neighboring cells can cause a cell to become wet. - If WETDRY :math:`<` 0, only a cell below a dry cell can cause the - cell to become wet. If WETDRY :math:`>` 0, the cell below a dry cell - and horizontally adjacent cells can cause a cell to become wet. If - WETDRY is 0, the cell cannot be wetted. The absolute value of WETDRY - is the wetting threshold. When the sum of BOT and the absolute value - of WETDRY at a dry cell is equaled or exceeded by the head at an - adjacent cell, the cell is wetted. WETDRY must be specified if - "REWET" is specified in the OPTIONS block. If "REWET" is not - specified in the options block, then WETDRY can be entered, and - memory will be allocated for it, even though it is not used. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - rewet_record = ListTemplateGenerator(('gwf6', 'npf', 'options', - 'rewet_record')) - icelltype = ArrayTemplateGenerator(('gwf6', 'npf', 'griddata', - 'icelltype')) - k = ArrayTemplateGenerator(('gwf6', 'npf', 'griddata', 'k')) - k22 = ArrayTemplateGenerator(('gwf6', 'npf', 'griddata', 'k22')) - k33 = ArrayTemplateGenerator(('gwf6', 'npf', 'griddata', 'k33')) - angle1 = ArrayTemplateGenerator(('gwf6', 'npf', 'griddata', - 'angle1')) - angle2 = ArrayTemplateGenerator(('gwf6', 'npf', 'griddata', - 'angle2')) - angle3 = ArrayTemplateGenerator(('gwf6', 'npf', 'griddata', - 'angle3')) - wetdry = ArrayTemplateGenerator(('gwf6', 'npf', 'griddata', - 'wetdry')) - package_abbr = "gwfnpf" - _package_type = "npf" - dfn_file_name = "gwf-npf.dfn" - - dfn = [["block options", "name save_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name alternative_cell_averaging", - "type string", "valid logarithmic amt-lmk amt-hmk", - "reader urword", "optional true"], - ["block options", "name thickstrt", "type keyword", - "reader urword", "optional true"], - ["block options", "name cvoptions", - "type record variablecv dewatered", "reader urword", - "optional true"], - ["block options", "name variablecv", "in_record true", - "type keyword", "reader urword"], - ["block options", "name dewatered", "in_record true", - "type keyword", "reader urword", "optional true"], - ["block options", "name perched", "type keyword", - "reader urword", "optional true"], - ["block options", "name rewet_record", - "type record rewet wetfct iwetit ihdwet", "reader urword", - "optional true"], - ["block options", "name rewet", "type keyword", "in_record true", - "reader urword", "optional false"], - ["block options", "name wetfct", "type double precision", - "in_record true", "reader urword", "optional false"], - ["block options", "name iwetit", "type integer", - "in_record true", "reader urword", "optional false"], - ["block options", "name ihdwet", "type integer", - "in_record true", "reader urword", "optional false"], - ["block options", "name xt3doptions", "type record xt3d rhs", - "reader urword", "optional true"], - ["block options", "name xt3d", "in_record true", "type keyword", - "reader urword"], - ["block options", "name rhs", "in_record true", "type keyword", - "reader urword", "optional true"], - ["block options", "name save_specific_discharge", "type keyword", - "reader urword", "optional true"], - ["block griddata", "name icelltype", "type integer", - "shape (nodes)", "valid", "reader readarray", "layered true", - "optional", "default_value 0"], - ["block griddata", "name k", "type double precision", - "shape (nodes)", "valid", "reader readarray", "layered true", - "optional", "default_value 1.0"], - ["block griddata", "name k22", "type double precision", - "shape (nodes)", "valid", "reader readarray", "layered true", - "optional true"], - ["block griddata", "name k33", "type double precision", - "shape (nodes)", "valid", "reader readarray", "layered true", - "optional true"], - ["block griddata", "name angle1", "type double precision", - "shape (nodes)", "valid", "reader readarray", "layered true", - "optional true"], - ["block griddata", "name angle2", "type double precision", - "shape (nodes)", "valid", "reader readarray", "layered true", - "optional true"], - ["block griddata", "name angle3", "type double precision", - "shape (nodes)", "valid", "reader readarray", "layered true", - "optional true"], - ["block griddata", "name wetdry", "type double precision", - "shape (nodes)", "valid", "reader readarray", "layered true", - "optional true"]] - - def __init__(self, model, loading_package=False, save_flows=None, - alternative_cell_averaging=None, thickstrt=None, - cvoptions=None, perched=None, rewet_record=None, - xt3doptions=None, save_specific_discharge=None, icelltype=0, - k=1.0, k22=None, k33=None, angle1=None, angle2=None, - angle3=None, wetdry=None, filename=None, pname=None, - parent_file=None): - super(ModflowGwfnpf, self).__init__(model, "npf", filename, pname, - loading_package, parent_file) - - # set up variables - self.save_flows = self.build_mfdata("save_flows", save_flows) - self.alternative_cell_averaging = self.build_mfdata( - "alternative_cell_averaging", alternative_cell_averaging) - self.thickstrt = self.build_mfdata("thickstrt", thickstrt) - self.cvoptions = self.build_mfdata("cvoptions", cvoptions) - self.perched = self.build_mfdata("perched", perched) - self.rewet_record = self.build_mfdata("rewet_record", rewet_record) - self.xt3doptions = self.build_mfdata("xt3doptions", xt3doptions) - self.save_specific_discharge = self.build_mfdata( - "save_specific_discharge", save_specific_discharge) - self.icelltype = self.build_mfdata("icelltype", icelltype) - self.k = self.build_mfdata("k", k) - self.k22 = self.build_mfdata("k22", k22) - self.k33 = self.build_mfdata("k33", k33) - self.angle1 = self.build_mfdata("angle1", angle1) - self.angle2 = self.build_mfdata("angle2", angle2) - self.angle3 = self.build_mfdata("angle3", angle3) - self.wetdry = self.build_mfdata("wetdry", wetdry) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ListTemplateGenerator, ArrayTemplateGenerator + + +class ModflowGwfnpf(mfpackage.MFPackage): + """ + ModflowGwfnpf defines a npf package within a gwf6 model. + + Parameters + ---------- + model : MFModel + Model that this package is a part of. Package is automatically + added to model when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + save_flows : boolean + * save_flows (boolean) keyword to indicate that cell-by-cell flow terms + will be written to the file specified with "BUDGET SAVE FILE" in + Output Control. + alternative_cell_averaging : string + * alternative_cell_averaging (string) is a text keyword to indicate + that an alternative method will be used for calculating the + conductance for horizontal cell connections. The text value for + ALTERNATIVE_CELL_AVERAGING can be "LOGARITHMIC", "AMT-LMK", or "AMT- + HMK". "AMT-LMK" signifies that the conductance will be calculated + using arithmetic-mean thickness and logarithmic-mean hydraulic + conductivity. "AMT-HMK" signifies that the conductance will be + calculated using arithmetic-mean thickness and harmonic-mean + hydraulic conductivity. If the user does not specify a value for + ALTERNATIVE_CELL_AVERAGING, then the harmonic-mean method will be + used. This option cannot be used if the XT3D option is invoked. + thickstrt : boolean + * thickstrt (boolean) indicates that cells having a negative ICELLTYPE + are confined, and their cell thickness for conductance calculations + will be computed as STRT-BOT rather than TOP-BOT. + cvoptions : [dewatered] + * dewatered (string) If the DEWATERED keyword is specified, then the + vertical conductance is calculated using only the saturated thickness + and properties of the overlying cell if the head in the underlying + cell is below its top. + perched : boolean + * perched (boolean) keyword to indicate that when a cell is overlying a + dewatered convertible cell, the head difference used in Darcy's Law + is equal to the head in the overlying cell minus the bottom elevation + of the overlying cell. If not specified, then the default is to use + the head difference between the two cells. + rewet_record : [wetfct, iwetit, ihdwet] + * wetfct (double) is a keyword and factor that is included in the + calculation of the head that is initially established at a cell when + that cell is converted from dry to wet. + * iwetit (integer) is a keyword and iteration interval for attempting + to wet cells. Wetting is attempted every IWETIT iteration. This + applies to outer iterations and not inner iterations. If IWETIT is + specified as zero or less, then the value is changed to 1. + * ihdwet (integer) is a keyword and integer flag that determines which + equation is used to define the initial head at cells that become wet. + If IHDWET is 0, h = BOT + WETFCT (hm - BOT). If IHDWET is not 0, h = + BOT + WETFCT (THRESH). + xt3doptions : [rhs] + * rhs (string) If the RHS keyword is also included, then the XT3D + additional terms will be added to the right-hand side. If the RHS + keyword is excluded, then the XT3D terms will be put into the + coefficient matrix. + save_specific_discharge : boolean + * save_specific_discharge (boolean) keyword to indicate that x, y, and + z components of specific discharge will be calculated at cell centers + and written to the cell-by-cell flow file, which is specified with + "BUDGET SAVE FILE" in Output Control. If this option is activated, + then additional information may be required in the discretization + packages and the GWF Exchange package (if GWF models are coupled). + Specifically, ANGLDEGX must be specified in the CONNECTIONDATA block + of the DISU Package; ANGLDEGX must also be specified for the GWF + Exchange as an auxiliary variable. + icelltype : [integer] + * icelltype (integer) flag for each cell that specifies how saturated + thickness is treated. 0 means saturated thickness is held constant; + :math:`>`0 means saturated thickness varies with computed head when + head is below the cell top; :math:`<`0 means saturated thickness + varies with computed head unless the THICKSTRT option is in effect. + When THICKSTRT is in effect, a negative value of icelltype indicates + that saturated thickness will be computed as STRT-BOT and held + constant. + k : [double] + * k (double) is the hydraulic conductivity. For the common case in + which the user would like to specify the horizontal hydraulic + conductivity and the vertical hydraulic conductivity, then K should + be assigned as the horizontal hydraulic conductivity, K33 should be + assigned as the vertical hydraulic conductivity, and texttt{K22} and + the three rotation angles should not be specified. When more + sophisticated anisotropy is required, then K corresponds to the K11 + hydraulic conductivity axis. All included cells (IDOMAIN :math:`>` 0) + must have a K value greater than zero. + k22 : [double] + * k22 (double) is the hydraulic conductivity of the second ellipsoid + axis; for an unrotated case this is the hydraulic conductivity in the + y direction. If K22 is not included in the GRIDDATA block, then K22 + is set equal to K. For a regular MODFLOW grid (DIS Package is used) + in which no rotation angles are specified, K22 is the hydraulic + conductivity along columns in the y direction. For an unstructured + DISU grid, the user must assign principal x and y axes and provide + the angle for each cell face relative to the assigned x direction. + All included cells (IDOMAIN :math:`>` 0) must have a K22 value + greater than zero. + k33 : [double] + * k33 (double) is the hydraulic conductivity of the third ellipsoid + axis; for an unrotated case, this is the vertical hydraulic + conductivity. When anisotropy is applied, K33 corresponds to the K33 + tensor component. All included cells (IDOMAIN :math:`>` 0) must have + a K33 value greater than zero. + angle1 : [double] + * angle1 (double) is a rotation angle of the hydraulic conductivity + tensor in degrees. The angle represents the first of three sequential + rotations of the hydraulic conductivity ellipsoid. With the K11, K22, + and K33 axes of the ellipsoid initially aligned with the x, y, and z + coordinate axes, respectively, ANGLE1 rotates the ellipsoid about its + K33 axis (within the x - y plane). A positive value represents + counter-clockwise rotation when viewed from any point on the positive + K33 axis, looking toward the center of the ellipsoid. A value of zero + indicates that the K11 axis lies within the x - z plane. If ANGLE1 is + not specified, default values of zero are assigned to ANGLE1, ANGLE2, + and ANGLE3, in which case the K11, K22, and K33 axes are aligned with + the x, y, and z axes, respectively. + angle2 : [double] + * angle2 (double) is a rotation angle of the hydraulic conductivity + tensor in degrees. The angle represents the second of three + sequential rotations of the hydraulic conductivity ellipsoid. + Following the rotation by ANGLE1 described above, ANGLE2 rotates the + ellipsoid about its K22 axis (out of the x - y plane). An array can + be specified for ANGLE2 only if ANGLE1 is also specified. A positive + value of ANGLE2 represents clockwise rotation when viewed from any + point on the positive K22 axis, looking toward the center of the + ellipsoid. A value of zero indicates that the K11 axis lies within + the x - y plane. If ANGLE2 is not specified, default values of zero + are assigned to ANGLE2 and ANGLE3; connections that are not user- + designated as vertical are assumed to be strictly horizontal (that + is, to have no z component to their orientation); and connection + lengths are based on horizontal distances. + angle3 : [double] + * angle3 (double) is a rotation angle of the hydraulic conductivity + tensor in degrees. The angle represents the third of three sequential + rotations of the hydraulic conductivity ellipsoid. Following the + rotations by ANGLE1 and ANGLE2 described above, ANGLE3 rotates the + ellipsoid about its K11 axis. An array can be specified for ANGLE3 + only if ANGLE1 and ANGLE2 are also specified. An array must be + specified for ANGLE3 if ANGLE2 is specified. A positive value of + ANGLE3 represents clockwise rotation when viewed from any point on + the positive K11 axis, looking toward the center of the ellipsoid. A + value of zero indicates that the K22 axis lies within the x - y + plane. + wetdry : [double] + * wetdry (double) is a combination of the wetting threshold and a flag + to indicate which neighboring cells can cause a cell to become wet. + If WETDRY :math:`<` 0, only a cell below a dry cell can cause the + cell to become wet. If WETDRY :math:`>` 0, the cell below a dry cell + and horizontally adjacent cells can cause a cell to become wet. If + WETDRY is 0, the cell cannot be wetted. The absolute value of WETDRY + is the wetting threshold. When the sum of BOT and the absolute value + of WETDRY at a dry cell is equaled or exceeded by the head at an + adjacent cell, the cell is wetted. WETDRY must be specified if + "REWET" is specified in the OPTIONS block. If "REWET" is not + specified in the options block, then WETDRY can be entered, and + memory will be allocated for it, even though it is not used. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + rewet_record = ListTemplateGenerator(('gwf6', 'npf', 'options', + 'rewet_record')) + icelltype = ArrayTemplateGenerator(('gwf6', 'npf', 'griddata', + 'icelltype')) + k = ArrayTemplateGenerator(('gwf6', 'npf', 'griddata', 'k')) + k22 = ArrayTemplateGenerator(('gwf6', 'npf', 'griddata', 'k22')) + k33 = ArrayTemplateGenerator(('gwf6', 'npf', 'griddata', 'k33')) + angle1 = ArrayTemplateGenerator(('gwf6', 'npf', 'griddata', + 'angle1')) + angle2 = ArrayTemplateGenerator(('gwf6', 'npf', 'griddata', + 'angle2')) + angle3 = ArrayTemplateGenerator(('gwf6', 'npf', 'griddata', + 'angle3')) + wetdry = ArrayTemplateGenerator(('gwf6', 'npf', 'griddata', + 'wetdry')) + package_abbr = "gwfnpf" + _package_type = "npf" + dfn_file_name = "gwf-npf.dfn" + + dfn = [["block options", "name save_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name alternative_cell_averaging", + "type string", "valid logarithmic amt-lmk amt-hmk", + "reader urword", "optional true"], + ["block options", "name thickstrt", "type keyword", + "reader urword", "optional true"], + ["block options", "name cvoptions", + "type record variablecv dewatered", "reader urword", + "optional true"], + ["block options", "name variablecv", "in_record true", + "type keyword", "reader urword"], + ["block options", "name dewatered", "in_record true", + "type keyword", "reader urword", "optional true"], + ["block options", "name perched", "type keyword", + "reader urword", "optional true"], + ["block options", "name rewet_record", + "type record rewet wetfct iwetit ihdwet", "reader urword", + "optional true"], + ["block options", "name rewet", "type keyword", "in_record true", + "reader urword", "optional false"], + ["block options", "name wetfct", "type double precision", + "in_record true", "reader urword", "optional false"], + ["block options", "name iwetit", "type integer", + "in_record true", "reader urword", "optional false"], + ["block options", "name ihdwet", "type integer", + "in_record true", "reader urword", "optional false"], + ["block options", "name xt3doptions", "type record xt3d rhs", + "reader urword", "optional true"], + ["block options", "name xt3d", "in_record true", "type keyword", + "reader urword"], + ["block options", "name rhs", "in_record true", "type keyword", + "reader urword", "optional true"], + ["block options", "name save_specific_discharge", "type keyword", + "reader urword", "optional true"], + ["block griddata", "name icelltype", "type integer", + "shape (nodes)", "valid", "reader readarray", "layered true", + "optional", "default_value 0"], + ["block griddata", "name k", "type double precision", + "shape (nodes)", "valid", "reader readarray", "layered true", + "optional", "default_value 1.0"], + ["block griddata", "name k22", "type double precision", + "shape (nodes)", "valid", "reader readarray", "layered true", + "optional true"], + ["block griddata", "name k33", "type double precision", + "shape (nodes)", "valid", "reader readarray", "layered true", + "optional true"], + ["block griddata", "name angle1", "type double precision", + "shape (nodes)", "valid", "reader readarray", "layered true", + "optional true"], + ["block griddata", "name angle2", "type double precision", + "shape (nodes)", "valid", "reader readarray", "layered true", + "optional true"], + ["block griddata", "name angle3", "type double precision", + "shape (nodes)", "valid", "reader readarray", "layered true", + "optional true"], + ["block griddata", "name wetdry", "type double precision", + "shape (nodes)", "valid", "reader readarray", "layered true", + "optional true"]] + + def __init__(self, model, loading_package=False, save_flows=None, + alternative_cell_averaging=None, thickstrt=None, + cvoptions=None, perched=None, rewet_record=None, + xt3doptions=None, save_specific_discharge=None, icelltype=0, + k=1.0, k22=None, k33=None, angle1=None, angle2=None, + angle3=None, wetdry=None, filename=None, pname=None, + parent_file=None): + super(ModflowGwfnpf, self).__init__(model, "npf", filename, pname, + loading_package, parent_file) + + # set up variables + self.save_flows = self.build_mfdata("save_flows", save_flows) + self.alternative_cell_averaging = self.build_mfdata( + "alternative_cell_averaging", alternative_cell_averaging) + self.thickstrt = self.build_mfdata("thickstrt", thickstrt) + self.cvoptions = self.build_mfdata("cvoptions", cvoptions) + self.perched = self.build_mfdata("perched", perched) + self.rewet_record = self.build_mfdata("rewet_record", rewet_record) + self.xt3doptions = self.build_mfdata("xt3doptions", xt3doptions) + self.save_specific_discharge = self.build_mfdata( + "save_specific_discharge", save_specific_discharge) + self.icelltype = self.build_mfdata("icelltype", icelltype) + self.k = self.build_mfdata("k", k) + self.k22 = self.build_mfdata("k22", k22) + self.k33 = self.build_mfdata("k33", k33) + self.angle1 = self.build_mfdata("angle1", angle1) + self.angle2 = self.build_mfdata("angle2", angle2) + self.angle3 = self.build_mfdata("angle3", angle3) + self.wetdry = self.build_mfdata("wetdry", wetdry) + self._init_complete = True diff --git a/flopy/mf6/modflow/mfgwfoc.py b/flopy/mf6/modflow/mfgwfoc.py index a6d03681f1..9b74c3b5fd 100644 --- a/flopy/mf6/modflow/mfgwfoc.py +++ b/flopy/mf6/modflow/mfgwfoc.py @@ -1,189 +1,189 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ListTemplateGenerator - - -class ModflowGwfoc(mfpackage.MFPackage): - """ - ModflowGwfoc defines a oc package within a gwf6 model. - - Parameters - ---------- - model : MFModel - Model that this package is a part of. Package is automatically - added to model when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - budget_filerecord : [budgetfile] - * budgetfile (string) name of the output file to write budget - information. - head_filerecord : [headfile] - * headfile (string) name of the output file to write head information. - headprintrecord : [columns, width, digits, format] - * columns (integer) number of columns for writing data. - * width (integer) width for writing each number. - * digits (integer) number of digits to use for writing a number. - * format (string) write format can be EXPONENTIAL, FIXED, GENERAL, or - SCIENTIFIC. - saverecord : [rtype, ocsetting] - * rtype (string) type of information to save or print. Can be BUDGET or - HEAD. - * ocsetting (keystring) specifies the steps for which the data will be - saved. - all : [keyword] - * all (keyword) keyword to indicate save for all time steps in - period. - first : [keyword] - * first (keyword) keyword to indicate save for first step in - period. This keyword may be used in conjunction with other - keywords to print or save results for multiple time steps. - last : [keyword] - * last (keyword) keyword to indicate save for last step in - period. This keyword may be used in conjunction with other - keywords to print or save results for multiple time steps. - frequency : [integer] - * frequency (integer) save at the specified time step - frequency. This keyword may be used in conjunction with other - keywords to print or save results for multiple time steps. - steps : [integer] - * steps (integer) save for each step specified in STEPS. This - keyword may be used in conjunction with other keywords to - print or save results for multiple time steps. - printrecord : [rtype, ocsetting] - * rtype (string) type of information to save or print. Can be BUDGET or - HEAD. - * ocsetting (keystring) specifies the steps for which the data will be - saved. - all : [keyword] - * all (keyword) keyword to indicate save for all time steps in - period. - first : [keyword] - * first (keyword) keyword to indicate save for first step in - period. This keyword may be used in conjunction with other - keywords to print or save results for multiple time steps. - last : [keyword] - * last (keyword) keyword to indicate save for last step in - period. This keyword may be used in conjunction with other - keywords to print or save results for multiple time steps. - frequency : [integer] - * frequency (integer) save at the specified time step - frequency. This keyword may be used in conjunction with other - keywords to print or save results for multiple time steps. - steps : [integer] - * steps (integer) save for each step specified in STEPS. This - keyword may be used in conjunction with other keywords to - print or save results for multiple time steps. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - budget_filerecord = ListTemplateGenerator(('gwf6', 'oc', 'options', - 'budget_filerecord')) - head_filerecord = ListTemplateGenerator(('gwf6', 'oc', 'options', - 'head_filerecord')) - headprintrecord = ListTemplateGenerator(('gwf6', 'oc', 'options', - 'headprintrecord')) - saverecord = ListTemplateGenerator(('gwf6', 'oc', 'period', - 'saverecord')) - printrecord = ListTemplateGenerator(('gwf6', 'oc', 'period', - 'printrecord')) - package_abbr = "gwfoc" - _package_type = "oc" - dfn_file_name = "gwf-oc.dfn" - - dfn = [["block options", "name budget_filerecord", - "type record budget fileout budgetfile", "shape", "reader urword", - "tagged true", "optional true"], - ["block options", "name budget", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name fileout", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name budgetfile", "type string", - "preserve_case true", "shape", "in_record true", "reader urword", - "tagged false", "optional false"], - ["block options", "name head_filerecord", - "type record head fileout headfile", "shape", "reader urword", - "tagged true", "optional true"], - ["block options", "name head", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name headfile", "type string", - "preserve_case true", "shape", "in_record true", "reader urword", - "tagged false", "optional false"], - ["block options", "name headprintrecord", - "type record head print_format formatrecord", "shape", - "reader urword", "optional true"], - ["block options", "name print_format", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name formatrecord", - "type record columns width digits format", "shape", - "in_record true", "reader urword", "tagged", "optional false"], - ["block options", "name columns", "type integer", "shape", - "in_record true", "reader urword", "tagged true", "optional"], - ["block options", "name width", "type integer", "shape", - "in_record true", "reader urword", "tagged true", "optional"], - ["block options", "name digits", "type integer", "shape", - "in_record true", "reader urword", "tagged true", "optional"], - ["block options", "name format", "type string", "shape", - "in_record true", "reader urword", "tagged false", - "optional false"], - ["block period", "name iper", "type integer", - "block_variable True", "in_record true", "tagged false", "shape", - "valid", "reader urword", "optional false"], - ["block period", "name saverecord", - "type record save rtype ocsetting", "shape", "reader urword", - "tagged false", "optional true"], - ["block period", "name save", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block period", "name printrecord", - "type record print rtype ocsetting", "shape", "reader urword", - "tagged false", "optional true"], - ["block period", "name print", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block period", "name rtype", "type string", "shape", - "in_record true", "reader urword", "tagged false", - "optional false"], - ["block period", "name ocsetting", - "type keystring all first last frequency steps", "shape", - "tagged false", "in_record true", "reader urword"], - ["block period", "name all", "type keyword", "shape", - "in_record true", "reader urword"], - ["block period", "name first", "type keyword", "shape", - "in_record true", "reader urword"], - ["block period", "name last", "type keyword", "shape", - "in_record true", "reader urword"], - ["block period", "name frequency", "type integer", "shape", - "tagged true", "in_record true", "reader urword"], - ["block period", "name steps", "type integer", "shape (`0 indicates confined storage is - used when head is above cell top and a mixed formulation of - unconfined and confined storage is used when head is below cell top. - ss : [double] - * ss (double) is specific storage (or the storage coefficient if - STORAGECOEFFICIENT is specified as an option). Specific storage - values must be greater than or equal to 0. - sy : [double] - * sy (double) is specific yield. Specific yield values must be greater - than or equal to 0. Specific yield does not have to be specified if - there are no convertible cells (ICONVERT=0 in every cell). - steady_state : boolean - * steady-state (boolean) keyword to indicate that stress period IPER is - steady-state. Steady-state conditions will apply until the TRANSIENT - keyword is specified in a subsequent BEGIN PERIOD block. - transient : boolean - * transient (boolean) keyword to indicate that stress period IPER is - transient. Transient conditions will apply until the STEADY-STATE - keyword is specified in a subsequent BEGIN PERIOD block. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - iconvert = ArrayTemplateGenerator(('gwf6', 'sto', 'griddata', - 'iconvert')) - ss = ArrayTemplateGenerator(('gwf6', 'sto', 'griddata', 'ss')) - sy = ArrayTemplateGenerator(('gwf6', 'sto', 'griddata', 'sy')) - package_abbr = "gwfsto" - _package_type = "sto" - dfn_file_name = "gwf-sto.dfn" - - dfn = [["block options", "name save_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name storagecoefficient", "type keyword", - "reader urword", "optional true"], - ["block griddata", "name iconvert", "type integer", - "shape (nodes)", "valid", "reader readarray", "layered true", - "optional false", "default_value 0"], - ["block griddata", "name ss", "type double precision", - "shape (nodes)", "valid", "reader readarray", "layered true", - "optional false", "default_value 1.e-5"], - ["block griddata", "name sy", "type double precision", - "shape (nodes)", "valid", "reader readarray", "layered true", - "optional false", "default_value 0.15"], - ["block period", "name iper", "type integer", - "block_variable True", "in_record true", "tagged false", "shape", - "valid", "reader urword", "optional false"], - ["block period", "name steady-state", "type keyword", "shape", - "valid", "reader urword", "optional true"], - ["block period", "name transient", "type keyword", "shape", - "valid", "reader urword", "optional true"]] - - def __init__(self, model, loading_package=False, save_flows=None, - storagecoefficient=None, iconvert=0, ss=1.e-5, sy=0.15, - steady_state=None, transient=None, filename=None, pname=None, - parent_file=None): - super(ModflowGwfsto, self).__init__(model, "sto", filename, pname, - loading_package, parent_file) - - # set up variables - self.save_flows = self.build_mfdata("save_flows", save_flows) - self.storagecoefficient = self.build_mfdata("storagecoefficient", - storagecoefficient) - self.iconvert = self.build_mfdata("iconvert", iconvert) - self.ss = self.build_mfdata("ss", ss) - self.sy = self.build_mfdata("sy", sy) - self.steady_state = self.build_mfdata("steady-state", steady_state) - self.transient = self.build_mfdata("transient", transient) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ArrayTemplateGenerator + + +class ModflowGwfsto(mfpackage.MFPackage): + """ + ModflowGwfsto defines a sto package within a gwf6 model. + + Parameters + ---------- + model : MFModel + Model that this package is a part of. Package is automatically + added to model when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + save_flows : boolean + * save_flows (boolean) keyword to indicate that cell-by-cell flow terms + will be written to the file specified with "BUDGET SAVE FILE" in + Output Control. + storagecoefficient : boolean + * storagecoefficient (boolean) keyword to indicate that the SS array is + read as storage coefficient rather than specific storage. + iconvert : [integer] + * iconvert (integer) is a flag for each cell that specifies whether or + not a cell is convertible for the storage calculation. 0 indicates + confined storage is used. :math:`>`0 indicates confined storage is + used when head is above cell top and a mixed formulation of + unconfined and confined storage is used when head is below cell top. + ss : [double] + * ss (double) is specific storage (or the storage coefficient if + STORAGECOEFFICIENT is specified as an option). Specific storage + values must be greater than or equal to 0. + sy : [double] + * sy (double) is specific yield. Specific yield values must be greater + than or equal to 0. Specific yield does not have to be specified if + there are no convertible cells (ICONVERT=0 in every cell). + steady_state : boolean + * steady-state (boolean) keyword to indicate that stress period IPER is + steady-state. Steady-state conditions will apply until the TRANSIENT + keyword is specified in a subsequent BEGIN PERIOD block. + transient : boolean + * transient (boolean) keyword to indicate that stress period IPER is + transient. Transient conditions will apply until the STEADY-STATE + keyword is specified in a subsequent BEGIN PERIOD block. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + iconvert = ArrayTemplateGenerator(('gwf6', 'sto', 'griddata', + 'iconvert')) + ss = ArrayTemplateGenerator(('gwf6', 'sto', 'griddata', 'ss')) + sy = ArrayTemplateGenerator(('gwf6', 'sto', 'griddata', 'sy')) + package_abbr = "gwfsto" + _package_type = "sto" + dfn_file_name = "gwf-sto.dfn" + + dfn = [["block options", "name save_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name storagecoefficient", "type keyword", + "reader urword", "optional true"], + ["block griddata", "name iconvert", "type integer", + "shape (nodes)", "valid", "reader readarray", "layered true", + "optional false", "default_value 0"], + ["block griddata", "name ss", "type double precision", + "shape (nodes)", "valid", "reader readarray", "layered true", + "optional false", "default_value 1.e-5"], + ["block griddata", "name sy", "type double precision", + "shape (nodes)", "valid", "reader readarray", "layered true", + "optional false", "default_value 0.15"], + ["block period", "name iper", "type integer", + "block_variable True", "in_record true", "tagged false", "shape", + "valid", "reader urword", "optional false"], + ["block period", "name steady-state", "type keyword", "shape", + "valid", "reader urword", "optional true"], + ["block period", "name transient", "type keyword", "shape", + "valid", "reader urword", "optional true"]] + + def __init__(self, model, loading_package=False, save_flows=None, + storagecoefficient=None, iconvert=0, ss=1.e-5, sy=0.15, + steady_state=None, transient=None, filename=None, pname=None, + parent_file=None): + super(ModflowGwfsto, self).__init__(model, "sto", filename, pname, + loading_package, parent_file) + + # set up variables + self.save_flows = self.build_mfdata("save_flows", save_flows) + self.storagecoefficient = self.build_mfdata("storagecoefficient", + storagecoefficient) + self.iconvert = self.build_mfdata("iconvert", iconvert) + self.ss = self.build_mfdata("ss", ss) + self.sy = self.build_mfdata("sy", sy) + self.steady_state = self.build_mfdata("steady-state", steady_state) + self.transient = self.build_mfdata("transient", transient) + self._init_complete = True diff --git a/flopy/mf6/modflow/mfgwfuzf.py b/flopy/mf6/modflow/mfgwfuzf.py index 41dc133bdc..fd569779d8 100644 --- a/flopy/mf6/modflow/mfgwfuzf.py +++ b/flopy/mf6/modflow/mfgwfuzf.py @@ -1,415 +1,415 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ListTemplateGenerator - - -class ModflowGwfuzf(mfpackage.MFPackage): - """ - ModflowGwfuzf defines a uzf package within a gwf6 model. - - Parameters - ---------- - model : MFModel - Model that this package is a part of. Package is automatically - added to model when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - auxiliary : [string] - * auxiliary (string) defines an array of one or more auxiliary variable - names. There is no limit on the number of auxiliary variables that - can be provided on this line; however, lists of information provided - in subsequent blocks must have a column of data for each auxiliary - variable name defined here. The number of auxiliary variables - detected on this line determines the value for naux. Comments cannot - be provided anywhere on this line as they will be interpreted as - auxiliary variable names. Auxiliary variables may not be used by the - package, but they will be available for use by other parts of the - program. The program will terminate with an error if auxiliary - variables are specified on more than one line in the options block. - auxmultname : string - * auxmultname (string) name of auxiliary variable to be used as - multiplier of GWF cell area used by UZF cell. - boundnames : boolean - * boundnames (boolean) keyword to indicate that boundary names may be - provided with the list of UZF cells. - print_input : boolean - * print_input (boolean) keyword to indicate that the list of UZF - information will be written to the listing file immediately after it - is read. - print_flows : boolean - * print_flows (boolean) keyword to indicate that the list of UZF flow - rates will be printed to the listing file for every stress period - time step in which "BUDGET PRINT" is specified in Output Control. If - there is no Output Control option and "PRINT_FLOWS" is specified, - then flow rates are printed for the last time step of each stress - period. - save_flows : boolean - * save_flows (boolean) keyword to indicate that UZF flow terms will be - written to the file specified with "BUDGET FILEOUT" in Output - Control. - budget_filerecord : [budgetfile] - * budgetfile (string) name of the binary output file to write budget - information. - timeseries : {varname:data} or timeseries data - * Contains data for the ts package. Data can be stored in a dictionary - containing data for the ts package with variable names as keys and - package data as values. Data just for the timeseries variable is also - acceptable. See ts package documentation for more information. - observations : {varname:data} or continuous data - * Contains data for the obs package. Data can be stored in a dictionary - containing data for the obs package with variable names as keys and - package data as values. Data just for the observations variable is - also acceptable. See obs package documentation for more information. - mover : boolean - * mover (boolean) keyword to indicate that this instance of the UZF - Package can be used with the Water Mover (MVR) Package. When the - MOVER option is specified, additional memory is allocated within the - package to store the available, provided, and received water. - simulate_et : boolean - * simulate_et (boolean) keyword specifying that ET in the unsaturated - (UZF) and saturated zones (GWF) will be simulated. ET can be - simulated in the UZF cell and not the GWF cell by omitting keywords - LINEAR_GWET and SQUARE_GWET. - linear_gwet : boolean - * linear_gwet (boolean) keyword specifying that groundwater ET will be - simulated using the original ET formulation of MODFLOW-2005. - square_gwet : boolean - * square_gwet (boolean) keyword specifying that groundwater ET will be - simulated by assuming a constant ET rate for groundwater levels - between land surface (TOP) and land surface minus the ET extinction - depth (TOP-EXTDP). Groundwater ET is smoothly reduced from the PET - rate to zero over a nominal interval at TOP-EXTDP. - simulate_gwseep : boolean - * simulate_gwseep (boolean) keyword specifying that groundwater - discharge (GWSEEP) to land surface will be simulated. Groundwater - discharge is nonzero when groundwater head is greater than land - surface. - unsat_etwc : boolean - * unsat_etwc (boolean) keyword specifying that ET in the unsaturated - zone will be simulated as a function of the specified PET rate while - the water content (THETA) is greater than the ET extinction water - content (EXTWC). - unsat_etae : boolean - * unsat_etae (boolean) keyword specifying that ET in the unsaturated - zone will be simulated simulated using a capillary pressure based - formulation. Capillary pressure is calculated using the Brooks-Corey - retention function. - nuzfcells : integer - * nuzfcells (integer) is the number of UZF cells. More than one UZF - cell can be assigned to a GWF cell; however, only one GWF cell can be - assigned to a single UZF cell. If more than one UZF cell is assigned - to a GWF cell, then an auxiliary variable should be used to reduce - the surface area of the UZF cell with the AUXMULTNAME option. - ntrailwaves : integer - * ntrailwaves (integer) is the number of trailing waves. NTRAILWAVES - has a default value of 7 and can be increased to lower mass balance - error in the unsaturated zone. - nwavesets : integer - * nwavesets (integer) is the number of UZF cells specified. NWAVESETS - has a default value of 40 and can be increased if more waves are - required to resolve variations in water content within the - unsaturated zone. - packagedata : [iuzno, cellid, landflag, ivertcon, surfdep, vks, thtr, thts, - thti, eps, boundname] - * iuzno (integer) integer value that defines the UZF cell number - associated with the specified PACKAGEDATA data on the line. IUZNO - must be greater than zero and less than or equal to NUZFCELLS. UZF - information must be specified for every UZF cell or the program will - terminate with an error. The program will also terminate with an - error if information for a UZF cell is specified more than once. - * cellid ((integer, ...)) is the cell identifier, and depends on the - type of grid that is used for the simulation. For a structured grid - that uses the DIS input file, CELLID is the layer, row, and column. - For a grid that uses the DISV input file, CELLID is the layer and - CELL2D number. If the model uses the unstructured discretization - (DISU) input file, CELLID is the node number for the cell. - * landflag (integer) integer value set to one for land surface cells - indicating that boundary conditions can be applied and data can be - specified in the PERIOD block. A value of 0 specifies a non-land - surface cell. - * ivertcon (integer) integer value set to specify underlying UZF cell - that receives water flowing to bottom of cell. If unsaturated zone - flow reaches the water table before the cell bottom, then water is - added to the GWF cell instead of flowing to the underlying UZF cell. - A value of 0 indicates the UZF cell is not connected to an underlying - UZF cell. - * surfdep (double) is the surface depression depth of the UZF cell. - * vks (double) is the vertical saturated hydraulic conductivity of the - UZF cell. - * thtr (double) is the residual (irreducible) water content of the UZF - cell. - * thts (double) is the saturated water content of the UZF cell. - * thti (double) is the initial water content of the UZF cell. - * eps (double) is the epsilon exponent of the UZF cell. - * boundname (string) name of the UZF cell cell. BOUNDNAME is an ASCII - character variable that can contain as many as 40 characters. If - BOUNDNAME contains spaces in it, then the entire name must be - enclosed within single quotes. - perioddata : [iuzno, finf, pet, extdp, extwc, ha, hroot, rootact, aux] - * iuzno (integer) integer value that defines the UZF cell number - associated with the specified PERIOD data on the line. - * finf (string) real or character value that defines the applied - infiltration rate of the UZF cell (:math:`LT^{-1}`). If the Options - block includes a TIMESERIESFILE entry (see the "Time-Variable Input" - section), values can be obtained from a time series by entering the - time-series name in place of a numeric value. - * pet (string) real or character value that defines the potential - evapotranspiration rate of the UZF cell and specified GWF cell. - Evapotranspiration is first removed from the unsaturated zone and any - remaining potential evapotranspiration is applied to the saturated - zone. If IVERTCON is greater than zero then residual potential - evapotranspiration not satisfied in the UZF cell is applied to the - underlying UZF and GWF cells. PET is always specified, but is only - used if SIMULATE_ET is specified in the OPTIONS block. If the Options - block includes a TIMESERIESFILE entry (see the "Time-Variable Input" - section), values can be obtained from a time series by entering the - time-series name in place of a numeric value. - * extdp (string) real or character value that defines the - evapotranspiration extinction depth of the UZF cell. If IVERTCON is - greater than zero and EXTDP extends below the GWF cell bottom then - remaining potential evapotranspiration is applied to the underlying - UZF and GWF cells. EXTDP is always specified, but is only used if - SIMULATE_ET is specified in the OPTIONS block. If the Options block - includes a TIMESERIESFILE entry (see the "Time-Variable Input" - section), values can be obtained from a time series by entering the - time-series name in place of a numeric value. - * extwc (string) real or character value that defines the - evapotranspiration extinction water content of the UZF cell. EXTWC is - always specified, but is only used if SIMULATE_ET and UNSAT_ETWC are - specified in the OPTIONS block. If the Options block includes a - TIMESERIESFILE entry (see the "Time-Variable Input" section), values - can be obtained from a time series by entering the time-series name - in place of a numeric value. - * ha (string) real or character value that defines the air entry - potential (head) of the UZF cell. HA is always specified, but is only - used if SIMULATE_ET and UNSAT_ETAE are specified in the OPTIONS - block. If the Options block includes a TIMESERIESFILE entry (see the - "Time-Variable Input" section), values can be obtained from a time - series by entering the time-series name in place of a numeric value. - * hroot (string) real or character value that defines the root - potential (head) of the UZF cell. HROOT is always specified, but is - only used if SIMULATE_ET and UNSAT_ETAE are specified in the OPTIONS - block. If the Options block includes a TIMESERIESFILE entry (see the - "Time-Variable Input" section), values can be obtained from a time - series by entering the time-series name in place of a numeric value. - * rootact (string) real or character value that defines the root - activity function of the UZF cell. ROOTACT is the length of roots in - a given volume of soil divided by that volume. Values range from 0 to - about 3 :math:`cm^{-2}`, depending on the plant community and its - stage of development. ROOTACT is always specified, but is only used - if SIMULATE\_ET and UNSAT\_ETAE are specified in the OPTIONS block. - If the Options block includes a TIMESERIESFILE entry (see the "Time- - Variable Input" section), values can be obtained from a time series - by entering the time-series name in place of a numeric value. - * aux (double) represents the values of the auxiliary variables for - each UZF. The values of auxiliary variables must be present for each - UZF. The values must be specified in the order of the auxiliary - variables specified in the OPTIONS block. If the package supports - time series and the Options block includes a TIMESERIESFILE entry - (see the "Time-Variable Input" section), values can be obtained from - a time series by entering the time-series name in place of a numeric - value. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - auxiliary = ListTemplateGenerator(('gwf6', 'uzf', 'options', - 'auxiliary')) - budget_filerecord = ListTemplateGenerator(('gwf6', 'uzf', 'options', - 'budget_filerecord')) - ts_filerecord = ListTemplateGenerator(('gwf6', 'uzf', 'options', - 'ts_filerecord')) - obs_filerecord = ListTemplateGenerator(('gwf6', 'uzf', 'options', - 'obs_filerecord')) - packagedata = ListTemplateGenerator(('gwf6', 'uzf', 'packagedata', - 'packagedata')) - perioddata = ListTemplateGenerator(('gwf6', 'uzf', 'period', - 'perioddata')) - package_abbr = "gwfuzf" - _package_type = "uzf" - dfn_file_name = "gwf-uzf.dfn" - - dfn = [["block options", "name auxiliary", "type string", - "shape (naux)", "reader urword", "optional true"], - ["block options", "name auxmultname", "type string", "shape", - "reader urword", "optional true"], - ["block options", "name boundnames", "type keyword", "shape", - "reader urword", "optional true"], - ["block options", "name print_input", "type keyword", - "reader urword", "optional true"], - ["block options", "name print_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name save_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name budget_filerecord", - "type record budget fileout budgetfile", "shape", "reader urword", - "tagged true", "optional true"], - ["block options", "name budget", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name fileout", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name budgetfile", "preserve_case true", - "type string", "shape", "in_record true", "reader urword", - "tagged false", "optional false"], - ["block options", "name ts_filerecord", - "type record ts6 filein ts6_filename", "shape", "reader urword", - "tagged true", "optional true", "construct_package ts", - "construct_data timeseries", "parameter_name timeseries"], - ["block options", "name ts6", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name filein", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name ts6_filename", "type string", - "preserve_case true", "in_record true", "reader urword", - "optional false", "tagged false"], - ["block options", "name obs_filerecord", - "type record obs6 filein obs6_filename", "shape", "reader urword", - "tagged true", "optional true", "construct_package obs", - "construct_data continuous", "parameter_name observations"], - ["block options", "name obs6", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name obs6_filename", "type string", - "preserve_case true", "in_record true", "tagged false", - "reader urword", "optional false"], - ["block options", "name mover", "type keyword", "tagged true", - "reader urword", "optional true"], - ["block options", "name simulate_et", "type keyword", - "tagged true", "reader urword", "optional true"], - ["block options", "name linear_gwet", "type keyword", - "tagged true", "reader urword", "optional true"], - ["block options", "name square_gwet", "type keyword", - "tagged true", "reader urword", "optional true"], - ["block options", "name simulate_gwseep", "type keyword", - "tagged true", "reader urword", "optional true"], - ["block options", "name unsat_etwc", "type keyword", - "tagged true", "reader urword", "optional true"], - ["block options", "name unsat_etae", "type keyword", - "tagged true", "reader urword", "optional true"], - ["block dimensions", "name nuzfcells", "type integer", - "reader urword", "optional false"], - ["block dimensions", "name ntrailwaves", "type integer", - "reader urword", "optional false"], - ["block dimensions", "name nwavesets", "type integer", - "reader urword", "optional false"], - ["block packagedata", "name packagedata", - "type recarray iuzno cellid landflag ivertcon surfdep vks thtr " - "thts thti eps boundname", - "shape (nuzfcells)", "reader urword"], - ["block packagedata", "name iuzno", "type integer", "shape", - "tagged false", "in_record true", "reader urword", - "numeric_index true"], - ["block packagedata", "name cellid", "type integer", - "shape (ncelldim)", "tagged false", "in_record true", - "reader urword"], - ["block packagedata", "name landflag", "type integer", "shape", - "tagged false", "in_record true", "reader urword"], - ["block packagedata", "name ivertcon", "type integer", "shape", - "tagged false", "in_record true", "reader urword", - "numeric_index true"], - ["block packagedata", "name surfdep", "type double precision", - "shape", "tagged false", "in_record true", "reader urword"], - ["block packagedata", "name vks", "type double precision", - "shape", "tagged false", "in_record true", "reader urword"], - ["block packagedata", "name thtr", "type double precision", - "shape", "tagged false", "in_record true", "reader urword"], - ["block packagedata", "name thts", "type double precision", - "shape", "tagged false", "in_record true", "reader urword"], - ["block packagedata", "name thti", "type double precision", - "shape", "tagged false", "in_record true", "reader urword"], - ["block packagedata", "name eps", "type double precision", - "shape", "tagged false", "in_record true", "reader urword"], - ["block packagedata", "name boundname", "type string", "shape", - "tagged false", "in_record true", "reader urword", - "optional true"], - ["block period", "name iper", "type integer", - "block_variable True", "in_record true", "tagged false", "shape", - "valid", "reader urword", "optional false"], - ["block period", "name perioddata", - "type recarray iuzno finf pet extdp extwc ha hroot rootact aux", - "shape", "reader urword"], - ["block period", "name iuzno", "type integer", "shape", - "tagged false", "in_record true", "reader urword", - "numeric_index true"], - ["block period", "name finf", "type string", "shape", - "tagged false", "in_record true", "time_series true", - "reader urword"], - ["block period", "name pet", "type string", "shape", - "tagged false", "in_record true", "reader urword", - "time_series true"], - ["block period", "name extdp", "type string", "shape", - "tagged false", "in_record true", "reader urword", - "time_series true"], - ["block period", "name extwc", "type string", "shape", - "tagged false", "in_record true", "reader urword", - "time_series true"], - ["block period", "name ha", "type string", "shape", - "tagged false", "in_record true", "time_series true", - "reader urword"], - ["block period", "name hroot", "type string", "shape", - "tagged false", "in_record true", "reader urword", - "time_series true"], - ["block period", "name rootact", "type string", "shape", - "tagged false", "in_record true", "reader urword", - "time_series true"], - ["block period", "name aux", "type double precision", - "in_record true", "tagged false", "shape (naux)", "reader urword", - "time_series true", "optional true"]] - - def __init__(self, model, loading_package=False, auxiliary=None, - auxmultname=None, boundnames=None, print_input=None, - print_flows=None, save_flows=None, budget_filerecord=None, - timeseries=None, observations=None, mover=None, - simulate_et=None, linear_gwet=None, square_gwet=None, - simulate_gwseep=None, unsat_etwc=None, unsat_etae=None, - nuzfcells=None, ntrailwaves=None, nwavesets=None, - packagedata=None, perioddata=None, filename=None, pname=None, - parent_file=None): - super(ModflowGwfuzf, self).__init__(model, "uzf", filename, pname, - loading_package, parent_file) - - # set up variables - self.auxiliary = self.build_mfdata("auxiliary", auxiliary) - self.auxmultname = self.build_mfdata("auxmultname", auxmultname) - self.boundnames = self.build_mfdata("boundnames", boundnames) - self.print_input = self.build_mfdata("print_input", print_input) - self.print_flows = self.build_mfdata("print_flows", print_flows) - self.save_flows = self.build_mfdata("save_flows", save_flows) - self.budget_filerecord = self.build_mfdata("budget_filerecord", - budget_filerecord) - self._ts_filerecord = self.build_mfdata("ts_filerecord", - None) - self._ts_package = self.build_child_package("ts", timeseries, - "timeseries", - self._ts_filerecord) - self._obs_filerecord = self.build_mfdata("obs_filerecord", - None) - self._obs_package = self.build_child_package("obs", observations, - "continuous", - self._obs_filerecord) - self.mover = self.build_mfdata("mover", mover) - self.simulate_et = self.build_mfdata("simulate_et", simulate_et) - self.linear_gwet = self.build_mfdata("linear_gwet", linear_gwet) - self.square_gwet = self.build_mfdata("square_gwet", square_gwet) - self.simulate_gwseep = self.build_mfdata("simulate_gwseep", - simulate_gwseep) - self.unsat_etwc = self.build_mfdata("unsat_etwc", unsat_etwc) - self.unsat_etae = self.build_mfdata("unsat_etae", unsat_etae) - self.nuzfcells = self.build_mfdata("nuzfcells", nuzfcells) - self.ntrailwaves = self.build_mfdata("ntrailwaves", ntrailwaves) - self.nwavesets = self.build_mfdata("nwavesets", nwavesets) - self.packagedata = self.build_mfdata("packagedata", packagedata) - self.perioddata = self.build_mfdata("perioddata", perioddata) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ListTemplateGenerator + + +class ModflowGwfuzf(mfpackage.MFPackage): + """ + ModflowGwfuzf defines a uzf package within a gwf6 model. + + Parameters + ---------- + model : MFModel + Model that this package is a part of. Package is automatically + added to model when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + auxiliary : [string] + * auxiliary (string) defines an array of one or more auxiliary variable + names. There is no limit on the number of auxiliary variables that + can be provided on this line; however, lists of information provided + in subsequent blocks must have a column of data for each auxiliary + variable name defined here. The number of auxiliary variables + detected on this line determines the value for naux. Comments cannot + be provided anywhere on this line as they will be interpreted as + auxiliary variable names. Auxiliary variables may not be used by the + package, but they will be available for use by other parts of the + program. The program will terminate with an error if auxiliary + variables are specified on more than one line in the options block. + auxmultname : string + * auxmultname (string) name of auxiliary variable to be used as + multiplier of GWF cell area used by UZF cell. + boundnames : boolean + * boundnames (boolean) keyword to indicate that boundary names may be + provided with the list of UZF cells. + print_input : boolean + * print_input (boolean) keyword to indicate that the list of UZF + information will be written to the listing file immediately after it + is read. + print_flows : boolean + * print_flows (boolean) keyword to indicate that the list of UZF flow + rates will be printed to the listing file for every stress period + time step in which "BUDGET PRINT" is specified in Output Control. If + there is no Output Control option and "PRINT_FLOWS" is specified, + then flow rates are printed for the last time step of each stress + period. + save_flows : boolean + * save_flows (boolean) keyword to indicate that UZF flow terms will be + written to the file specified with "BUDGET FILEOUT" in Output + Control. + budget_filerecord : [budgetfile] + * budgetfile (string) name of the binary output file to write budget + information. + timeseries : {varname:data} or timeseries data + * Contains data for the ts package. Data can be stored in a dictionary + containing data for the ts package with variable names as keys and + package data as values. Data just for the timeseries variable is also + acceptable. See ts package documentation for more information. + observations : {varname:data} or continuous data + * Contains data for the obs package. Data can be stored in a dictionary + containing data for the obs package with variable names as keys and + package data as values. Data just for the observations variable is + also acceptable. See obs package documentation for more information. + mover : boolean + * mover (boolean) keyword to indicate that this instance of the UZF + Package can be used with the Water Mover (MVR) Package. When the + MOVER option is specified, additional memory is allocated within the + package to store the available, provided, and received water. + simulate_et : boolean + * simulate_et (boolean) keyword specifying that ET in the unsaturated + (UZF) and saturated zones (GWF) will be simulated. ET can be + simulated in the UZF cell and not the GWF cell by omitting keywords + LINEAR_GWET and SQUARE_GWET. + linear_gwet : boolean + * linear_gwet (boolean) keyword specifying that groundwater ET will be + simulated using the original ET formulation of MODFLOW-2005. + square_gwet : boolean + * square_gwet (boolean) keyword specifying that groundwater ET will be + simulated by assuming a constant ET rate for groundwater levels + between land surface (TOP) and land surface minus the ET extinction + depth (TOP-EXTDP). Groundwater ET is smoothly reduced from the PET + rate to zero over a nominal interval at TOP-EXTDP. + simulate_gwseep : boolean + * simulate_gwseep (boolean) keyword specifying that groundwater + discharge (GWSEEP) to land surface will be simulated. Groundwater + discharge is nonzero when groundwater head is greater than land + surface. + unsat_etwc : boolean + * unsat_etwc (boolean) keyword specifying that ET in the unsaturated + zone will be simulated as a function of the specified PET rate while + the water content (THETA) is greater than the ET extinction water + content (EXTWC). + unsat_etae : boolean + * unsat_etae (boolean) keyword specifying that ET in the unsaturated + zone will be simulated simulated using a capillary pressure based + formulation. Capillary pressure is calculated using the Brooks-Corey + retention function. + nuzfcells : integer + * nuzfcells (integer) is the number of UZF cells. More than one UZF + cell can be assigned to a GWF cell; however, only one GWF cell can be + assigned to a single UZF cell. If more than one UZF cell is assigned + to a GWF cell, then an auxiliary variable should be used to reduce + the surface area of the UZF cell with the AUXMULTNAME option. + ntrailwaves : integer + * ntrailwaves (integer) is the number of trailing waves. NTRAILWAVES + has a default value of 7 and can be increased to lower mass balance + error in the unsaturated zone. + nwavesets : integer + * nwavesets (integer) is the number of UZF cells specified. NWAVESETS + has a default value of 40 and can be increased if more waves are + required to resolve variations in water content within the + unsaturated zone. + packagedata : [iuzno, cellid, landflag, ivertcon, surfdep, vks, thtr, thts, + thti, eps, boundname] + * iuzno (integer) integer value that defines the UZF cell number + associated with the specified PACKAGEDATA data on the line. IUZNO + must be greater than zero and less than or equal to NUZFCELLS. UZF + information must be specified for every UZF cell or the program will + terminate with an error. The program will also terminate with an + error if information for a UZF cell is specified more than once. + * cellid ((integer, ...)) is the cell identifier, and depends on the + type of grid that is used for the simulation. For a structured grid + that uses the DIS input file, CELLID is the layer, row, and column. + For a grid that uses the DISV input file, CELLID is the layer and + CELL2D number. If the model uses the unstructured discretization + (DISU) input file, CELLID is the node number for the cell. + * landflag (integer) integer value set to one for land surface cells + indicating that boundary conditions can be applied and data can be + specified in the PERIOD block. A value of 0 specifies a non-land + surface cell. + * ivertcon (integer) integer value set to specify underlying UZF cell + that receives water flowing to bottom of cell. If unsaturated zone + flow reaches the water table before the cell bottom, then water is + added to the GWF cell instead of flowing to the underlying UZF cell. + A value of 0 indicates the UZF cell is not connected to an underlying + UZF cell. + * surfdep (double) is the surface depression depth of the UZF cell. + * vks (double) is the vertical saturated hydraulic conductivity of the + UZF cell. + * thtr (double) is the residual (irreducible) water content of the UZF + cell. + * thts (double) is the saturated water content of the UZF cell. + * thti (double) is the initial water content of the UZF cell. + * eps (double) is the epsilon exponent of the UZF cell. + * boundname (string) name of the UZF cell cell. BOUNDNAME is an ASCII + character variable that can contain as many as 40 characters. If + BOUNDNAME contains spaces in it, then the entire name must be + enclosed within single quotes. + perioddata : [iuzno, finf, pet, extdp, extwc, ha, hroot, rootact, aux] + * iuzno (integer) integer value that defines the UZF cell number + associated with the specified PERIOD data on the line. + * finf (string) real or character value that defines the applied + infiltration rate of the UZF cell (:math:`LT^{-1}`). If the Options + block includes a TIMESERIESFILE entry (see the "Time-Variable Input" + section), values can be obtained from a time series by entering the + time-series name in place of a numeric value. + * pet (string) real or character value that defines the potential + evapotranspiration rate of the UZF cell and specified GWF cell. + Evapotranspiration is first removed from the unsaturated zone and any + remaining potential evapotranspiration is applied to the saturated + zone. If IVERTCON is greater than zero then residual potential + evapotranspiration not satisfied in the UZF cell is applied to the + underlying UZF and GWF cells. PET is always specified, but is only + used if SIMULATE_ET is specified in the OPTIONS block. If the Options + block includes a TIMESERIESFILE entry (see the "Time-Variable Input" + section), values can be obtained from a time series by entering the + time-series name in place of a numeric value. + * extdp (string) real or character value that defines the + evapotranspiration extinction depth of the UZF cell. If IVERTCON is + greater than zero and EXTDP extends below the GWF cell bottom then + remaining potential evapotranspiration is applied to the underlying + UZF and GWF cells. EXTDP is always specified, but is only used if + SIMULATE_ET is specified in the OPTIONS block. If the Options block + includes a TIMESERIESFILE entry (see the "Time-Variable Input" + section), values can be obtained from a time series by entering the + time-series name in place of a numeric value. + * extwc (string) real or character value that defines the + evapotranspiration extinction water content of the UZF cell. EXTWC is + always specified, but is only used if SIMULATE_ET and UNSAT_ETWC are + specified in the OPTIONS block. If the Options block includes a + TIMESERIESFILE entry (see the "Time-Variable Input" section), values + can be obtained from a time series by entering the time-series name + in place of a numeric value. + * ha (string) real or character value that defines the air entry + potential (head) of the UZF cell. HA is always specified, but is only + used if SIMULATE_ET and UNSAT_ETAE are specified in the OPTIONS + block. If the Options block includes a TIMESERIESFILE entry (see the + "Time-Variable Input" section), values can be obtained from a time + series by entering the time-series name in place of a numeric value. + * hroot (string) real or character value that defines the root + potential (head) of the UZF cell. HROOT is always specified, but is + only used if SIMULATE_ET and UNSAT_ETAE are specified in the OPTIONS + block. If the Options block includes a TIMESERIESFILE entry (see the + "Time-Variable Input" section), values can be obtained from a time + series by entering the time-series name in place of a numeric value. + * rootact (string) real or character value that defines the root + activity function of the UZF cell. ROOTACT is the length of roots in + a given volume of soil divided by that volume. Values range from 0 to + about 3 :math:`cm^{-2}`, depending on the plant community and its + stage of development. ROOTACT is always specified, but is only used + if SIMULATE\_ET and UNSAT\_ETAE are specified in the OPTIONS block. + If the Options block includes a TIMESERIESFILE entry (see the "Time- + Variable Input" section), values can be obtained from a time series + by entering the time-series name in place of a numeric value. + * aux (double) represents the values of the auxiliary variables for + each UZF. The values of auxiliary variables must be present for each + UZF. The values must be specified in the order of the auxiliary + variables specified in the OPTIONS block. If the package supports + time series and the Options block includes a TIMESERIESFILE entry + (see the "Time-Variable Input" section), values can be obtained from + a time series by entering the time-series name in place of a numeric + value. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + auxiliary = ListTemplateGenerator(('gwf6', 'uzf', 'options', + 'auxiliary')) + budget_filerecord = ListTemplateGenerator(('gwf6', 'uzf', 'options', + 'budget_filerecord')) + ts_filerecord = ListTemplateGenerator(('gwf6', 'uzf', 'options', + 'ts_filerecord')) + obs_filerecord = ListTemplateGenerator(('gwf6', 'uzf', 'options', + 'obs_filerecord')) + packagedata = ListTemplateGenerator(('gwf6', 'uzf', 'packagedata', + 'packagedata')) + perioddata = ListTemplateGenerator(('gwf6', 'uzf', 'period', + 'perioddata')) + package_abbr = "gwfuzf" + _package_type = "uzf" + dfn_file_name = "gwf-uzf.dfn" + + dfn = [["block options", "name auxiliary", "type string", + "shape (naux)", "reader urword", "optional true"], + ["block options", "name auxmultname", "type string", "shape", + "reader urword", "optional true"], + ["block options", "name boundnames", "type keyword", "shape", + "reader urword", "optional true"], + ["block options", "name print_input", "type keyword", + "reader urword", "optional true"], + ["block options", "name print_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name save_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name budget_filerecord", + "type record budget fileout budgetfile", "shape", "reader urword", + "tagged true", "optional true"], + ["block options", "name budget", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name fileout", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name budgetfile", "preserve_case true", + "type string", "shape", "in_record true", "reader urword", + "tagged false", "optional false"], + ["block options", "name ts_filerecord", + "type record ts6 filein ts6_filename", "shape", "reader urword", + "tagged true", "optional true", "construct_package ts", + "construct_data timeseries", "parameter_name timeseries"], + ["block options", "name ts6", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name filein", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name ts6_filename", "type string", + "preserve_case true", "in_record true", "reader urword", + "optional false", "tagged false"], + ["block options", "name obs_filerecord", + "type record obs6 filein obs6_filename", "shape", "reader urword", + "tagged true", "optional true", "construct_package obs", + "construct_data continuous", "parameter_name observations"], + ["block options", "name obs6", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name obs6_filename", "type string", + "preserve_case true", "in_record true", "tagged false", + "reader urword", "optional false"], + ["block options", "name mover", "type keyword", "tagged true", + "reader urword", "optional true"], + ["block options", "name simulate_et", "type keyword", + "tagged true", "reader urword", "optional true"], + ["block options", "name linear_gwet", "type keyword", + "tagged true", "reader urword", "optional true"], + ["block options", "name square_gwet", "type keyword", + "tagged true", "reader urword", "optional true"], + ["block options", "name simulate_gwseep", "type keyword", + "tagged true", "reader urword", "optional true"], + ["block options", "name unsat_etwc", "type keyword", + "tagged true", "reader urword", "optional true"], + ["block options", "name unsat_etae", "type keyword", + "tagged true", "reader urword", "optional true"], + ["block dimensions", "name nuzfcells", "type integer", + "reader urword", "optional false"], + ["block dimensions", "name ntrailwaves", "type integer", + "reader urword", "optional false"], + ["block dimensions", "name nwavesets", "type integer", + "reader urword", "optional false"], + ["block packagedata", "name packagedata", + "type recarray iuzno cellid landflag ivertcon surfdep vks thtr " + "thts thti eps boundname", + "shape (nuzfcells)", "reader urword"], + ["block packagedata", "name iuzno", "type integer", "shape", + "tagged false", "in_record true", "reader urword", + "numeric_index true"], + ["block packagedata", "name cellid", "type integer", + "shape (ncelldim)", "tagged false", "in_record true", + "reader urword"], + ["block packagedata", "name landflag", "type integer", "shape", + "tagged false", "in_record true", "reader urword"], + ["block packagedata", "name ivertcon", "type integer", "shape", + "tagged false", "in_record true", "reader urword", + "numeric_index true"], + ["block packagedata", "name surfdep", "type double precision", + "shape", "tagged false", "in_record true", "reader urword"], + ["block packagedata", "name vks", "type double precision", + "shape", "tagged false", "in_record true", "reader urword"], + ["block packagedata", "name thtr", "type double precision", + "shape", "tagged false", "in_record true", "reader urword"], + ["block packagedata", "name thts", "type double precision", + "shape", "tagged false", "in_record true", "reader urword"], + ["block packagedata", "name thti", "type double precision", + "shape", "tagged false", "in_record true", "reader urword"], + ["block packagedata", "name eps", "type double precision", + "shape", "tagged false", "in_record true", "reader urword"], + ["block packagedata", "name boundname", "type string", "shape", + "tagged false", "in_record true", "reader urword", + "optional true"], + ["block period", "name iper", "type integer", + "block_variable True", "in_record true", "tagged false", "shape", + "valid", "reader urword", "optional false"], + ["block period", "name perioddata", + "type recarray iuzno finf pet extdp extwc ha hroot rootact aux", + "shape", "reader urword"], + ["block period", "name iuzno", "type integer", "shape", + "tagged false", "in_record true", "reader urword", + "numeric_index true"], + ["block period", "name finf", "type string", "shape", + "tagged false", "in_record true", "time_series true", + "reader urword"], + ["block period", "name pet", "type string", "shape", + "tagged false", "in_record true", "reader urword", + "time_series true"], + ["block period", "name extdp", "type string", "shape", + "tagged false", "in_record true", "reader urword", + "time_series true"], + ["block period", "name extwc", "type string", "shape", + "tagged false", "in_record true", "reader urword", + "time_series true"], + ["block period", "name ha", "type string", "shape", + "tagged false", "in_record true", "time_series true", + "reader urword"], + ["block period", "name hroot", "type string", "shape", + "tagged false", "in_record true", "reader urword", + "time_series true"], + ["block period", "name rootact", "type string", "shape", + "tagged false", "in_record true", "reader urword", + "time_series true"], + ["block period", "name aux", "type double precision", + "in_record true", "tagged false", "shape (naux)", "reader urword", + "time_series true", "optional true"]] + + def __init__(self, model, loading_package=False, auxiliary=None, + auxmultname=None, boundnames=None, print_input=None, + print_flows=None, save_flows=None, budget_filerecord=None, + timeseries=None, observations=None, mover=None, + simulate_et=None, linear_gwet=None, square_gwet=None, + simulate_gwseep=None, unsat_etwc=None, unsat_etae=None, + nuzfcells=None, ntrailwaves=None, nwavesets=None, + packagedata=None, perioddata=None, filename=None, pname=None, + parent_file=None): + super(ModflowGwfuzf, self).__init__(model, "uzf", filename, pname, + loading_package, parent_file) + + # set up variables + self.auxiliary = self.build_mfdata("auxiliary", auxiliary) + self.auxmultname = self.build_mfdata("auxmultname", auxmultname) + self.boundnames = self.build_mfdata("boundnames", boundnames) + self.print_input = self.build_mfdata("print_input", print_input) + self.print_flows = self.build_mfdata("print_flows", print_flows) + self.save_flows = self.build_mfdata("save_flows", save_flows) + self.budget_filerecord = self.build_mfdata("budget_filerecord", + budget_filerecord) + self._ts_filerecord = self.build_mfdata("ts_filerecord", + None) + self._ts_package = self.build_child_package("ts", timeseries, + "timeseries", + self._ts_filerecord) + self._obs_filerecord = self.build_mfdata("obs_filerecord", + None) + self._obs_package = self.build_child_package("obs", observations, + "continuous", + self._obs_filerecord) + self.mover = self.build_mfdata("mover", mover) + self.simulate_et = self.build_mfdata("simulate_et", simulate_et) + self.linear_gwet = self.build_mfdata("linear_gwet", linear_gwet) + self.square_gwet = self.build_mfdata("square_gwet", square_gwet) + self.simulate_gwseep = self.build_mfdata("simulate_gwseep", + simulate_gwseep) + self.unsat_etwc = self.build_mfdata("unsat_etwc", unsat_etwc) + self.unsat_etae = self.build_mfdata("unsat_etae", unsat_etae) + self.nuzfcells = self.build_mfdata("nuzfcells", nuzfcells) + self.ntrailwaves = self.build_mfdata("ntrailwaves", ntrailwaves) + self.nwavesets = self.build_mfdata("nwavesets", nwavesets) + self.packagedata = self.build_mfdata("packagedata", packagedata) + self.perioddata = self.build_mfdata("perioddata", perioddata) + self._init_complete = True diff --git a/flopy/mf6/modflow/mfgwfwel.py b/flopy/mf6/modflow/mfgwfwel.py index db5f2c7564..a3be0d3473 100644 --- a/flopy/mf6/modflow/mfgwfwel.py +++ b/flopy/mf6/modflow/mfgwfwel.py @@ -1,219 +1,219 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ListTemplateGenerator - - -class ModflowGwfwel(mfpackage.MFPackage): - """ - ModflowGwfwel defines a wel package within a gwf6 model. - - Parameters - ---------- - model : MFModel - Model that this package is a part of. Package is automatically - added to model when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - auxiliary : [string] - * auxiliary (string) defines an array of one or more auxiliary variable - names. There is no limit on the number of auxiliary variables that - can be provided on this line; however, lists of information provided - in subsequent blocks must have a column of data for each auxiliary - variable name defined here. The number of auxiliary variables - detected on this line determines the value for naux. Comments cannot - be provided anywhere on this line as they will be interpreted as - auxiliary variable names. Auxiliary variables may not be used by the - package, but they will be available for use by other parts of the - program. The program will terminate with an error if auxiliary - variables are specified on more than one line in the options block. - auxmultname : string - * auxmultname (string) name of auxiliary variable to be used as - multiplier of well flow rate. - boundnames : boolean - * boundnames (boolean) keyword to indicate that boundary names may be - provided with the list of well cells. - print_input : boolean - * print_input (boolean) keyword to indicate that the list of well - information will be written to the listing file immediately after it - is read. - print_flows : boolean - * print_flows (boolean) keyword to indicate that the list of well flow - rates will be printed to the listing file for every stress period - time step in which "BUDGET PRINT" is specified in Output Control. If - there is no Output Control option and "PRINT_FLOWS" is specified, - then flow rates are printed for the last time step of each stress - period. - save_flows : boolean - * save_flows (boolean) keyword to indicate that well flow terms will be - written to the file specified with "BUDGET FILEOUT" in Output - Control. - auto_flow_reduce : double - * auto_flow_reduce (double) keyword and real value that defines the - fraction of the cell thickness used as an interval for smoothly - adjusting negative pumping rates to 0 in cells with head values less - than or equal to the bottom of the cell. Negative pumping rates are - adjusted to 0 or a smaller negative value when the head in the cell - is equal to or less than the calculated interval above the cell - bottom. AUTO_FLOW_REDUCE is set to 0.1 if the specified value is less - than or equal to zero. By default, negative pumping rates are not - reduced during a simulation. - timeseries : {varname:data} or timeseries data - * Contains data for the ts package. Data can be stored in a dictionary - containing data for the ts package with variable names as keys and - package data as values. Data just for the timeseries variable is also - acceptable. See ts package documentation for more information. - observations : {varname:data} or continuous data - * Contains data for the obs package. Data can be stored in a dictionary - containing data for the obs package with variable names as keys and - package data as values. Data just for the observations variable is - also acceptable. See obs package documentation for more information. - mover : boolean - * mover (boolean) keyword to indicate that this instance of the Well - Package can be used with the Water Mover (MVR) Package. When the - MOVER option is specified, additional memory is allocated within the - package to store the available, provided, and received water. - maxbound : integer - * maxbound (integer) integer value specifying the maximum number of - wells cells that will be specified for use during any stress period. - stress_period_data : [cellid, q, aux, boundname] - * cellid ((integer, ...)) is the cell identifier, and depends on the - type of grid that is used for the simulation. For a structured grid - that uses the DIS input file, CELLID is the layer, row, and column. - For a grid that uses the DISV input file, CELLID is the layer and - CELL2D number. If the model uses the unstructured discretization - (DISU) input file, CELLID is the node number for the cell. - * q (double) is the volumetric well rate. A positive value indicates - recharge (injection) and a negative value indicates discharge - (extraction). If the Options block includes a TIMESERIESFILE entry - (see the "Time-Variable Input" section), values can be obtained from - a time series by entering the time-series name in place of a numeric - value. - * aux (double) represents the values of the auxiliary variables for - each well. The values of auxiliary variables must be present for each - well. The values must be specified in the order of the auxiliary - variables specified in the OPTIONS block. If the package supports - time series and the Options block includes a TIMESERIESFILE entry - (see the "Time-Variable Input" section), values can be obtained from - a time series by entering the time-series name in place of a numeric - value. - * boundname (string) name of the well cell. BOUNDNAME is an ASCII - character variable that can contain as many as 40 characters. If - BOUNDNAME contains spaces in it, then the entire name must be - enclosed within single quotes. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - auxiliary = ListTemplateGenerator(('gwf6', 'wel', 'options', - 'auxiliary')) - ts_filerecord = ListTemplateGenerator(('gwf6', 'wel', 'options', - 'ts_filerecord')) - obs_filerecord = ListTemplateGenerator(('gwf6', 'wel', 'options', - 'obs_filerecord')) - stress_period_data = ListTemplateGenerator(('gwf6', 'wel', 'period', - 'stress_period_data')) - package_abbr = "gwfwel" - _package_type = "wel" - dfn_file_name = "gwf-wel.dfn" - - dfn = [["block options", "name auxiliary", "type string", - "shape (naux)", "reader urword", "optional true"], - ["block options", "name auxmultname", "type string", "shape", - "reader urword", "optional true"], - ["block options", "name boundnames", "type keyword", "shape", - "reader urword", "optional true"], - ["block options", "name print_input", "type keyword", - "reader urword", "optional true"], - ["block options", "name print_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name save_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name auto_flow_reduce", - "type double precision", "reader urword", "optional true"], - ["block options", "name ts_filerecord", - "type record ts6 filein ts6_filename", "shape", "reader urword", - "tagged true", "optional true", "construct_package ts", - "construct_data timeseries", "parameter_name timeseries"], - ["block options", "name ts6", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name filein", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name ts6_filename", "type string", - "preserve_case true", "in_record true", "reader urword", - "optional false", "tagged false"], - ["block options", "name obs_filerecord", - "type record obs6 filein obs6_filename", "shape", "reader urword", - "tagged true", "optional true", "construct_package obs", - "construct_data continuous", "parameter_name observations"], - ["block options", "name obs6", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name obs6_filename", "type string", - "preserve_case true", "in_record true", "tagged false", - "reader urword", "optional false"], - ["block options", "name mover", "type keyword", "tagged true", - "reader urword", "optional true"], - ["block dimensions", "name maxbound", "type integer", - "reader urword", "optional false"], - ["block period", "name iper", "type integer", - "block_variable True", "in_record true", "tagged false", "shape", - "valid", "reader urword", "optional false"], - ["block period", "name stress_period_data", - "type recarray cellid q aux boundname", "shape (maxbound)", - "reader urword"], - ["block period", "name cellid", "type integer", - "shape (ncelldim)", "tagged false", "in_record true", - "reader urword"], - ["block period", "name q", "type double precision", "shape", - "tagged false", "in_record true", "reader urword", - "time_series true"], - ["block period", "name aux", "type double precision", - "in_record true", "tagged false", "shape (naux)", "reader urword", - "optional true", "time_series true"], - ["block period", "name boundname", "type string", "shape", - "tagged false", "in_record true", "reader urword", - "optional true"]] - - def __init__(self, model, loading_package=False, auxiliary=None, - auxmultname=None, boundnames=None, print_input=None, - print_flows=None, save_flows=None, auto_flow_reduce=None, - timeseries=None, observations=None, mover=None, maxbound=None, - stress_period_data=None, filename=None, pname=None, - parent_file=None): - super(ModflowGwfwel, self).__init__(model, "wel", filename, pname, - loading_package, parent_file) - - # set up variables - self.auxiliary = self.build_mfdata("auxiliary", auxiliary) - self.auxmultname = self.build_mfdata("auxmultname", auxmultname) - self.boundnames = self.build_mfdata("boundnames", boundnames) - self.print_input = self.build_mfdata("print_input", print_input) - self.print_flows = self.build_mfdata("print_flows", print_flows) - self.save_flows = self.build_mfdata("save_flows", save_flows) - self.auto_flow_reduce = self.build_mfdata("auto_flow_reduce", - auto_flow_reduce) - self._ts_filerecord = self.build_mfdata("ts_filerecord", - None) - self._ts_package = self.build_child_package("ts", timeseries, - "timeseries", - self._ts_filerecord) - self._obs_filerecord = self.build_mfdata("obs_filerecord", - None) - self._obs_package = self.build_child_package("obs", observations, - "continuous", - self._obs_filerecord) - self.mover = self.build_mfdata("mover", mover) - self.maxbound = self.build_mfdata("maxbound", maxbound) - self.stress_period_data = self.build_mfdata("stress_period_data", - stress_period_data) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ListTemplateGenerator + + +class ModflowGwfwel(mfpackage.MFPackage): + """ + ModflowGwfwel defines a wel package within a gwf6 model. + + Parameters + ---------- + model : MFModel + Model that this package is a part of. Package is automatically + added to model when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + auxiliary : [string] + * auxiliary (string) defines an array of one or more auxiliary variable + names. There is no limit on the number of auxiliary variables that + can be provided on this line; however, lists of information provided + in subsequent blocks must have a column of data for each auxiliary + variable name defined here. The number of auxiliary variables + detected on this line determines the value for naux. Comments cannot + be provided anywhere on this line as they will be interpreted as + auxiliary variable names. Auxiliary variables may not be used by the + package, but they will be available for use by other parts of the + program. The program will terminate with an error if auxiliary + variables are specified on more than one line in the options block. + auxmultname : string + * auxmultname (string) name of auxiliary variable to be used as + multiplier of well flow rate. + boundnames : boolean + * boundnames (boolean) keyword to indicate that boundary names may be + provided with the list of well cells. + print_input : boolean + * print_input (boolean) keyword to indicate that the list of well + information will be written to the listing file immediately after it + is read. + print_flows : boolean + * print_flows (boolean) keyword to indicate that the list of well flow + rates will be printed to the listing file for every stress period + time step in which "BUDGET PRINT" is specified in Output Control. If + there is no Output Control option and "PRINT_FLOWS" is specified, + then flow rates are printed for the last time step of each stress + period. + save_flows : boolean + * save_flows (boolean) keyword to indicate that well flow terms will be + written to the file specified with "BUDGET FILEOUT" in Output + Control. + auto_flow_reduce : double + * auto_flow_reduce (double) keyword and real value that defines the + fraction of the cell thickness used as an interval for smoothly + adjusting negative pumping rates to 0 in cells with head values less + than or equal to the bottom of the cell. Negative pumping rates are + adjusted to 0 or a smaller negative value when the head in the cell + is equal to or less than the calculated interval above the cell + bottom. AUTO_FLOW_REDUCE is set to 0.1 if the specified value is less + than or equal to zero. By default, negative pumping rates are not + reduced during a simulation. + timeseries : {varname:data} or timeseries data + * Contains data for the ts package. Data can be stored in a dictionary + containing data for the ts package with variable names as keys and + package data as values. Data just for the timeseries variable is also + acceptable. See ts package documentation for more information. + observations : {varname:data} or continuous data + * Contains data for the obs package. Data can be stored in a dictionary + containing data for the obs package with variable names as keys and + package data as values. Data just for the observations variable is + also acceptable. See obs package documentation for more information. + mover : boolean + * mover (boolean) keyword to indicate that this instance of the Well + Package can be used with the Water Mover (MVR) Package. When the + MOVER option is specified, additional memory is allocated within the + package to store the available, provided, and received water. + maxbound : integer + * maxbound (integer) integer value specifying the maximum number of + wells cells that will be specified for use during any stress period. + stress_period_data : [cellid, q, aux, boundname] + * cellid ((integer, ...)) is the cell identifier, and depends on the + type of grid that is used for the simulation. For a structured grid + that uses the DIS input file, CELLID is the layer, row, and column. + For a grid that uses the DISV input file, CELLID is the layer and + CELL2D number. If the model uses the unstructured discretization + (DISU) input file, CELLID is the node number for the cell. + * q (double) is the volumetric well rate. A positive value indicates + recharge (injection) and a negative value indicates discharge + (extraction). If the Options block includes a TIMESERIESFILE entry + (see the "Time-Variable Input" section), values can be obtained from + a time series by entering the time-series name in place of a numeric + value. + * aux (double) represents the values of the auxiliary variables for + each well. The values of auxiliary variables must be present for each + well. The values must be specified in the order of the auxiliary + variables specified in the OPTIONS block. If the package supports + time series and the Options block includes a TIMESERIESFILE entry + (see the "Time-Variable Input" section), values can be obtained from + a time series by entering the time-series name in place of a numeric + value. + * boundname (string) name of the well cell. BOUNDNAME is an ASCII + character variable that can contain as many as 40 characters. If + BOUNDNAME contains spaces in it, then the entire name must be + enclosed within single quotes. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + auxiliary = ListTemplateGenerator(('gwf6', 'wel', 'options', + 'auxiliary')) + ts_filerecord = ListTemplateGenerator(('gwf6', 'wel', 'options', + 'ts_filerecord')) + obs_filerecord = ListTemplateGenerator(('gwf6', 'wel', 'options', + 'obs_filerecord')) + stress_period_data = ListTemplateGenerator(('gwf6', 'wel', 'period', + 'stress_period_data')) + package_abbr = "gwfwel" + _package_type = "wel" + dfn_file_name = "gwf-wel.dfn" + + dfn = [["block options", "name auxiliary", "type string", + "shape (naux)", "reader urword", "optional true"], + ["block options", "name auxmultname", "type string", "shape", + "reader urword", "optional true"], + ["block options", "name boundnames", "type keyword", "shape", + "reader urword", "optional true"], + ["block options", "name print_input", "type keyword", + "reader urword", "optional true"], + ["block options", "name print_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name save_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name auto_flow_reduce", + "type double precision", "reader urword", "optional true"], + ["block options", "name ts_filerecord", + "type record ts6 filein ts6_filename", "shape", "reader urword", + "tagged true", "optional true", "construct_package ts", + "construct_data timeseries", "parameter_name timeseries"], + ["block options", "name ts6", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name filein", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name ts6_filename", "type string", + "preserve_case true", "in_record true", "reader urword", + "optional false", "tagged false"], + ["block options", "name obs_filerecord", + "type record obs6 filein obs6_filename", "shape", "reader urword", + "tagged true", "optional true", "construct_package obs", + "construct_data continuous", "parameter_name observations"], + ["block options", "name obs6", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name obs6_filename", "type string", + "preserve_case true", "in_record true", "tagged false", + "reader urword", "optional false"], + ["block options", "name mover", "type keyword", "tagged true", + "reader urword", "optional true"], + ["block dimensions", "name maxbound", "type integer", + "reader urword", "optional false"], + ["block period", "name iper", "type integer", + "block_variable True", "in_record true", "tagged false", "shape", + "valid", "reader urword", "optional false"], + ["block period", "name stress_period_data", + "type recarray cellid q aux boundname", "shape (maxbound)", + "reader urword"], + ["block period", "name cellid", "type integer", + "shape (ncelldim)", "tagged false", "in_record true", + "reader urword"], + ["block period", "name q", "type double precision", "shape", + "tagged false", "in_record true", "reader urword", + "time_series true"], + ["block period", "name aux", "type double precision", + "in_record true", "tagged false", "shape (naux)", "reader urword", + "optional true", "time_series true"], + ["block period", "name boundname", "type string", "shape", + "tagged false", "in_record true", "reader urword", + "optional true"]] + + def __init__(self, model, loading_package=False, auxiliary=None, + auxmultname=None, boundnames=None, print_input=None, + print_flows=None, save_flows=None, auto_flow_reduce=None, + timeseries=None, observations=None, mover=None, maxbound=None, + stress_period_data=None, filename=None, pname=None, + parent_file=None): + super(ModflowGwfwel, self).__init__(model, "wel", filename, pname, + loading_package, parent_file) + + # set up variables + self.auxiliary = self.build_mfdata("auxiliary", auxiliary) + self.auxmultname = self.build_mfdata("auxmultname", auxmultname) + self.boundnames = self.build_mfdata("boundnames", boundnames) + self.print_input = self.build_mfdata("print_input", print_input) + self.print_flows = self.build_mfdata("print_flows", print_flows) + self.save_flows = self.build_mfdata("save_flows", save_flows) + self.auto_flow_reduce = self.build_mfdata("auto_flow_reduce", + auto_flow_reduce) + self._ts_filerecord = self.build_mfdata("ts_filerecord", + None) + self._ts_package = self.build_child_package("ts", timeseries, + "timeseries", + self._ts_filerecord) + self._obs_filerecord = self.build_mfdata("obs_filerecord", + None) + self._obs_package = self.build_child_package("obs", observations, + "continuous", + self._obs_filerecord) + self.mover = self.build_mfdata("mover", mover) + self.maxbound = self.build_mfdata("maxbound", maxbound) + self.stress_period_data = self.build_mfdata("stress_period_data", + stress_period_data) + self._init_complete = True diff --git a/flopy/mf6/modflow/mfims.py b/flopy/mf6/modflow/mfims.py index 19d7f9c4c3..7d8d3ce314 100644 --- a/flopy/mf6/modflow/mfims.py +++ b/flopy/mf6/modflow/mfims.py @@ -1,429 +1,429 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ListTemplateGenerator - - -class ModflowIms(mfpackage.MFPackage): - """ - ModflowIms defines a ims package. - - Parameters - ---------- - simulation : MFSimulation - Simulation that this package is a part of. Package is automatically - added to simulation when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - print_option : string - * print_option (string) is a flag that controls printing of convergence - information from the solver. NONE means print nothing. SUMMARY means - print only the total number of iterations and nonlinear residual - reduction summaries. ALL means print linear matrix solver convergence - information to the solution listing file and model specific linear - matrix solver convergence information to each model listing file in - addition to SUMMARY information. NONE is default if PRINT_OPTION is - not specified. - complexity : string - * complexity (string) is an optional keyword that defines default non- - linear and linear solver parameters. SIMPLE - indicates that default - solver input values will be defined that work well for nearly linear - models. This would be used for models that do not include nonlinear - stress packages and models that are either confined or consist of a - single unconfined layer that is thick enough to contain the water - table within a single layer. MODERATE - indicates that default solver - input values will be defined that work well for moderately nonlinear - models. This would be used for models that include nonlinear stress - packages and models that consist of one or more unconfined layers. - The MODERATE option should be used when the SIMPLE option does not - result in successful convergence. COMPLEX - indicates that default - solver input values will be defined that work well for highly - nonlinear models. This would be used for models that include - nonlinear stress packages and models that consist of one or more - unconfined layers representing complex geology and surface- - water/groundwater interaction. The COMPLEX option should be used when - the MODERATE option does not result in successful convergence. Non- - linear and linear solver parameters assigned using a specified - complexity can be modified in the NONLINEAR and LINEAR blocks. If the - COMPLEXITY option is not specified, NONLINEAR and LINEAR variables - will be assigned the simple complexity values. - csv_output_filerecord : [csvfile] - * csvfile (string) name of the ascii comma separated values output file - to write solver convergence information. If PRINT_OPTION is NONE or - SUMMARY, comma separated values output includes maximum head change - convergence information at the end of each outer iteration for each - time step. If PRINT_OPTION is ALL, comma separated values output - includes maximum head change and maximum residual convergence - information for the solution and each model (if the solution includes - more than one model) and linear acceleration information for each - inner iteration. - no_ptc : boolean - * no_ptc (boolean) is a flag that is used to disable pseudo-transient - continuation (PTC). Option only applies to steady-state stress - periods for models using the Newton-Raphson formulation. For many - problems, PTC can significantly improve convergence behavior for - steady-state simulations, and for this reason it is active by - default. In some cases, however, PTC can worsen the convergence - behavior, especially when the initial conditions are similar to the - solution. When the initial conditions are similar to, or exactly the - same as, the solution and convergence is slow, then this NO_PTC - option should be used to deactivate PTC. This NO_PTC option should - also be used in order to compare convergence behavior with other - MODFLOW versions, as PTC is only available in MODFLOW 6. - outer_hclose : double - * outer_hclose (double) real value defining the head change criterion - for convergence of the outer (nonlinear) iterations, in units of - length. When the maximum absolute value of the head change at all - nodes during an iteration is less than or equal to OUTER_HCLOSE, - iteration stops. Commonly, OUTER_HCLOSE equals 0.01. - outer_rclosebnd : double - * outer_rclosebnd (double) real value defining the residual tolerance - for convergence of model packages that solve a separate equation not - solved by the IMS linear solver. This value represents the maximum - allowable residual between successive outer iterations at any single - model package element. An example of a model package that would use - OUTER_RCLOSEBND to evaluate convergence is the SFR package which - solves a continuity equation for each reach. - outer_maximum : integer - * outer_maximum (integer) integer value defining the maximum number of - outer (nonlinear) iterations -- that is, calls to the solution - routine. For a linear problem OUTER_MAXIMUM should be 1. - under_relaxation : string - * under_relaxation (string) is an optional keyword that defines the - nonlinear under-relaxation schemes used. By default under-relaxation - is not used. NONE - under-relaxation is not used. SIMPLE - Simple - under-relaxation scheme with a fixed relaxation factor is used. - COOLEY - Cooley under-relaxation scheme is used. DBD - delta-bar- - delta under-relaxation is used. Note that the under-relaxation - schemes are used in conjunction with problems that use the Newton- - Raphson formulation, however, experience has indicated that the - Cooley under-relaxation and damping work well also for the Picard - scheme with the wet/dry options of MODFLOW 6. - under_relaxation_theta : double - * under_relaxation_theta (double) real value defining the reduction - factor for the learning rate (under-relaxation term) of the delta- - bar-delta algorithm. The value of UNDER_RELAXATION_THETA is between - zero and one. If the change in the variable (head) is of opposite - sign to that of the previous iteration, the under-relaxation term is - reduced by a factor of UNDER_RELAXATION_THETA. The value usually - ranges from 0.3 to 0.9; a value of 0.7 works well for most problems. - UNDER_RELAXATION_THETA only needs to be specified if UNDER_RELAXATION - is DBD. - under_relaxation_kappa : double - * under_relaxation_kappa (double) real value defining the increment for - the learning rate (under-relaxation term) of the delta-bar-delta - algorithm. The value of UNDER_RELAXATION_kappa is between zero and - one. If the change in the variable (head) is of the same sign to that - of the previous iteration, the under-relaxation term is increased by - an increment of UNDER_RELAXATION_KAPPA. The value usually ranges from - 0.03 to 0.3; a value of 0.1 works well for most problems. - UNDER_RELAXATION_KAPPA only needs to be specified if UNDER_RELAXATION - is DBD. - under_relaxation_gamma : double - * under_relaxation_gamma (double) real value defining the history or - memory term factor of the delta-bar-delta algorithm. - UNDER_RELAXATION_GAMMA is between zero and 1 but cannot be equal to - one. When UNDER_RELAXATION_GAMMA is zero, only the most recent - history (previous iteration value) is maintained. As - UNDER_RELAXATION_GAMMA is increased, past history of iteration - changes has greater influence on the memory term. The memory term is - maintained as an exponential average of past changes. Retaining some - past history can overcome granular behavior in the calculated - function surface and therefore helps to overcome cyclic patterns of - non-convergence. The value usually ranges from 0.1 to 0.3; a value of - 0.2 works well for most problems. UNDER_RELAXATION_GAMMA only needs - to be specified if UNDER_RELAXATION is not NONE. - under_relaxation_momentum : double - * under_relaxation_momentum (double) real value defining the fraction - of past history changes that is added as a momentum term to the step - change for a nonlinear iteration. The value of - UNDER_RELAXATION_MOMENTUM is between zero and one. A large momentum - term should only be used when small learning rates are expected. - Small amounts of the momentum term help convergence. The value - usually ranges from 0.0001 to 0.1; a value of 0.001 works well for - most problems. UNDER_RELAXATION_MOMENTUM only needs to be specified - if UNDER_RELAXATION is DBD. - backtracking_number : integer - * backtracking_number (integer) integer value defining the maximum - number of backtracking iterations allowed for residual reduction - computations. If BACKTRACKING_NUMBER = 0 then the backtracking - iterations are omitted. The value usually ranges from 2 to 20; a - value of 10 works well for most problems. - backtracking_tolerance : double - * backtracking_tolerance (double) real value defining the tolerance for - residual change that is allowed for residual reduction computations. - BACKTRACKING_TOLERANCE should not be less than one to avoid getting - stuck in local minima. A large value serves to check for extreme - residual increases, while a low value serves to control step size - more severely. The value usually ranges from 1.0 to 10:math:`^6`; a - value of 10:math:`^4` works well for most problems but lower values - like 1.1 may be required for harder problems. BACKTRACKING\_TOLERANCE - only needs to be specified if BACKTRACKING\_NUMBER is greater than - zero. - backtracking_reduction_factor : double - * backtracking_reduction_factor (double) real value defining the - reduction in step size used for residual reduction computations. The - value of BACKTRACKING_REDUCTION_FACTOR is between zero and one. The - value usually ranges from 0.1 to 0.3; a value of 0.2 works well for - most problems. BACKTRACKING_REDUCTION_FACTOR only needs to be - specified if BACKTRACKING_NUMBER is greater than zero. - backtracking_residual_limit : double - * backtracking_residual_limit (double) real value defining the limit to - which the residual is reduced with backtracking. If the residual is - smaller than BACKTRACKING_RESIDUAL_LIMIT, then further backtracking - is not performed. A value of 100 is suitable for large problems and - residual reduction to smaller values may only slow down computations. - BACKTRACKING_RESIDUAL_LIMIT only needs to be specified if - BACKTRACKING_NUMBER is greater than zero. - inner_maximum : integer - * inner_maximum (integer) integer value defining the maximum number of - inner (linear) iterations. The number typically depends on the - characteristics of the matrix solution scheme being used. For - nonlinear problems, INNER_MAXIMUM usually ranges from 60 to 600; a - value of 100 will be sufficient for most linear problems. - inner_hclose : double - * inner_hclose (double) real value defining the head change criterion - for convergence of the inner (linear) iterations, in units of length. - When the maximum absolute value of the head change at all nodes - during an iteration is less than or equal to INNER_HCLOSE, the matrix - solver assumes convergence. Commonly, INNER_HCLOSE is set an order of - magnitude less than the OUTER_HCLOSE value specified for the - NONLINEAR block. - rcloserecord : [inner_rclose, rclose_option] - * inner_rclose (double) real value that defines the flow residual - tolerance for convergence of the IMS linear solver and specific flow - residual criteria used. This value represents the maximum allowable - residual at any single node. Value is in units of length cubed per - time, and must be consistent with mf length and time units. Usually a - value of :math:`1.0 \\times 10^{-1}` is sufficient for the flow- - residual criteria when meters and seconds are the defined \mf length - and time. - * rclose_option (string) an optional keyword that defines the specific - flow residual criterion used. STRICT--an optional keyword that is - used to specify that INNER_RCLOSE represents a infinity-Norm - (absolute convergence criteria) and that the head and flow - convergence criteria must be met on the first inner iteration (this - criteria is equivalent to the criteria used by the MODFLOW-2005 PCG - package~citep{hill1990preconditioned}). L2NORM_RCLOSE--an optional - keyword that is used to specify that INNER_RCLOSE represents a L-2 - Norm closure criteria instead of a infinity-Norm (absolute - convergence criteria). When L2NORM_RCLOSE is specified, a reasonable - initial INNER_RCLOSE value is 0.1 times the number of active cells - when meters and seconds are the defined mf length and time. - RELATIVE_RCLOSE--an optional keyword that is used to specify that - INNER_RCLOSE represents a relative L-2 Norm reduction closure - criteria instead of a infinity-Norm (absolute convergence criteria). - When RELATIVE_RCLOSE is specified, a reasonable initial INNER_RCLOSE - value is :math:`1.0 \\times 10^{-4}` and convergence is achieved for - a given inner (linear) iteration when :math:`\\Delta h \\le` - INNER_HCLOSE and the current L-2 Norm is :math:`\\le` the product of - the RELATIVE\_RCLOSE and the initial L-2 Norm for the current inner - (linear) iteration. If RCLOSE\_OPTION is not specified, an absolute - residual (infinity-norm) criterion is used. - linear_acceleration : string - * linear_acceleration (string) a keyword that defines the linear - acceleration method used by the default IMS linear solvers. CG - - preconditioned conjugate gradient method. BICGSTAB - preconditioned - bi-conjugate gradient stabilized method. - relaxation_factor : double - * relaxation_factor (double) optional real value that defines the - relaxation factor used by the incomplete LU factorization - preconditioners (MILU(0) and MILUT). RELAXATION_FACTOR is unitless - and should be greater than or equal to 0.0 and less than or equal to - 1.0. RELAXATION_FACTOR values of about 1.0 are commonly used, and - experience suggests that convergence can be optimized in some cases - with relax values of 0.97. A RELAXATION_FACTOR value of 0.0 will - result in either ILU(0) or ILUT preconditioning (depending on the - value specified for PRECONDITIONER_LEVELS and/or - PRECONDITIONER_DROP_TOLERANCE). By default, RELAXATION_FACTOR is - zero. - preconditioner_levels : integer - * preconditioner_levels (integer) optional integer value defining the - level of fill for ILU decomposition used in the ILUT and MILUT - preconditioners. Higher levels of fill provide more robustness but - also require more memory. For optimal performance, it is suggested - that a large level of fill be applied (7 or 8) with use of a drop - tolerance. Specification of a PRECONDITIONER_LEVELS value greater - than zero results in use of the ILUT preconditioner. By default, - PRECONDITIONER_LEVELS is zero and the zero-fill incomplete LU - factorization preconditioners (ILU(0) and MILU(0)) are used. - preconditioner_drop_tolerance : double - * preconditioner_drop_tolerance (double) optional real value that - defines the drop tolerance used to drop preconditioner terms based on - the magnitude of matrix entries in the ILUT and MILUT - preconditioners. A value of :math:`10^{-4}` works well for most - problems. By default, PRECONDITIONER\_DROP\_TOLERANCE is zero and the - zero-fill incomplete LU factorization preconditioners (ILU(0) and - MILU(0)) are used. - number_orthogonalizations : integer - * number_orthogonalizations (integer) optional integer value defining - the interval used to explicitly recalculate the residual of the flow - equation using the solver coefficient matrix, the latest head - estimates, and the right hand side. For problems that benefit from - explicit recalculation of the residual, a number between 4 and 10 is - appropriate. By default, NUMBER_ORTHOGONALIZATIONS is zero. - scaling_method : string - * scaling_method (string) an optional keyword that defines the matrix - scaling approach used. By default, matrix scaling is not applied. - NONE - no matrix scaling applied. DIAGONAL - symmetric matrix scaling - using the POLCG preconditioner scaling method in Hill (1992). L2NORM - - symmetric matrix scaling using the L2 norm. - reordering_method : string - * reordering_method (string) an optional keyword that defines the - matrix reordering approach used. By default, matrix reordering is not - applied. NONE - original ordering. RCM - reverse Cuthill McKee - ordering. MD - minimum degree ordering. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - csv_output_filerecord = ListTemplateGenerator(('ims', 'options', - 'csv_output_filerecord')) - rcloserecord = ListTemplateGenerator(('ims', 'linear', - 'rcloserecord')) - package_abbr = "ims" - _package_type = "ims" - dfn_file_name = "sln-ims.dfn" - - dfn = [["block options", "name print_option", "type string", - "reader urword", "optional true"], - ["block options", "name complexity", "type string", - "reader urword", "optional true"], - ["block options", "name csv_output_filerecord", - "type record csv_output fileout csvfile", "shape", - "reader urword", "tagged true", "optional true"], - ["block options", "name csv_output", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name fileout", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name csvfile", "type string", - "preserve_case true", "shape", "in_record true", "reader urword", - "tagged false", "optional false"], - ["block options", "name no_ptc", "type keyword", "reader urword", - "optional true"], - ["block nonlinear", "name outer_hclose", "type double precision", - "reader urword", "optional false"], - ["block nonlinear", "name outer_rclosebnd", - "type double precision", "reader urword", "optional true"], - ["block nonlinear", "name outer_maximum", "type integer", - "reader urword", "optional false"], - ["block nonlinear", "name under_relaxation", "type string", - "reader urword", "optional true"], - ["block nonlinear", "name under_relaxation_theta", - "type double precision", "reader urword", "optional true"], - ["block nonlinear", "name under_relaxation_kappa", - "type double precision", "reader urword", "optional true"], - ["block nonlinear", "name under_relaxation_gamma", - "type double precision", "reader urword", "optional true"], - ["block nonlinear", "name under_relaxation_momentum", - "type double precision", "reader urword", "optional true"], - ["block nonlinear", "name backtracking_number", "type integer", - "reader urword", "optional true"], - ["block nonlinear", "name backtracking_tolerance", - "type double precision", "reader urword", "optional true"], - ["block nonlinear", "name backtracking_reduction_factor", - "type double precision", "reader urword", "optional true"], - ["block nonlinear", "name backtracking_residual_limit", - "type double precision", "reader urword", "optional true"], - ["block linear", "name inner_maximum", "type integer", - "reader urword", "optional false"], - ["block linear", "name inner_hclose", "type double precision", - "reader urword", "optional false"], - ["block linear", "name rcloserecord", - "type record inner_rclose rclose_option", "reader urword", - "optional false"], - ["block linear", "name inner_rclose", "type double precision", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block linear", "name rclose_option", "type string", - "tagged false", "in_record true", "reader urword", - "optional true"], - ["block linear", "name linear_acceleration", "type string", - "reader urword", "optional false"], - ["block linear", "name relaxation_factor", - "type double precision", "reader urword", "optional true"], - ["block linear", "name preconditioner_levels", "type integer", - "reader urword", "optional true"], - ["block linear", "name preconditioner_drop_tolerance", - "type double precision", "reader urword", "optional true"], - ["block linear", "name number_orthogonalizations", - "type integer", "reader urword", "optional true"], - ["block linear", "name scaling_method", "type string", - "reader urword", "optional true"], - ["block linear", "name reordering_method", "type string", - "reader urword", "optional true"]] - - def __init__(self, simulation, loading_package=False, print_option=None, - complexity=None, csv_output_filerecord=None, no_ptc=None, - outer_hclose=None, outer_rclosebnd=None, outer_maximum=None, - under_relaxation=None, under_relaxation_theta=None, - under_relaxation_kappa=None, under_relaxation_gamma=None, - under_relaxation_momentum=None, backtracking_number=None, - backtracking_tolerance=None, - backtracking_reduction_factor=None, - backtracking_residual_limit=None, inner_maximum=None, - inner_hclose=None, rcloserecord=None, - linear_acceleration=None, relaxation_factor=None, - preconditioner_levels=None, - preconditioner_drop_tolerance=None, - number_orthogonalizations=None, scaling_method=None, - reordering_method=None, filename=None, pname=None, - parent_file=None): - super(ModflowIms, self).__init__(simulation, "ims", filename, pname, - loading_package, parent_file) - - # set up variables - self.print_option = self.build_mfdata("print_option", print_option) - self.complexity = self.build_mfdata("complexity", complexity) - self.csv_output_filerecord = self.build_mfdata("csv_output_filerecord", - csv_output_filerecord) - self.no_ptc = self.build_mfdata("no_ptc", no_ptc) - self.outer_hclose = self.build_mfdata("outer_hclose", outer_hclose) - self.outer_rclosebnd = self.build_mfdata("outer_rclosebnd", - outer_rclosebnd) - self.outer_maximum = self.build_mfdata("outer_maximum", outer_maximum) - self.under_relaxation = self.build_mfdata("under_relaxation", - under_relaxation) - self.under_relaxation_theta = self.build_mfdata( - "under_relaxation_theta", under_relaxation_theta) - self.under_relaxation_kappa = self.build_mfdata( - "under_relaxation_kappa", under_relaxation_kappa) - self.under_relaxation_gamma = self.build_mfdata( - "under_relaxation_gamma", under_relaxation_gamma) - self.under_relaxation_momentum = self.build_mfdata( - "under_relaxation_momentum", under_relaxation_momentum) - self.backtracking_number = self.build_mfdata("backtracking_number", - backtracking_number) - self.backtracking_tolerance = self.build_mfdata( - "backtracking_tolerance", backtracking_tolerance) - self.backtracking_reduction_factor = self.build_mfdata( - "backtracking_reduction_factor", backtracking_reduction_factor) - self.backtracking_residual_limit = self.build_mfdata( - "backtracking_residual_limit", backtracking_residual_limit) - self.inner_maximum = self.build_mfdata("inner_maximum", inner_maximum) - self.inner_hclose = self.build_mfdata("inner_hclose", inner_hclose) - self.rcloserecord = self.build_mfdata("rcloserecord", rcloserecord) - self.linear_acceleration = self.build_mfdata("linear_acceleration", - linear_acceleration) - self.relaxation_factor = self.build_mfdata("relaxation_factor", - relaxation_factor) - self.preconditioner_levels = self.build_mfdata("preconditioner_levels", - preconditioner_levels) - self.preconditioner_drop_tolerance = self.build_mfdata( - "preconditioner_drop_tolerance", preconditioner_drop_tolerance) - self.number_orthogonalizations = self.build_mfdata( - "number_orthogonalizations", number_orthogonalizations) - self.scaling_method = self.build_mfdata("scaling_method", - scaling_method) - self.reordering_method = self.build_mfdata("reordering_method", - reordering_method) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ListTemplateGenerator + + +class ModflowIms(mfpackage.MFPackage): + """ + ModflowIms defines a ims package. + + Parameters + ---------- + simulation : MFSimulation + Simulation that this package is a part of. Package is automatically + added to simulation when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + print_option : string + * print_option (string) is a flag that controls printing of convergence + information from the solver. NONE means print nothing. SUMMARY means + print only the total number of iterations and nonlinear residual + reduction summaries. ALL means print linear matrix solver convergence + information to the solution listing file and model specific linear + matrix solver convergence information to each model listing file in + addition to SUMMARY information. NONE is default if PRINT_OPTION is + not specified. + complexity : string + * complexity (string) is an optional keyword that defines default non- + linear and linear solver parameters. SIMPLE - indicates that default + solver input values will be defined that work well for nearly linear + models. This would be used for models that do not include nonlinear + stress packages and models that are either confined or consist of a + single unconfined layer that is thick enough to contain the water + table within a single layer. MODERATE - indicates that default solver + input values will be defined that work well for moderately nonlinear + models. This would be used for models that include nonlinear stress + packages and models that consist of one or more unconfined layers. + The MODERATE option should be used when the SIMPLE option does not + result in successful convergence. COMPLEX - indicates that default + solver input values will be defined that work well for highly + nonlinear models. This would be used for models that include + nonlinear stress packages and models that consist of one or more + unconfined layers representing complex geology and surface- + water/groundwater interaction. The COMPLEX option should be used when + the MODERATE option does not result in successful convergence. Non- + linear and linear solver parameters assigned using a specified + complexity can be modified in the NONLINEAR and LINEAR blocks. If the + COMPLEXITY option is not specified, NONLINEAR and LINEAR variables + will be assigned the simple complexity values. + csv_output_filerecord : [csvfile] + * csvfile (string) name of the ascii comma separated values output file + to write solver convergence information. If PRINT_OPTION is NONE or + SUMMARY, comma separated values output includes maximum head change + convergence information at the end of each outer iteration for each + time step. If PRINT_OPTION is ALL, comma separated values output + includes maximum head change and maximum residual convergence + information for the solution and each model (if the solution includes + more than one model) and linear acceleration information for each + inner iteration. + no_ptc : boolean + * no_ptc (boolean) is a flag that is used to disable pseudo-transient + continuation (PTC). Option only applies to steady-state stress + periods for models using the Newton-Raphson formulation. For many + problems, PTC can significantly improve convergence behavior for + steady-state simulations, and for this reason it is active by + default. In some cases, however, PTC can worsen the convergence + behavior, especially when the initial conditions are similar to the + solution. When the initial conditions are similar to, or exactly the + same as, the solution and convergence is slow, then this NO_PTC + option should be used to deactivate PTC. This NO_PTC option should + also be used in order to compare convergence behavior with other + MODFLOW versions, as PTC is only available in MODFLOW 6. + outer_hclose : double + * outer_hclose (double) real value defining the head change criterion + for convergence of the outer (nonlinear) iterations, in units of + length. When the maximum absolute value of the head change at all + nodes during an iteration is less than or equal to OUTER_HCLOSE, + iteration stops. Commonly, OUTER_HCLOSE equals 0.01. + outer_rclosebnd : double + * outer_rclosebnd (double) real value defining the residual tolerance + for convergence of model packages that solve a separate equation not + solved by the IMS linear solver. This value represents the maximum + allowable residual between successive outer iterations at any single + model package element. An example of a model package that would use + OUTER_RCLOSEBND to evaluate convergence is the SFR package which + solves a continuity equation for each reach. + outer_maximum : integer + * outer_maximum (integer) integer value defining the maximum number of + outer (nonlinear) iterations -- that is, calls to the solution + routine. For a linear problem OUTER_MAXIMUM should be 1. + under_relaxation : string + * under_relaxation (string) is an optional keyword that defines the + nonlinear under-relaxation schemes used. By default under-relaxation + is not used. NONE - under-relaxation is not used. SIMPLE - Simple + under-relaxation scheme with a fixed relaxation factor is used. + COOLEY - Cooley under-relaxation scheme is used. DBD - delta-bar- + delta under-relaxation is used. Note that the under-relaxation + schemes are used in conjunction with problems that use the Newton- + Raphson formulation, however, experience has indicated that the + Cooley under-relaxation and damping work well also for the Picard + scheme with the wet/dry options of MODFLOW 6. + under_relaxation_theta : double + * under_relaxation_theta (double) real value defining the reduction + factor for the learning rate (under-relaxation term) of the delta- + bar-delta algorithm. The value of UNDER_RELAXATION_THETA is between + zero and one. If the change in the variable (head) is of opposite + sign to that of the previous iteration, the under-relaxation term is + reduced by a factor of UNDER_RELAXATION_THETA. The value usually + ranges from 0.3 to 0.9; a value of 0.7 works well for most problems. + UNDER_RELAXATION_THETA only needs to be specified if UNDER_RELAXATION + is DBD. + under_relaxation_kappa : double + * under_relaxation_kappa (double) real value defining the increment for + the learning rate (under-relaxation term) of the delta-bar-delta + algorithm. The value of UNDER_RELAXATION_kappa is between zero and + one. If the change in the variable (head) is of the same sign to that + of the previous iteration, the under-relaxation term is increased by + an increment of UNDER_RELAXATION_KAPPA. The value usually ranges from + 0.03 to 0.3; a value of 0.1 works well for most problems. + UNDER_RELAXATION_KAPPA only needs to be specified if UNDER_RELAXATION + is DBD. + under_relaxation_gamma : double + * under_relaxation_gamma (double) real value defining the history or + memory term factor of the delta-bar-delta algorithm. + UNDER_RELAXATION_GAMMA is between zero and 1 but cannot be equal to + one. When UNDER_RELAXATION_GAMMA is zero, only the most recent + history (previous iteration value) is maintained. As + UNDER_RELAXATION_GAMMA is increased, past history of iteration + changes has greater influence on the memory term. The memory term is + maintained as an exponential average of past changes. Retaining some + past history can overcome granular behavior in the calculated + function surface and therefore helps to overcome cyclic patterns of + non-convergence. The value usually ranges from 0.1 to 0.3; a value of + 0.2 works well for most problems. UNDER_RELAXATION_GAMMA only needs + to be specified if UNDER_RELAXATION is not NONE. + under_relaxation_momentum : double + * under_relaxation_momentum (double) real value defining the fraction + of past history changes that is added as a momentum term to the step + change for a nonlinear iteration. The value of + UNDER_RELAXATION_MOMENTUM is between zero and one. A large momentum + term should only be used when small learning rates are expected. + Small amounts of the momentum term help convergence. The value + usually ranges from 0.0001 to 0.1; a value of 0.001 works well for + most problems. UNDER_RELAXATION_MOMENTUM only needs to be specified + if UNDER_RELAXATION is DBD. + backtracking_number : integer + * backtracking_number (integer) integer value defining the maximum + number of backtracking iterations allowed for residual reduction + computations. If BACKTRACKING_NUMBER = 0 then the backtracking + iterations are omitted. The value usually ranges from 2 to 20; a + value of 10 works well for most problems. + backtracking_tolerance : double + * backtracking_tolerance (double) real value defining the tolerance for + residual change that is allowed for residual reduction computations. + BACKTRACKING_TOLERANCE should not be less than one to avoid getting + stuck in local minima. A large value serves to check for extreme + residual increases, while a low value serves to control step size + more severely. The value usually ranges from 1.0 to 10:math:`^6`; a + value of 10:math:`^4` works well for most problems but lower values + like 1.1 may be required for harder problems. BACKTRACKING\_TOLERANCE + only needs to be specified if BACKTRACKING\_NUMBER is greater than + zero. + backtracking_reduction_factor : double + * backtracking_reduction_factor (double) real value defining the + reduction in step size used for residual reduction computations. The + value of BACKTRACKING_REDUCTION_FACTOR is between zero and one. The + value usually ranges from 0.1 to 0.3; a value of 0.2 works well for + most problems. BACKTRACKING_REDUCTION_FACTOR only needs to be + specified if BACKTRACKING_NUMBER is greater than zero. + backtracking_residual_limit : double + * backtracking_residual_limit (double) real value defining the limit to + which the residual is reduced with backtracking. If the residual is + smaller than BACKTRACKING_RESIDUAL_LIMIT, then further backtracking + is not performed. A value of 100 is suitable for large problems and + residual reduction to smaller values may only slow down computations. + BACKTRACKING_RESIDUAL_LIMIT only needs to be specified if + BACKTRACKING_NUMBER is greater than zero. + inner_maximum : integer + * inner_maximum (integer) integer value defining the maximum number of + inner (linear) iterations. The number typically depends on the + characteristics of the matrix solution scheme being used. For + nonlinear problems, INNER_MAXIMUM usually ranges from 60 to 600; a + value of 100 will be sufficient for most linear problems. + inner_hclose : double + * inner_hclose (double) real value defining the head change criterion + for convergence of the inner (linear) iterations, in units of length. + When the maximum absolute value of the head change at all nodes + during an iteration is less than or equal to INNER_HCLOSE, the matrix + solver assumes convergence. Commonly, INNER_HCLOSE is set an order of + magnitude less than the OUTER_HCLOSE value specified for the + NONLINEAR block. + rcloserecord : [inner_rclose, rclose_option] + * inner_rclose (double) real value that defines the flow residual + tolerance for convergence of the IMS linear solver and specific flow + residual criteria used. This value represents the maximum allowable + residual at any single node. Value is in units of length cubed per + time, and must be consistent with mf length and time units. Usually a + value of :math:`1.0 \\times 10^{-1}` is sufficient for the flow- + residual criteria when meters and seconds are the defined \mf length + and time. + * rclose_option (string) an optional keyword that defines the specific + flow residual criterion used. STRICT--an optional keyword that is + used to specify that INNER_RCLOSE represents a infinity-Norm + (absolute convergence criteria) and that the head and flow + convergence criteria must be met on the first inner iteration (this + criteria is equivalent to the criteria used by the MODFLOW-2005 PCG + package~citep{hill1990preconditioned}). L2NORM_RCLOSE--an optional + keyword that is used to specify that INNER_RCLOSE represents a L-2 + Norm closure criteria instead of a infinity-Norm (absolute + convergence criteria). When L2NORM_RCLOSE is specified, a reasonable + initial INNER_RCLOSE value is 0.1 times the number of active cells + when meters and seconds are the defined mf length and time. + RELATIVE_RCLOSE--an optional keyword that is used to specify that + INNER_RCLOSE represents a relative L-2 Norm reduction closure + criteria instead of a infinity-Norm (absolute convergence criteria). + When RELATIVE_RCLOSE is specified, a reasonable initial INNER_RCLOSE + value is :math:`1.0 \\times 10^{-4}` and convergence is achieved for + a given inner (linear) iteration when :math:`\\Delta h \\le` + INNER_HCLOSE and the current L-2 Norm is :math:`\\le` the product of + the RELATIVE\_RCLOSE and the initial L-2 Norm for the current inner + (linear) iteration. If RCLOSE\_OPTION is not specified, an absolute + residual (infinity-norm) criterion is used. + linear_acceleration : string + * linear_acceleration (string) a keyword that defines the linear + acceleration method used by the default IMS linear solvers. CG - + preconditioned conjugate gradient method. BICGSTAB - preconditioned + bi-conjugate gradient stabilized method. + relaxation_factor : double + * relaxation_factor (double) optional real value that defines the + relaxation factor used by the incomplete LU factorization + preconditioners (MILU(0) and MILUT). RELAXATION_FACTOR is unitless + and should be greater than or equal to 0.0 and less than or equal to + 1.0. RELAXATION_FACTOR values of about 1.0 are commonly used, and + experience suggests that convergence can be optimized in some cases + with relax values of 0.97. A RELAXATION_FACTOR value of 0.0 will + result in either ILU(0) or ILUT preconditioning (depending on the + value specified for PRECONDITIONER_LEVELS and/or + PRECONDITIONER_DROP_TOLERANCE). By default, RELAXATION_FACTOR is + zero. + preconditioner_levels : integer + * preconditioner_levels (integer) optional integer value defining the + level of fill for ILU decomposition used in the ILUT and MILUT + preconditioners. Higher levels of fill provide more robustness but + also require more memory. For optimal performance, it is suggested + that a large level of fill be applied (7 or 8) with use of a drop + tolerance. Specification of a PRECONDITIONER_LEVELS value greater + than zero results in use of the ILUT preconditioner. By default, + PRECONDITIONER_LEVELS is zero and the zero-fill incomplete LU + factorization preconditioners (ILU(0) and MILU(0)) are used. + preconditioner_drop_tolerance : double + * preconditioner_drop_tolerance (double) optional real value that + defines the drop tolerance used to drop preconditioner terms based on + the magnitude of matrix entries in the ILUT and MILUT + preconditioners. A value of :math:`10^{-4}` works well for most + problems. By default, PRECONDITIONER\_DROP\_TOLERANCE is zero and the + zero-fill incomplete LU factorization preconditioners (ILU(0) and + MILU(0)) are used. + number_orthogonalizations : integer + * number_orthogonalizations (integer) optional integer value defining + the interval used to explicitly recalculate the residual of the flow + equation using the solver coefficient matrix, the latest head + estimates, and the right hand side. For problems that benefit from + explicit recalculation of the residual, a number between 4 and 10 is + appropriate. By default, NUMBER_ORTHOGONALIZATIONS is zero. + scaling_method : string + * scaling_method (string) an optional keyword that defines the matrix + scaling approach used. By default, matrix scaling is not applied. + NONE - no matrix scaling applied. DIAGONAL - symmetric matrix scaling + using the POLCG preconditioner scaling method in Hill (1992). L2NORM + - symmetric matrix scaling using the L2 norm. + reordering_method : string + * reordering_method (string) an optional keyword that defines the + matrix reordering approach used. By default, matrix reordering is not + applied. NONE - original ordering. RCM - reverse Cuthill McKee + ordering. MD - minimum degree ordering. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + csv_output_filerecord = ListTemplateGenerator(('ims', 'options', + 'csv_output_filerecord')) + rcloserecord = ListTemplateGenerator(('ims', 'linear', + 'rcloserecord')) + package_abbr = "ims" + _package_type = "ims" + dfn_file_name = "sln-ims.dfn" + + dfn = [["block options", "name print_option", "type string", + "reader urword", "optional true"], + ["block options", "name complexity", "type string", + "reader urword", "optional true"], + ["block options", "name csv_output_filerecord", + "type record csv_output fileout csvfile", "shape", + "reader urword", "tagged true", "optional true"], + ["block options", "name csv_output", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name fileout", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name csvfile", "type string", + "preserve_case true", "shape", "in_record true", "reader urword", + "tagged false", "optional false"], + ["block options", "name no_ptc", "type keyword", "reader urword", + "optional true"], + ["block nonlinear", "name outer_hclose", "type double precision", + "reader urword", "optional false"], + ["block nonlinear", "name outer_rclosebnd", + "type double precision", "reader urword", "optional true"], + ["block nonlinear", "name outer_maximum", "type integer", + "reader urword", "optional false"], + ["block nonlinear", "name under_relaxation", "type string", + "reader urword", "optional true"], + ["block nonlinear", "name under_relaxation_theta", + "type double precision", "reader urword", "optional true"], + ["block nonlinear", "name under_relaxation_kappa", + "type double precision", "reader urword", "optional true"], + ["block nonlinear", "name under_relaxation_gamma", + "type double precision", "reader urword", "optional true"], + ["block nonlinear", "name under_relaxation_momentum", + "type double precision", "reader urword", "optional true"], + ["block nonlinear", "name backtracking_number", "type integer", + "reader urword", "optional true"], + ["block nonlinear", "name backtracking_tolerance", + "type double precision", "reader urword", "optional true"], + ["block nonlinear", "name backtracking_reduction_factor", + "type double precision", "reader urword", "optional true"], + ["block nonlinear", "name backtracking_residual_limit", + "type double precision", "reader urword", "optional true"], + ["block linear", "name inner_maximum", "type integer", + "reader urword", "optional false"], + ["block linear", "name inner_hclose", "type double precision", + "reader urword", "optional false"], + ["block linear", "name rcloserecord", + "type record inner_rclose rclose_option", "reader urword", + "optional false"], + ["block linear", "name inner_rclose", "type double precision", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block linear", "name rclose_option", "type string", + "tagged false", "in_record true", "reader urword", + "optional true"], + ["block linear", "name linear_acceleration", "type string", + "reader urword", "optional false"], + ["block linear", "name relaxation_factor", + "type double precision", "reader urword", "optional true"], + ["block linear", "name preconditioner_levels", "type integer", + "reader urword", "optional true"], + ["block linear", "name preconditioner_drop_tolerance", + "type double precision", "reader urword", "optional true"], + ["block linear", "name number_orthogonalizations", + "type integer", "reader urword", "optional true"], + ["block linear", "name scaling_method", "type string", + "reader urword", "optional true"], + ["block linear", "name reordering_method", "type string", + "reader urword", "optional true"]] + + def __init__(self, simulation, loading_package=False, print_option=None, + complexity=None, csv_output_filerecord=None, no_ptc=None, + outer_hclose=None, outer_rclosebnd=None, outer_maximum=None, + under_relaxation=None, under_relaxation_theta=None, + under_relaxation_kappa=None, under_relaxation_gamma=None, + under_relaxation_momentum=None, backtracking_number=None, + backtracking_tolerance=None, + backtracking_reduction_factor=None, + backtracking_residual_limit=None, inner_maximum=None, + inner_hclose=None, rcloserecord=None, + linear_acceleration=None, relaxation_factor=None, + preconditioner_levels=None, + preconditioner_drop_tolerance=None, + number_orthogonalizations=None, scaling_method=None, + reordering_method=None, filename=None, pname=None, + parent_file=None): + super(ModflowIms, self).__init__(simulation, "ims", filename, pname, + loading_package, parent_file) + + # set up variables + self.print_option = self.build_mfdata("print_option", print_option) + self.complexity = self.build_mfdata("complexity", complexity) + self.csv_output_filerecord = self.build_mfdata("csv_output_filerecord", + csv_output_filerecord) + self.no_ptc = self.build_mfdata("no_ptc", no_ptc) + self.outer_hclose = self.build_mfdata("outer_hclose", outer_hclose) + self.outer_rclosebnd = self.build_mfdata("outer_rclosebnd", + outer_rclosebnd) + self.outer_maximum = self.build_mfdata("outer_maximum", outer_maximum) + self.under_relaxation = self.build_mfdata("under_relaxation", + under_relaxation) + self.under_relaxation_theta = self.build_mfdata( + "under_relaxation_theta", under_relaxation_theta) + self.under_relaxation_kappa = self.build_mfdata( + "under_relaxation_kappa", under_relaxation_kappa) + self.under_relaxation_gamma = self.build_mfdata( + "under_relaxation_gamma", under_relaxation_gamma) + self.under_relaxation_momentum = self.build_mfdata( + "under_relaxation_momentum", under_relaxation_momentum) + self.backtracking_number = self.build_mfdata("backtracking_number", + backtracking_number) + self.backtracking_tolerance = self.build_mfdata( + "backtracking_tolerance", backtracking_tolerance) + self.backtracking_reduction_factor = self.build_mfdata( + "backtracking_reduction_factor", backtracking_reduction_factor) + self.backtracking_residual_limit = self.build_mfdata( + "backtracking_residual_limit", backtracking_residual_limit) + self.inner_maximum = self.build_mfdata("inner_maximum", inner_maximum) + self.inner_hclose = self.build_mfdata("inner_hclose", inner_hclose) + self.rcloserecord = self.build_mfdata("rcloserecord", rcloserecord) + self.linear_acceleration = self.build_mfdata("linear_acceleration", + linear_acceleration) + self.relaxation_factor = self.build_mfdata("relaxation_factor", + relaxation_factor) + self.preconditioner_levels = self.build_mfdata("preconditioner_levels", + preconditioner_levels) + self.preconditioner_drop_tolerance = self.build_mfdata( + "preconditioner_drop_tolerance", preconditioner_drop_tolerance) + self.number_orthogonalizations = self.build_mfdata( + "number_orthogonalizations", number_orthogonalizations) + self.scaling_method = self.build_mfdata("scaling_method", + scaling_method) + self.reordering_method = self.build_mfdata("reordering_method", + reordering_method) + self._init_complete = True diff --git a/flopy/mf6/modflow/mfmvr.py b/flopy/mf6/modflow/mfmvr.py index f5f057325a..2e77a5a812 100644 --- a/flopy/mf6/modflow/mfmvr.py +++ b/flopy/mf6/modflow/mfmvr.py @@ -1,176 +1,176 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ListTemplateGenerator - - -class ModflowMvr(mfpackage.MFPackage): - """ - ModflowMvr defines a mvr package. - - Parameters - ---------- - simulation : MFSimulation - Simulation that this package is a part of. Package is automatically - added to simulation when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - print_input : boolean - * print_input (boolean) keyword to indicate that the list of MVR - information will be written to the listing file immediately after it - is read. - print_flows : boolean - * print_flows (boolean) keyword to indicate that the list of MVR flow - rates will be printed to the listing file for every stress period - time step in which "BUDGET PRINT" is specified in Output Control. If - there is no Output Control option and "PRINT_FLOWS" is specified, - then flow rates are printed for the last time step of each stress - period. - modelnames : boolean - * modelnames (boolean) keyword to indicate that all package names will - be preceded by the model name for the package. Model names are - required when the Mover Package is used with a GWF-GWF Exchange. The - MODELNAME keyword should not be used for a Mover Package that is for - a single GWF Model. - budget_filerecord : [budgetfile] - * budgetfile (string) name of the output file to write budget - information. - maxmvr : integer - * maxmvr (integer) integer value specifying the maximum number of water - mover entries that will specified for any stress period. - maxpackages : integer - * maxpackages (integer) integer value specifying the number of unique - packages that are included in this water mover input file. - packages : [mname, pname] - * mname (string) name of model containing the package. Model names are - assigned by the user in the simulation name file. - * pname (string) is the name of a package that may be included in a - subsequent stress period block. The package name is assigned in the - name file for the GWF Model. Package names are optionally provided in - the name file. If they are not provided by the user, then packages - are assigned a default value, which is the package acronym followed - by a hyphen and the package number. For example, the first Drain - Package is named DRN-1. The second Drain Package is named DRN-2, and - so forth. - perioddata : [mname1, pname1, id1, mname2, pname2, id2, mvrtype, value] - * mname1 (string) name of model containing the package, PNAME1. - * pname1 (string) is the package name for the provider. The package - PNAME1 must be designated to provide water through the MVR Package by - specifying the keyword "MOVER" in its OPTIONS block. - * id1 (integer) is the identifier for the provider. For the standard - boundary packages, the provider identifier is the number of the - boundary as it is listed in the package input file. (Note that the - order of these boundaries may change by stress period, which must be - accounted for in the Mover Package.) So the first well has an - identifier of one. The second is two, and so forth. For the advanced - packages, the identifier is the reach number (SFR Package), well - number (MAW Package), or UZF cell number. For the Lake Package, ID1 - is the lake outlet number. Thus, outflows from a single lake can be - routed to different streams, for example. - * mname2 (string) name of model containing the package, PNAME2. - * pname2 (string) is the package name for the receiver. The package - PNAME2 must be designated to receive water from the MVR Package by - specifying the keyword "MOVER" in its OPTIONS block. - * id2 (integer) is the identifier for the receiver. The receiver - identifier is the reach number (SFR Package), Lake number (LAK - Package), well number (MAW Package), or UZF cell number. - * mvrtype (string) is the character string signifying the method for - determining how much water will be moved. Supported values are - "FACTOR" "EXCESS" "THRESHOLD" and "UPTO". These four options - determine how the receiver flow rate, :math:`Q_R`, is calculated. - These options are based the options available in the SFR2 Package for - diverting stream flow. - * value (double) is the value to be used in the equation for - calculating the amount of water to move. For the "FACTOR" option, - VALUE is the :math:`\\alpha` factor. For the remaining options, VALUE - is the specified flow rate, :math:`Q_S`. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - budget_filerecord = ListTemplateGenerator(('mvr', 'options', - 'budget_filerecord')) - packages = ListTemplateGenerator(('mvr', 'packages', 'packages')) - perioddata = ListTemplateGenerator(('mvr', 'period', 'perioddata')) - package_abbr = "mvr" - _package_type = "mvr" - dfn_file_name = "gwf-mvr.dfn" - - dfn = [["block options", "name print_input", "type keyword", - "reader urword", "optional true"], - ["block options", "name print_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name modelnames", "type keyword", - "reader urword", "optional true"], - ["block options", "name budget_filerecord", - "type record budget fileout budgetfile", "shape", "reader urword", - "tagged true", "optional true"], - ["block options", "name budget", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name fileout", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name budgetfile", "type string", - "preserve_case true", "shape", "in_record true", "reader urword", - "tagged false", "optional false"], - ["block dimensions", "name maxmvr", "type integer", - "reader urword", "optional false"], - ["block dimensions", "name maxpackages", "type integer", - "reader urword", "optional false"], - ["block packages", "name packages", "type recarray mname pname", - "reader urword", "shape (npackages)", "optional false"], - ["block packages", "name mname", "type string", "reader urword", - "shape", "tagged false", "in_record true", "optional true"], - ["block packages", "name pname", "type string", "reader urword", - "shape", "tagged false", "in_record true", "optional false"], - ["block period", "name iper", "type integer", - "block_variable True", "in_record true", "tagged false", "shape", - "valid", "reader urword", "optional false"], - ["block period", "name perioddata", - "type recarray mname1 pname1 id1 mname2 pname2 id2 mvrtype value", - "shape (maxbound)", "reader urword"], - ["block period", "name mname1", "type string", "reader urword", - "shape", "tagged false", "in_record true", "optional true"], - ["block period", "name pname1", "type string", "shape", - "tagged false", "in_record true", "reader urword"], - ["block period", "name id1", "type integer", "shape", - "tagged false", "in_record true", "reader urword", - "numeric_index true"], - ["block period", "name mname2", "type string", "reader urword", - "shape", "tagged false", "in_record true", "optional true"], - ["block period", "name pname2", "type string", "shape", - "tagged false", "in_record true", "reader urword"], - ["block period", "name id2", "type integer", "shape", - "tagged false", "in_record true", "reader urword", - "numeric_index true"], - ["block period", "name mvrtype", "type string", "shape", - "tagged false", "in_record true", "reader urword"], - ["block period", "name value", "type double precision", "shape", - "tagged false", "in_record true", "reader urword"]] - - def __init__(self, simulation, loading_package=False, print_input=None, - print_flows=None, modelnames=None, budget_filerecord=None, - maxmvr=None, maxpackages=None, packages=None, perioddata=None, - filename=None, pname=None, parent_file=None): - super(ModflowMvr, self).__init__(simulation, "mvr", filename, pname, - loading_package, parent_file) - - # set up variables - self.print_input = self.build_mfdata("print_input", print_input) - self.print_flows = self.build_mfdata("print_flows", print_flows) - self.modelnames = self.build_mfdata("modelnames", modelnames) - self.budget_filerecord = self.build_mfdata("budget_filerecord", - budget_filerecord) - self.maxmvr = self.build_mfdata("maxmvr", maxmvr) - self.maxpackages = self.build_mfdata("maxpackages", maxpackages) - self.packages = self.build_mfdata("packages", packages) - self.perioddata = self.build_mfdata("perioddata", perioddata) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ListTemplateGenerator + + +class ModflowMvr(mfpackage.MFPackage): + """ + ModflowMvr defines a mvr package. + + Parameters + ---------- + simulation : MFSimulation + Simulation that this package is a part of. Package is automatically + added to simulation when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + print_input : boolean + * print_input (boolean) keyword to indicate that the list of MVR + information will be written to the listing file immediately after it + is read. + print_flows : boolean + * print_flows (boolean) keyword to indicate that the list of MVR flow + rates will be printed to the listing file for every stress period + time step in which "BUDGET PRINT" is specified in Output Control. If + there is no Output Control option and "PRINT_FLOWS" is specified, + then flow rates are printed for the last time step of each stress + period. + modelnames : boolean + * modelnames (boolean) keyword to indicate that all package names will + be preceded by the model name for the package. Model names are + required when the Mover Package is used with a GWF-GWF Exchange. The + MODELNAME keyword should not be used for a Mover Package that is for + a single GWF Model. + budget_filerecord : [budgetfile] + * budgetfile (string) name of the output file to write budget + information. + maxmvr : integer + * maxmvr (integer) integer value specifying the maximum number of water + mover entries that will specified for any stress period. + maxpackages : integer + * maxpackages (integer) integer value specifying the number of unique + packages that are included in this water mover input file. + packages : [mname, pname] + * mname (string) name of model containing the package. Model names are + assigned by the user in the simulation name file. + * pname (string) is the name of a package that may be included in a + subsequent stress period block. The package name is assigned in the + name file for the GWF Model. Package names are optionally provided in + the name file. If they are not provided by the user, then packages + are assigned a default value, which is the package acronym followed + by a hyphen and the package number. For example, the first Drain + Package is named DRN-1. The second Drain Package is named DRN-2, and + so forth. + perioddata : [mname1, pname1, id1, mname2, pname2, id2, mvrtype, value] + * mname1 (string) name of model containing the package, PNAME1. + * pname1 (string) is the package name for the provider. The package + PNAME1 must be designated to provide water through the MVR Package by + specifying the keyword "MOVER" in its OPTIONS block. + * id1 (integer) is the identifier for the provider. For the standard + boundary packages, the provider identifier is the number of the + boundary as it is listed in the package input file. (Note that the + order of these boundaries may change by stress period, which must be + accounted for in the Mover Package.) So the first well has an + identifier of one. The second is two, and so forth. For the advanced + packages, the identifier is the reach number (SFR Package), well + number (MAW Package), or UZF cell number. For the Lake Package, ID1 + is the lake outlet number. Thus, outflows from a single lake can be + routed to different streams, for example. + * mname2 (string) name of model containing the package, PNAME2. + * pname2 (string) is the package name for the receiver. The package + PNAME2 must be designated to receive water from the MVR Package by + specifying the keyword "MOVER" in its OPTIONS block. + * id2 (integer) is the identifier for the receiver. The receiver + identifier is the reach number (SFR Package), Lake number (LAK + Package), well number (MAW Package), or UZF cell number. + * mvrtype (string) is the character string signifying the method for + determining how much water will be moved. Supported values are + "FACTOR" "EXCESS" "THRESHOLD" and "UPTO". These four options + determine how the receiver flow rate, :math:`Q_R`, is calculated. + These options are based the options available in the SFR2 Package for + diverting stream flow. + * value (double) is the value to be used in the equation for + calculating the amount of water to move. For the "FACTOR" option, + VALUE is the :math:`\\alpha` factor. For the remaining options, VALUE + is the specified flow rate, :math:`Q_S`. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + budget_filerecord = ListTemplateGenerator(('mvr', 'options', + 'budget_filerecord')) + packages = ListTemplateGenerator(('mvr', 'packages', 'packages')) + perioddata = ListTemplateGenerator(('mvr', 'period', 'perioddata')) + package_abbr = "mvr" + _package_type = "mvr" + dfn_file_name = "gwf-mvr.dfn" + + dfn = [["block options", "name print_input", "type keyword", + "reader urword", "optional true"], + ["block options", "name print_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name modelnames", "type keyword", + "reader urword", "optional true"], + ["block options", "name budget_filerecord", + "type record budget fileout budgetfile", "shape", "reader urword", + "tagged true", "optional true"], + ["block options", "name budget", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name fileout", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name budgetfile", "type string", + "preserve_case true", "shape", "in_record true", "reader urword", + "tagged false", "optional false"], + ["block dimensions", "name maxmvr", "type integer", + "reader urword", "optional false"], + ["block dimensions", "name maxpackages", "type integer", + "reader urword", "optional false"], + ["block packages", "name packages", "type recarray mname pname", + "reader urword", "shape (npackages)", "optional false"], + ["block packages", "name mname", "type string", "reader urword", + "shape", "tagged false", "in_record true", "optional true"], + ["block packages", "name pname", "type string", "reader urword", + "shape", "tagged false", "in_record true", "optional false"], + ["block period", "name iper", "type integer", + "block_variable True", "in_record true", "tagged false", "shape", + "valid", "reader urword", "optional false"], + ["block period", "name perioddata", + "type recarray mname1 pname1 id1 mname2 pname2 id2 mvrtype value", + "shape (maxbound)", "reader urword"], + ["block period", "name mname1", "type string", "reader urword", + "shape", "tagged false", "in_record true", "optional true"], + ["block period", "name pname1", "type string", "shape", + "tagged false", "in_record true", "reader urword"], + ["block period", "name id1", "type integer", "shape", + "tagged false", "in_record true", "reader urword", + "numeric_index true"], + ["block period", "name mname2", "type string", "reader urword", + "shape", "tagged false", "in_record true", "optional true"], + ["block period", "name pname2", "type string", "shape", + "tagged false", "in_record true", "reader urword"], + ["block period", "name id2", "type integer", "shape", + "tagged false", "in_record true", "reader urword", + "numeric_index true"], + ["block period", "name mvrtype", "type string", "shape", + "tagged false", "in_record true", "reader urword"], + ["block period", "name value", "type double precision", "shape", + "tagged false", "in_record true", "reader urword"]] + + def __init__(self, simulation, loading_package=False, print_input=None, + print_flows=None, modelnames=None, budget_filerecord=None, + maxmvr=None, maxpackages=None, packages=None, perioddata=None, + filename=None, pname=None, parent_file=None): + super(ModflowMvr, self).__init__(simulation, "mvr", filename, pname, + loading_package, parent_file) + + # set up variables + self.print_input = self.build_mfdata("print_input", print_input) + self.print_flows = self.build_mfdata("print_flows", print_flows) + self.modelnames = self.build_mfdata("modelnames", modelnames) + self.budget_filerecord = self.build_mfdata("budget_filerecord", + budget_filerecord) + self.maxmvr = self.build_mfdata("maxmvr", maxmvr) + self.maxpackages = self.build_mfdata("maxpackages", maxpackages) + self.packages = self.build_mfdata("packages", packages) + self.perioddata = self.build_mfdata("perioddata", perioddata) + self._init_complete = True diff --git a/flopy/mf6/modflow/mfnam.py b/flopy/mf6/modflow/mfnam.py index 1e6630cc8c..d51a0568ae 100644 --- a/flopy/mf6/modflow/mfnam.py +++ b/flopy/mf6/modflow/mfnam.py @@ -1,139 +1,139 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ListTemplateGenerator - - -class ModflowNam(mfpackage.MFPackage): - """ - ModflowNam defines a nam package. - - Parameters - ---------- - simulation : MFSimulation - Simulation that this package is a part of. Package is automatically - added to simulation when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - continue_ : boolean - * continue (boolean) keyword flag to indicate that the simulation - should continue even if one or more solutions do not converge. - nocheck : boolean - * nocheck (boolean) keyword flag to indicate that the model input check - routines should not be called prior to each time step. Checks are - performed by default. - memory_print_option : string - * memory_print_option (string) is a flag that controls printing of - detailed memory manager usage to the end of the simulation list file. - NONE means do not print detailed information. SUMMARY means print - only the total memory for each simulation component. ALL means print - information for each variable stored in the memory manager. NONE is - default if MEMORY_PRINT_OPTION is not specified. - tdis6 : string - * tdis6 (string) is the name of the Temporal Discretization (TDIS) - Input File. - models : [mtype, mfname, mname] - * mtype (string) is the type of model to add to simulation. - * mfname (string) is the file name of the model name file. - * mname (string) is the user-assigned name of the model. The model name - cannot exceed 16 characters and must not have blanks within the name. - The model name is case insensitive; any lowercase letters are - converted and stored as upper case letters. - exchanges : [exgtype, exgfile, exgmnamea, exgmnameb] - * exgtype (string) is the exchange type. - * exgfile (string) is the input file for the exchange. - * exgmnamea (string) is the name of the first model that is part of - this exchange. - * exgmnameb (string) is the name of the second model that is part of - this exchange. - mxiter : integer - * mxiter (integer) is the maximum number of outer iterations for this - solution group. The default value is 1. If there is only one solution - in the solution group, then MXITER must be 1. - solutiongroup : [slntype, slnfname, slnmnames] - * slntype (string) is the type of solution. The Integrated Model - Solution (IMS6) is the only supported option in this version. - * slnfname (string) name of file containing solution input. - * slnmnames (string) is the array of model names to add to this - solution. The number of model names is determined by the number of - model names the user provides on this line. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - models = ListTemplateGenerator(('nam', 'models', 'models')) - exchanges = ListTemplateGenerator(('nam', 'exchanges', 'exchanges')) - solutiongroup = ListTemplateGenerator(('nam', 'solutiongroup', - 'solutiongroup')) - package_abbr = "nam" - _package_type = "nam" - dfn_file_name = "sim-nam.dfn" - - dfn = [["block options", "name continue", "type keyword", - "reader urword", "optional true"], - ["block options", "name nocheck", "type keyword", - "reader urword", "optional true"], - ["block options", "name memory_print_option", "type string", - "reader urword", "optional true"], - ["block timing", "name tdis6", "preserve_case true", - "type string", "reader urword", "optional"], - ["block models", "name models", - "type recarray mtype mfname mname", "reader urword", "optional"], - ["block models", "name mtype", "in_record true", "type string", - "tagged false", "reader urword"], - ["block models", "name mfname", "in_record true", "type string", - "preserve_case true", "tagged false", "reader urword"], - ["block models", "name mname", "in_record true", "type string", - "tagged false", "reader urword"], - ["block exchanges", "name exchanges", - "type recarray exgtype exgfile exgmnamea exgmnameb", - "reader urword", "optional"], - ["block exchanges", "name exgtype", "in_record true", - "type string", "tagged false", "reader urword"], - ["block exchanges", "name exgfile", "in_record true", - "type string", "preserve_case true", "tagged false", - "reader urword"], - ["block exchanges", "name exgmnamea", "in_record true", - "type string", "tagged false", "reader urword"], - ["block exchanges", "name exgmnameb", "in_record true", - "type string", "tagged false", "reader urword"], - ["block solutiongroup", "name group_num", "type integer", - "block_variable True", "in_record true", "tagged false", "shape", - "reader urword"], - ["block solutiongroup", "name mxiter", "type integer", - "reader urword", "optional true"], - ["block solutiongroup", "name solutiongroup", - "type recarray slntype slnfname slnmnames", "reader urword"], - ["block solutiongroup", "name slntype", "type string", - "valid ims6", "in_record true", "tagged false", "reader urword"], - ["block solutiongroup", "name slnfname", "type string", - "preserve_case true", "in_record true", "tagged false", - "reader urword"], - ["block solutiongroup", "name slnmnames", "type string", - "in_record true", "shape (:)", "tagged false", "reader urword"]] - - def __init__(self, simulation, loading_package=False, continue_=None, - nocheck=None, memory_print_option=None, tdis6=None, - models=None, exchanges=None, mxiter=None, solutiongroup=None, - filename=None, pname=None, parent_file=None): - super(ModflowNam, self).__init__(simulation, "nam", filename, pname, - loading_package, parent_file) - - # set up variables - self.continue_ = self.build_mfdata("continue", continue_) - self.nocheck = self.build_mfdata("nocheck", nocheck) - self.memory_print_option = self.build_mfdata("memory_print_option", - memory_print_option) - self.tdis6 = self.build_mfdata("tdis6", tdis6) - self.models = self.build_mfdata("models", models) - self.exchanges = self.build_mfdata("exchanges", exchanges) - self.mxiter = self.build_mfdata("mxiter", mxiter) - self.solutiongroup = self.build_mfdata("solutiongroup", solutiongroup) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ListTemplateGenerator + + +class ModflowNam(mfpackage.MFPackage): + """ + ModflowNam defines a nam package. + + Parameters + ---------- + simulation : MFSimulation + Simulation that this package is a part of. Package is automatically + added to simulation when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + continue_ : boolean + * continue (boolean) keyword flag to indicate that the simulation + should continue even if one or more solutions do not converge. + nocheck : boolean + * nocheck (boolean) keyword flag to indicate that the model input check + routines should not be called prior to each time step. Checks are + performed by default. + memory_print_option : string + * memory_print_option (string) is a flag that controls printing of + detailed memory manager usage to the end of the simulation list file. + NONE means do not print detailed information. SUMMARY means print + only the total memory for each simulation component. ALL means print + information for each variable stored in the memory manager. NONE is + default if MEMORY_PRINT_OPTION is not specified. + tdis6 : string + * tdis6 (string) is the name of the Temporal Discretization (TDIS) + Input File. + models : [mtype, mfname, mname] + * mtype (string) is the type of model to add to simulation. + * mfname (string) is the file name of the model name file. + * mname (string) is the user-assigned name of the model. The model name + cannot exceed 16 characters and must not have blanks within the name. + The model name is case insensitive; any lowercase letters are + converted and stored as upper case letters. + exchanges : [exgtype, exgfile, exgmnamea, exgmnameb] + * exgtype (string) is the exchange type. + * exgfile (string) is the input file for the exchange. + * exgmnamea (string) is the name of the first model that is part of + this exchange. + * exgmnameb (string) is the name of the second model that is part of + this exchange. + mxiter : integer + * mxiter (integer) is the maximum number of outer iterations for this + solution group. The default value is 1. If there is only one solution + in the solution group, then MXITER must be 1. + solutiongroup : [slntype, slnfname, slnmnames] + * slntype (string) is the type of solution. The Integrated Model + Solution (IMS6) is the only supported option in this version. + * slnfname (string) name of file containing solution input. + * slnmnames (string) is the array of model names to add to this + solution. The number of model names is determined by the number of + model names the user provides on this line. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + models = ListTemplateGenerator(('nam', 'models', 'models')) + exchanges = ListTemplateGenerator(('nam', 'exchanges', 'exchanges')) + solutiongroup = ListTemplateGenerator(('nam', 'solutiongroup', + 'solutiongroup')) + package_abbr = "nam" + _package_type = "nam" + dfn_file_name = "sim-nam.dfn" + + dfn = [["block options", "name continue", "type keyword", + "reader urword", "optional true"], + ["block options", "name nocheck", "type keyword", + "reader urword", "optional true"], + ["block options", "name memory_print_option", "type string", + "reader urword", "optional true"], + ["block timing", "name tdis6", "preserve_case true", + "type string", "reader urword", "optional"], + ["block models", "name models", + "type recarray mtype mfname mname", "reader urword", "optional"], + ["block models", "name mtype", "in_record true", "type string", + "tagged false", "reader urword"], + ["block models", "name mfname", "in_record true", "type string", + "preserve_case true", "tagged false", "reader urword"], + ["block models", "name mname", "in_record true", "type string", + "tagged false", "reader urword"], + ["block exchanges", "name exchanges", + "type recarray exgtype exgfile exgmnamea exgmnameb", + "reader urword", "optional"], + ["block exchanges", "name exgtype", "in_record true", + "type string", "tagged false", "reader urword"], + ["block exchanges", "name exgfile", "in_record true", + "type string", "preserve_case true", "tagged false", + "reader urword"], + ["block exchanges", "name exgmnamea", "in_record true", + "type string", "tagged false", "reader urword"], + ["block exchanges", "name exgmnameb", "in_record true", + "type string", "tagged false", "reader urword"], + ["block solutiongroup", "name group_num", "type integer", + "block_variable True", "in_record true", "tagged false", "shape", + "reader urword"], + ["block solutiongroup", "name mxiter", "type integer", + "reader urword", "optional true"], + ["block solutiongroup", "name solutiongroup", + "type recarray slntype slnfname slnmnames", "reader urword"], + ["block solutiongroup", "name slntype", "type string", + "valid ims6", "in_record true", "tagged false", "reader urword"], + ["block solutiongroup", "name slnfname", "type string", + "preserve_case true", "in_record true", "tagged false", + "reader urword"], + ["block solutiongroup", "name slnmnames", "type string", + "in_record true", "shape (:)", "tagged false", "reader urword"]] + + def __init__(self, simulation, loading_package=False, continue_=None, + nocheck=None, memory_print_option=None, tdis6=None, + models=None, exchanges=None, mxiter=None, solutiongroup=None, + filename=None, pname=None, parent_file=None): + super(ModflowNam, self).__init__(simulation, "nam", filename, pname, + loading_package, parent_file) + + # set up variables + self.continue_ = self.build_mfdata("continue", continue_) + self.nocheck = self.build_mfdata("nocheck", nocheck) + self.memory_print_option = self.build_mfdata("memory_print_option", + memory_print_option) + self.tdis6 = self.build_mfdata("tdis6", tdis6) + self.models = self.build_mfdata("models", models) + self.exchanges = self.build_mfdata("exchanges", exchanges) + self.mxiter = self.build_mfdata("mxiter", mxiter) + self.solutiongroup = self.build_mfdata("solutiongroup", solutiongroup) + self._init_complete = True diff --git a/flopy/mf6/modflow/mftdis.py b/flopy/mf6/modflow/mftdis.py index df5e4ef103..7f50fc304b 100644 --- a/flopy/mf6/modflow/mftdis.py +++ b/flopy/mf6/modflow/mftdis.py @@ -1,88 +1,88 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ListTemplateGenerator - - -class ModflowTdis(mfpackage.MFPackage): - """ - ModflowTdis defines a tdis package. - - Parameters - ---------- - simulation : MFSimulation - Simulation that this package is a part of. Package is automatically - added to simulation when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - time_units : string - * time_units (string) is the time units of the simulation. This is a - text string that is used as a label within model output files. Values - for time_units may be "unknown", "seconds", "minutes", "hours", - "days", or "years". The default time unit is "unknown". - start_date_time : string - * start_date_time (string) is the starting date and time of the - simulation. This is a text string that is used as a label within the - simulation list file. The value has no affect on the simulation. The - recommended format for the starting date and time is described at - https://www.w3.org/TR/NOTE-datetime. - nper : integer - * nper (integer) is the number of stress periods for the simulation. - perioddata : [perlen, nstp, tsmult] - * perlen (double) is the length of a stress period. - * nstp (integer) is the number of time steps in a stress period. - * tsmult (double) is the multiplier for the length of successive time - steps. The length of a time step is calculated by multiplying the - length of the previous time step by TSMULT. The length of the first - time step, :math:`\\Delta t_1`, is related to PERLEN, NSTP, and - TSMULT by the relation :math:`\\Delta t_1= perlen \\frac{tsmult - - 1}{tsmult^{nstp}-1}`. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - perioddata = ListTemplateGenerator(('tdis', 'perioddata', - 'perioddata')) - package_abbr = "tdis" - _package_type = "tdis" - dfn_file_name = "sim-tdis.dfn" - - dfn = [["block options", "name time_units", "type string", - "reader urword", "optional true"], - ["block options", "name start_date_time", "type string", - "reader urword", "optional true"], - ["block dimensions", "name nper", "type integer", - "reader urword", "optional false", "default_value 1"], - ["block perioddata", "name perioddata", - "type recarray perlen nstp tsmult", "reader urword", - "optional false", "default_value ((1.0, 1, 1.0),)"], - ["block perioddata", "name perlen", "type double precision", - "in_record true", "tagged false", "reader urword", - "optional false"], - ["block perioddata", "name nstp", "type integer", - "in_record true", "tagged false", "reader urword", - "optional false"], - ["block perioddata", "name tsmult", "type double precision", - "in_record true", "tagged false", "reader urword", - "optional false"]] - - def __init__(self, simulation, loading_package=False, time_units=None, - start_date_time=None, nper=1, perioddata=((1.0, 1, 1.0),), - filename=None, pname=None, parent_file=None): - super(ModflowTdis, self).__init__(simulation, "tdis", filename, pname, - loading_package, parent_file) - - # set up variables - self.time_units = self.build_mfdata("time_units", time_units) - self.start_date_time = self.build_mfdata("start_date_time", - start_date_time) - self.nper = self.build_mfdata("nper", nper) - self.perioddata = self.build_mfdata("perioddata", perioddata) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ListTemplateGenerator + + +class ModflowTdis(mfpackage.MFPackage): + """ + ModflowTdis defines a tdis package. + + Parameters + ---------- + simulation : MFSimulation + Simulation that this package is a part of. Package is automatically + added to simulation when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + time_units : string + * time_units (string) is the time units of the simulation. This is a + text string that is used as a label within model output files. Values + for time_units may be "unknown", "seconds", "minutes", "hours", + "days", or "years". The default time unit is "unknown". + start_date_time : string + * start_date_time (string) is the starting date and time of the + simulation. This is a text string that is used as a label within the + simulation list file. The value has no affect on the simulation. The + recommended format for the starting date and time is described at + https://www.w3.org/TR/NOTE-datetime. + nper : integer + * nper (integer) is the number of stress periods for the simulation. + perioddata : [perlen, nstp, tsmult] + * perlen (double) is the length of a stress period. + * nstp (integer) is the number of time steps in a stress period. + * tsmult (double) is the multiplier for the length of successive time + steps. The length of a time step is calculated by multiplying the + length of the previous time step by TSMULT. The length of the first + time step, :math:`\\Delta t_1`, is related to PERLEN, NSTP, and + TSMULT by the relation :math:`\\Delta t_1= perlen \\frac{tsmult - + 1}{tsmult^{nstp}-1}`. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + perioddata = ListTemplateGenerator(('tdis', 'perioddata', + 'perioddata')) + package_abbr = "tdis" + _package_type = "tdis" + dfn_file_name = "sim-tdis.dfn" + + dfn = [["block options", "name time_units", "type string", + "reader urword", "optional true"], + ["block options", "name start_date_time", "type string", + "reader urword", "optional true"], + ["block dimensions", "name nper", "type integer", + "reader urword", "optional false", "default_value 1"], + ["block perioddata", "name perioddata", + "type recarray perlen nstp tsmult", "reader urword", + "optional false", "default_value ((1.0, 1, 1.0),)"], + ["block perioddata", "name perlen", "type double precision", + "in_record true", "tagged false", "reader urword", + "optional false"], + ["block perioddata", "name nstp", "type integer", + "in_record true", "tagged false", "reader urword", + "optional false"], + ["block perioddata", "name tsmult", "type double precision", + "in_record true", "tagged false", "reader urword", + "optional false"]] + + def __init__(self, simulation, loading_package=False, time_units=None, + start_date_time=None, nper=1, perioddata=((1.0, 1, 1.0),), + filename=None, pname=None, parent_file=None): + super(ModflowTdis, self).__init__(simulation, "tdis", filename, pname, + loading_package, parent_file) + + # set up variables + self.time_units = self.build_mfdata("time_units", time_units) + self.start_date_time = self.build_mfdata("start_date_time", + start_date_time) + self.nper = self.build_mfdata("nper", nper) + self.perioddata = self.build_mfdata("perioddata", perioddata) + self._init_complete = True diff --git a/flopy/mf6/modflow/mfutllaktab.py b/flopy/mf6/modflow/mfutllaktab.py index 9d16690b0e..3643d398c1 100644 --- a/flopy/mf6/modflow/mfutllaktab.py +++ b/flopy/mf6/modflow/mfutllaktab.py @@ -1,79 +1,79 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ListTemplateGenerator - - -class ModflowUtllaktab(mfpackage.MFPackage): - """ - ModflowUtllaktab defines a tab package within a utl model. - - Parameters - ---------- - model : MFModel - Model that this package is a part of. Package is automatically - added to model when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - nrow : integer - * nrow (integer) integer value specifying the number of rows in the - lake table. There must be NROW rows of data in the TABLE block. - ncol : integer - * ncol (integer) integer value specifying the number of columns in the - lake table. There must be NCOL columns of data in the TABLE block. - For lakes with HORIZONTAL and/or VERTICAL CTYPE connections, NCOL - must be equal to 3. For lakes with EMBEDDEDH or EMBEDDEDV CTYPE - connections, NCOL must be equal to 4. - table : [stage, volume, sarea, barea] - * stage (double) real value that defines the stage corresponding to the - remaining data on the line. - * volume (double) real value that defines the lake volume corresponding - to the stage specified on the line. - * sarea (double) real value that defines the lake surface area - corresponding to the stage specified on the line. - * barea (double) real value that defines the lake-GWF exchange area - corresponding to the stage specified on the line. BAREA is only - specified if the CLAKTYPE for the lake is EMBEDDEDH or EMBEDDEDV. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - table = ListTemplateGenerator(('tab', 'table', 'table')) - package_abbr = "utltab" - _package_type = "tab" - dfn_file_name = "utl-lak-tab.dfn" - - dfn = [["block dimensions", "name nrow", "type integer", - "reader urword", "optional false"], - ["block dimensions", "name ncol", "type integer", - "reader urword", "optional false"], - ["block table", "name table", - "type recarray stage volume sarea barea", "shape (nrow)", - "reader urword"], - ["block table", "name stage", "type double precision", "shape", - "tagged false", "in_record true", "reader urword"], - ["block table", "name volume", "type double precision", "shape", - "tagged false", "in_record true", "reader urword"], - ["block table", "name sarea", "type double precision", "shape", - "tagged false", "in_record true", "reader urword"], - ["block table", "name barea", "type double precision", "shape", - "tagged false", "in_record true", "reader urword", - "optional true"]] - - def __init__(self, model, loading_package=False, nrow=None, ncol=None, - table=None, filename=None, pname=None, parent_file=None): - super(ModflowUtllaktab, self).__init__(model, "tab", filename, pname, - loading_package, parent_file) - - # set up variables - self.nrow = self.build_mfdata("nrow", nrow) - self.ncol = self.build_mfdata("ncol", ncol) - self.table = self.build_mfdata("table", table) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ListTemplateGenerator + + +class ModflowUtllaktab(mfpackage.MFPackage): + """ + ModflowUtllaktab defines a tab package within a utl model. + + Parameters + ---------- + model : MFModel + Model that this package is a part of. Package is automatically + added to model when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + nrow : integer + * nrow (integer) integer value specifying the number of rows in the + lake table. There must be NROW rows of data in the TABLE block. + ncol : integer + * ncol (integer) integer value specifying the number of columns in the + lake table. There must be NCOL columns of data in the TABLE block. + For lakes with HORIZONTAL and/or VERTICAL CTYPE connections, NCOL + must be equal to 3. For lakes with EMBEDDEDH or EMBEDDEDV CTYPE + connections, NCOL must be equal to 4. + table : [stage, volume, sarea, barea] + * stage (double) real value that defines the stage corresponding to the + remaining data on the line. + * volume (double) real value that defines the lake volume corresponding + to the stage specified on the line. + * sarea (double) real value that defines the lake surface area + corresponding to the stage specified on the line. + * barea (double) real value that defines the lake-GWF exchange area + corresponding to the stage specified on the line. BAREA is only + specified if the CLAKTYPE for the lake is EMBEDDEDH or EMBEDDEDV. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + table = ListTemplateGenerator(('tab', 'table', 'table')) + package_abbr = "utltab" + _package_type = "tab" + dfn_file_name = "utl-lak-tab.dfn" + + dfn = [["block dimensions", "name nrow", "type integer", + "reader urword", "optional false"], + ["block dimensions", "name ncol", "type integer", + "reader urword", "optional false"], + ["block table", "name table", + "type recarray stage volume sarea barea", "shape (nrow)", + "reader urword"], + ["block table", "name stage", "type double precision", "shape", + "tagged false", "in_record true", "reader urword"], + ["block table", "name volume", "type double precision", "shape", + "tagged false", "in_record true", "reader urword"], + ["block table", "name sarea", "type double precision", "shape", + "tagged false", "in_record true", "reader urword"], + ["block table", "name barea", "type double precision", "shape", + "tagged false", "in_record true", "reader urword", + "optional true"]] + + def __init__(self, model, loading_package=False, nrow=None, ncol=None, + table=None, filename=None, pname=None, parent_file=None): + super(ModflowUtllaktab, self).__init__(model, "tab", filename, pname, + loading_package, parent_file) + + # set up variables + self.nrow = self.build_mfdata("nrow", nrow) + self.ncol = self.build_mfdata("ncol", ncol) + self.table = self.build_mfdata("table", table) + self._init_complete = True diff --git a/flopy/mf6/modflow/mfutlobs.py b/flopy/mf6/modflow/mfutlobs.py index 5471d1280a..b98a8134e0 100644 --- a/flopy/mf6/modflow/mfutlobs.py +++ b/flopy/mf6/modflow/mfutlobs.py @@ -1,129 +1,129 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ListTemplateGenerator - - -class ModflowUtlobs(mfpackage.MFPackage): - """ - ModflowUtlobs defines a obs package within a utl model. - - Parameters - ---------- - model : MFModel - Model that this package is a part of. Package is automatically - added to model when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - digits : integer - * digits (integer) Keyword and an integer digits specifier used for - conversion of simulated values to text on output. The default is 5 - digits. When simulated values are written to a file specified as file - type DATA in the Name File, the digits specifier controls the number - of significant digits with which simulated values are written to the - output file. The digits specifier has no effect on the number of - significant digits with which the simulation time is written for - continuous observations. - print_input : boolean - * print_input (boolean) keyword to indicate that the list of - observation information will be written to the listing file - immediately after it is read. - continuous : [obsname, obstype, id, id2] - * obsname (string) string of 1 to 40 nonblank characters used to - identify the observation. The identifier need not be unique; however, - identification and post-processing of observations in the output - files are facilitated if each observation is given a unique name. - * obstype (string) a string of characters used to identify the - observation type. - * id (string) Text identifying cell where observation is located. For - packages other than NPF, if boundary names are defined in the - corresponding package input file, ID can be a boundary name. - Otherwise ID is a cellid. If the model discretization is type DIS, - cellid is three integers (layer, row, column). If the discretization - is DISV, cellid is two integers (layer, cell number). If the - discretization is DISU, cellid is one integer (node number). - * id2 (string) Text identifying cell adjacent to cell identified by ID. - The form of ID2 is as described for ID. ID2 is used for intercell- - flow observations of a GWF model, for three observation types of the - LAK Package, for two observation types of the MAW Package, and one - observation type of the UZF Package. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - continuous = ListTemplateGenerator(('obs', 'continuous', - 'continuous')) - package_abbr = "utlobs" - _package_type = "obs" - dfn_file_name = "utl-obs.dfn" - - dfn = [["block options", "name digits", "type integer", "shape", - "reader urword", "optional true"], - ["block options", "name print_input", "type keyword", - "reader urword", "optional true"], - ["block continuous", "name output", - "type record fileout obs_output_file_name binary", "shape", - "block_variable true", "in_record false", "reader urword", - "optional false"], - ["block continuous", "name fileout", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block continuous", "name obs_output_file_name", "type string", - "preserve_case true", "in_record true", "shape", "tagged false", - "reader urword"], - ["block continuous", "name binary", "type keyword", - "in_record true", "shape", "reader urword", "optional true"], - ["block continuous", "name continuous", - "type recarray obsname obstype id id2", "shape", "reader urword", - "optional false"], - ["block continuous", "name obsname", "type string", "shape", - "tagged false", "in_record true", "reader urword"], - ["block continuous", "name obstype", "type string", "shape", - "tagged false", "in_record true", "reader urword"], - ["block continuous", "name id", "type string", "shape", - "tagged false", "in_record true", "reader urword", - "numeric_index true"], - ["block continuous", "name id2", "type string", "shape", - "tagged false", "in_record true", "reader urword", - "optional true", "numeric_index true"]] - - def __init__(self, model, loading_package=False, digits=None, - print_input=None, continuous=None, filename=None, pname=None, - parent_file=None): - super(ModflowUtlobs, self).__init__(model, "obs", filename, pname, - loading_package, parent_file) - - # set up variables - self.digits = self.build_mfdata("digits", digits) - self.print_input = self.build_mfdata("print_input", print_input) - self.continuous = self.build_mfdata("continuous", continuous) - self._init_complete = True - - -class UtlobsPackages(mfpackage.MFChildPackages): - """ - UtlobsPackages is a container class for the ModflowUtlobs class. - - Methods - ---------- - initialize - Initializes a new ModflowUtlobs package removing any sibling child - packages attached to the same parent package. See ModflowUtlobs init - documentation for definition of parameters. - """ - package_abbr = "utlobspackages" - - def initialize(self, digits=None, print_input=None, continuous=None, - filename=None, pname=None): - new_package = ModflowUtlobs(self._model, digits=digits, - print_input=print_input, - continuous=continuous, filename=filename, - pname=pname, parent_file=self._cpparent) - self._init_package(new_package, filename) +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ListTemplateGenerator + + +class ModflowUtlobs(mfpackage.MFPackage): + """ + ModflowUtlobs defines a obs package within a utl model. + + Parameters + ---------- + model : MFModel + Model that this package is a part of. Package is automatically + added to model when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + digits : integer + * digits (integer) Keyword and an integer digits specifier used for + conversion of simulated values to text on output. The default is 5 + digits. When simulated values are written to a file specified as file + type DATA in the Name File, the digits specifier controls the number + of significant digits with which simulated values are written to the + output file. The digits specifier has no effect on the number of + significant digits with which the simulation time is written for + continuous observations. + print_input : boolean + * print_input (boolean) keyword to indicate that the list of + observation information will be written to the listing file + immediately after it is read. + continuous : [obsname, obstype, id, id2] + * obsname (string) string of 1 to 40 nonblank characters used to + identify the observation. The identifier need not be unique; however, + identification and post-processing of observations in the output + files are facilitated if each observation is given a unique name. + * obstype (string) a string of characters used to identify the + observation type. + * id (string) Text identifying cell where observation is located. For + packages other than NPF, if boundary names are defined in the + corresponding package input file, ID can be a boundary name. + Otherwise ID is a cellid. If the model discretization is type DIS, + cellid is three integers (layer, row, column). If the discretization + is DISV, cellid is two integers (layer, cell number). If the + discretization is DISU, cellid is one integer (node number). + * id2 (string) Text identifying cell adjacent to cell identified by ID. + The form of ID2 is as described for ID. ID2 is used for intercell- + flow observations of a GWF model, for three observation types of the + LAK Package, for two observation types of the MAW Package, and one + observation type of the UZF Package. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + continuous = ListTemplateGenerator(('obs', 'continuous', + 'continuous')) + package_abbr = "utlobs" + _package_type = "obs" + dfn_file_name = "utl-obs.dfn" + + dfn = [["block options", "name digits", "type integer", "shape", + "reader urword", "optional true"], + ["block options", "name print_input", "type keyword", + "reader urword", "optional true"], + ["block continuous", "name output", + "type record fileout obs_output_file_name binary", "shape", + "block_variable true", "in_record false", "reader urword", + "optional false"], + ["block continuous", "name fileout", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block continuous", "name obs_output_file_name", "type string", + "preserve_case true", "in_record true", "shape", "tagged false", + "reader urword"], + ["block continuous", "name binary", "type keyword", + "in_record true", "shape", "reader urword", "optional true"], + ["block continuous", "name continuous", + "type recarray obsname obstype id id2", "shape", "reader urword", + "optional false"], + ["block continuous", "name obsname", "type string", "shape", + "tagged false", "in_record true", "reader urword"], + ["block continuous", "name obstype", "type string", "shape", + "tagged false", "in_record true", "reader urword"], + ["block continuous", "name id", "type string", "shape", + "tagged false", "in_record true", "reader urword", + "numeric_index true"], + ["block continuous", "name id2", "type string", "shape", + "tagged false", "in_record true", "reader urword", + "optional true", "numeric_index true"]] + + def __init__(self, model, loading_package=False, digits=None, + print_input=None, continuous=None, filename=None, pname=None, + parent_file=None): + super(ModflowUtlobs, self).__init__(model, "obs", filename, pname, + loading_package, parent_file) + + # set up variables + self.digits = self.build_mfdata("digits", digits) + self.print_input = self.build_mfdata("print_input", print_input) + self.continuous = self.build_mfdata("continuous", continuous) + self._init_complete = True + + +class UtlobsPackages(mfpackage.MFChildPackages): + """ + UtlobsPackages is a container class for the ModflowUtlobs class. + + Methods + ---------- + initialize + Initializes a new ModflowUtlobs package removing any sibling child + packages attached to the same parent package. See ModflowUtlobs init + documentation for definition of parameters. + """ + package_abbr = "utlobspackages" + + def initialize(self, digits=None, print_input=None, continuous=None, + filename=None, pname=None): + new_package = ModflowUtlobs(self._model, digits=digits, + print_input=print_input, + continuous=continuous, filename=filename, + pname=pname, parent_file=self._cpparent) + self._init_package(new_package, filename) diff --git a/flopy/mf6/modflow/mfutltas.py b/flopy/mf6/modflow/mfutltas.py index 91d1c6084c..eb93deb1fa 100644 --- a/flopy/mf6/modflow/mfutltas.py +++ b/flopy/mf6/modflow/mfutltas.py @@ -1,142 +1,142 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ListTemplateGenerator, ArrayTemplateGenerator - - -class ModflowUtltas(mfpackage.MFPackage): - """ - ModflowUtltas defines a tas package within a utl model. - - Parameters - ---------- - model : MFModel - Model that this package is a part of. Package is automatically - added to model when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - time_series_namerecord : [time_series_name] - * time_series_name (string) Name by which a package references a - particular time-array series. The name must be unique among all time- - array series used in a package. - interpolation_methodrecord : [interpolation_method] - * interpolation_method (string) Interpolation method, which is either - STEPWISE or LINEAR. - sfacrecord : [sfacval] - * sfacval (double) Scale factor, which will multiply all array values - in time series. SFAC is an optional attribute; if omitted, SFAC = - 1.0. - tas_array : [double] - * tas_array (double) An array of numeric, floating-point values, or a - constant value, readable by the U2DREL array-reading utility. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - time_series_namerecord = ListTemplateGenerator(('tas', 'attributes', - 'time_series_namerecord')) - interpolation_methodrecord = ListTemplateGenerator(( - 'tas', 'attributes', 'interpolation_methodrecord')) - sfacrecord = ListTemplateGenerator(('tas', 'attributes', - 'sfacrecord')) - tas_array = ArrayTemplateGenerator(('tas', 'time', 'tas_array')) - package_abbr = "utltas" - _package_type = "tas" - dfn_file_name = "utl-tas.dfn" - - dfn = [["block attributes", "name time_series_namerecord", - "type record name time_series_name", "shape", "reader urword", - "tagged false", "optional false"], - ["block attributes", "name name", "type keyword", "shape", - "reader urword", "optional false"], - ["block attributes", "name time_series_name", "type string", - "shape any1d", "tagged false", "reader urword", "optional false"], - ["block attributes", "name interpolation_methodrecord", - "type record method interpolation_method", "shape", - "reader urword", "tagged false", "optional true"], - ["block attributes", "name method", "type keyword", "shape", - "reader urword", "optional false"], - ["block attributes", "name interpolation_method", "type string", - "valid stepwise linear linearend", "shape", "tagged false", - "reader urword", "optional false"], - ["block attributes", "name sfacrecord", - "type record sfac sfacval", "shape", "reader urword", - "tagged true", "optional true"], - ["block attributes", "name sfac", "type keyword", "shape", - "reader urword", "optional false"], - ["block attributes", "name sfacval", "type double precision", - "shape time_series_name", "tagged false", "reader urword", - "optional false"], - ["block time", "name time_from_model_start", - "type double precision", "block_variable True", "in_record true", - "shape", "tagged false", "valid", "reader urword", - "optional false"], - ["block time", "name tas_array", "type double precision", - "tagged false", "just_data true", "shape (unknown)", - "reader readarray", "optional false", "repeating true"]] - - def __init__(self, model, loading_package=False, - time_series_namerecord=None, interpolation_methodrecord=None, - sfacrecord=None, tas_array=None, filename=None, pname=None, - parent_file=None): - super(ModflowUtltas, self).__init__(model, "tas", filename, pname, - loading_package, parent_file) - - # set up variables - self.time_series_namerecord = self.build_mfdata( - "time_series_namerecord", time_series_namerecord) - self.interpolation_methodrecord = self.build_mfdata( - "interpolation_methodrecord", interpolation_methodrecord) - self.sfacrecord = self.build_mfdata("sfacrecord", sfacrecord) - self.tas_array = self.build_mfdata("tas_array", tas_array) - self._init_complete = True - - -class UtltasPackages(mfpackage.MFChildPackages): - """ - UtltasPackages is a container class for the ModflowUtltas class. - - Methods - ---------- - initialize - Initializes a new ModflowUtltas package removing any sibling child - packages attached to the same parent package. See ModflowUtltas init - documentation for definition of parameters. - append_package - Adds a new ModflowUtltas package to the container. See ModflowUtltas - init documentation for definition of parameters. - """ - package_abbr = "utltaspackages" - - def initialize(self, time_series_namerecord=None, - interpolation_methodrecord=None, sfacrecord=None, - tas_array=None, filename=None, pname=None): - new_package = ModflowUtltas(self._model, - time_series_namerecord= - time_series_namerecord, - interpolation_methodrecord= - interpolation_methodrecord, - sfacrecord=sfacrecord, tas_array=tas_array, - filename=filename, pname=pname, - parent_file=self._cpparent) - self._init_package(new_package, filename) - - def append_package(self, time_series_namerecord=None, - interpolation_methodrecord=None, sfacrecord=None, - tas_array=None, filename=None, pname=None): - new_package = ModflowUtltas(self._model, - time_series_namerecord= - time_series_namerecord, - interpolation_methodrecord= - interpolation_methodrecord, - sfacrecord=sfacrecord, tas_array=tas_array, - filename=filename, pname=pname, - parent_file=self._cpparent) - self._append_package(new_package, filename) +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ListTemplateGenerator, ArrayTemplateGenerator + + +class ModflowUtltas(mfpackage.MFPackage): + """ + ModflowUtltas defines a tas package within a utl model. + + Parameters + ---------- + model : MFModel + Model that this package is a part of. Package is automatically + added to model when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + time_series_namerecord : [time_series_name] + * time_series_name (string) Name by which a package references a + particular time-array series. The name must be unique among all time- + array series used in a package. + interpolation_methodrecord : [interpolation_method] + * interpolation_method (string) Interpolation method, which is either + STEPWISE or LINEAR. + sfacrecord : [sfacval] + * sfacval (double) Scale factor, which will multiply all array values + in time series. SFAC is an optional attribute; if omitted, SFAC = + 1.0. + tas_array : [double] + * tas_array (double) An array of numeric, floating-point values, or a + constant value, readable by the U2DREL array-reading utility. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + time_series_namerecord = ListTemplateGenerator(('tas', 'attributes', + 'time_series_namerecord')) + interpolation_methodrecord = ListTemplateGenerator(( + 'tas', 'attributes', 'interpolation_methodrecord')) + sfacrecord = ListTemplateGenerator(('tas', 'attributes', + 'sfacrecord')) + tas_array = ArrayTemplateGenerator(('tas', 'time', 'tas_array')) + package_abbr = "utltas" + _package_type = "tas" + dfn_file_name = "utl-tas.dfn" + + dfn = [["block attributes", "name time_series_namerecord", + "type record name time_series_name", "shape", "reader urword", + "tagged false", "optional false"], + ["block attributes", "name name", "type keyword", "shape", + "reader urword", "optional false"], + ["block attributes", "name time_series_name", "type string", + "shape any1d", "tagged false", "reader urword", "optional false"], + ["block attributes", "name interpolation_methodrecord", + "type record method interpolation_method", "shape", + "reader urword", "tagged false", "optional true"], + ["block attributes", "name method", "type keyword", "shape", + "reader urword", "optional false"], + ["block attributes", "name interpolation_method", "type string", + "valid stepwise linear linearend", "shape", "tagged false", + "reader urword", "optional false"], + ["block attributes", "name sfacrecord", + "type record sfac sfacval", "shape", "reader urword", + "tagged true", "optional true"], + ["block attributes", "name sfac", "type keyword", "shape", + "reader urword", "optional false"], + ["block attributes", "name sfacval", "type double precision", + "shape time_series_name", "tagged false", "reader urword", + "optional false"], + ["block time", "name time_from_model_start", + "type double precision", "block_variable True", "in_record true", + "shape", "tagged false", "valid", "reader urword", + "optional false"], + ["block time", "name tas_array", "type double precision", + "tagged false", "just_data true", "shape (unknown)", + "reader readarray", "optional false", "repeating true"]] + + def __init__(self, model, loading_package=False, + time_series_namerecord=None, interpolation_methodrecord=None, + sfacrecord=None, tas_array=None, filename=None, pname=None, + parent_file=None): + super(ModflowUtltas, self).__init__(model, "tas", filename, pname, + loading_package, parent_file) + + # set up variables + self.time_series_namerecord = self.build_mfdata( + "time_series_namerecord", time_series_namerecord) + self.interpolation_methodrecord = self.build_mfdata( + "interpolation_methodrecord", interpolation_methodrecord) + self.sfacrecord = self.build_mfdata("sfacrecord", sfacrecord) + self.tas_array = self.build_mfdata("tas_array", tas_array) + self._init_complete = True + + +class UtltasPackages(mfpackage.MFChildPackages): + """ + UtltasPackages is a container class for the ModflowUtltas class. + + Methods + ---------- + initialize + Initializes a new ModflowUtltas package removing any sibling child + packages attached to the same parent package. See ModflowUtltas init + documentation for definition of parameters. + append_package + Adds a new ModflowUtltas package to the container. See ModflowUtltas + init documentation for definition of parameters. + """ + package_abbr = "utltaspackages" + + def initialize(self, time_series_namerecord=None, + interpolation_methodrecord=None, sfacrecord=None, + tas_array=None, filename=None, pname=None): + new_package = ModflowUtltas(self._model, + time_series_namerecord= + time_series_namerecord, + interpolation_methodrecord= + interpolation_methodrecord, + sfacrecord=sfacrecord, tas_array=tas_array, + filename=filename, pname=pname, + parent_file=self._cpparent) + self._init_package(new_package, filename) + + def append_package(self, time_series_namerecord=None, + interpolation_methodrecord=None, sfacrecord=None, + tas_array=None, filename=None, pname=None): + new_package = ModflowUtltas(self._model, + time_series_namerecord= + time_series_namerecord, + interpolation_methodrecord= + interpolation_methodrecord, + sfacrecord=sfacrecord, tas_array=tas_array, + filename=filename, pname=pname, + parent_file=self._cpparent) + self._append_package(new_package, filename) diff --git a/flopy/mf6/modflow/mfutlts.py b/flopy/mf6/modflow/mfutlts.py index 484ae6bd4d..f4658db3a9 100644 --- a/flopy/mf6/modflow/mfutlts.py +++ b/flopy/mf6/modflow/mfutlts.py @@ -1,186 +1,186 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ListTemplateGenerator - - -class ModflowUtlts(mfpackage.MFPackage): - """ - ModflowUtlts defines a ts package within a utl model. - - Parameters - ---------- - model : MFModel - Model that this package is a part of. Package is automatically - added to model when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - time_series_namerecord : [time_series_names] - * time_series_names (string) Name by which a package references a - particular time-array series. The name must be unique among all time- - array series used in a package. - interpolation_methodrecord : [interpolation_method] - * interpolation_method (string) Interpolation method, which is either - STEPWISE or LINEAR. - interpolation_methodrecord_single : [interpolation_method_single] - * interpolation_method_single (string) Interpolation method, which is - either STEPWISE or LINEAR. - sfacrecord : [sfacval] - * sfacval (double) Scale factor, which will multiply all array values - in time series. SFAC is an optional attribute; if omitted, SFAC = - 1.0. - sfacrecord_single : [sfacval] - * sfacval (double) Scale factor, which will multiply all array values - in time series. SFAC is an optional attribute; if omitted, SFAC = - 1.0. - timeseries : [ts_time, ts_array] - * ts_time (double) A numeric time relative to the start of the - simulation, in the time unit used in the simulation. Times must be - strictly increasing. - * ts_array (double) A 2-D array of numeric, floating-point values, or a - constant value, readable by the U2DREL array-reading utility. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - time_series_namerecord = ListTemplateGenerator(('ts', 'attributes', - 'time_series_namerecord')) - interpolation_methodrecord = ListTemplateGenerator(( - 'ts', 'attributes', 'interpolation_methodrecord')) - interpolation_methodrecord_single = ListTemplateGenerator(( - 'ts', 'attributes', 'interpolation_methodrecord_single')) - sfacrecord = ListTemplateGenerator(('ts', 'attributes', 'sfacrecord')) - sfacrecord_single = ListTemplateGenerator(('ts', 'attributes', - 'sfacrecord_single')) - timeseries = ListTemplateGenerator(('ts', 'timeseries', 'timeseries')) - package_abbr = "utlts" - _package_type = "ts" - dfn_file_name = "utl-ts.dfn" - - dfn = [["block attributes", "name time_series_namerecord", - "type record names time_series_names", "shape", "reader urword", - "tagged false", "optional false"], - ["block attributes", "name names", "other_names name", - "type keyword", "shape", "reader urword", "optional false"], - ["block attributes", "name time_series_names", "type string", - "shape any1d", "tagged false", "reader urword", "optional false"], - ["block attributes", "name interpolation_methodrecord", - "type record methods interpolation_method", "shape", - "reader urword", "tagged false", "optional true"], - ["block attributes", "name methods", "type keyword", "shape", - "reader urword", "optional false"], - ["block attributes", "name interpolation_method", "type string", - "valid stepwise linear linearend", "shape time_series_names", - "tagged false", "reader urword", "optional false"], - ["block attributes", "name interpolation_methodrecord_single", - "type record method interpolation_method_single", "shape", - "reader urword", "tagged false", "optional true"], - ["block attributes", "name method", "type keyword", "shape", - "reader urword", "optional false"], - ["block attributes", "name interpolation_method_single", - "type string", "valid stepwise linear linearend", "shape", - "tagged false", "reader urword", "optional false"], - ["block attributes", "name sfacrecord", - "type record sfacs sfacval", "shape", "reader urword", - "tagged true", "optional true"], - ["block attributes", "name sfacs", "type keyword", "shape", - "reader urword", "optional false"], - ["block attributes", "name sfacval", "type double precision", - "shape Date: Mon, 1 Jul 2019 14:22:24 -0700 Subject: [PATCH 3/9] fix(disu arrays): Added more testing for disu arrays --- autotest/t504_test.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/autotest/t504_test.py b/autotest/t504_test.py index 5b25c7334a..d8411cead6 100644 --- a/autotest/t504_test.py +++ b/autotest/t504_test.py @@ -318,6 +318,16 @@ def test006_gwf3(): # load simulation sim = MFSimulation.load(model_name, 'mf6', exe_name, pth) + model = sim.get_model() + disu = model.get_package('disu') + # test switching disu array to internal array + disu.ja = disu.ja.array + # test writing hwva and cl12 arrays out to different locations + disu.hwva = {'filename': 'flow.disu.hwva_new.dat', 'factor': 1.0, + 'data': disu.hwva.array} + disu.cl12 = {'filename': 'flow.disu.cl12_new.dat', 'factor': 1.0, + 'data': disu.cl12.array} + # make temp folder to save simulation sim.simulation_data.mfpath.set_sim_path(run_folder) # write simulation to new location @@ -858,12 +868,12 @@ def test027_timeseriestest(): if __name__ == '__main__': + test006_gwf3() test001a_tharmonic() test001e_uzf_3lay() test003_gwfs_disv() test005_advgw_tidal() test006_2models_mvr() - test006_gwf3() test027_timeseriestest() test036_twrihfb() test045_lake1ss_table() From 0ece5500e4969fbf429c07773c87baf97995e2e4 Mon Sep 17 00:00:00 2001 From: spaulins-usgs Date: Tue, 2 Jul 2019 13:27:19 -0700 Subject: [PATCH 4/9] Fix(flopy write): Copy external files before writing out package files. Package file writing can require access to external files. --- flopy/mf6/modflow/mfsimulation.py | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/flopy/mf6/modflow/mfsimulation.py b/flopy/mf6/modflow/mfsimulation.py index 10eb7b1578..62ecaeb64c 100644 --- a/flopy/mf6/modflow/mfsimulation.py +++ b/flopy/mf6/modflow/mfsimulation.py @@ -886,6 +886,20 @@ def write_simulation(self, 'writing. File will not be ' 'written.'.format(mvr_file)) + if ext_file_action == ExtFileAction.copy_relative_paths: + # move external files with relative paths + num_files_copied = self.simulation_data.mfpath.copy_files() + elif ext_file_action == ExtFileAction.copy_all: + # move all external files + num_files_copied = self.simulation_data.mfpath.copy_files( + copy_relative_only=False) + else: + num_files_copied = 0 + if self.simulation_data.verbosity_level.value >= \ + VerbosityLevel.verbose.value and num_files_copied > 0: + print('INFORMATION: {} external files copied'.format( + num_files_copied)) + # write other packages for pp in self._other_files.values(): if self.simulation_data.verbosity_level.value >= \ @@ -902,19 +916,6 @@ def write_simulation(self, print(' writing model {}...'.format(model.name)) model.write(ext_file_action=ext_file_action) - if ext_file_action == ExtFileAction.copy_relative_paths: - # move external files with relative paths - num_files_copied = self.simulation_data.mfpath.copy_files() - elif ext_file_action == ExtFileAction.copy_all: - # move all external files - num_files_copied = self.simulation_data.mfpath.copy_files( - copy_relative_only=False) - else: - num_files_copied = 0 - if self.simulation_data.verbosity_level.value >= \ - VerbosityLevel.verbose.value and num_files_copied > 0: - print('INFORMATION: {} external files copied'.format( - num_files_copied)) self.simulation_data.mfpath.set_last_accessed_path() if silent: From d7c4f7d2f5c7f2dac7711675ba4c0eb1756f6bc2 Mon Sep 17 00:00:00 2001 From: spaulins-usgs Date: Mon, 8 Jul 2019 14:09:44 -0700 Subject: [PATCH 5/9] fix(np types): Changed code from using np.int to explicitly defining integer type np.int32. --- flopy/mf6/coordinates/modelgrid.py | 26 +++++++++++++------------- flopy/mf6/data/mfdatalist.py | 2 +- flopy/mf6/data/mfdatascalar.py | 10 +++++----- flopy/mf6/data/mfdatastorage.py | 7 +++++-- flopy/mf6/data/mfdatautil.py | 2 +- flopy/mf6/data/mffileaccess.py | 7 ++----- flopy/mf6/data/mfstructure.py | 4 ++-- flopy/mf6/mfpackage.py | 1 + 8 files changed, 30 insertions(+), 29 deletions(-) diff --git a/flopy/mf6/coordinates/modelgrid.py b/flopy/mf6/coordinates/modelgrid.py index 3e15dc4e0f..76840f2530 100644 --- a/flopy/mf6/coordinates/modelgrid.py +++ b/flopy/mf6/coordinates/modelgrid.py @@ -433,7 +433,7 @@ def grid_type_consistent(self): def get_connections_array(self): if self.grid_type() == DiscretizationType.DISU: - return np.arange(1, self.num_connections() + 1, 1, np.int) + return np.arange(1, self.num_connections() + 1, 1, np.int32) else: except_str = 'ERROR: Can not get connections arrays for model ' \ '"{}" Only DISU (unstructured) grids ' \ @@ -443,10 +443,10 @@ def get_connections_array(self): def get_horizontal_cross_section_dim_arrays(self): if self.grid_type() == DiscretizationType.DIS: - return [np.arange(1, self.num_rows() + 1, 1, np.int), - np.arange(1, self.num_columns() + 1, 1, np.int)] + return [np.arange(1, self.num_rows() + 1, 1, np.int32), + np.arange(1, self.num_columns() + 1, 1, np.int32)] elif self.grid_type() == DiscretizationType.DISV: - return [np.arange(1, self.num_cells_per_layer() + 1, 1, np.int)] + return [np.arange(1, self.num_cells_per_layer() + 1, 1, np.int32)] elif self.grid_type() == DiscretizationType.DISU: except_str = 'ERROR: Can not get horizontal plane arrays for ' \ 'model "{}" DISU grid. DISU grids do not support ' \ @@ -464,23 +464,23 @@ def get_model_dim(self): def get_model_dim_arrays(self): if self.grid_type() == DiscretizationType.DIS: - return [np.arange(1, self.num_layers() + 1, 1, np.int), - np.arange(1, self.num_rows() + 1, 1, np.int), - np.arange(1, self.num_columns() + 1, 1, np.int)] + return [np.arange(1, self.num_layers() + 1, 1, np.int32), + np.arange(1, self.num_rows() + 1, 1, np.int32), + np.arange(1, self.num_columns() + 1, 1, np.int32)] elif self.grid_type() == DiscretizationType.DISV: - return [np.arange(1, self.num_layers() + 1, 1, np.int), - np.arange(1, self.num_cells_per_layer() + 1, 1, np.int)] + return [np.arange(1, self.num_layers() + 1, 1, np.int32), + np.arange(1, self.num_cells_per_layer() + 1, 1, np.int32)] elif self.grid_type() == DiscretizationType.DISU: - return [np.arange(1, self.num_cells() + 1, 1, np.int)] + return [np.arange(1, self.num_cells() + 1, 1, np.int32)] def get_row_array(self): - return np.arange(1, self.num_rows() + 1, 1, np.int) + return np.arange(1, self.num_rows() + 1, 1, np.int32) def get_column_array(self): - return np.arange(1, self.num_columns() + 1, 1, np.int) + return np.arange(1, self.num_columns() + 1, 1, np.int32) def get_layer_array(self): - return np.arange(1, self.num_layers() + 1, 1, np.int) + return np.arange(1, self.num_layers() + 1, 1, np.int32) def get_horizontal_cross_section_dim_names(self): if self.grid_type() == DiscretizationType.DIS: diff --git a/flopy/mf6/data/mfdatalist.py b/flopy/mf6/data/mfdatalist.py index ed11ba3b56..3841d77d67 100644 --- a/flopy/mf6/data/mfdatalist.py +++ b/flopy/mf6/data/mfdatalist.py @@ -178,7 +178,7 @@ def to_array(self, kper=0, mask=False): raise Exception("MfList: something bad happened") for name, arr in arrays.items(): - cnt = np.zeros(shape, dtype=np.float) + cnt = np.zeros(shape, dtype=np.float64) #print(name,kper) for sp_rec in sarr: if sp_rec is not None: diff --git a/flopy/mf6/data/mfdatascalar.py b/flopy/mf6/data/mfdatascalar.py index 310c9e5409..e493f17fe2 100644 --- a/flopy/mf6/data/mfdatascalar.py +++ b/flopy/mf6/data/mfdatascalar.py @@ -80,17 +80,17 @@ def plotable(self): @property def dtype(self): if self.structure.type == DatumType.double_precision: - return np.float32 + return np.float64 elif self.structure.type == DatumType.integer: - return np.int + return np.int32 elif self.structure.type == DatumType.recarray or \ self.structure.type == DatumType.record or \ self.structure.type == DatumType.repeating_record: for data_item_struct in self.structure.data_item_structures: if data_item_struct.type == DatumType.double_precision: - return np.float32 + return np.float64 elif data_item_struct.type == DatumType.integer: - return np.int + return np.int32 return None def has_data(self): @@ -169,7 +169,7 @@ def set_data(self, data): def add_one(self): datum_type = self.structure.get_datum_type() - if datum_type == int or datum_type == np.int: + if datum_type == int or datum_type == np.int32: if self._get_storage_obj().get_data() is None: try: self._get_storage_obj().set_data(1) diff --git a/flopy/mf6/data/mfdatastorage.py b/flopy/mf6/data/mfdatastorage.py index df7cff52e0..cdbf1d0388 100644 --- a/flopy/mf6/data/mfdatastorage.py +++ b/flopy/mf6/data/mfdatastorage.py @@ -1092,11 +1092,12 @@ def store_external(self, file_path, layer=None, multiplier=None, self.data_dimensions.structure, self.data_dimensions, self._simulation_data, self._data_path, self._stress_period) + str_layered = self.data_dimensions.structure.layered file_access.write_binary_file( data, fp, text, self._model_or_sim.modeldiscrit, self._model_or_sim.modeltime, stress_period=self._stress_period, precision='double', - write_multi_layer=(layer is None and self.layered)) + write_multi_layer=(layer is None and str_layered)) else: file_access = MFFileAccessArray( self.data_dimensions.structure, self.data_dimensions, @@ -1675,7 +1676,9 @@ def _fill_const_layer(self, layer): if data_dimensions[0] < 0: return ls.data_const_value else: - return np.full(data_dimensions, ls.data_const_value[0]) + data_type = self.data_dimensions.structure. \ + get_datum_type(numpy_type=True) + return np.full(data_dimensions, ls.data_const_value[0], data_type) def _is_type(self, data_item, data_type): if data_type == DatumType.string or data_type == DatumType.keyword: diff --git a/flopy/mf6/data/mfdatautil.py b/flopy/mf6/data/mfdatautil.py index f6ac3435dd..571b4f737e 100644 --- a/flopy/mf6/data/mfdatautil.py +++ b/flopy/mf6/data/mfdatautil.py @@ -528,7 +528,7 @@ def _build_layer(self, data_type, data_storage_type, default_value, data_type) elif data_storage_type == DataStorageType.internal_constant: if default_value is None: - if data_type == np.int: + if data_type == np.int32: data = 0 else: data = 0.0 diff --git a/flopy/mf6/data/mffileaccess.py b/flopy/mf6/data/mffileaccess.py index 132da10492..1aca8008c7 100644 --- a/flopy/mf6/data/mffileaccess.py +++ b/flopy/mf6/data/mffileaccess.py @@ -734,10 +734,7 @@ def _build_data_array(self, data, modelgrid, precision): return np.array(data_list, dtype=header) def _get_header(self, modelgrid, precision): - if precision.lower() == 'double': - np_flt_type = np.float64 - else: - np_flt_type = np.float32 + np_flt_type = np.float64 header = [] int_cellid_indexes = {} ext_cellid_indexes = {} @@ -759,7 +756,7 @@ def _get_header(self, modelgrid, precision): 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.float64)) + header.append((aux_var_name, np_flt_type)) ext_index += 1 return header, int_cellid_indexes, ext_cellid_indexes diff --git a/flopy/mf6/data/mfstructure.py b/flopy/mf6/data/mfstructure.py index d84526cdf0..1616898333 100644 --- a/flopy/mf6/data/mfstructure.py +++ b/flopy/mf6/data/mfstructure.py @@ -1599,9 +1599,9 @@ def get_datum_type(self, numpy_type=False, return_enum_type=False): else: if numpy_type: if var_type[0] == DatumType.double_precision: - return np.float + return np.float64 elif var_type[0] == DatumType.integer: - return np.int + return np.int32 else: return np.object else: diff --git a/flopy/mf6/mfpackage.py b/flopy/mf6/mfpackage.py index 3995afd49b..40289ffef4 100644 --- a/flopy/mf6/mfpackage.py +++ b/flopy/mf6/mfpackage.py @@ -928,6 +928,7 @@ def _write_block(self, fd, block_header, ext_file_action): inspect.stack()[0][3], type_, value_, traceback_, message, self._simulation_data.debug) + # write data sets for key, dataset in self.datasets.items(): try: From 89a73d5b4c3dd89c9104f16f3463124123ff20d3 Mon Sep 17 00:00:00 2001 From: spaulins-usgs Date: Mon, 15 Jul 2019 19:00:37 -0700 Subject: [PATCH 6/9] fix(#616): Shapefile export code fix --- flopy/export/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flopy/export/utils.py b/flopy/export/utils.py index 030be51561..86892e68d9 100644 --- a/flopy/export/utils.py +++ b/flopy/export/utils.py @@ -600,7 +600,7 @@ def transient2d_export(f, t2d, **kwargs): if isinstance(f, str) and f.lower().endswith(".shp"): array_dict = {} - for kper in range(t2d.model.modeltime.sim_time.nper): + for kper in range(t2d.model.modeltime.nper): u2d = t2d[kper] name = '{}_{}'.format( shapefile_utils.shape_attr_name(u2d.name), kper + 1) From 5efa33fa28ebaf41a9456ca6f326a861695be915 Mon Sep 17 00:00:00 2001 From: spaulins-usgs Date: Tue, 16 Jul 2019 19:05:19 -0700 Subject: [PATCH 7/9] fix(#614): Wel package added to multi-package list. Fix to always get multiple packages when searching by package type. --- flopy/mf6/data/mfstructure.py | 2 +- flopy/mf6/mfbase.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/flopy/mf6/data/mfstructure.py b/flopy/mf6/data/mfstructure.py index 1616898333..fbffd56b27 100644 --- a/flopy/mf6/data/mfstructure.py +++ b/flopy/mf6/data/mfstructure.py @@ -64,7 +64,7 @@ def __init__(self): self.common = os.path.join(self.dfndir, 'common.dfn') # FIX: Transport - multi packages are hard coded self.multi_package = {'gwfmvr': 0, 'exggwfgwf': 0, 'gwfchd': 0, - 'gwfrch': 0, + 'gwfrch': 0, 'gwfwel': 0, 'gwfdrn': 0, 'gwfriv': 0, 'utlobs': 0, 'utlts': 0, 'utltas': 0} diff --git a/flopy/mf6/mfbase.py b/flopy/mf6/mfbase.py index 2c93999a86..a95eedc45b 100644 --- a/flopy/mf6/mfbase.py +++ b/flopy/mf6/mfbase.py @@ -597,10 +597,6 @@ def get_package(self, name=None): if name.lower() in self.package_name_dict: return self.package_name_dict[name.lower()] - # search for package key - if name.lower() in self.package_key_dict: - return self.package_key_dict[name.lower()] - # search for package type if name.lower() in self.package_type_dict: if len(self.package_type_dict[name.lower()]) == 0: @@ -610,6 +606,10 @@ def get_package(self, name=None): else: return self.package_type_dict[name.lower()] + # search for package key + if name.lower() in self.package_key_dict: + return self.package_key_dict[name.lower()] + # search for partial package name for pp in self._packagelist: if pp.package_name is not None: From 027ca2d495e8304d2c1ed55ea1885a68a0fb4d0d Mon Sep 17 00:00:00 2001 From: spaulins-usgs Date: Tue, 30 Jul 2019 08:29:11 -0700 Subject: [PATCH 8/9] fix(different int types): Different systems appear to use different types of ints. Int type check changed to be more generic. --- flopy/mf6/data/mfdatautil.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flopy/mf6/data/mfdatautil.py b/flopy/mf6/data/mfdatautil.py index 571b4f737e..70336aee6f 100644 --- a/flopy/mf6/data/mfdatautil.py +++ b/flopy/mf6/data/mfdatautil.py @@ -3,7 +3,7 @@ from copy import deepcopy from ..mfbase import MFDataException, FlopyException from .mfstructure import DatumType -from ...utils.datautil import PyListUtil +from ...utils.datautil import PyListUtil, DatumUtil import struct @@ -122,7 +122,7 @@ def to_string(val, data_type, sim_data, data_dim, is_cellid=False, else: return sim_data.sci_format_str.format(val) elif is_cellid or (possible_cellid and isinstance(val, tuple)): - if isinstance(val, np.int32): + if DatumUtil.is_int(val): return str(val + 1) if len(val) > 0 and val[0] == 'none': # handle case that cellid is 'none' From a4e2efcdfe61a9af3ca4ef272f8874964d7ae562 Mon Sep 17 00:00:00 2001 From: spaulins-usgs Date: Tue, 30 Jul 2019 12:56:16 -0700 Subject: [PATCH 9/9] refact(CR/LF): Removed CR line endings --- flopy/mf6/modflow/__init__.py | 74 +- flopy/mf6/modflow/mfgnc.py | 266 +-- flopy/mf6/modflow/mfgwf.py | 204 +- flopy/mf6/modflow/mfgwfchd.py | 384 ++-- flopy/mf6/modflow/mfgwfdis.py | 282 +-- flopy/mf6/modflow/mfgwfdisu.py | 540 ++--- flopy/mf6/modflow/mfgwfdisv.py | 366 ++-- flopy/mf6/modflow/mfgwfdrn.py | 422 ++-- flopy/mf6/modflow/mfgwfevt.py | 498 ++--- flopy/mf6/modflow/mfgwfevta.py | 400 ++-- flopy/mf6/modflow/mfgwfghb.py | 426 ++-- flopy/mf6/modflow/mfgwfgnc.py | 268 +-- flopy/mf6/modflow/mfgwfgwf.py | 544 ++--- flopy/mf6/modflow/mfgwfhfb.py | 190 +- flopy/mf6/modflow/mfgwfic.py | 112 +- flopy/mf6/modflow/mfgwflak.py | 1340 ++++++------- flopy/mf6/modflow/mfgwfmaw.py | 1086 +++++----- flopy/mf6/modflow/mfgwfmvr.py | 356 ++-- flopy/mf6/modflow/mfgwfnam.py | 232 +-- flopy/mf6/modflow/mfgwfnpf.py | 568 +++--- flopy/mf6/modflow/mfgwfoc.py | 378 ++-- flopy/mf6/modflow/mfgwfrch.py | 406 ++-- flopy/mf6/modflow/mfgwfrcha.py | 380 ++-- flopy/mf6/modflow/mfgwfriv.py | 434 ++-- flopy/mf6/modflow/mfgwfsfr.py | 1152 +++++------ flopy/mf6/modflow/mfgwfsto.py | 206 +- flopy/mf6/modflow/mfgwfuzf.py | 830 ++++---- flopy/mf6/modflow/mfgwfwel.py | 438 ++-- flopy/mf6/modflow/mfims.py | 858 ++++---- flopy/mf6/modflow/mfmvr.py | 352 ++-- flopy/mf6/modflow/mfnam.py | 278 +-- flopy/mf6/modflow/mfsimulation.py | 3068 ++++++++++++++--------------- flopy/mf6/modflow/mftdis.py | 176 +- flopy/mf6/modflow/mfutllaktab.py | 158 +- flopy/mf6/modflow/mfutlobs.py | 258 +-- flopy/mf6/modflow/mfutltas.py | 284 +-- flopy/mf6/modflow/mfutlts.py | 372 ++-- 37 files changed, 9293 insertions(+), 9293 deletions(-) diff --git a/flopy/mf6/modflow/__init__.py b/flopy/mf6/modflow/__init__.py index dbf5b3c71f..8cdaf053b4 100644 --- a/flopy/mf6/modflow/__init__.py +++ b/flopy/mf6/modflow/__init__.py @@ -1,37 +1,37 @@ -# imports -from .mfsimulation import MFSimulation -from .mfnam import ModflowNam -from .mftdis import ModflowTdis -from .mfgwfgwf import ModflowGwfgwf -from .mfims import ModflowIms -from .mfmvr import ModflowMvr -from .mfgnc import ModflowGnc -from .mfutlobs import ModflowUtlobs -from .mfutlts import ModflowUtlts -from .mfutltas import ModflowUtltas -from .mfutllaktab import ModflowUtllaktab -from .mfgwfnam import ModflowGwfnam -from .mfgwf import ModflowGwf -from .mfgwfdis import ModflowGwfdis -from .mfgwfdisv import ModflowGwfdisv -from .mfgwfdisu import ModflowGwfdisu -from .mfgwfic import ModflowGwfic -from .mfgwfnpf import ModflowGwfnpf -from .mfgwfsto import ModflowGwfsto -from .mfgwfhfb import ModflowGwfhfb -from .mfgwfchd import ModflowGwfchd -from .mfgwfwel import ModflowGwfwel -from .mfgwfdrn import ModflowGwfdrn -from .mfgwfriv import ModflowGwfriv -from .mfgwfghb import ModflowGwfghb -from .mfgwfrch import ModflowGwfrch -from .mfgwfrcha import ModflowGwfrcha -from .mfgwfevt import ModflowGwfevt -from .mfgwfevta import ModflowGwfevta -from .mfgwfmaw import ModflowGwfmaw -from .mfgwfsfr import ModflowGwfsfr -from .mfgwflak import ModflowGwflak -from .mfgwfuzf import ModflowGwfuzf -from .mfgwfmvr import ModflowGwfmvr -from .mfgwfgnc import ModflowGwfgnc -from .mfgwfoc import ModflowGwfoc +# imports +from .mfsimulation import MFSimulation +from .mfnam import ModflowNam +from .mftdis import ModflowTdis +from .mfgwfgwf import ModflowGwfgwf +from .mfims import ModflowIms +from .mfmvr import ModflowMvr +from .mfgnc import ModflowGnc +from .mfutlobs import ModflowUtlobs +from .mfutlts import ModflowUtlts +from .mfutltas import ModflowUtltas +from .mfutllaktab import ModflowUtllaktab +from .mfgwfnam import ModflowGwfnam +from .mfgwf import ModflowGwf +from .mfgwfdis import ModflowGwfdis +from .mfgwfdisv import ModflowGwfdisv +from .mfgwfdisu import ModflowGwfdisu +from .mfgwfic import ModflowGwfic +from .mfgwfnpf import ModflowGwfnpf +from .mfgwfsto import ModflowGwfsto +from .mfgwfhfb import ModflowGwfhfb +from .mfgwfchd import ModflowGwfchd +from .mfgwfwel import ModflowGwfwel +from .mfgwfdrn import ModflowGwfdrn +from .mfgwfriv import ModflowGwfriv +from .mfgwfghb import ModflowGwfghb +from .mfgwfrch import ModflowGwfrch +from .mfgwfrcha import ModflowGwfrcha +from .mfgwfevt import ModflowGwfevt +from .mfgwfevta import ModflowGwfevta +from .mfgwfmaw import ModflowGwfmaw +from .mfgwfsfr import ModflowGwfsfr +from .mfgwflak import ModflowGwflak +from .mfgwfuzf import ModflowGwfuzf +from .mfgwfmvr import ModflowGwfmvr +from .mfgwfgnc import ModflowGwfgnc +from .mfgwfoc import ModflowGwfoc diff --git a/flopy/mf6/modflow/mfgnc.py b/flopy/mf6/modflow/mfgnc.py index 522433a84c..febcc83967 100644 --- a/flopy/mf6/modflow/mfgnc.py +++ b/flopy/mf6/modflow/mfgnc.py @@ -1,133 +1,133 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ListTemplateGenerator - - -class ModflowGnc(mfpackage.MFPackage): - """ - ModflowGnc defines a gnc package. - - Parameters - ---------- - simulation : MFSimulation - Simulation that this package is a part of. Package is automatically - added to simulation when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - print_input : boolean - * print_input (boolean) keyword to indicate that the list of GNC - information will be written to the listing file immediately after it - is read. - print_flows : boolean - * print_flows (boolean) keyword to indicate that the list of GNC flow - rates will be printed to the listing file for every stress period - time step in which "BUDGET PRINT" is specified in Output Control. If - there is no Output Control option and "PRINT_FLOWS" is specified, - then flow rates are printed for the last time step of each stress - period. - explicit : boolean - * explicit (boolean) keyword to indicate that the ghost node correction - is applied in an explicit manner on the right-hand side of the - matrix. The explicit approach will likely require additional outer - iterations. If the keyword is not specified, then the correction will - be applied in an implicit manner on the left-hand side. The implicit - approach will likely converge better, but may require additional - memory. If the EXPLICIT keyword is not specified, then the BICGSTAB - linear acceleration option should be specified within the LINEAR - block of the Sparse Matrix Solver. - numgnc : integer - * numgnc (integer) is the number of GNC entries. - numalphaj : integer - * numalphaj (integer) is the number of contributing factors. - gncdata : [cellidn, cellidm, cellidsj, alphasj] - * cellidn ((integer, ...)) is the cellid of the cell, :math:`n`, in - which the ghost node is located. For a structured grid that uses the - DIS input file, CELLIDN is the layer, row, and column numbers of the - cell. For a grid that uses the DISV input file, CELLIDN is the layer - number and CELL2D number for the two cells. If the model uses the - unstructured discretization (DISU) input file, then CELLIDN is the - node number for the cell. - * cellidm ((integer, ...)) is the cellid of the connecting cell, - :math:`m`, to which flow occurs from the ghost node. For a structured - grid that uses the DIS input file, CELLIDM is the layer, row, and - column numbers of the cell. For a grid that uses the DISV input file, - CELLIDM is the layer number and CELL2D number for the two cells. If - the model uses the unstructured discretization (DISU) input file, - then CELLIDM is the node number for the cell. - * cellidsj ((integer, ...)) is the array of CELLIDS for the - contributing j cells, which contribute to the interpolated head value - at the ghost node. This item contains one CELLID for each of the - contributing cells of the ghost node. Note that if the number of - actual contributing cells needed by the user is less than NUMALPHAJ - for any ghost node, then a dummy CELLID of zero(s) should be inserted - with an associated contributing factor of zero. For a structured grid - that uses the DIS input file, CELLID is the layer, row, and column - numbers of the cell. For a grid that uses the DISV input file, CELLID - is the layer number and cell2d number for the two cells. If the model - uses the unstructured discretization (DISU) input file, then CELLID - is the node number for the cell. - * alphasj (double) is the contributing factors for each contributing - node in CELLIDSJ. Note that if the number of actual contributing - cells is less than NUMALPHAJ for any ghost node, then dummy CELLIDS - should be inserted with an associated contributing factor of zero. - The sum of ALPHASJ should be less than one. This is because one minus - the sum of ALPHASJ is equal to the alpha term (alpha n in equation - 4-61 of the GWF Model report) that is multiplied by the head in cell - n. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - gncdata = ListTemplateGenerator(('gnc', 'gncdata', 'gncdata')) - package_abbr = "gnc" - _package_type = "gnc" - dfn_file_name = "gwf-gnc.dfn" - - dfn = [["block options", "name print_input", "type keyword", - "reader urword", "optional true"], - ["block options", "name print_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name explicit", "type keyword", "tagged true", - "reader urword", "optional true"], - ["block dimensions", "name numgnc", "type integer", - "reader urword", "optional false"], - ["block dimensions", "name numalphaj", "type integer", - "reader urword", "optional false"], - ["block gncdata", "name gncdata", - "type recarray cellidn cellidm cellidsj alphasj", - "shape (maxbound)", "reader urword"], - ["block gncdata", "name cellidn", "type integer", "shape", - "tagged false", "in_record true", "reader urword", - "numeric_index true"], - ["block gncdata", "name cellidm", "type integer", "shape", - "tagged false", "in_record true", "reader urword", - "numeric_index true"], - ["block gncdata", "name cellidsj", "type integer", - "shape (numalphaj)", "tagged false", "in_record true", - "reader urword", "numeric_index true"], - ["block gncdata", "name alphasj", "type double precision", - "shape (numalphaj)", "tagged false", "in_record true", - "reader urword"]] - - def __init__(self, simulation, loading_package=False, print_input=None, - print_flows=None, explicit=None, numgnc=None, numalphaj=None, - gncdata=None, filename=None, pname=None, parent_file=None): - super(ModflowGnc, self).__init__(simulation, "gnc", filename, pname, - loading_package, parent_file) - - # set up variables - self.print_input = self.build_mfdata("print_input", print_input) - self.print_flows = self.build_mfdata("print_flows", print_flows) - self.explicit = self.build_mfdata("explicit", explicit) - self.numgnc = self.build_mfdata("numgnc", numgnc) - self.numalphaj = self.build_mfdata("numalphaj", numalphaj) - self.gncdata = self.build_mfdata("gncdata", gncdata) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ListTemplateGenerator + + +class ModflowGnc(mfpackage.MFPackage): + """ + ModflowGnc defines a gnc package. + + Parameters + ---------- + simulation : MFSimulation + Simulation that this package is a part of. Package is automatically + added to simulation when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + print_input : boolean + * print_input (boolean) keyword to indicate that the list of GNC + information will be written to the listing file immediately after it + is read. + print_flows : boolean + * print_flows (boolean) keyword to indicate that the list of GNC flow + rates will be printed to the listing file for every stress period + time step in which "BUDGET PRINT" is specified in Output Control. If + there is no Output Control option and "PRINT_FLOWS" is specified, + then flow rates are printed for the last time step of each stress + period. + explicit : boolean + * explicit (boolean) keyword to indicate that the ghost node correction + is applied in an explicit manner on the right-hand side of the + matrix. The explicit approach will likely require additional outer + iterations. If the keyword is not specified, then the correction will + be applied in an implicit manner on the left-hand side. The implicit + approach will likely converge better, but may require additional + memory. If the EXPLICIT keyword is not specified, then the BICGSTAB + linear acceleration option should be specified within the LINEAR + block of the Sparse Matrix Solver. + numgnc : integer + * numgnc (integer) is the number of GNC entries. + numalphaj : integer + * numalphaj (integer) is the number of contributing factors. + gncdata : [cellidn, cellidm, cellidsj, alphasj] + * cellidn ((integer, ...)) is the cellid of the cell, :math:`n`, in + which the ghost node is located. For a structured grid that uses the + DIS input file, CELLIDN is the layer, row, and column numbers of the + cell. For a grid that uses the DISV input file, CELLIDN is the layer + number and CELL2D number for the two cells. If the model uses the + unstructured discretization (DISU) input file, then CELLIDN is the + node number for the cell. + * cellidm ((integer, ...)) is the cellid of the connecting cell, + :math:`m`, to which flow occurs from the ghost node. For a structured + grid that uses the DIS input file, CELLIDM is the layer, row, and + column numbers of the cell. For a grid that uses the DISV input file, + CELLIDM is the layer number and CELL2D number for the two cells. If + the model uses the unstructured discretization (DISU) input file, + then CELLIDM is the node number for the cell. + * cellidsj ((integer, ...)) is the array of CELLIDS for the + contributing j cells, which contribute to the interpolated head value + at the ghost node. This item contains one CELLID for each of the + contributing cells of the ghost node. Note that if the number of + actual contributing cells needed by the user is less than NUMALPHAJ + for any ghost node, then a dummy CELLID of zero(s) should be inserted + with an associated contributing factor of zero. For a structured grid + that uses the DIS input file, CELLID is the layer, row, and column + numbers of the cell. For a grid that uses the DISV input file, CELLID + is the layer number and cell2d number for the two cells. If the model + uses the unstructured discretization (DISU) input file, then CELLID + is the node number for the cell. + * alphasj (double) is the contributing factors for each contributing + node in CELLIDSJ. Note that if the number of actual contributing + cells is less than NUMALPHAJ for any ghost node, then dummy CELLIDS + should be inserted with an associated contributing factor of zero. + The sum of ALPHASJ should be less than one. This is because one minus + the sum of ALPHASJ is equal to the alpha term (alpha n in equation + 4-61 of the GWF Model report) that is multiplied by the head in cell + n. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + gncdata = ListTemplateGenerator(('gnc', 'gncdata', 'gncdata')) + package_abbr = "gnc" + _package_type = "gnc" + dfn_file_name = "gwf-gnc.dfn" + + dfn = [["block options", "name print_input", "type keyword", + "reader urword", "optional true"], + ["block options", "name print_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name explicit", "type keyword", "tagged true", + "reader urword", "optional true"], + ["block dimensions", "name numgnc", "type integer", + "reader urword", "optional false"], + ["block dimensions", "name numalphaj", "type integer", + "reader urword", "optional false"], + ["block gncdata", "name gncdata", + "type recarray cellidn cellidm cellidsj alphasj", + "shape (maxbound)", "reader urword"], + ["block gncdata", "name cellidn", "type integer", "shape", + "tagged false", "in_record true", "reader urword", + "numeric_index true"], + ["block gncdata", "name cellidm", "type integer", "shape", + "tagged false", "in_record true", "reader urword", + "numeric_index true"], + ["block gncdata", "name cellidsj", "type integer", + "shape (numalphaj)", "tagged false", "in_record true", + "reader urword", "numeric_index true"], + ["block gncdata", "name alphasj", "type double precision", + "shape (numalphaj)", "tagged false", "in_record true", + "reader urword"]] + + def __init__(self, simulation, loading_package=False, print_input=None, + print_flows=None, explicit=None, numgnc=None, numalphaj=None, + gncdata=None, filename=None, pname=None, parent_file=None): + super(ModflowGnc, self).__init__(simulation, "gnc", filename, pname, + loading_package, parent_file) + + # set up variables + self.print_input = self.build_mfdata("print_input", print_input) + self.print_flows = self.build_mfdata("print_flows", print_flows) + self.explicit = self.build_mfdata("explicit", explicit) + self.numgnc = self.build_mfdata("numgnc", numgnc) + self.numalphaj = self.build_mfdata("numalphaj", numalphaj) + self.gncdata = self.build_mfdata("gncdata", gncdata) + self._init_complete = True diff --git a/flopy/mf6/modflow/mfgwf.py b/flopy/mf6/modflow/mfgwf.py index 2433ae9fd8..e6c2211dc0 100644 --- a/flopy/mf6/modflow/mfgwf.py +++ b/flopy/mf6/modflow/mfgwf.py @@ -1,102 +1,102 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfmodel -from ..data.mfdatautil import ListTemplateGenerator, ArrayTemplateGenerator - - -class ModflowGwf(mfmodel.MFModel): - """ - Modflowgwf defines a gwf model - - Parameters - ---------- - modelname : string - name of the model - model_nam_file : string - relative path to the model name file from model working folder - version : string - version of modflow - exe_name : string - model executable name - model_ws : string - model working folder path - sim : MFSimulation - Simulation that this model is a part of. Model is automatically - added to simulation when it is initialized. - list : string - * list (string) is name of the listing file to create for this GWF - model. If not specified, then the name of the list file will be the - basename of the GWF model name file and the '.lst' extension. For - example, if the GWF name file is called "my.model.nam" then the list - file will be called "my.model.lst". - print_input : boolean - * print_input (boolean) keyword to indicate that the list of all model - stress package information will be written to the listing file - immediately after it is read. - print_flows : boolean - * print_flows (boolean) keyword to indicate that the list of all model - package flow rates will be printed to the listing file for every - stress period time step in which "BUDGET PRINT" is specified in - Output Control. If there is no Output Control option and - "PRINT_FLOWS" is specified, then flow rates are printed for the last - time step of each stress period. - save_flows : boolean - * save_flows (boolean) keyword to indicate that all model package flow - terms will be written to the file specified with "BUDGET FILEOUT" in - Output Control. - newtonoptions : [under_relaxation] - * under_relaxation (string) keyword that indicates whether the - groundwater head in a cell will be under-relaxed when water levels - fall below the bottom of the model below any given cell. By default, - Newton-Raphson UNDER_RELAXATION is not applied. - packages : [ftype, fname, pname] - * ftype (string) is the file type, which must be one of the following - character values shown in table~ref{table:ftype}. Ftype may be - entered in any combination of uppercase and lowercase. - * fname (string) is the name of the file containing the package input. - The path to the file should be included if the file is not located in - the folder where the program was run. - * pname (string) is the user-defined name for the package. PNAME is - restricted to 16 characters. No spaces are allowed in PNAME. PNAME - character values are read and stored by the program for stress - packages only. These names may be useful for labeling purposes when - multiple stress packages of the same type are located within a single - GWF Model. If PNAME is specified for a stress package, then PNAME - will be used in the flow budget table in the listing file; it will - also be used for the text entry in the cell-by-cell budget file. - PNAME is case insensitive and is stored in all upper case letters. - - Methods - ------- - load : (simulation : MFSimulationData, model_name : string, - namfile : string, version : string, exe_name : string, - model_ws : string, strict : boolean) : MFSimulation - a class method that loads a model from files - """ - model_type = 'gwf' - - def __init__(self, simulation, modelname='model', model_nam_file=None, - version='mf6', exe_name='mf6.exe', model_rel_path='.', - list=None, print_input=None, print_flows=None, - save_flows=None, newtonoptions=None, packages=None, **kwargs): - super(ModflowGwf, self).__init__(simulation, model_type='gwf6', - modelname=modelname, - model_nam_file=model_nam_file, - version=version, exe_name=exe_name, - model_rel_path=model_rel_path, - **kwargs) - - self.name_file.list.set_data(list) - self.name_file.print_input.set_data(print_input) - self.name_file.print_flows.set_data(print_flows) - self.name_file.save_flows.set_data(save_flows) - self.name_file.newtonoptions.set_data(newtonoptions) - self.name_file.packages.set_data(packages) - - @classmethod - def load(cls, simulation, structure, modelname='NewModel', - model_nam_file='modflowtest.nam', version='mf6', - exe_name='mf6.exe', strict=True, model_rel_path='.'): - return mfmodel.MFModel.load_base(simulation, structure, modelname, - model_nam_file, 'gwf', version, - exe_name, strict, model_rel_path) +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfmodel +from ..data.mfdatautil import ListTemplateGenerator, ArrayTemplateGenerator + + +class ModflowGwf(mfmodel.MFModel): + """ + Modflowgwf defines a gwf model + + Parameters + ---------- + modelname : string + name of the model + model_nam_file : string + relative path to the model name file from model working folder + version : string + version of modflow + exe_name : string + model executable name + model_ws : string + model working folder path + sim : MFSimulation + Simulation that this model is a part of. Model is automatically + added to simulation when it is initialized. + list : string + * list (string) is name of the listing file to create for this GWF + model. If not specified, then the name of the list file will be the + basename of the GWF model name file and the '.lst' extension. For + example, if the GWF name file is called "my.model.nam" then the list + file will be called "my.model.lst". + print_input : boolean + * print_input (boolean) keyword to indicate that the list of all model + stress package information will be written to the listing file + immediately after it is read. + print_flows : boolean + * print_flows (boolean) keyword to indicate that the list of all model + package flow rates will be printed to the listing file for every + stress period time step in which "BUDGET PRINT" is specified in + Output Control. If there is no Output Control option and + "PRINT_FLOWS" is specified, then flow rates are printed for the last + time step of each stress period. + save_flows : boolean + * save_flows (boolean) keyword to indicate that all model package flow + terms will be written to the file specified with "BUDGET FILEOUT" in + Output Control. + newtonoptions : [under_relaxation] + * under_relaxation (string) keyword that indicates whether the + groundwater head in a cell will be under-relaxed when water levels + fall below the bottom of the model below any given cell. By default, + Newton-Raphson UNDER_RELAXATION is not applied. + packages : [ftype, fname, pname] + * ftype (string) is the file type, which must be one of the following + character values shown in table~ref{table:ftype}. Ftype may be + entered in any combination of uppercase and lowercase. + * fname (string) is the name of the file containing the package input. + The path to the file should be included if the file is not located in + the folder where the program was run. + * pname (string) is the user-defined name for the package. PNAME is + restricted to 16 characters. No spaces are allowed in PNAME. PNAME + character values are read and stored by the program for stress + packages only. These names may be useful for labeling purposes when + multiple stress packages of the same type are located within a single + GWF Model. If PNAME is specified for a stress package, then PNAME + will be used in the flow budget table in the listing file; it will + also be used for the text entry in the cell-by-cell budget file. + PNAME is case insensitive and is stored in all upper case letters. + + Methods + ------- + load : (simulation : MFSimulationData, model_name : string, + namfile : string, version : string, exe_name : string, + model_ws : string, strict : boolean) : MFSimulation + a class method that loads a model from files + """ + model_type = 'gwf' + + def __init__(self, simulation, modelname='model', model_nam_file=None, + version='mf6', exe_name='mf6.exe', model_rel_path='.', + list=None, print_input=None, print_flows=None, + save_flows=None, newtonoptions=None, packages=None, **kwargs): + super(ModflowGwf, self).__init__(simulation, model_type='gwf6', + modelname=modelname, + model_nam_file=model_nam_file, + version=version, exe_name=exe_name, + model_rel_path=model_rel_path, + **kwargs) + + self.name_file.list.set_data(list) + self.name_file.print_input.set_data(print_input) + self.name_file.print_flows.set_data(print_flows) + self.name_file.save_flows.set_data(save_flows) + self.name_file.newtonoptions.set_data(newtonoptions) + self.name_file.packages.set_data(packages) + + @classmethod + def load(cls, simulation, structure, modelname='NewModel', + model_nam_file='modflowtest.nam', version='mf6', + exe_name='mf6.exe', strict=True, model_rel_path='.'): + return mfmodel.MFModel.load_base(simulation, structure, modelname, + model_nam_file, 'gwf', version, + exe_name, strict, model_rel_path) diff --git a/flopy/mf6/modflow/mfgwfchd.py b/flopy/mf6/modflow/mfgwfchd.py index 2eb2db6e59..62ed689d9f 100644 --- a/flopy/mf6/modflow/mfgwfchd.py +++ b/flopy/mf6/modflow/mfgwfchd.py @@ -1,192 +1,192 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ListTemplateGenerator - - -class ModflowGwfchd(mfpackage.MFPackage): - """ - ModflowGwfchd defines a chd package within a gwf6 model. - - Parameters - ---------- - model : MFModel - Model that this package is a part of. Package is automatically - added to model when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - auxiliary : [string] - * auxiliary (string) defines an array of one or more auxiliary variable - names. There is no limit on the number of auxiliary variables that - can be provided on this line; however, lists of information provided - in subsequent blocks must have a column of data for each auxiliary - variable name defined here. The number of auxiliary variables - detected on this line determines the value for naux. Comments cannot - be provided anywhere on this line as they will be interpreted as - auxiliary variable names. Auxiliary variables may not be used by the - package, but they will be available for use by other parts of the - program. The program will terminate with an error if auxiliary - variables are specified on more than one line in the options block. - auxmultname : string - * auxmultname (string) name of auxiliary variable to be used as - multiplier of CHD head value. - boundnames : boolean - * boundnames (boolean) keyword to indicate that boundary names may be - provided with the list of constant-head cells. - print_input : boolean - * print_input (boolean) keyword to indicate that the list of constant- - head information will be written to the listing file immediately - after it is read. - print_flows : boolean - * print_flows (boolean) keyword to indicate that the list of constant- - head flow rates will be printed to the listing file for every stress - period time step in which "BUDGET PRINT" is specified in Output - Control. If there is no Output Control option and "PRINT_FLOWS" is - specified, then flow rates are printed for the last time step of each - stress period. - save_flows : boolean - * save_flows (boolean) keyword to indicate that constant-head flow - terms will be written to the file specified with "BUDGET FILEOUT" in - Output Control. - timeseries : {varname:data} or timeseries data - * Contains data for the ts package. Data can be stored in a dictionary - containing data for the ts package with variable names as keys and - package data as values. Data just for the timeseries variable is also - acceptable. See ts package documentation for more information. - observations : {varname:data} or continuous data - * Contains data for the obs package. Data can be stored in a dictionary - containing data for the obs package with variable names as keys and - package data as values. Data just for the observations variable is - also acceptable. See obs package documentation for more information. - maxbound : integer - * maxbound (integer) integer value specifying the maximum number of - constant-head cells that will be specified for use during any stress - period. - stress_period_data : [cellid, head, aux, boundname] - * cellid ((integer, ...)) is the cell identifier, and depends on the - type of grid that is used for the simulation. For a structured grid - that uses the DIS input file, CELLID is the layer, row, and column. - For a grid that uses the DISV input file, CELLID is the layer and - CELL2D number. If the model uses the unstructured discretization - (DISU) input file, CELLID is the node number for the cell. - * head (double) is the head at the boundary. - * aux (double) represents the values of the auxiliary variables for - each constant head. The values of auxiliary variables must be present - for each constant head. The values must be specified in the order of - the auxiliary variables specified in the OPTIONS block. If the - package supports time series and the Options block includes a - TIMESERIESFILE entry (see the "Time-Variable Input" section), values - can be obtained from a time series by entering the time-series name - in place of a numeric value. - * boundname (string) name of the constant head boundary cell. BOUNDNAME - is an ASCII character variable that can contain as many as 40 - characters. If BOUNDNAME contains spaces in it, then the entire name - must be enclosed within single quotes. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - auxiliary = ListTemplateGenerator(('gwf6', 'chd', 'options', - 'auxiliary')) - ts_filerecord = ListTemplateGenerator(('gwf6', 'chd', 'options', - 'ts_filerecord')) - obs_filerecord = ListTemplateGenerator(('gwf6', 'chd', 'options', - 'obs_filerecord')) - stress_period_data = ListTemplateGenerator(('gwf6', 'chd', 'period', - 'stress_period_data')) - package_abbr = "gwfchd" - _package_type = "chd" - dfn_file_name = "gwf-chd.dfn" - - dfn = [["block options", "name auxiliary", "type string", - "shape (naux)", "reader urword", "optional true"], - ["block options", "name auxmultname", "type string", "shape", - "reader urword", "optional true"], - ["block options", "name boundnames", "type keyword", "shape", - "reader urword", "optional true"], - ["block options", "name print_input", "type keyword", - "reader urword", "optional true"], - ["block options", "name print_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name save_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name ts_filerecord", - "type record ts6 filein ts6_filename", "shape", "reader urword", - "tagged true", "optional true", "construct_package ts", - "construct_data timeseries", "parameter_name timeseries"], - ["block options", "name ts6", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name filein", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name ts6_filename", "type string", - "preserve_case true", "in_record true", "reader urword", - "optional false", "tagged false"], - ["block options", "name obs_filerecord", - "type record obs6 filein obs6_filename", "shape", "reader urword", - "tagged true", "optional true", "construct_package obs", - "construct_data continuous", "parameter_name observations"], - ["block options", "name obs6", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name obs6_filename", "type string", - "preserve_case true", "in_record true", "tagged false", - "reader urword", "optional false"], - ["block dimensions", "name maxbound", "type integer", - "reader urword", "optional false"], - ["block period", "name iper", "type integer", - "block_variable True", "in_record true", "tagged false", "shape", - "valid", "reader urword", "optional false"], - ["block period", "name stress_period_data", - "type recarray cellid head aux boundname", "shape (maxbound)", - "reader urword"], - ["block period", "name cellid", "type integer", - "shape (ncelldim)", "tagged false", "in_record true", - "reader urword"], - ["block period", "name head", "type double precision", "shape", - "tagged false", "in_record true", "reader urword", - "time_series true"], - ["block period", "name aux", "type double precision", - "in_record true", "tagged false", "shape (naux)", "reader urword", - "optional true", "time_series true"], - ["block period", "name boundname", "type string", "shape", - "tagged false", "in_record true", "reader urword", - "optional true"]] - - def __init__(self, model, loading_package=False, auxiliary=None, - auxmultname=None, boundnames=None, print_input=None, - print_flows=None, save_flows=None, timeseries=None, - observations=None, maxbound=None, stress_period_data=None, - filename=None, pname=None, parent_file=None): - super(ModflowGwfchd, self).__init__(model, "chd", filename, pname, - loading_package, parent_file) - - # set up variables - self.auxiliary = self.build_mfdata("auxiliary", auxiliary) - self.auxmultname = self.build_mfdata("auxmultname", auxmultname) - self.boundnames = self.build_mfdata("boundnames", boundnames) - self.print_input = self.build_mfdata("print_input", print_input) - self.print_flows = self.build_mfdata("print_flows", print_flows) - self.save_flows = self.build_mfdata("save_flows", save_flows) - self._ts_filerecord = self.build_mfdata("ts_filerecord", - None) - self._ts_package = self.build_child_package("ts", timeseries, - "timeseries", - self._ts_filerecord) - self._obs_filerecord = self.build_mfdata("obs_filerecord", - None) - self._obs_package = self.build_child_package("obs", observations, - "continuous", - self._obs_filerecord) - self.maxbound = self.build_mfdata("maxbound", maxbound) - self.stress_period_data = self.build_mfdata("stress_period_data", - stress_period_data) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ListTemplateGenerator + + +class ModflowGwfchd(mfpackage.MFPackage): + """ + ModflowGwfchd defines a chd package within a gwf6 model. + + Parameters + ---------- + model : MFModel + Model that this package is a part of. Package is automatically + added to model when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + auxiliary : [string] + * auxiliary (string) defines an array of one or more auxiliary variable + names. There is no limit on the number of auxiliary variables that + can be provided on this line; however, lists of information provided + in subsequent blocks must have a column of data for each auxiliary + variable name defined here. The number of auxiliary variables + detected on this line determines the value for naux. Comments cannot + be provided anywhere on this line as they will be interpreted as + auxiliary variable names. Auxiliary variables may not be used by the + package, but they will be available for use by other parts of the + program. The program will terminate with an error if auxiliary + variables are specified on more than one line in the options block. + auxmultname : string + * auxmultname (string) name of auxiliary variable to be used as + multiplier of CHD head value. + boundnames : boolean + * boundnames (boolean) keyword to indicate that boundary names may be + provided with the list of constant-head cells. + print_input : boolean + * print_input (boolean) keyword to indicate that the list of constant- + head information will be written to the listing file immediately + after it is read. + print_flows : boolean + * print_flows (boolean) keyword to indicate that the list of constant- + head flow rates will be printed to the listing file for every stress + period time step in which "BUDGET PRINT" is specified in Output + Control. If there is no Output Control option and "PRINT_FLOWS" is + specified, then flow rates are printed for the last time step of each + stress period. + save_flows : boolean + * save_flows (boolean) keyword to indicate that constant-head flow + terms will be written to the file specified with "BUDGET FILEOUT" in + Output Control. + timeseries : {varname:data} or timeseries data + * Contains data for the ts package. Data can be stored in a dictionary + containing data for the ts package with variable names as keys and + package data as values. Data just for the timeseries variable is also + acceptable. See ts package documentation for more information. + observations : {varname:data} or continuous data + * Contains data for the obs package. Data can be stored in a dictionary + containing data for the obs package with variable names as keys and + package data as values. Data just for the observations variable is + also acceptable. See obs package documentation for more information. + maxbound : integer + * maxbound (integer) integer value specifying the maximum number of + constant-head cells that will be specified for use during any stress + period. + stress_period_data : [cellid, head, aux, boundname] + * cellid ((integer, ...)) is the cell identifier, and depends on the + type of grid that is used for the simulation. For a structured grid + that uses the DIS input file, CELLID is the layer, row, and column. + For a grid that uses the DISV input file, CELLID is the layer and + CELL2D number. If the model uses the unstructured discretization + (DISU) input file, CELLID is the node number for the cell. + * head (double) is the head at the boundary. + * aux (double) represents the values of the auxiliary variables for + each constant head. The values of auxiliary variables must be present + for each constant head. The values must be specified in the order of + the auxiliary variables specified in the OPTIONS block. If the + package supports time series and the Options block includes a + TIMESERIESFILE entry (see the "Time-Variable Input" section), values + can be obtained from a time series by entering the time-series name + in place of a numeric value. + * boundname (string) name of the constant head boundary cell. BOUNDNAME + is an ASCII character variable that can contain as many as 40 + characters. If BOUNDNAME contains spaces in it, then the entire name + must be enclosed within single quotes. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + auxiliary = ListTemplateGenerator(('gwf6', 'chd', 'options', + 'auxiliary')) + ts_filerecord = ListTemplateGenerator(('gwf6', 'chd', 'options', + 'ts_filerecord')) + obs_filerecord = ListTemplateGenerator(('gwf6', 'chd', 'options', + 'obs_filerecord')) + stress_period_data = ListTemplateGenerator(('gwf6', 'chd', 'period', + 'stress_period_data')) + package_abbr = "gwfchd" + _package_type = "chd" + dfn_file_name = "gwf-chd.dfn" + + dfn = [["block options", "name auxiliary", "type string", + "shape (naux)", "reader urword", "optional true"], + ["block options", "name auxmultname", "type string", "shape", + "reader urword", "optional true"], + ["block options", "name boundnames", "type keyword", "shape", + "reader urword", "optional true"], + ["block options", "name print_input", "type keyword", + "reader urword", "optional true"], + ["block options", "name print_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name save_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name ts_filerecord", + "type record ts6 filein ts6_filename", "shape", "reader urword", + "tagged true", "optional true", "construct_package ts", + "construct_data timeseries", "parameter_name timeseries"], + ["block options", "name ts6", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name filein", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name ts6_filename", "type string", + "preserve_case true", "in_record true", "reader urword", + "optional false", "tagged false"], + ["block options", "name obs_filerecord", + "type record obs6 filein obs6_filename", "shape", "reader urword", + "tagged true", "optional true", "construct_package obs", + "construct_data continuous", "parameter_name observations"], + ["block options", "name obs6", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name obs6_filename", "type string", + "preserve_case true", "in_record true", "tagged false", + "reader urword", "optional false"], + ["block dimensions", "name maxbound", "type integer", + "reader urword", "optional false"], + ["block period", "name iper", "type integer", + "block_variable True", "in_record true", "tagged false", "shape", + "valid", "reader urword", "optional false"], + ["block period", "name stress_period_data", + "type recarray cellid head aux boundname", "shape (maxbound)", + "reader urword"], + ["block period", "name cellid", "type integer", + "shape (ncelldim)", "tagged false", "in_record true", + "reader urword"], + ["block period", "name head", "type double precision", "shape", + "tagged false", "in_record true", "reader urword", + "time_series true"], + ["block period", "name aux", "type double precision", + "in_record true", "tagged false", "shape (naux)", "reader urword", + "optional true", "time_series true"], + ["block period", "name boundname", "type string", "shape", + "tagged false", "in_record true", "reader urword", + "optional true"]] + + def __init__(self, model, loading_package=False, auxiliary=None, + auxmultname=None, boundnames=None, print_input=None, + print_flows=None, save_flows=None, timeseries=None, + observations=None, maxbound=None, stress_period_data=None, + filename=None, pname=None, parent_file=None): + super(ModflowGwfchd, self).__init__(model, "chd", filename, pname, + loading_package, parent_file) + + # set up variables + self.auxiliary = self.build_mfdata("auxiliary", auxiliary) + self.auxmultname = self.build_mfdata("auxmultname", auxmultname) + self.boundnames = self.build_mfdata("boundnames", boundnames) + self.print_input = self.build_mfdata("print_input", print_input) + self.print_flows = self.build_mfdata("print_flows", print_flows) + self.save_flows = self.build_mfdata("save_flows", save_flows) + self._ts_filerecord = self.build_mfdata("ts_filerecord", + None) + self._ts_package = self.build_child_package("ts", timeseries, + "timeseries", + self._ts_filerecord) + self._obs_filerecord = self.build_mfdata("obs_filerecord", + None) + self._obs_package = self.build_child_package("obs", observations, + "continuous", + self._obs_filerecord) + self.maxbound = self.build_mfdata("maxbound", maxbound) + self.stress_period_data = self.build_mfdata("stress_period_data", + stress_period_data) + self._init_complete = True diff --git a/flopy/mf6/modflow/mfgwfdis.py b/flopy/mf6/modflow/mfgwfdis.py index 740e73b01e..b879a32031 100644 --- a/flopy/mf6/modflow/mfgwfdis.py +++ b/flopy/mf6/modflow/mfgwfdis.py @@ -1,141 +1,141 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ArrayTemplateGenerator - - -class ModflowGwfdis(mfpackage.MFPackage): - """ - ModflowGwfdis defines a dis package within a gwf6 model. - - Parameters - ---------- - model : MFModel - Model that this package is a part of. Package is automatically - added to model when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - length_units : string - * length_units (string) is the length units used for this model. Values - can be "FEET", "METERS", or "CENTIMETERS". If not specified, the - default is "UNKNOWN". - nogrb : boolean - * nogrb (boolean) keyword to deactivate writing of the binary grid - file. - xorigin : double - * xorigin (double) x-position of the lower-left corner of the model - grid. A default value of zero is assigned if not specified. The value - for XORIGIN does not affect the model simulation, but it is written - to the binary grid file so that postprocessors can locate the grid in - space. - yorigin : double - * yorigin (double) y-position of the lower-left corner of the model - grid. If not specified, then a default value equal to zero is used. - The value for YORIGIN does not affect the model simulation, but it is - written to the binary grid file so that postprocessors can locate the - grid in space. - angrot : double - * angrot (double) counter-clockwise rotation angle (in degrees) of the - lower-left corner of the model grid. If not specified, then a default - value of 0.0 is assigned. The value for ANGROT does not affect the - model simulation, but it is written to the binary grid file so that - postprocessors can locate the grid in space. - nlay : integer - * nlay (integer) is the number of layers in the model grid. - nrow : integer - * nrow (integer) is the number of rows in the model grid. - ncol : integer - * ncol (integer) is the number of columns in the model grid. - delr : [double] - * delr (double) is the is the column spacing in the row direction. - delc : [double] - * delc (double) is the is the row spacing in the column direction. - top : [double] - * top (double) is the top elevation for each cell in the top model - layer. - botm : [double] - * botm (double) is the bottom elevation for each cell. - idomain : [integer] - * idomain (integer) is an optional array that characterizes the - existence status of a cell. If the IDOMAIN array is not specified, - then all model cells exist within the solution. If the IDOMAIN value - for a cell is 0, the cell does not exist in the simulation. Input and - output values will be read and written for the cell, but internal to - the program, the cell is excluded from the solution. If the IDOMAIN - value for a cell is 1, the cell exists in the simulation. If the - IDOMAIN value for a cell is -1, the cell does not exist in the - simulation. Furthermore, the first existing cell above will be - connected to the first existing cell below. This type of cell is - referred to as a "vertical pass through" cell. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - delr = ArrayTemplateGenerator(('gwf6', 'dis', 'griddata', 'delr')) - delc = ArrayTemplateGenerator(('gwf6', 'dis', 'griddata', 'delc')) - top = ArrayTemplateGenerator(('gwf6', 'dis', 'griddata', 'top')) - botm = ArrayTemplateGenerator(('gwf6', 'dis', 'griddata', 'botm')) - idomain = ArrayTemplateGenerator(('gwf6', 'dis', 'griddata', - 'idomain')) - package_abbr = "gwfdis" - _package_type = "dis" - dfn_file_name = "gwf-dis.dfn" - - dfn = [["block options", "name length_units", "type string", - "reader urword", "optional true"], - ["block options", "name nogrb", "type keyword", "reader urword", - "optional true"], - ["block options", "name xorigin", "type double precision", - "reader urword", "optional true"], - ["block options", "name yorigin", "type double precision", - "reader urword", "optional true"], - ["block options", "name angrot", "type double precision", - "reader urword", "optional true"], - ["block dimensions", "name nlay", "type integer", - "reader urword", "optional false", "default_value 1"], - ["block dimensions", "name nrow", "type integer", - "reader urword", "optional false", "default_value 2"], - ["block dimensions", "name ncol", "type integer", - "reader urword", "optional false", "default_value 2"], - ["block griddata", "name delr", "type double precision", - "shape (ncol)", "reader readarray", "default_value 1.0"], - ["block griddata", "name delc", "type double precision", - "shape (nrow)", "reader readarray", "default_value 1.0"], - ["block griddata", "name top", "type double precision", - "shape (ncol, nrow)", "reader readarray", "default_value 1.0"], - ["block griddata", "name botm", "type double precision", - "shape (ncol, nrow, nlay)", "reader readarray", "layered true", - "default_value 0."], - ["block griddata", "name idomain", "type integer", - "shape (ncol, nrow, nlay)", "reader readarray", "layered true", - "optional true"]] - - def __init__(self, model, loading_package=False, length_units=None, - nogrb=None, xorigin=None, yorigin=None, angrot=None, nlay=1, - nrow=2, ncol=2, delr=1.0, delc=1.0, top=1.0, botm=0., - idomain=None, filename=None, pname=None, parent_file=None): - super(ModflowGwfdis, self).__init__(model, "dis", filename, pname, - loading_package, parent_file) - - # set up variables - self.length_units = self.build_mfdata("length_units", length_units) - self.nogrb = self.build_mfdata("nogrb", nogrb) - self.xorigin = self.build_mfdata("xorigin", xorigin) - self.yorigin = self.build_mfdata("yorigin", yorigin) - self.angrot = self.build_mfdata("angrot", angrot) - self.nlay = self.build_mfdata("nlay", nlay) - self.nrow = self.build_mfdata("nrow", nrow) - self.ncol = self.build_mfdata("ncol", ncol) - self.delr = self.build_mfdata("delr", delr) - self.delc = self.build_mfdata("delc", delc) - self.top = self.build_mfdata("top", top) - self.botm = self.build_mfdata("botm", botm) - self.idomain = self.build_mfdata("idomain", idomain) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ArrayTemplateGenerator + + +class ModflowGwfdis(mfpackage.MFPackage): + """ + ModflowGwfdis defines a dis package within a gwf6 model. + + Parameters + ---------- + model : MFModel + Model that this package is a part of. Package is automatically + added to model when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + length_units : string + * length_units (string) is the length units used for this model. Values + can be "FEET", "METERS", or "CENTIMETERS". If not specified, the + default is "UNKNOWN". + nogrb : boolean + * nogrb (boolean) keyword to deactivate writing of the binary grid + file. + xorigin : double + * xorigin (double) x-position of the lower-left corner of the model + grid. A default value of zero is assigned if not specified. The value + for XORIGIN does not affect the model simulation, but it is written + to the binary grid file so that postprocessors can locate the grid in + space. + yorigin : double + * yorigin (double) y-position of the lower-left corner of the model + grid. If not specified, then a default value equal to zero is used. + The value for YORIGIN does not affect the model simulation, but it is + written to the binary grid file so that postprocessors can locate the + grid in space. + angrot : double + * angrot (double) counter-clockwise rotation angle (in degrees) of the + lower-left corner of the model grid. If not specified, then a default + value of 0.0 is assigned. The value for ANGROT does not affect the + model simulation, but it is written to the binary grid file so that + postprocessors can locate the grid in space. + nlay : integer + * nlay (integer) is the number of layers in the model grid. + nrow : integer + * nrow (integer) is the number of rows in the model grid. + ncol : integer + * ncol (integer) is the number of columns in the model grid. + delr : [double] + * delr (double) is the is the column spacing in the row direction. + delc : [double] + * delc (double) is the is the row spacing in the column direction. + top : [double] + * top (double) is the top elevation for each cell in the top model + layer. + botm : [double] + * botm (double) is the bottom elevation for each cell. + idomain : [integer] + * idomain (integer) is an optional array that characterizes the + existence status of a cell. If the IDOMAIN array is not specified, + then all model cells exist within the solution. If the IDOMAIN value + for a cell is 0, the cell does not exist in the simulation. Input and + output values will be read and written for the cell, but internal to + the program, the cell is excluded from the solution. If the IDOMAIN + value for a cell is 1, the cell exists in the simulation. If the + IDOMAIN value for a cell is -1, the cell does not exist in the + simulation. Furthermore, the first existing cell above will be + connected to the first existing cell below. This type of cell is + referred to as a "vertical pass through" cell. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + delr = ArrayTemplateGenerator(('gwf6', 'dis', 'griddata', 'delr')) + delc = ArrayTemplateGenerator(('gwf6', 'dis', 'griddata', 'delc')) + top = ArrayTemplateGenerator(('gwf6', 'dis', 'griddata', 'top')) + botm = ArrayTemplateGenerator(('gwf6', 'dis', 'griddata', 'botm')) + idomain = ArrayTemplateGenerator(('gwf6', 'dis', 'griddata', + 'idomain')) + package_abbr = "gwfdis" + _package_type = "dis" + dfn_file_name = "gwf-dis.dfn" + + dfn = [["block options", "name length_units", "type string", + "reader urword", "optional true"], + ["block options", "name nogrb", "type keyword", "reader urword", + "optional true"], + ["block options", "name xorigin", "type double precision", + "reader urword", "optional true"], + ["block options", "name yorigin", "type double precision", + "reader urword", "optional true"], + ["block options", "name angrot", "type double precision", + "reader urword", "optional true"], + ["block dimensions", "name nlay", "type integer", + "reader urword", "optional false", "default_value 1"], + ["block dimensions", "name nrow", "type integer", + "reader urword", "optional false", "default_value 2"], + ["block dimensions", "name ncol", "type integer", + "reader urword", "optional false", "default_value 2"], + ["block griddata", "name delr", "type double precision", + "shape (ncol)", "reader readarray", "default_value 1.0"], + ["block griddata", "name delc", "type double precision", + "shape (nrow)", "reader readarray", "default_value 1.0"], + ["block griddata", "name top", "type double precision", + "shape (ncol, nrow)", "reader readarray", "default_value 1.0"], + ["block griddata", "name botm", "type double precision", + "shape (ncol, nrow, nlay)", "reader readarray", "layered true", + "default_value 0."], + ["block griddata", "name idomain", "type integer", + "shape (ncol, nrow, nlay)", "reader readarray", "layered true", + "optional true"]] + + def __init__(self, model, loading_package=False, length_units=None, + nogrb=None, xorigin=None, yorigin=None, angrot=None, nlay=1, + nrow=2, ncol=2, delr=1.0, delc=1.0, top=1.0, botm=0., + idomain=None, filename=None, pname=None, parent_file=None): + super(ModflowGwfdis, self).__init__(model, "dis", filename, pname, + loading_package, parent_file) + + # set up variables + self.length_units = self.build_mfdata("length_units", length_units) + self.nogrb = self.build_mfdata("nogrb", nogrb) + self.xorigin = self.build_mfdata("xorigin", xorigin) + self.yorigin = self.build_mfdata("yorigin", yorigin) + self.angrot = self.build_mfdata("angrot", angrot) + self.nlay = self.build_mfdata("nlay", nlay) + self.nrow = self.build_mfdata("nrow", nrow) + self.ncol = self.build_mfdata("ncol", ncol) + self.delr = self.build_mfdata("delr", delr) + self.delc = self.build_mfdata("delc", delc) + self.top = self.build_mfdata("top", top) + self.botm = self.build_mfdata("botm", botm) + self.idomain = self.build_mfdata("idomain", idomain) + self._init_complete = True diff --git a/flopy/mf6/modflow/mfgwfdisu.py b/flopy/mf6/modflow/mfgwfdisu.py index e325959f1a..2089b86757 100644 --- a/flopy/mf6/modflow/mfgwfdisu.py +++ b/flopy/mf6/modflow/mfgwfdisu.py @@ -1,270 +1,270 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ArrayTemplateGenerator, ListTemplateGenerator - - -class ModflowGwfdisu(mfpackage.MFPackage): - """ - ModflowGwfdisu defines a disu package within a gwf6 model. - - Parameters - ---------- - model : MFModel - Model that this package is a part of. Package is automatically - added to model when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - length_units : string - * length_units (string) is the length units used for this model. Values - can be "FEET", "METERS", or "CENTIMETERS". If not specified, the - default is "UNKNOWN". - nogrb : boolean - * nogrb (boolean) keyword to deactivate writing of the binary grid - file. - xorigin : double - * xorigin (double) x-position of the origin used for model grid - vertices. This value should be provided in a real-world coordinate - system. A default value of zero is assigned if not specified. The - value for XORIGIN does not affect the model simulation, but it is - written to the binary grid file so that postprocessors can locate the - grid in space. - yorigin : double - * yorigin (double) y-position of the origin used for model grid - vertices. This value should be provided in a real-world coordinate - system. If not specified, then a default value equal to zero is used. - The value for YORIGIN does not affect the model simulation, but it is - written to the binary grid file so that postprocessors can locate the - grid in space. - angrot : double - * angrot (double) counter-clockwise rotation angle (in degrees) of the - model grid coordinate system relative to a real-world coordinate - system. If not specified, then a default value of 0.0 is assigned. - The value for ANGROT does not affect the model simulation, but it is - written to the binary grid file so that postprocessors can locate the - grid in space. - nodes : integer - * nodes (integer) is the number of cells in the model grid. - nja : integer - * nja (integer) is the sum of the number of connections and NODES. When - calculating the total number of connections, the connection between - cell n and cell m is considered to be different from the connection - between cell m and cell n. Thus, NJA is equal to the total number of - connections, including n to m and m to n, and the total number of - cells. - nvert : integer - * nvert (integer) is the total number of (x, y) vertex pairs used to - define the plan-view shape of each cell in the model grid. If NVERT - is not specified or is specified as zero, then the VERTICES and - CELL2D blocks below are not read. NVERT and the accompanying VERTICES - and CELL2D blocks should be specified for most simulations. If the - XT3D or SAVE_SPECIFIC_DISCHARGE options are specified in the NPF - Package, these this information is required. - top : [double] - * top (double) is the top elevation for each cell in the model grid. - bot : [double] - * bot (double) is the bottom elevation for each cell. - area : [double] - * area (double) is the cell surface area (in plan view). - iac : [integer] - * iac (integer) is the number of connections (plus 1) for each cell. - The sum of all the entries in IAC must be equal to NJA. - ja : [integer] - * ja (integer) is a list of cell number (n) followed by its connecting - cell numbers (m) for each of the m cells connected to cell n. The - number of values to provide for cell n is IAC(n). This list is - sequentially provided for the first to the last cell. The first value - in the list must be cell n itself, and the remaining cells must be - listed in an increasing order (sorted from lowest number to highest). - Note that the cell and its connections are only supplied for the GWF - cells and their connections to the other GWF cells. Also note that - the JA list input may be divided such that every node and its - connectivity list can be on a separate line for ease in readability - of the file. To further ease readability of the file, the node number - of the cell whose connectivity is subsequently listed, may be - expressed as a negative number, the sign of which is subsequently - converted to positive by the code. - ihc : [integer] - * ihc (integer) is an index array indicating the direction between node - n and all of its m connections. If IHC = 0 then cell n and cell m are - connected in the vertical direction. Cell n overlies cell m if the - cell number for n is less than m; cell m overlies cell n if the cell - number for m is less than n. If IHC = 1 then cell n and cell m are - connected in the horizontal direction. If IHC = 2 then cell n and - cell m are connected in the horizontal direction, and the connection - is vertically staggered. A vertically staggered connection is one in - which a cell is horizontally connected to more than one cell in a - horizontal connection. - cl12 : [double] - * cl12 (double) is the array containing connection lengths between the - center of cell n and the shared face with each adjacent m cell. - hwva : [double] - * hwva (double) is a symmetric array of size NJA. For horizontal - connections, entries in HWVA are the horizontal width perpendicular - to flow. For vertical connections, entries in HWVA are the vertical - area for flow. Thus, values in the HWVA array contain dimensions of - both length and area. Entries in the HWVA array have a one-to-one - correspondence with the connections specified in the JA array. - Likewise, there is a one-to-one correspondence between entries in the - HWVA array and entries in the IHC array, which specifies the - connection type (horizontal or vertical). Entries in the HWVA array - must be symmetric; the program will terminate with an error if the - value for HWVA for an n to m connection does not equal the value for - HWVA for the corresponding n to m connection. - angldegx : [double] - * angldegx (double) is the angle (in degrees) between the horizontal - x-axis and the outward normal to the face between a cell and its - connecting cells. The angle varies between zero and 360.0 degrees, - where zero degrees points in the positive x-axis direction, and 90 - degrees points in the positive y-axis direction. ANGLDEGX is only - needed if horizontal anisotropy is specified in the NPF Package, if - the XT3D option is used in the NPF Package, or if the - SAVE_SPECIFIC_DISCHARGE option is specifed in the NPF Package. - ANGLDEGX does not need to be specified if these conditions are not - met. ANGLDEGX is of size NJA; values specified for vertical - connections and for the diagonal position are not used. Note that - ANGLDEGX is read in degrees, which is different from MODFLOW-USG, - which reads a similar variable (ANGLEX) in radians. - vertices : [iv, xv, yv] - * iv (integer) is the vertex number. Records in the VERTICES block must - be listed in consecutive order from 1 to NVERT. - * xv (double) is the x-coordinate for the vertex. - * yv (double) is the y-coordinate for the vertex. - cell2d : [icell2d, xc, yc, ncvert, icvert] - * icell2d (integer) is the cell2d number. Records in the CELL2D block - must be listed in consecutive order from 1 to NODES. - * xc (double) is the x-coordinate for the cell center. - * yc (double) is the y-coordinate for the cell center. - * ncvert (integer) is the number of vertices required to define the - cell. There may be a different number of vertices for each cell. - * icvert (integer) is an array of integer values containing vertex - numbers (in the VERTICES block) used to define the cell. Vertices - must be listed in clockwise order. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - top = ArrayTemplateGenerator(('gwf6', 'disu', 'griddata', 'top')) - bot = ArrayTemplateGenerator(('gwf6', 'disu', 'griddata', 'bot')) - area = ArrayTemplateGenerator(('gwf6', 'disu', 'griddata', 'area')) - iac = ArrayTemplateGenerator(('gwf6', 'disu', 'connectiondata', - 'iac')) - ja = ArrayTemplateGenerator(('gwf6', 'disu', 'connectiondata', - 'ja')) - ihc = ArrayTemplateGenerator(('gwf6', 'disu', 'connectiondata', - 'ihc')) - cl12 = ArrayTemplateGenerator(('gwf6', 'disu', 'connectiondata', - 'cl12')) - hwva = ArrayTemplateGenerator(('gwf6', 'disu', 'connectiondata', - 'hwva')) - angldegx = ArrayTemplateGenerator(('gwf6', 'disu', 'connectiondata', - 'angldegx')) - vertices = ListTemplateGenerator(('gwf6', 'disu', 'vertices', - 'vertices')) - cell2d = ListTemplateGenerator(('gwf6', 'disu', 'cell2d', 'cell2d')) - package_abbr = "gwfdisu" - _package_type = "disu" - dfn_file_name = "gwf-disu.dfn" - - dfn = [["block options", "name length_units", "type string", - "reader urword", "optional true"], - ["block options", "name nogrb", "type keyword", "reader urword", - "optional true"], - ["block options", "name xorigin", "type double precision", - "reader urword", "optional true"], - ["block options", "name yorigin", "type double precision", - "reader urword", "optional true"], - ["block options", "name angrot", "type double precision", - "reader urword", "optional true"], - ["block dimensions", "name nodes", "type integer", - "reader urword", "optional false"], - ["block dimensions", "name nja", "type integer", "reader urword", - "optional false"], - ["block dimensions", "name nvert", "type integer", - "reader urword", "optional true"], - ["block griddata", "name top", "type double precision", - "shape (nodes)", "reader readarray"], - ["block griddata", "name bot", "type double precision", - "shape (nodes)", "reader readarray"], - ["block griddata", "name area", "type double precision", - "shape (nodes)", "reader readarray"], - ["block connectiondata", "name iac", "type integer", - "shape (nodes)", "reader readarray"], - ["block connectiondata", "name ja", "type integer", - "shape (nja)", "reader readarray", "numeric_index true", - "jagged_array iac"], - ["block connectiondata", "name ihc", "type integer", - "shape (nja)", "reader readarray", "jagged_array iac"], - ["block connectiondata", "name cl12", "type double precision", - "shape (nja)", "reader readarray", "jagged_array iac"], - ["block connectiondata", "name hwva", "type double precision", - "shape (nja)", "reader readarray", "jagged_array iac"], - ["block connectiondata", "name angldegx", - "type double precision", "optional true", "shape (nja)", - "reader readarray", "jagged_array iac"], - ["block vertices", "name vertices", "type recarray iv xv yv", - "reader urword", "optional false"], - ["block vertices", "name iv", "type integer", "in_record true", - "tagged false", "reader urword", "optional false", - "numeric_index true"], - ["block vertices", "name xv", "type double precision", - "in_record true", "tagged false", "reader urword", - "optional false"], - ["block vertices", "name yv", "type double precision", - "in_record true", "tagged false", "reader urword", - "optional false"], - ["block cell2d", "name cell2d", - "type recarray icell2d xc yc ncvert icvert", "reader urword", - "optional false"], - ["block cell2d", "name icell2d", "type integer", - "in_record true", "tagged false", "reader urword", - "optional false", "numeric_index true"], - ["block cell2d", "name xc", "type double precision", - "in_record true", "tagged false", "reader urword", - "optional false"], - ["block cell2d", "name yc", "type double precision", - "in_record true", "tagged false", "reader urword", - "optional false"], - ["block cell2d", "name ncvert", "type integer", "in_record true", - "tagged false", "reader urword", "optional false"], - ["block cell2d", "name icvert", "type integer", "shape (ncvert)", - "in_record true", "tagged false", "reader urword", - "optional false"]] - - def __init__(self, model, loading_package=False, length_units=None, - nogrb=None, xorigin=None, yorigin=None, angrot=None, - nodes=None, nja=None, nvert=None, top=None, bot=None, - area=None, iac=None, ja=None, ihc=None, cl12=None, hwva=None, - angldegx=None, vertices=None, cell2d=None, filename=None, - pname=None, parent_file=None): - super(ModflowGwfdisu, self).__init__(model, "disu", filename, pname, - loading_package, parent_file) - - # set up variables - self.length_units = self.build_mfdata("length_units", length_units) - self.nogrb = self.build_mfdata("nogrb", nogrb) - self.xorigin = self.build_mfdata("xorigin", xorigin) - self.yorigin = self.build_mfdata("yorigin", yorigin) - self.angrot = self.build_mfdata("angrot", angrot) - self.nodes = self.build_mfdata("nodes", nodes) - self.nja = self.build_mfdata("nja", nja) - self.nvert = self.build_mfdata("nvert", nvert) - self.top = self.build_mfdata("top", top) - self.bot = self.build_mfdata("bot", bot) - self.area = self.build_mfdata("area", area) - self.iac = self.build_mfdata("iac", iac) - self.ja = self.build_mfdata("ja", ja) - self.ihc = self.build_mfdata("ihc", ihc) - self.cl12 = self.build_mfdata("cl12", cl12) - self.hwva = self.build_mfdata("hwva", hwva) - self.angldegx = self.build_mfdata("angldegx", angldegx) - self.vertices = self.build_mfdata("vertices", vertices) - self.cell2d = self.build_mfdata("cell2d", cell2d) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ArrayTemplateGenerator, ListTemplateGenerator + + +class ModflowGwfdisu(mfpackage.MFPackage): + """ + ModflowGwfdisu defines a disu package within a gwf6 model. + + Parameters + ---------- + model : MFModel + Model that this package is a part of. Package is automatically + added to model when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + length_units : string + * length_units (string) is the length units used for this model. Values + can be "FEET", "METERS", or "CENTIMETERS". If not specified, the + default is "UNKNOWN". + nogrb : boolean + * nogrb (boolean) keyword to deactivate writing of the binary grid + file. + xorigin : double + * xorigin (double) x-position of the origin used for model grid + vertices. This value should be provided in a real-world coordinate + system. A default value of zero is assigned if not specified. The + value for XORIGIN does not affect the model simulation, but it is + written to the binary grid file so that postprocessors can locate the + grid in space. + yorigin : double + * yorigin (double) y-position of the origin used for model grid + vertices. This value should be provided in a real-world coordinate + system. If not specified, then a default value equal to zero is used. + The value for YORIGIN does not affect the model simulation, but it is + written to the binary grid file so that postprocessors can locate the + grid in space. + angrot : double + * angrot (double) counter-clockwise rotation angle (in degrees) of the + model grid coordinate system relative to a real-world coordinate + system. If not specified, then a default value of 0.0 is assigned. + The value for ANGROT does not affect the model simulation, but it is + written to the binary grid file so that postprocessors can locate the + grid in space. + nodes : integer + * nodes (integer) is the number of cells in the model grid. + nja : integer + * nja (integer) is the sum of the number of connections and NODES. When + calculating the total number of connections, the connection between + cell n and cell m is considered to be different from the connection + between cell m and cell n. Thus, NJA is equal to the total number of + connections, including n to m and m to n, and the total number of + cells. + nvert : integer + * nvert (integer) is the total number of (x, y) vertex pairs used to + define the plan-view shape of each cell in the model grid. If NVERT + is not specified or is specified as zero, then the VERTICES and + CELL2D blocks below are not read. NVERT and the accompanying VERTICES + and CELL2D blocks should be specified for most simulations. If the + XT3D or SAVE_SPECIFIC_DISCHARGE options are specified in the NPF + Package, these this information is required. + top : [double] + * top (double) is the top elevation for each cell in the model grid. + bot : [double] + * bot (double) is the bottom elevation for each cell. + area : [double] + * area (double) is the cell surface area (in plan view). + iac : [integer] + * iac (integer) is the number of connections (plus 1) for each cell. + The sum of all the entries in IAC must be equal to NJA. + ja : [integer] + * ja (integer) is a list of cell number (n) followed by its connecting + cell numbers (m) for each of the m cells connected to cell n. The + number of values to provide for cell n is IAC(n). This list is + sequentially provided for the first to the last cell. The first value + in the list must be cell n itself, and the remaining cells must be + listed in an increasing order (sorted from lowest number to highest). + Note that the cell and its connections are only supplied for the GWF + cells and their connections to the other GWF cells. Also note that + the JA list input may be divided such that every node and its + connectivity list can be on a separate line for ease in readability + of the file. To further ease readability of the file, the node number + of the cell whose connectivity is subsequently listed, may be + expressed as a negative number, the sign of which is subsequently + converted to positive by the code. + ihc : [integer] + * ihc (integer) is an index array indicating the direction between node + n and all of its m connections. If IHC = 0 then cell n and cell m are + connected in the vertical direction. Cell n overlies cell m if the + cell number for n is less than m; cell m overlies cell n if the cell + number for m is less than n. If IHC = 1 then cell n and cell m are + connected in the horizontal direction. If IHC = 2 then cell n and + cell m are connected in the horizontal direction, and the connection + is vertically staggered. A vertically staggered connection is one in + which a cell is horizontally connected to more than one cell in a + horizontal connection. + cl12 : [double] + * cl12 (double) is the array containing connection lengths between the + center of cell n and the shared face with each adjacent m cell. + hwva : [double] + * hwva (double) is a symmetric array of size NJA. For horizontal + connections, entries in HWVA are the horizontal width perpendicular + to flow. For vertical connections, entries in HWVA are the vertical + area for flow. Thus, values in the HWVA array contain dimensions of + both length and area. Entries in the HWVA array have a one-to-one + correspondence with the connections specified in the JA array. + Likewise, there is a one-to-one correspondence between entries in the + HWVA array and entries in the IHC array, which specifies the + connection type (horizontal or vertical). Entries in the HWVA array + must be symmetric; the program will terminate with an error if the + value for HWVA for an n to m connection does not equal the value for + HWVA for the corresponding n to m connection. + angldegx : [double] + * angldegx (double) is the angle (in degrees) between the horizontal + x-axis and the outward normal to the face between a cell and its + connecting cells. The angle varies between zero and 360.0 degrees, + where zero degrees points in the positive x-axis direction, and 90 + degrees points in the positive y-axis direction. ANGLDEGX is only + needed if horizontal anisotropy is specified in the NPF Package, if + the XT3D option is used in the NPF Package, or if the + SAVE_SPECIFIC_DISCHARGE option is specifed in the NPF Package. + ANGLDEGX does not need to be specified if these conditions are not + met. ANGLDEGX is of size NJA; values specified for vertical + connections and for the diagonal position are not used. Note that + ANGLDEGX is read in degrees, which is different from MODFLOW-USG, + which reads a similar variable (ANGLEX) in radians. + vertices : [iv, xv, yv] + * iv (integer) is the vertex number. Records in the VERTICES block must + be listed in consecutive order from 1 to NVERT. + * xv (double) is the x-coordinate for the vertex. + * yv (double) is the y-coordinate for the vertex. + cell2d : [icell2d, xc, yc, ncvert, icvert] + * icell2d (integer) is the cell2d number. Records in the CELL2D block + must be listed in consecutive order from 1 to NODES. + * xc (double) is the x-coordinate for the cell center. + * yc (double) is the y-coordinate for the cell center. + * ncvert (integer) is the number of vertices required to define the + cell. There may be a different number of vertices for each cell. + * icvert (integer) is an array of integer values containing vertex + numbers (in the VERTICES block) used to define the cell. Vertices + must be listed in clockwise order. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + top = ArrayTemplateGenerator(('gwf6', 'disu', 'griddata', 'top')) + bot = ArrayTemplateGenerator(('gwf6', 'disu', 'griddata', 'bot')) + area = ArrayTemplateGenerator(('gwf6', 'disu', 'griddata', 'area')) + iac = ArrayTemplateGenerator(('gwf6', 'disu', 'connectiondata', + 'iac')) + ja = ArrayTemplateGenerator(('gwf6', 'disu', 'connectiondata', + 'ja')) + ihc = ArrayTemplateGenerator(('gwf6', 'disu', 'connectiondata', + 'ihc')) + cl12 = ArrayTemplateGenerator(('gwf6', 'disu', 'connectiondata', + 'cl12')) + hwva = ArrayTemplateGenerator(('gwf6', 'disu', 'connectiondata', + 'hwva')) + angldegx = ArrayTemplateGenerator(('gwf6', 'disu', 'connectiondata', + 'angldegx')) + vertices = ListTemplateGenerator(('gwf6', 'disu', 'vertices', + 'vertices')) + cell2d = ListTemplateGenerator(('gwf6', 'disu', 'cell2d', 'cell2d')) + package_abbr = "gwfdisu" + _package_type = "disu" + dfn_file_name = "gwf-disu.dfn" + + dfn = [["block options", "name length_units", "type string", + "reader urword", "optional true"], + ["block options", "name nogrb", "type keyword", "reader urword", + "optional true"], + ["block options", "name xorigin", "type double precision", + "reader urword", "optional true"], + ["block options", "name yorigin", "type double precision", + "reader urword", "optional true"], + ["block options", "name angrot", "type double precision", + "reader urword", "optional true"], + ["block dimensions", "name nodes", "type integer", + "reader urword", "optional false"], + ["block dimensions", "name nja", "type integer", "reader urword", + "optional false"], + ["block dimensions", "name nvert", "type integer", + "reader urword", "optional true"], + ["block griddata", "name top", "type double precision", + "shape (nodes)", "reader readarray"], + ["block griddata", "name bot", "type double precision", + "shape (nodes)", "reader readarray"], + ["block griddata", "name area", "type double precision", + "shape (nodes)", "reader readarray"], + ["block connectiondata", "name iac", "type integer", + "shape (nodes)", "reader readarray"], + ["block connectiondata", "name ja", "type integer", + "shape (nja)", "reader readarray", "numeric_index true", + "jagged_array iac"], + ["block connectiondata", "name ihc", "type integer", + "shape (nja)", "reader readarray", "jagged_array iac"], + ["block connectiondata", "name cl12", "type double precision", + "shape (nja)", "reader readarray", "jagged_array iac"], + ["block connectiondata", "name hwva", "type double precision", + "shape (nja)", "reader readarray", "jagged_array iac"], + ["block connectiondata", "name angldegx", + "type double precision", "optional true", "shape (nja)", + "reader readarray", "jagged_array iac"], + ["block vertices", "name vertices", "type recarray iv xv yv", + "reader urword", "optional false"], + ["block vertices", "name iv", "type integer", "in_record true", + "tagged false", "reader urword", "optional false", + "numeric_index true"], + ["block vertices", "name xv", "type double precision", + "in_record true", "tagged false", "reader urword", + "optional false"], + ["block vertices", "name yv", "type double precision", + "in_record true", "tagged false", "reader urword", + "optional false"], + ["block cell2d", "name cell2d", + "type recarray icell2d xc yc ncvert icvert", "reader urword", + "optional false"], + ["block cell2d", "name icell2d", "type integer", + "in_record true", "tagged false", "reader urword", + "optional false", "numeric_index true"], + ["block cell2d", "name xc", "type double precision", + "in_record true", "tagged false", "reader urword", + "optional false"], + ["block cell2d", "name yc", "type double precision", + "in_record true", "tagged false", "reader urword", + "optional false"], + ["block cell2d", "name ncvert", "type integer", "in_record true", + "tagged false", "reader urword", "optional false"], + ["block cell2d", "name icvert", "type integer", "shape (ncvert)", + "in_record true", "tagged false", "reader urword", + "optional false"]] + + def __init__(self, model, loading_package=False, length_units=None, + nogrb=None, xorigin=None, yorigin=None, angrot=None, + nodes=None, nja=None, nvert=None, top=None, bot=None, + area=None, iac=None, ja=None, ihc=None, cl12=None, hwva=None, + angldegx=None, vertices=None, cell2d=None, filename=None, + pname=None, parent_file=None): + super(ModflowGwfdisu, self).__init__(model, "disu", filename, pname, + loading_package, parent_file) + + # set up variables + self.length_units = self.build_mfdata("length_units", length_units) + self.nogrb = self.build_mfdata("nogrb", nogrb) + self.xorigin = self.build_mfdata("xorigin", xorigin) + self.yorigin = self.build_mfdata("yorigin", yorigin) + self.angrot = self.build_mfdata("angrot", angrot) + self.nodes = self.build_mfdata("nodes", nodes) + self.nja = self.build_mfdata("nja", nja) + self.nvert = self.build_mfdata("nvert", nvert) + self.top = self.build_mfdata("top", top) + self.bot = self.build_mfdata("bot", bot) + self.area = self.build_mfdata("area", area) + self.iac = self.build_mfdata("iac", iac) + self.ja = self.build_mfdata("ja", ja) + self.ihc = self.build_mfdata("ihc", ihc) + self.cl12 = self.build_mfdata("cl12", cl12) + self.hwva = self.build_mfdata("hwva", hwva) + self.angldegx = self.build_mfdata("angldegx", angldegx) + self.vertices = self.build_mfdata("vertices", vertices) + self.cell2d = self.build_mfdata("cell2d", cell2d) + self._init_complete = True diff --git a/flopy/mf6/modflow/mfgwfdisv.py b/flopy/mf6/modflow/mfgwfdisv.py index 6ae5d1e41f..c6df0d014e 100644 --- a/flopy/mf6/modflow/mfgwfdisv.py +++ b/flopy/mf6/modflow/mfgwfdisv.py @@ -1,183 +1,183 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ArrayTemplateGenerator, ListTemplateGenerator - - -class ModflowGwfdisv(mfpackage.MFPackage): - """ - ModflowGwfdisv defines a disv package within a gwf6 model. - - Parameters - ---------- - model : MFModel - Model that this package is a part of. Package is automatically - added to model when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - length_units : string - * length_units (string) is the length units used for this model. Values - can be "FEET", "METERS", or "CENTIMETERS". If not specified, the - default is "UNKNOWN". - nogrb : boolean - * nogrb (boolean) keyword to deactivate writing of the binary grid - file. - xorigin : double - * xorigin (double) x-position of the origin used for model grid - vertices. This value should be provided in a real-world coordinate - system. A default value of zero is assigned if not specified. The - value for XORIGIN does not affect the model simulation, but it is - written to the binary grid file so that postprocessors can locate the - grid in space. - yorigin : double - * yorigin (double) y-position of the origin used for model grid - vertices. This value should be provided in a real-world coordinate - system. If not specified, then a default value equal to zero is used. - The value for YORIGIN does not affect the model simulation, but it is - written to the binary grid file so that postprocessors can locate the - grid in space. - angrot : double - * angrot (double) counter-clockwise rotation angle (in degrees) of the - model grid coordinate system relative to a real-world coordinate - system. If not specified, then a default value of 0.0 is assigned. - The value for ANGROT does not affect the model simulation, but it is - written to the binary grid file so that postprocessors can locate the - grid in space. - nlay : integer - * nlay (integer) is the number of layers in the model grid. - ncpl : integer - * ncpl (integer) is the number of cells per layer. This is a constant - value for the grid and it applies to all layers. - nvert : integer - * nvert (integer) is the total number of (x, y) vertex pairs used to - characterize the horizontal configuration of the model grid. - top : [double] - * top (double) is the top elevation for each cell in the top model - layer. - botm : [double] - * botm (double) is the bottom elevation for each cell. - idomain : [integer] - * idomain (integer) is an optional array that characterizes the - existence status of a cell. If the IDOMAIN array is not specified, - then all model cells exist within the solution. If the IDOMAIN value - for a cell is 0, the cell does not exist in the simulation. Input and - output values will be read and written for the cell, but internal to - the program, the cell is excluded from the solution. If the IDOMAIN - value for a cell is 1, the cell exists in the simulation. If the - IDOMAIN value for a cell is -1, the cell does not exist in the - simulation. Furthermore, the first existing cell above will be - connected to the first existing cell below. This type of cell is - referred to as a "vertical pass through" cell. - vertices : [iv, xv, yv] - * iv (integer) is the vertex number. Records in the VERTICES block must - be listed in consecutive order from 1 to NVERT. - * xv (double) is the x-coordinate for the vertex. - * yv (double) is the y-coordinate for the vertex. - cell2d : [icell2d, xc, yc, ncvert, icvert] - * icell2d (integer) is the CELL2D number. Records in the CELL2D block - must be listed in consecutive order from the first to the last. - * xc (double) is the x-coordinate for the cell center. - * yc (double) is the y-coordinate for the cell center. - * ncvert (integer) is the number of vertices required to define the - cell. There may be a different number of vertices for each cell. - * icvert (integer) is an array of integer values containing vertex - numbers (in the VERTICES block) used to define the cell. Vertices - must be listed in clockwise order. Cells that are connected must - share vertices. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - top = ArrayTemplateGenerator(('gwf6', 'disv', 'griddata', 'top')) - botm = ArrayTemplateGenerator(('gwf6', 'disv', 'griddata', 'botm')) - idomain = ArrayTemplateGenerator(('gwf6', 'disv', 'griddata', - 'idomain')) - vertices = ListTemplateGenerator(('gwf6', 'disv', 'vertices', - 'vertices')) - cell2d = ListTemplateGenerator(('gwf6', 'disv', 'cell2d', 'cell2d')) - package_abbr = "gwfdisv" - _package_type = "disv" - dfn_file_name = "gwf-disv.dfn" - - dfn = [["block options", "name length_units", "type string", - "reader urword", "optional true"], - ["block options", "name nogrb", "type keyword", "reader urword", - "optional true"], - ["block options", "name xorigin", "type double precision", - "reader urword", "optional true"], - ["block options", "name yorigin", "type double precision", - "reader urword", "optional true"], - ["block options", "name angrot", "type double precision", - "reader urword", "optional true"], - ["block dimensions", "name nlay", "type integer", - "reader urword", "optional false"], - ["block dimensions", "name ncpl", "type integer", - "reader urword", "optional false"], - ["block dimensions", "name nvert", "type integer", - "reader urword", "optional false"], - ["block griddata", "name top", "type double precision", - "shape (ncpl)", "reader readarray"], - ["block griddata", "name botm", "type double precision", - "shape (nlay, ncpl)", "reader readarray", "layered true"], - ["block griddata", "name idomain", "type integer", - "shape (nlay, ncpl)", "reader readarray", "layered true", - "optional true"], - ["block vertices", "name vertices", "type recarray iv xv yv", - "reader urword", "optional false"], - ["block vertices", "name iv", "type integer", "in_record true", - "tagged false", "reader urword", "optional false", - "numeric_index true"], - ["block vertices", "name xv", "type double precision", - "in_record true", "tagged false", "reader urword", - "optional false"], - ["block vertices", "name yv", "type double precision", - "in_record true", "tagged false", "reader urword", - "optional false"], - ["block cell2d", "name cell2d", - "type recarray icell2d xc yc ncvert icvert", "reader urword", - "optional false"], - ["block cell2d", "name icell2d", "type integer", - "in_record true", "tagged false", "reader urword", - "optional false", "numeric_index true"], - ["block cell2d", "name xc", "type double precision", - "in_record true", "tagged false", "reader urword", - "optional false"], - ["block cell2d", "name yc", "type double precision", - "in_record true", "tagged false", "reader urword", - "optional false"], - ["block cell2d", "name ncvert", "type integer", "in_record true", - "tagged false", "reader urword", "optional false"], - ["block cell2d", "name icvert", "type integer", "shape (ncvert)", - "in_record true", "tagged false", "reader urword", - "optional false", "numeric_index true"]] - - def __init__(self, model, loading_package=False, length_units=None, - nogrb=None, xorigin=None, yorigin=None, angrot=None, - nlay=None, ncpl=None, nvert=None, top=None, botm=None, - idomain=None, vertices=None, cell2d=None, filename=None, - pname=None, parent_file=None): - super(ModflowGwfdisv, self).__init__(model, "disv", filename, pname, - loading_package, parent_file) - - # set up variables - self.length_units = self.build_mfdata("length_units", length_units) - self.nogrb = self.build_mfdata("nogrb", nogrb) - self.xorigin = self.build_mfdata("xorigin", xorigin) - self.yorigin = self.build_mfdata("yorigin", yorigin) - self.angrot = self.build_mfdata("angrot", angrot) - self.nlay = self.build_mfdata("nlay", nlay) - self.ncpl = self.build_mfdata("ncpl", ncpl) - self.nvert = self.build_mfdata("nvert", nvert) - self.top = self.build_mfdata("top", top) - self.botm = self.build_mfdata("botm", botm) - self.idomain = self.build_mfdata("idomain", idomain) - self.vertices = self.build_mfdata("vertices", vertices) - self.cell2d = self.build_mfdata("cell2d", cell2d) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ArrayTemplateGenerator, ListTemplateGenerator + + +class ModflowGwfdisv(mfpackage.MFPackage): + """ + ModflowGwfdisv defines a disv package within a gwf6 model. + + Parameters + ---------- + model : MFModel + Model that this package is a part of. Package is automatically + added to model when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + length_units : string + * length_units (string) is the length units used for this model. Values + can be "FEET", "METERS", or "CENTIMETERS". If not specified, the + default is "UNKNOWN". + nogrb : boolean + * nogrb (boolean) keyword to deactivate writing of the binary grid + file. + xorigin : double + * xorigin (double) x-position of the origin used for model grid + vertices. This value should be provided in a real-world coordinate + system. A default value of zero is assigned if not specified. The + value for XORIGIN does not affect the model simulation, but it is + written to the binary grid file so that postprocessors can locate the + grid in space. + yorigin : double + * yorigin (double) y-position of the origin used for model grid + vertices. This value should be provided in a real-world coordinate + system. If not specified, then a default value equal to zero is used. + The value for YORIGIN does not affect the model simulation, but it is + written to the binary grid file so that postprocessors can locate the + grid in space. + angrot : double + * angrot (double) counter-clockwise rotation angle (in degrees) of the + model grid coordinate system relative to a real-world coordinate + system. If not specified, then a default value of 0.0 is assigned. + The value for ANGROT does not affect the model simulation, but it is + written to the binary grid file so that postprocessors can locate the + grid in space. + nlay : integer + * nlay (integer) is the number of layers in the model grid. + ncpl : integer + * ncpl (integer) is the number of cells per layer. This is a constant + value for the grid and it applies to all layers. + nvert : integer + * nvert (integer) is the total number of (x, y) vertex pairs used to + characterize the horizontal configuration of the model grid. + top : [double] + * top (double) is the top elevation for each cell in the top model + layer. + botm : [double] + * botm (double) is the bottom elevation for each cell. + idomain : [integer] + * idomain (integer) is an optional array that characterizes the + existence status of a cell. If the IDOMAIN array is not specified, + then all model cells exist within the solution. If the IDOMAIN value + for a cell is 0, the cell does not exist in the simulation. Input and + output values will be read and written for the cell, but internal to + the program, the cell is excluded from the solution. If the IDOMAIN + value for a cell is 1, the cell exists in the simulation. If the + IDOMAIN value for a cell is -1, the cell does not exist in the + simulation. Furthermore, the first existing cell above will be + connected to the first existing cell below. This type of cell is + referred to as a "vertical pass through" cell. + vertices : [iv, xv, yv] + * iv (integer) is the vertex number. Records in the VERTICES block must + be listed in consecutive order from 1 to NVERT. + * xv (double) is the x-coordinate for the vertex. + * yv (double) is the y-coordinate for the vertex. + cell2d : [icell2d, xc, yc, ncvert, icvert] + * icell2d (integer) is the CELL2D number. Records in the CELL2D block + must be listed in consecutive order from the first to the last. + * xc (double) is the x-coordinate for the cell center. + * yc (double) is the y-coordinate for the cell center. + * ncvert (integer) is the number of vertices required to define the + cell. There may be a different number of vertices for each cell. + * icvert (integer) is an array of integer values containing vertex + numbers (in the VERTICES block) used to define the cell. Vertices + must be listed in clockwise order. Cells that are connected must + share vertices. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + top = ArrayTemplateGenerator(('gwf6', 'disv', 'griddata', 'top')) + botm = ArrayTemplateGenerator(('gwf6', 'disv', 'griddata', 'botm')) + idomain = ArrayTemplateGenerator(('gwf6', 'disv', 'griddata', + 'idomain')) + vertices = ListTemplateGenerator(('gwf6', 'disv', 'vertices', + 'vertices')) + cell2d = ListTemplateGenerator(('gwf6', 'disv', 'cell2d', 'cell2d')) + package_abbr = "gwfdisv" + _package_type = "disv" + dfn_file_name = "gwf-disv.dfn" + + dfn = [["block options", "name length_units", "type string", + "reader urword", "optional true"], + ["block options", "name nogrb", "type keyword", "reader urword", + "optional true"], + ["block options", "name xorigin", "type double precision", + "reader urword", "optional true"], + ["block options", "name yorigin", "type double precision", + "reader urword", "optional true"], + ["block options", "name angrot", "type double precision", + "reader urword", "optional true"], + ["block dimensions", "name nlay", "type integer", + "reader urword", "optional false"], + ["block dimensions", "name ncpl", "type integer", + "reader urword", "optional false"], + ["block dimensions", "name nvert", "type integer", + "reader urword", "optional false"], + ["block griddata", "name top", "type double precision", + "shape (ncpl)", "reader readarray"], + ["block griddata", "name botm", "type double precision", + "shape (nlay, ncpl)", "reader readarray", "layered true"], + ["block griddata", "name idomain", "type integer", + "shape (nlay, ncpl)", "reader readarray", "layered true", + "optional true"], + ["block vertices", "name vertices", "type recarray iv xv yv", + "reader urword", "optional false"], + ["block vertices", "name iv", "type integer", "in_record true", + "tagged false", "reader urword", "optional false", + "numeric_index true"], + ["block vertices", "name xv", "type double precision", + "in_record true", "tagged false", "reader urword", + "optional false"], + ["block vertices", "name yv", "type double precision", + "in_record true", "tagged false", "reader urword", + "optional false"], + ["block cell2d", "name cell2d", + "type recarray icell2d xc yc ncvert icvert", "reader urword", + "optional false"], + ["block cell2d", "name icell2d", "type integer", + "in_record true", "tagged false", "reader urword", + "optional false", "numeric_index true"], + ["block cell2d", "name xc", "type double precision", + "in_record true", "tagged false", "reader urword", + "optional false"], + ["block cell2d", "name yc", "type double precision", + "in_record true", "tagged false", "reader urword", + "optional false"], + ["block cell2d", "name ncvert", "type integer", "in_record true", + "tagged false", "reader urword", "optional false"], + ["block cell2d", "name icvert", "type integer", "shape (ncvert)", + "in_record true", "tagged false", "reader urword", + "optional false", "numeric_index true"]] + + def __init__(self, model, loading_package=False, length_units=None, + nogrb=None, xorigin=None, yorigin=None, angrot=None, + nlay=None, ncpl=None, nvert=None, top=None, botm=None, + idomain=None, vertices=None, cell2d=None, filename=None, + pname=None, parent_file=None): + super(ModflowGwfdisv, self).__init__(model, "disv", filename, pname, + loading_package, parent_file) + + # set up variables + self.length_units = self.build_mfdata("length_units", length_units) + self.nogrb = self.build_mfdata("nogrb", nogrb) + self.xorigin = self.build_mfdata("xorigin", xorigin) + self.yorigin = self.build_mfdata("yorigin", yorigin) + self.angrot = self.build_mfdata("angrot", angrot) + self.nlay = self.build_mfdata("nlay", nlay) + self.ncpl = self.build_mfdata("ncpl", ncpl) + self.nvert = self.build_mfdata("nvert", nvert) + self.top = self.build_mfdata("top", top) + self.botm = self.build_mfdata("botm", botm) + self.idomain = self.build_mfdata("idomain", idomain) + self.vertices = self.build_mfdata("vertices", vertices) + self.cell2d = self.build_mfdata("cell2d", cell2d) + self._init_complete = True diff --git a/flopy/mf6/modflow/mfgwfdrn.py b/flopy/mf6/modflow/mfgwfdrn.py index 2a64e313e5..353921d8f4 100644 --- a/flopy/mf6/modflow/mfgwfdrn.py +++ b/flopy/mf6/modflow/mfgwfdrn.py @@ -1,211 +1,211 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ListTemplateGenerator - - -class ModflowGwfdrn(mfpackage.MFPackage): - """ - ModflowGwfdrn defines a drn package within a gwf6 model. - - Parameters - ---------- - model : MFModel - Model that this package is a part of. Package is automatically - added to model when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - auxiliary : [string] - * auxiliary (string) defines an array of one or more auxiliary variable - names. There is no limit on the number of auxiliary variables that - can be provided on this line; however, lists of information provided - in subsequent blocks must have a column of data for each auxiliary - variable name defined here. The number of auxiliary variables - detected on this line determines the value for naux. Comments cannot - be provided anywhere on this line as they will be interpreted as - auxiliary variable names. Auxiliary variables may not be used by the - package, but they will be available for use by other parts of the - program. The program will terminate with an error if auxiliary - variables are specified on more than one line in the options block. - auxmultname : string - * auxmultname (string) name of auxiliary variable to be used as - multiplier of drain conductance. - boundnames : boolean - * boundnames (boolean) keyword to indicate that boundary names may be - provided with the list of drain cells. - print_input : boolean - * print_input (boolean) keyword to indicate that the list of drain - information will be written to the listing file immediately after it - is read. - print_flows : boolean - * print_flows (boolean) keyword to indicate that the list of drain flow - rates will be printed to the listing file for every stress period - time step in which "BUDGET PRINT" is specified in Output Control. If - there is no Output Control option and "PRINT_FLOWS" is specified, - then flow rates are printed for the last time step of each stress - period. - save_flows : boolean - * save_flows (boolean) keyword to indicate that drain flow terms will - be written to the file specified with "BUDGET FILEOUT" in Output - Control. - timeseries : {varname:data} or timeseries data - * Contains data for the ts package. Data can be stored in a dictionary - containing data for the ts package with variable names as keys and - package data as values. Data just for the timeseries variable is also - acceptable. See ts package documentation for more information. - observations : {varname:data} or continuous data - * Contains data for the obs package. Data can be stored in a dictionary - containing data for the obs package with variable names as keys and - package data as values. Data just for the observations variable is - also acceptable. See obs package documentation for more information. - mover : boolean - * mover (boolean) keyword to indicate that this instance of the Drain - Package can be used with the Water Mover (MVR) Package. When the - MOVER option is specified, additional memory is allocated within the - package to store the available, provided, and received water. - maxbound : integer - * maxbound (integer) integer value specifying the maximum number of - drains cells that will be specified for use during any stress period. - stress_period_data : [cellid, elev, cond, aux, boundname] - * cellid ((integer, ...)) is the cell identifier, and depends on the - type of grid that is used for the simulation. For a structured grid - that uses the DIS input file, CELLID is the layer, row, and column. - For a grid that uses the DISV input file, CELLID is the layer and - CELL2D number. If the model uses the unstructured discretization - (DISU) input file, CELLID is the node number for the cell. - * elev (double) is the elevation of the drain. If the Options block - includes a TIMESERIESFILE entry (see the "Time-Variable Input" - section), values can be obtained from a time series by entering the - time-series name in place of a numeric value. - * cond (double) is the hydraulic conductance of the interface between - the aquifer and the drain. If the Options block includes a - TIMESERIESFILE entry (see the "Time-Variable Input" section), values - can be obtained from a time series by entering the time-series name - in place of a numeric value. - * aux (double) represents the values of the auxiliary variables for - each drain. The values of auxiliary variables must be present for - each drain. The values must be specified in the order of the - auxiliary variables specified in the OPTIONS block. If the package - supports time series and the Options block includes a TIMESERIESFILE - entry (see the "Time-Variable Input" section), values can be obtained - from a time series by entering the time-series name in place of a - numeric value. - * boundname (string) name of the drain cell. BOUNDNAME is an ASCII - character variable that can contain as many as 40 characters. If - BOUNDNAME contains spaces in it, then the entire name must be - enclosed within single quotes. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - auxiliary = ListTemplateGenerator(('gwf6', 'drn', 'options', - 'auxiliary')) - ts_filerecord = ListTemplateGenerator(('gwf6', 'drn', 'options', - 'ts_filerecord')) - obs_filerecord = ListTemplateGenerator(('gwf6', 'drn', 'options', - 'obs_filerecord')) - stress_period_data = ListTemplateGenerator(('gwf6', 'drn', 'period', - 'stress_period_data')) - package_abbr = "gwfdrn" - _package_type = "drn" - dfn_file_name = "gwf-drn.dfn" - - dfn = [["block options", "name auxiliary", "type string", - "shape (naux)", "reader urword", "optional true"], - ["block options", "name auxmultname", "type string", "shape", - "reader urword", "optional true"], - ["block options", "name boundnames", "type keyword", "shape", - "reader urword", "optional true"], - ["block options", "name print_input", "type keyword", - "reader urword", "optional true"], - ["block options", "name print_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name save_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name ts_filerecord", - "type record ts6 filein ts6_filename", "shape", "reader urword", - "tagged true", "optional true", "construct_package ts", - "construct_data timeseries", "parameter_name timeseries"], - ["block options", "name ts6", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name filein", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name ts6_filename", "type string", - "preserve_case true", "in_record true", "reader urword", - "optional false", "tagged false"], - ["block options", "name obs_filerecord", - "type record obs6 filein obs6_filename", "shape", "reader urword", - "tagged true", "optional true", "construct_package obs", - "construct_data continuous", "parameter_name observations"], - ["block options", "name obs6", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name obs6_filename", "type string", - "preserve_case true", "in_record true", "tagged false", - "reader urword", "optional false"], - ["block options", "name mover", "type keyword", "tagged true", - "reader urword", "optional true"], - ["block dimensions", "name maxbound", "type integer", - "reader urword", "optional false"], - ["block period", "name iper", "type integer", - "block_variable True", "in_record true", "tagged false", "shape", - "valid", "reader urword", "optional false"], - ["block period", "name stress_period_data", - "type recarray cellid elev cond aux boundname", - "shape (maxbound)", "reader urword"], - ["block period", "name cellid", "type integer", - "shape (ncelldim)", "tagged false", "in_record true", - "reader urword"], - ["block period", "name elev", "type double precision", "shape", - "tagged false", "in_record true", "reader urword", - "time_series true"], - ["block period", "name cond", "type double precision", "shape", - "tagged false", "in_record true", "reader urword", - "time_series true"], - ["block period", "name aux", "type double precision", - "in_record true", "tagged false", "shape (naux)", "reader urword", - "optional true", "time_series true"], - ["block period", "name boundname", "type string", "shape", - "tagged false", "in_record true", "reader urword", - "optional true"]] - - def __init__(self, model, loading_package=False, auxiliary=None, - auxmultname=None, boundnames=None, print_input=None, - print_flows=None, save_flows=None, timeseries=None, - observations=None, mover=None, maxbound=None, - stress_period_data=None, filename=None, pname=None, - parent_file=None): - super(ModflowGwfdrn, self).__init__(model, "drn", filename, pname, - loading_package, parent_file) - - # set up variables - self.auxiliary = self.build_mfdata("auxiliary", auxiliary) - self.auxmultname = self.build_mfdata("auxmultname", auxmultname) - self.boundnames = self.build_mfdata("boundnames", boundnames) - self.print_input = self.build_mfdata("print_input", print_input) - self.print_flows = self.build_mfdata("print_flows", print_flows) - self.save_flows = self.build_mfdata("save_flows", save_flows) - self._ts_filerecord = self.build_mfdata("ts_filerecord", - None) - self._ts_package = self.build_child_package("ts", timeseries, - "timeseries", - self._ts_filerecord) - self._obs_filerecord = self.build_mfdata("obs_filerecord", - None) - self._obs_package = self.build_child_package("obs", observations, - "continuous", - self._obs_filerecord) - self.mover = self.build_mfdata("mover", mover) - self.maxbound = self.build_mfdata("maxbound", maxbound) - self.stress_period_data = self.build_mfdata("stress_period_data", - stress_period_data) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ListTemplateGenerator + + +class ModflowGwfdrn(mfpackage.MFPackage): + """ + ModflowGwfdrn defines a drn package within a gwf6 model. + + Parameters + ---------- + model : MFModel + Model that this package is a part of. Package is automatically + added to model when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + auxiliary : [string] + * auxiliary (string) defines an array of one or more auxiliary variable + names. There is no limit on the number of auxiliary variables that + can be provided on this line; however, lists of information provided + in subsequent blocks must have a column of data for each auxiliary + variable name defined here. The number of auxiliary variables + detected on this line determines the value for naux. Comments cannot + be provided anywhere on this line as they will be interpreted as + auxiliary variable names. Auxiliary variables may not be used by the + package, but they will be available for use by other parts of the + program. The program will terminate with an error if auxiliary + variables are specified on more than one line in the options block. + auxmultname : string + * auxmultname (string) name of auxiliary variable to be used as + multiplier of drain conductance. + boundnames : boolean + * boundnames (boolean) keyword to indicate that boundary names may be + provided with the list of drain cells. + print_input : boolean + * print_input (boolean) keyword to indicate that the list of drain + information will be written to the listing file immediately after it + is read. + print_flows : boolean + * print_flows (boolean) keyword to indicate that the list of drain flow + rates will be printed to the listing file for every stress period + time step in which "BUDGET PRINT" is specified in Output Control. If + there is no Output Control option and "PRINT_FLOWS" is specified, + then flow rates are printed for the last time step of each stress + period. + save_flows : boolean + * save_flows (boolean) keyword to indicate that drain flow terms will + be written to the file specified with "BUDGET FILEOUT" in Output + Control. + timeseries : {varname:data} or timeseries data + * Contains data for the ts package. Data can be stored in a dictionary + containing data for the ts package with variable names as keys and + package data as values. Data just for the timeseries variable is also + acceptable. See ts package documentation for more information. + observations : {varname:data} or continuous data + * Contains data for the obs package. Data can be stored in a dictionary + containing data for the obs package with variable names as keys and + package data as values. Data just for the observations variable is + also acceptable. See obs package documentation for more information. + mover : boolean + * mover (boolean) keyword to indicate that this instance of the Drain + Package can be used with the Water Mover (MVR) Package. When the + MOVER option is specified, additional memory is allocated within the + package to store the available, provided, and received water. + maxbound : integer + * maxbound (integer) integer value specifying the maximum number of + drains cells that will be specified for use during any stress period. + stress_period_data : [cellid, elev, cond, aux, boundname] + * cellid ((integer, ...)) is the cell identifier, and depends on the + type of grid that is used for the simulation. For a structured grid + that uses the DIS input file, CELLID is the layer, row, and column. + For a grid that uses the DISV input file, CELLID is the layer and + CELL2D number. If the model uses the unstructured discretization + (DISU) input file, CELLID is the node number for the cell. + * elev (double) is the elevation of the drain. If the Options block + includes a TIMESERIESFILE entry (see the "Time-Variable Input" + section), values can be obtained from a time series by entering the + time-series name in place of a numeric value. + * cond (double) is the hydraulic conductance of the interface between + the aquifer and the drain. If the Options block includes a + TIMESERIESFILE entry (see the "Time-Variable Input" section), values + can be obtained from a time series by entering the time-series name + in place of a numeric value. + * aux (double) represents the values of the auxiliary variables for + each drain. The values of auxiliary variables must be present for + each drain. The values must be specified in the order of the + auxiliary variables specified in the OPTIONS block. If the package + supports time series and the Options block includes a TIMESERIESFILE + entry (see the "Time-Variable Input" section), values can be obtained + from a time series by entering the time-series name in place of a + numeric value. + * boundname (string) name of the drain cell. BOUNDNAME is an ASCII + character variable that can contain as many as 40 characters. If + BOUNDNAME contains spaces in it, then the entire name must be + enclosed within single quotes. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + auxiliary = ListTemplateGenerator(('gwf6', 'drn', 'options', + 'auxiliary')) + ts_filerecord = ListTemplateGenerator(('gwf6', 'drn', 'options', + 'ts_filerecord')) + obs_filerecord = ListTemplateGenerator(('gwf6', 'drn', 'options', + 'obs_filerecord')) + stress_period_data = ListTemplateGenerator(('gwf6', 'drn', 'period', + 'stress_period_data')) + package_abbr = "gwfdrn" + _package_type = "drn" + dfn_file_name = "gwf-drn.dfn" + + dfn = [["block options", "name auxiliary", "type string", + "shape (naux)", "reader urword", "optional true"], + ["block options", "name auxmultname", "type string", "shape", + "reader urword", "optional true"], + ["block options", "name boundnames", "type keyword", "shape", + "reader urword", "optional true"], + ["block options", "name print_input", "type keyword", + "reader urword", "optional true"], + ["block options", "name print_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name save_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name ts_filerecord", + "type record ts6 filein ts6_filename", "shape", "reader urword", + "tagged true", "optional true", "construct_package ts", + "construct_data timeseries", "parameter_name timeseries"], + ["block options", "name ts6", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name filein", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name ts6_filename", "type string", + "preserve_case true", "in_record true", "reader urword", + "optional false", "tagged false"], + ["block options", "name obs_filerecord", + "type record obs6 filein obs6_filename", "shape", "reader urword", + "tagged true", "optional true", "construct_package obs", + "construct_data continuous", "parameter_name observations"], + ["block options", "name obs6", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name obs6_filename", "type string", + "preserve_case true", "in_record true", "tagged false", + "reader urword", "optional false"], + ["block options", "name mover", "type keyword", "tagged true", + "reader urword", "optional true"], + ["block dimensions", "name maxbound", "type integer", + "reader urword", "optional false"], + ["block period", "name iper", "type integer", + "block_variable True", "in_record true", "tagged false", "shape", + "valid", "reader urword", "optional false"], + ["block period", "name stress_period_data", + "type recarray cellid elev cond aux boundname", + "shape (maxbound)", "reader urword"], + ["block period", "name cellid", "type integer", + "shape (ncelldim)", "tagged false", "in_record true", + "reader urword"], + ["block period", "name elev", "type double precision", "shape", + "tagged false", "in_record true", "reader urword", + "time_series true"], + ["block period", "name cond", "type double precision", "shape", + "tagged false", "in_record true", "reader urword", + "time_series true"], + ["block period", "name aux", "type double precision", + "in_record true", "tagged false", "shape (naux)", "reader urword", + "optional true", "time_series true"], + ["block period", "name boundname", "type string", "shape", + "tagged false", "in_record true", "reader urword", + "optional true"]] + + def __init__(self, model, loading_package=False, auxiliary=None, + auxmultname=None, boundnames=None, print_input=None, + print_flows=None, save_flows=None, timeseries=None, + observations=None, mover=None, maxbound=None, + stress_period_data=None, filename=None, pname=None, + parent_file=None): + super(ModflowGwfdrn, self).__init__(model, "drn", filename, pname, + loading_package, parent_file) + + # set up variables + self.auxiliary = self.build_mfdata("auxiliary", auxiliary) + self.auxmultname = self.build_mfdata("auxmultname", auxmultname) + self.boundnames = self.build_mfdata("boundnames", boundnames) + self.print_input = self.build_mfdata("print_input", print_input) + self.print_flows = self.build_mfdata("print_flows", print_flows) + self.save_flows = self.build_mfdata("save_flows", save_flows) + self._ts_filerecord = self.build_mfdata("ts_filerecord", + None) + self._ts_package = self.build_child_package("ts", timeseries, + "timeseries", + self._ts_filerecord) + self._obs_filerecord = self.build_mfdata("obs_filerecord", + None) + self._obs_package = self.build_child_package("obs", observations, + "continuous", + self._obs_filerecord) + self.mover = self.build_mfdata("mover", mover) + self.maxbound = self.build_mfdata("maxbound", maxbound) + self.stress_period_data = self.build_mfdata("stress_period_data", + stress_period_data) + self._init_complete = True diff --git a/flopy/mf6/modflow/mfgwfevt.py b/flopy/mf6/modflow/mfgwfevt.py index ef3ed840b8..1fb1c1710e 100644 --- a/flopy/mf6/modflow/mfgwfevt.py +++ b/flopy/mf6/modflow/mfgwfevt.py @@ -1,249 +1,249 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ListTemplateGenerator - - -class ModflowGwfevt(mfpackage.MFPackage): - """ - ModflowGwfevt defines a evt package within a gwf6 model. - - Parameters - ---------- - model : MFModel - Model that this package is a part of. Package is automatically - added to model when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - fixed_cell : boolean - * fixed_cell (boolean) indicates that evapotranspiration will not be - reassigned to a cell underlying the cell specified in the list if the - specified cell is inactive. - auxiliary : [string] - * auxiliary (string) defines an array of one or more auxiliary variable - names. There is no limit on the number of auxiliary variables that - can be provided on this line; however, lists of information provided - in subsequent blocks must have a column of data for each auxiliary - variable name defined here. The number of auxiliary variables - detected on this line determines the value for naux. Comments cannot - be provided anywhere on this line as they will be interpreted as - auxiliary variable names. Auxiliary variables may not be used by the - package, but they will be available for use by other parts of the - program. The program will terminate with an error if auxiliary - variables are specified on more than one line in the options block. - auxmultname : string - * auxmultname (string) name of auxiliary variable to be used as - multiplier of evapotranspiration rate. - boundnames : boolean - * boundnames (boolean) keyword to indicate that boundary names may be - provided with the list of evapotranspiration cells. - print_input : boolean - * print_input (boolean) keyword to indicate that the list of - evapotranspiration information will be written to the listing file - immediately after it is read. - print_flows : boolean - * print_flows (boolean) keyword to indicate that the list of - evapotranspiration flow rates will be printed to the listing file for - every stress period time step in which "BUDGET PRINT" is specified in - Output Control. If there is no Output Control option and - "PRINT_FLOWS" is specified, then flow rates are printed for the last - time step of each stress period. - save_flows : boolean - * save_flows (boolean) keyword to indicate that evapotranspiration flow - terms will be written to the file specified with "BUDGET FILEOUT" in - Output Control. - timeseries : {varname:data} or timeseries data - * Contains data for the ts package. Data can be stored in a dictionary - containing data for the ts package with variable names as keys and - package data as values. Data just for the timeseries variable is also - acceptable. See ts package documentation for more information. - observations : {varname:data} or continuous data - * Contains data for the obs package. Data can be stored in a dictionary - containing data for the obs package with variable names as keys and - package data as values. Data just for the observations variable is - also acceptable. See obs package documentation for more information. - surf_rate_specified : boolean - * surf_rate_specified (boolean) indicates that the evapotranspiration - rate at the ET surface will be specified as PETM0 in list input. - maxbound : integer - * maxbound (integer) integer value specifying the maximum number of - evapotranspiration cells cells that will be specified for use during - any stress period. - nseg : integer - * nseg (integer) number of ET segments. Default is one. When NSEG is - greater than 1, PXDP and PETM arrays must be specified NSEG - 1 times - each, in order from the uppermost segment down. PXDP defines the - extinction-depth proportion at the bottom of a segment. PETM defines - the proportion of the maximum ET flux rate at the bottom of a - segment. - stress_period_data : [cellid, surface, rate, depth, pxdp, petm, petm0, aux, - boundname] - * cellid ((integer, ...)) is the cell identifier, and depends on the - type of grid that is used for the simulation. For a structured grid - that uses the DIS input file, CELLID is the layer, row, and column. - For a grid that uses the DISV input file, CELLID is the layer and - CELL2D number. If the model uses the unstructured discretization - (DISU) input file, CELLID is the node number for the cell. - * surface (double) is the elevation of the ET surface (:math:`L`). A - time-series name may be specified. - * rate (double) is the maximum ET flux rate (:math:`LT^{-1}`). A time- - series name may be specified. - * depth (double) is the ET extinction depth (:math:`L`). A time-series - name may be specified. - * pxdp (double) is the proportion of the ET extinction depth at the - bottom of a segment (dimensionless). A time-series name may be - specified. - * petm (double) is the proportion of the maximum ET flux rate at the - bottom of a segment (dimensionless). A time-series name may be - specified. - * petm0 (double) is the proportion of the maximum ET flux rate that - will apply when head is at or above the ET surface (dimensionless). - PETM0 is read only when the SURF_RATE_SPECIFIED option is used. A - time-series name may be specified. - * aux (double) represents the values of the auxiliary variables for - each evapotranspiration. The values of auxiliary variables must be - present for each evapotranspiration. The values must be specified in - the order of the auxiliary variables specified in the OPTIONS block. - If the package supports time series and the Options block includes a - TIMESERIESFILE entry (see the "Time-Variable Input" section), values - can be obtained from a time series by entering the time-series name - in place of a numeric value. - * boundname (string) name of the evapotranspiration cell. BOUNDNAME is - an ASCII character variable that can contain as many as 40 - characters. If BOUNDNAME contains spaces in it, then the entire name - must be enclosed within single quotes. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - auxiliary = ListTemplateGenerator(('gwf6', 'evt', 'options', - 'auxiliary')) - ts_filerecord = ListTemplateGenerator(('gwf6', 'evt', 'options', - 'ts_filerecord')) - obs_filerecord = ListTemplateGenerator(('gwf6', 'evt', 'options', - 'obs_filerecord')) - stress_period_data = ListTemplateGenerator(('gwf6', 'evt', 'period', - 'stress_period_data')) - package_abbr = "gwfevt" - _package_type = "evt" - dfn_file_name = "gwf-evt.dfn" - - dfn = [["block options", "name fixed_cell", "type keyword", "shape", - "reader urword", "optional true"], - ["block options", "name auxiliary", "type string", - "shape (naux)", "reader urword", "optional true"], - ["block options", "name auxmultname", "type string", "shape", - "reader urword", "optional true"], - ["block options", "name boundnames", "type keyword", "shape", - "reader urword", "optional true"], - ["block options", "name print_input", "type keyword", - "reader urword", "optional true"], - ["block options", "name print_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name save_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name ts_filerecord", - "type record ts6 filein ts6_filename", "shape", "reader urword", - "tagged true", "optional true", "construct_package ts", - "construct_data timeseries", "parameter_name timeseries"], - ["block options", "name ts6", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name filein", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name ts6_filename", "type string", - "preserve_case true", "in_record true", "reader urword", - "optional false", "tagged false"], - ["block options", "name obs_filerecord", - "type record obs6 filein obs6_filename", "shape", "reader urword", - "tagged true", "optional true", "construct_package obs", - "construct_data continuous", "parameter_name observations"], - ["block options", "name obs6", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name obs6_filename", "type string", - "preserve_case true", "in_record true", "tagged false", - "reader urword", "optional false"], - ["block options", "name surf_rate_specified", "type keyword", - "reader urword", "optional true"], - ["block dimensions", "name maxbound", "type integer", - "reader urword", "optional false"], - ["block dimensions", "name nseg", "type integer", - "reader urword", "optional false"], - ["block period", "name iper", "type integer", - "block_variable True", "in_record true", "tagged false", "shape", - "valid", "reader urword", "optional false"], - ["block period", "name stress_period_data", - "type recarray cellid surface rate depth pxdp petm petm0 aux " - "boundname", - "shape (maxbound)", "reader urword"], - ["block period", "name cellid", "type integer", - "shape (ncelldim)", "tagged false", "in_record true", - "reader urword"], - ["block period", "name surface", "type double precision", - "shape", "tagged false", "in_record true", "reader urword", - "time_series true"], - ["block period", "name rate", "type double precision", "shape", - "tagged false", "in_record true", "reader urword", - "time_series true"], - ["block period", "name depth", "type double precision", "shape", - "tagged false", "in_record true", "reader urword", - "time_series true"], - ["block period", "name pxdp", "type double precision", - "shape (nseg-1)", "tagged false", "in_record true", - "reader urword", "time_series true"], - ["block period", "name petm", "type double precision", - "shape (nseg-1)", "tagged false", "in_record true", - "reader urword", "time_series true"], - ["block period", "name petm0", "type double precision", "shape", - "tagged false", "in_record true", "reader urword", - "optional true", "time_series true"], - ["block period", "name aux", "type double precision", - "in_record true", "tagged false", "shape (naux)", "reader urword", - "optional true", "time_series true"], - ["block period", "name boundname", "type string", "shape", - "tagged false", "in_record true", "reader urword", - "optional true"]] - - def __init__(self, model, loading_package=False, fixed_cell=None, - auxiliary=None, auxmultname=None, boundnames=None, - print_input=None, print_flows=None, save_flows=None, - timeseries=None, observations=None, surf_rate_specified=None, - maxbound=None, nseg=None, stress_period_data=None, - filename=None, pname=None, parent_file=None): - super(ModflowGwfevt, self).__init__(model, "evt", filename, pname, - loading_package, parent_file) - - # set up variables - self.fixed_cell = self.build_mfdata("fixed_cell", fixed_cell) - self.auxiliary = self.build_mfdata("auxiliary", auxiliary) - self.auxmultname = self.build_mfdata("auxmultname", auxmultname) - self.boundnames = self.build_mfdata("boundnames", boundnames) - self.print_input = self.build_mfdata("print_input", print_input) - self.print_flows = self.build_mfdata("print_flows", print_flows) - self.save_flows = self.build_mfdata("save_flows", save_flows) - self._ts_filerecord = self.build_mfdata("ts_filerecord", - None) - self._ts_package = self.build_child_package("ts", timeseries, - "timeseries", - self._ts_filerecord) - self._obs_filerecord = self.build_mfdata("obs_filerecord", - None) - self._obs_package = self.build_child_package("obs", observations, - "continuous", - self._obs_filerecord) - self.surf_rate_specified = self.build_mfdata("surf_rate_specified", - surf_rate_specified) - self.maxbound = self.build_mfdata("maxbound", maxbound) - self.nseg = self.build_mfdata("nseg", nseg) - self.stress_period_data = self.build_mfdata("stress_period_data", - stress_period_data) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ListTemplateGenerator + + +class ModflowGwfevt(mfpackage.MFPackage): + """ + ModflowGwfevt defines a evt package within a gwf6 model. + + Parameters + ---------- + model : MFModel + Model that this package is a part of. Package is automatically + added to model when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + fixed_cell : boolean + * fixed_cell (boolean) indicates that evapotranspiration will not be + reassigned to a cell underlying the cell specified in the list if the + specified cell is inactive. + auxiliary : [string] + * auxiliary (string) defines an array of one or more auxiliary variable + names. There is no limit on the number of auxiliary variables that + can be provided on this line; however, lists of information provided + in subsequent blocks must have a column of data for each auxiliary + variable name defined here. The number of auxiliary variables + detected on this line determines the value for naux. Comments cannot + be provided anywhere on this line as they will be interpreted as + auxiliary variable names. Auxiliary variables may not be used by the + package, but they will be available for use by other parts of the + program. The program will terminate with an error if auxiliary + variables are specified on more than one line in the options block. + auxmultname : string + * auxmultname (string) name of auxiliary variable to be used as + multiplier of evapotranspiration rate. + boundnames : boolean + * boundnames (boolean) keyword to indicate that boundary names may be + provided with the list of evapotranspiration cells. + print_input : boolean + * print_input (boolean) keyword to indicate that the list of + evapotranspiration information will be written to the listing file + immediately after it is read. + print_flows : boolean + * print_flows (boolean) keyword to indicate that the list of + evapotranspiration flow rates will be printed to the listing file for + every stress period time step in which "BUDGET PRINT" is specified in + Output Control. If there is no Output Control option and + "PRINT_FLOWS" is specified, then flow rates are printed for the last + time step of each stress period. + save_flows : boolean + * save_flows (boolean) keyword to indicate that evapotranspiration flow + terms will be written to the file specified with "BUDGET FILEOUT" in + Output Control. + timeseries : {varname:data} or timeseries data + * Contains data for the ts package. Data can be stored in a dictionary + containing data for the ts package with variable names as keys and + package data as values. Data just for the timeseries variable is also + acceptable. See ts package documentation for more information. + observations : {varname:data} or continuous data + * Contains data for the obs package. Data can be stored in a dictionary + containing data for the obs package with variable names as keys and + package data as values. Data just for the observations variable is + also acceptable. See obs package documentation for more information. + surf_rate_specified : boolean + * surf_rate_specified (boolean) indicates that the evapotranspiration + rate at the ET surface will be specified as PETM0 in list input. + maxbound : integer + * maxbound (integer) integer value specifying the maximum number of + evapotranspiration cells cells that will be specified for use during + any stress period. + nseg : integer + * nseg (integer) number of ET segments. Default is one. When NSEG is + greater than 1, PXDP and PETM arrays must be specified NSEG - 1 times + each, in order from the uppermost segment down. PXDP defines the + extinction-depth proportion at the bottom of a segment. PETM defines + the proportion of the maximum ET flux rate at the bottom of a + segment. + stress_period_data : [cellid, surface, rate, depth, pxdp, petm, petm0, aux, + boundname] + * cellid ((integer, ...)) is the cell identifier, and depends on the + type of grid that is used for the simulation. For a structured grid + that uses the DIS input file, CELLID is the layer, row, and column. + For a grid that uses the DISV input file, CELLID is the layer and + CELL2D number. If the model uses the unstructured discretization + (DISU) input file, CELLID is the node number for the cell. + * surface (double) is the elevation of the ET surface (:math:`L`). A + time-series name may be specified. + * rate (double) is the maximum ET flux rate (:math:`LT^{-1}`). A time- + series name may be specified. + * depth (double) is the ET extinction depth (:math:`L`). A time-series + name may be specified. + * pxdp (double) is the proportion of the ET extinction depth at the + bottom of a segment (dimensionless). A time-series name may be + specified. + * petm (double) is the proportion of the maximum ET flux rate at the + bottom of a segment (dimensionless). A time-series name may be + specified. + * petm0 (double) is the proportion of the maximum ET flux rate that + will apply when head is at or above the ET surface (dimensionless). + PETM0 is read only when the SURF_RATE_SPECIFIED option is used. A + time-series name may be specified. + * aux (double) represents the values of the auxiliary variables for + each evapotranspiration. The values of auxiliary variables must be + present for each evapotranspiration. The values must be specified in + the order of the auxiliary variables specified in the OPTIONS block. + If the package supports time series and the Options block includes a + TIMESERIESFILE entry (see the "Time-Variable Input" section), values + can be obtained from a time series by entering the time-series name + in place of a numeric value. + * boundname (string) name of the evapotranspiration cell. BOUNDNAME is + an ASCII character variable that can contain as many as 40 + characters. If BOUNDNAME contains spaces in it, then the entire name + must be enclosed within single quotes. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + auxiliary = ListTemplateGenerator(('gwf6', 'evt', 'options', + 'auxiliary')) + ts_filerecord = ListTemplateGenerator(('gwf6', 'evt', 'options', + 'ts_filerecord')) + obs_filerecord = ListTemplateGenerator(('gwf6', 'evt', 'options', + 'obs_filerecord')) + stress_period_data = ListTemplateGenerator(('gwf6', 'evt', 'period', + 'stress_period_data')) + package_abbr = "gwfevt" + _package_type = "evt" + dfn_file_name = "gwf-evt.dfn" + + dfn = [["block options", "name fixed_cell", "type keyword", "shape", + "reader urword", "optional true"], + ["block options", "name auxiliary", "type string", + "shape (naux)", "reader urword", "optional true"], + ["block options", "name auxmultname", "type string", "shape", + "reader urword", "optional true"], + ["block options", "name boundnames", "type keyword", "shape", + "reader urword", "optional true"], + ["block options", "name print_input", "type keyword", + "reader urword", "optional true"], + ["block options", "name print_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name save_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name ts_filerecord", + "type record ts6 filein ts6_filename", "shape", "reader urword", + "tagged true", "optional true", "construct_package ts", + "construct_data timeseries", "parameter_name timeseries"], + ["block options", "name ts6", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name filein", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name ts6_filename", "type string", + "preserve_case true", "in_record true", "reader urword", + "optional false", "tagged false"], + ["block options", "name obs_filerecord", + "type record obs6 filein obs6_filename", "shape", "reader urword", + "tagged true", "optional true", "construct_package obs", + "construct_data continuous", "parameter_name observations"], + ["block options", "name obs6", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name obs6_filename", "type string", + "preserve_case true", "in_record true", "tagged false", + "reader urword", "optional false"], + ["block options", "name surf_rate_specified", "type keyword", + "reader urword", "optional true"], + ["block dimensions", "name maxbound", "type integer", + "reader urword", "optional false"], + ["block dimensions", "name nseg", "type integer", + "reader urword", "optional false"], + ["block period", "name iper", "type integer", + "block_variable True", "in_record true", "tagged false", "shape", + "valid", "reader urword", "optional false"], + ["block period", "name stress_period_data", + "type recarray cellid surface rate depth pxdp petm petm0 aux " + "boundname", + "shape (maxbound)", "reader urword"], + ["block period", "name cellid", "type integer", + "shape (ncelldim)", "tagged false", "in_record true", + "reader urword"], + ["block period", "name surface", "type double precision", + "shape", "tagged false", "in_record true", "reader urword", + "time_series true"], + ["block period", "name rate", "type double precision", "shape", + "tagged false", "in_record true", "reader urword", + "time_series true"], + ["block period", "name depth", "type double precision", "shape", + "tagged false", "in_record true", "reader urword", + "time_series true"], + ["block period", "name pxdp", "type double precision", + "shape (nseg-1)", "tagged false", "in_record true", + "reader urword", "time_series true"], + ["block period", "name petm", "type double precision", + "shape (nseg-1)", "tagged false", "in_record true", + "reader urword", "time_series true"], + ["block period", "name petm0", "type double precision", "shape", + "tagged false", "in_record true", "reader urword", + "optional true", "time_series true"], + ["block period", "name aux", "type double precision", + "in_record true", "tagged false", "shape (naux)", "reader urword", + "optional true", "time_series true"], + ["block period", "name boundname", "type string", "shape", + "tagged false", "in_record true", "reader urword", + "optional true"]] + + def __init__(self, model, loading_package=False, fixed_cell=None, + auxiliary=None, auxmultname=None, boundnames=None, + print_input=None, print_flows=None, save_flows=None, + timeseries=None, observations=None, surf_rate_specified=None, + maxbound=None, nseg=None, stress_period_data=None, + filename=None, pname=None, parent_file=None): + super(ModflowGwfevt, self).__init__(model, "evt", filename, pname, + loading_package, parent_file) + + # set up variables + self.fixed_cell = self.build_mfdata("fixed_cell", fixed_cell) + self.auxiliary = self.build_mfdata("auxiliary", auxiliary) + self.auxmultname = self.build_mfdata("auxmultname", auxmultname) + self.boundnames = self.build_mfdata("boundnames", boundnames) + self.print_input = self.build_mfdata("print_input", print_input) + self.print_flows = self.build_mfdata("print_flows", print_flows) + self.save_flows = self.build_mfdata("save_flows", save_flows) + self._ts_filerecord = self.build_mfdata("ts_filerecord", + None) + self._ts_package = self.build_child_package("ts", timeseries, + "timeseries", + self._ts_filerecord) + self._obs_filerecord = self.build_mfdata("obs_filerecord", + None) + self._obs_package = self.build_child_package("obs", observations, + "continuous", + self._obs_filerecord) + self.surf_rate_specified = self.build_mfdata("surf_rate_specified", + surf_rate_specified) + self.maxbound = self.build_mfdata("maxbound", maxbound) + self.nseg = self.build_mfdata("nseg", nseg) + self.stress_period_data = self.build_mfdata("stress_period_data", + stress_period_data) + self._init_complete = True diff --git a/flopy/mf6/modflow/mfgwfevta.py b/flopy/mf6/modflow/mfgwfevta.py index d09ce3f74d..b1d0049f50 100644 --- a/flopy/mf6/modflow/mfgwfevta.py +++ b/flopy/mf6/modflow/mfgwfevta.py @@ -1,200 +1,200 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ListTemplateGenerator, ArrayTemplateGenerator - - -class ModflowGwfevta(mfpackage.MFPackage): - """ - ModflowGwfevta defines a evta package within a gwf6 model. - - Parameters - ---------- - model : MFModel - Model that this package is a part of. Package is automatically - added to model when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - readasarrays : boolean - * readasarrays (boolean) indicates that array-based input will be used - for the Evapotranspiration Package. This keyword must be specified to - use array-based input. - fixed_cell : boolean - * fixed_cell (boolean) indicates that evapotranspiration will not be - reassigned to a cell underlying the cell specified in the list if the - specified cell is inactive. - auxiliary : [string] - * auxiliary (string) defines an array of one or more auxiliary variable - names. There is no limit on the number of auxiliary variables that - can be provided on this line; however, lists of information provided - in subsequent blocks must have a column of data for each auxiliary - variable name defined here. The number of auxiliary variables - detected on this line determines the value for naux. Comments cannot - be provided anywhere on this line as they will be interpreted as - auxiliary variable names. Auxiliary variables may not be used by the - package, but they will be available for use by other parts of the - program. The program will terminate with an error if auxiliary - variables are specified on more than one line in the options block. - auxmultname : string - * auxmultname (string) name of auxiliary variable to be used as - multiplier of evapotranspiration rate. - print_input : boolean - * print_input (boolean) keyword to indicate that the list of - evapotranspiration information will be written to the listing file - immediately after it is read. - print_flows : boolean - * print_flows (boolean) keyword to indicate that the list of - evapotranspiration flow rates will be printed to the listing file for - every stress period time step in which "BUDGET PRINT" is specified in - Output Control. If there is no Output Control option and - "PRINT_FLOWS" is specified, then flow rates are printed for the last - time step of each stress period. - save_flows : boolean - * save_flows (boolean) keyword to indicate that evapotranspiration flow - terms will be written to the file specified with "BUDGET FILEOUT" in - Output Control. - timearrayseries : {varname:data} or tas_array data - * Contains data for the tas package. Data can be stored in a dictionary - containing data for the tas package with variable names as keys and - package data as values. Data just for the timearrayseries variable is - also acceptable. See tas package documentation for more information. - observations : {varname:data} or continuous data - * Contains data for the obs package. Data can be stored in a dictionary - containing data for the obs package with variable names as keys and - package data as values. Data just for the observations variable is - also acceptable. See obs package documentation for more information. - ievt : [integer] - * ievt (integer) IEVT is the layer number that defines the layer in - each vertical column where evapotranspiration is applied. If IEVT is - omitted, evapotranspiration by default is applied to cells in layer - 1. If IEVT is specified, it must be specified as the first variable - in the PERIOD block or MODFLOW will terminate with an error. - surface : [double] - * surface (double) is the elevation of the ET surface (:math:`L`). - rate : [double] - * rate (double) is the maximum ET flux rate (:math:`LT^{-1}`). - depth : [double] - * depth (double) is the ET extinction depth (:math:`L`). - aux(iaux) : [double] - * aux(iaux) (double) is an array of values for auxiliary variable - AUX(IAUX), where iaux is a value from 1 to NAUX, and AUX(IAUX) must - be listed as part of the auxiliary variables. A separate array can be - specified for each auxiliary variable. If an array is not specified - for an auxiliary variable, then a value of zero is assigned. If the - value specified here for the auxiliary variable is the same as - auxmultname, then the evapotranspiration rate will be multiplied by - this array. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - auxiliary = ListTemplateGenerator(('gwf6', 'evta', 'options', - 'auxiliary')) - tas_filerecord = ListTemplateGenerator(('gwf6', 'evta', 'options', - 'tas_filerecord')) - obs_filerecord = ListTemplateGenerator(('gwf6', 'evta', 'options', - 'obs_filerecord')) - ievt = ArrayTemplateGenerator(('gwf6', 'evta', 'period', 'ievt')) - surface = ArrayTemplateGenerator(('gwf6', 'evta', 'period', - 'surface')) - rate = ArrayTemplateGenerator(('gwf6', 'evta', 'period', 'rate')) - depth = ArrayTemplateGenerator(('gwf6', 'evta', 'period', 'depth')) - aux = ArrayTemplateGenerator(('gwf6', 'evta', 'period', - 'aux(iaux)')) - package_abbr = "gwfevta" - _package_type = "evta" - dfn_file_name = "gwf-evta.dfn" - - dfn = [["block options", "name readasarrays", "type keyword", "shape", - "reader urword", "optional false", "default_value True"], - ["block options", "name fixed_cell", "type keyword", "shape", - "reader urword", "optional true"], - ["block options", "name auxiliary", "type string", - "shape (naux)", "reader urword", "optional true"], - ["block options", "name auxmultname", "type string", "shape", - "reader urword", "optional true"], - ["block options", "name print_input", "type keyword", - "reader urword", "optional true"], - ["block options", "name print_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name save_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name tas_filerecord", - "type record tas6 filein tas6_filename", "shape", "reader urword", - "tagged true", "optional true", "construct_package tas", - "construct_data tas_array", "parameter_name timearrayseries"], - ["block options", "name tas6", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name filein", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name tas6_filename", "type string", - "preserve_case true", "in_record true", "reader urword", - "optional false", "tagged false"], - ["block options", "name obs_filerecord", - "type record obs6 filein obs6_filename", "shape", "reader urword", - "tagged true", "optional true", "construct_package obs", - "construct_data continuous", "parameter_name observations"], - ["block options", "name obs6", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name obs6_filename", "type string", - "preserve_case true", "in_record true", "tagged false", - "reader urword", "optional false"], - ["block period", "name iper", "type integer", - "block_variable True", "in_record true", "tagged false", "shape", - "valid", "reader urword", "optional false"], - ["block period", "name ievt", "type integer", - "shape (ncol*nrow; ncpl)", "reader readarray", "optional true"], - ["block period", "name surface", "type double precision", - "shape (ncol*nrow; ncpl)", "reader readarray", "default_value 0."], - ["block period", "name rate", "type double precision", - "shape (ncol*nrow; ncpl)", "reader readarray", - "default_value 1.e-3"], - ["block period", "name depth", "type double precision", - "shape (ncol*nrow; ncpl)", "reader readarray", - "default_value 1.0"], - ["block period", "name aux(iaux)", "type double precision", - "shape (ncol*nrow; ncpl)", "reader readarray"]] - - def __init__(self, model, loading_package=False, readasarrays=True, - fixed_cell=None, auxiliary=None, auxmultname=None, - print_input=None, print_flows=None, save_flows=None, - timearrayseries=None, observations=None, ievt=None, - surface=0., rate=1.e-3, depth=1.0, aux=None, filename=None, - pname=None, parent_file=None): - super(ModflowGwfevta, self).__init__(model, "evta", filename, pname, - loading_package, parent_file) - - # set up variables - self.readasarrays = self.build_mfdata("readasarrays", readasarrays) - self.fixed_cell = self.build_mfdata("fixed_cell", fixed_cell) - self.auxiliary = self.build_mfdata("auxiliary", auxiliary) - self.auxmultname = self.build_mfdata("auxmultname", auxmultname) - self.print_input = self.build_mfdata("print_input", print_input) - self.print_flows = self.build_mfdata("print_flows", print_flows) - self.save_flows = self.build_mfdata("save_flows", save_flows) - self._tas_filerecord = self.build_mfdata("tas_filerecord", - None) - self._tas_package = self.build_child_package("tas", timearrayseries, - "tas_array", - self._tas_filerecord) - self._obs_filerecord = self.build_mfdata("obs_filerecord", - None) - self._obs_package = self.build_child_package("obs", observations, - "continuous", - self._obs_filerecord) - self.ievt = self.build_mfdata("ievt", ievt) - self.surface = self.build_mfdata("surface", surface) - self.rate = self.build_mfdata("rate", rate) - self.depth = self.build_mfdata("depth", depth) - self.aux = self.build_mfdata("aux(iaux)", aux) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ListTemplateGenerator, ArrayTemplateGenerator + + +class ModflowGwfevta(mfpackage.MFPackage): + """ + ModflowGwfevta defines a evta package within a gwf6 model. + + Parameters + ---------- + model : MFModel + Model that this package is a part of. Package is automatically + added to model when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + readasarrays : boolean + * readasarrays (boolean) indicates that array-based input will be used + for the Evapotranspiration Package. This keyword must be specified to + use array-based input. + fixed_cell : boolean + * fixed_cell (boolean) indicates that evapotranspiration will not be + reassigned to a cell underlying the cell specified in the list if the + specified cell is inactive. + auxiliary : [string] + * auxiliary (string) defines an array of one or more auxiliary variable + names. There is no limit on the number of auxiliary variables that + can be provided on this line; however, lists of information provided + in subsequent blocks must have a column of data for each auxiliary + variable name defined here. The number of auxiliary variables + detected on this line determines the value for naux. Comments cannot + be provided anywhere on this line as they will be interpreted as + auxiliary variable names. Auxiliary variables may not be used by the + package, but they will be available for use by other parts of the + program. The program will terminate with an error if auxiliary + variables are specified on more than one line in the options block. + auxmultname : string + * auxmultname (string) name of auxiliary variable to be used as + multiplier of evapotranspiration rate. + print_input : boolean + * print_input (boolean) keyword to indicate that the list of + evapotranspiration information will be written to the listing file + immediately after it is read. + print_flows : boolean + * print_flows (boolean) keyword to indicate that the list of + evapotranspiration flow rates will be printed to the listing file for + every stress period time step in which "BUDGET PRINT" is specified in + Output Control. If there is no Output Control option and + "PRINT_FLOWS" is specified, then flow rates are printed for the last + time step of each stress period. + save_flows : boolean + * save_flows (boolean) keyword to indicate that evapotranspiration flow + terms will be written to the file specified with "BUDGET FILEOUT" in + Output Control. + timearrayseries : {varname:data} or tas_array data + * Contains data for the tas package. Data can be stored in a dictionary + containing data for the tas package with variable names as keys and + package data as values. Data just for the timearrayseries variable is + also acceptable. See tas package documentation for more information. + observations : {varname:data} or continuous data + * Contains data for the obs package. Data can be stored in a dictionary + containing data for the obs package with variable names as keys and + package data as values. Data just for the observations variable is + also acceptable. See obs package documentation for more information. + ievt : [integer] + * ievt (integer) IEVT is the layer number that defines the layer in + each vertical column where evapotranspiration is applied. If IEVT is + omitted, evapotranspiration by default is applied to cells in layer + 1. If IEVT is specified, it must be specified as the first variable + in the PERIOD block or MODFLOW will terminate with an error. + surface : [double] + * surface (double) is the elevation of the ET surface (:math:`L`). + rate : [double] + * rate (double) is the maximum ET flux rate (:math:`LT^{-1}`). + depth : [double] + * depth (double) is the ET extinction depth (:math:`L`). + aux(iaux) : [double] + * aux(iaux) (double) is an array of values for auxiliary variable + AUX(IAUX), where iaux is a value from 1 to NAUX, and AUX(IAUX) must + be listed as part of the auxiliary variables. A separate array can be + specified for each auxiliary variable. If an array is not specified + for an auxiliary variable, then a value of zero is assigned. If the + value specified here for the auxiliary variable is the same as + auxmultname, then the evapotranspiration rate will be multiplied by + this array. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + auxiliary = ListTemplateGenerator(('gwf6', 'evta', 'options', + 'auxiliary')) + tas_filerecord = ListTemplateGenerator(('gwf6', 'evta', 'options', + 'tas_filerecord')) + obs_filerecord = ListTemplateGenerator(('gwf6', 'evta', 'options', + 'obs_filerecord')) + ievt = ArrayTemplateGenerator(('gwf6', 'evta', 'period', 'ievt')) + surface = ArrayTemplateGenerator(('gwf6', 'evta', 'period', + 'surface')) + rate = ArrayTemplateGenerator(('gwf6', 'evta', 'period', 'rate')) + depth = ArrayTemplateGenerator(('gwf6', 'evta', 'period', 'depth')) + aux = ArrayTemplateGenerator(('gwf6', 'evta', 'period', + 'aux(iaux)')) + package_abbr = "gwfevta" + _package_type = "evta" + dfn_file_name = "gwf-evta.dfn" + + dfn = [["block options", "name readasarrays", "type keyword", "shape", + "reader urword", "optional false", "default_value True"], + ["block options", "name fixed_cell", "type keyword", "shape", + "reader urword", "optional true"], + ["block options", "name auxiliary", "type string", + "shape (naux)", "reader urword", "optional true"], + ["block options", "name auxmultname", "type string", "shape", + "reader urword", "optional true"], + ["block options", "name print_input", "type keyword", + "reader urword", "optional true"], + ["block options", "name print_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name save_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name tas_filerecord", + "type record tas6 filein tas6_filename", "shape", "reader urword", + "tagged true", "optional true", "construct_package tas", + "construct_data tas_array", "parameter_name timearrayseries"], + ["block options", "name tas6", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name filein", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name tas6_filename", "type string", + "preserve_case true", "in_record true", "reader urword", + "optional false", "tagged false"], + ["block options", "name obs_filerecord", + "type record obs6 filein obs6_filename", "shape", "reader urword", + "tagged true", "optional true", "construct_package obs", + "construct_data continuous", "parameter_name observations"], + ["block options", "name obs6", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name obs6_filename", "type string", + "preserve_case true", "in_record true", "tagged false", + "reader urword", "optional false"], + ["block period", "name iper", "type integer", + "block_variable True", "in_record true", "tagged false", "shape", + "valid", "reader urword", "optional false"], + ["block period", "name ievt", "type integer", + "shape (ncol*nrow; ncpl)", "reader readarray", "optional true"], + ["block period", "name surface", "type double precision", + "shape (ncol*nrow; ncpl)", "reader readarray", "default_value 0."], + ["block period", "name rate", "type double precision", + "shape (ncol*nrow; ncpl)", "reader readarray", + "default_value 1.e-3"], + ["block period", "name depth", "type double precision", + "shape (ncol*nrow; ncpl)", "reader readarray", + "default_value 1.0"], + ["block period", "name aux(iaux)", "type double precision", + "shape (ncol*nrow; ncpl)", "reader readarray"]] + + def __init__(self, model, loading_package=False, readasarrays=True, + fixed_cell=None, auxiliary=None, auxmultname=None, + print_input=None, print_flows=None, save_flows=None, + timearrayseries=None, observations=None, ievt=None, + surface=0., rate=1.e-3, depth=1.0, aux=None, filename=None, + pname=None, parent_file=None): + super(ModflowGwfevta, self).__init__(model, "evta", filename, pname, + loading_package, parent_file) + + # set up variables + self.readasarrays = self.build_mfdata("readasarrays", readasarrays) + self.fixed_cell = self.build_mfdata("fixed_cell", fixed_cell) + self.auxiliary = self.build_mfdata("auxiliary", auxiliary) + self.auxmultname = self.build_mfdata("auxmultname", auxmultname) + self.print_input = self.build_mfdata("print_input", print_input) + self.print_flows = self.build_mfdata("print_flows", print_flows) + self.save_flows = self.build_mfdata("save_flows", save_flows) + self._tas_filerecord = self.build_mfdata("tas_filerecord", + None) + self._tas_package = self.build_child_package("tas", timearrayseries, + "tas_array", + self._tas_filerecord) + self._obs_filerecord = self.build_mfdata("obs_filerecord", + None) + self._obs_package = self.build_child_package("obs", observations, + "continuous", + self._obs_filerecord) + self.ievt = self.build_mfdata("ievt", ievt) + self.surface = self.build_mfdata("surface", surface) + self.rate = self.build_mfdata("rate", rate) + self.depth = self.build_mfdata("depth", depth) + self.aux = self.build_mfdata("aux(iaux)", aux) + self._init_complete = True diff --git a/flopy/mf6/modflow/mfgwfghb.py b/flopy/mf6/modflow/mfgwfghb.py index 7ecd0dd976..9e2068df9b 100644 --- a/flopy/mf6/modflow/mfgwfghb.py +++ b/flopy/mf6/modflow/mfgwfghb.py @@ -1,213 +1,213 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ListTemplateGenerator - - -class ModflowGwfghb(mfpackage.MFPackage): - """ - ModflowGwfghb defines a ghb package within a gwf6 model. - - Parameters - ---------- - model : MFModel - Model that this package is a part of. Package is automatically - added to model when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - auxiliary : [string] - * auxiliary (string) defines an array of one or more auxiliary variable - names. There is no limit on the number of auxiliary variables that - can be provided on this line; however, lists of information provided - in subsequent blocks must have a column of data for each auxiliary - variable name defined here. The number of auxiliary variables - detected on this line determines the value for naux. Comments cannot - be provided anywhere on this line as they will be interpreted as - auxiliary variable names. Auxiliary variables may not be used by the - package, but they will be available for use by other parts of the - program. The program will terminate with an error if auxiliary - variables are specified on more than one line in the options block. - auxmultname : string - * auxmultname (string) name of auxiliary variable to be used as - multiplier of general-head boundary conductance. - boundnames : boolean - * boundnames (boolean) keyword to indicate that boundary names may be - provided with the list of general-head boundary cells. - print_input : boolean - * print_input (boolean) keyword to indicate that the list of general- - head boundary information will be written to the listing file - immediately after it is read. - print_flows : boolean - * print_flows (boolean) keyword to indicate that the list of general- - head boundary flow rates will be printed to the listing file for - every stress period time step in which "BUDGET PRINT" is specified in - Output Control. If there is no Output Control option and - "PRINT_FLOWS" is specified, then flow rates are printed for the last - time step of each stress period. - save_flows : boolean - * save_flows (boolean) keyword to indicate that general-head boundary - flow terms will be written to the file specified with "BUDGET - FILEOUT" in Output Control. - timeseries : {varname:data} or timeseries data - * Contains data for the ts package. Data can be stored in a dictionary - containing data for the ts package with variable names as keys and - package data as values. Data just for the timeseries variable is also - acceptable. See ts package documentation for more information. - observations : {varname:data} or continuous data - * Contains data for the obs package. Data can be stored in a dictionary - containing data for the obs package with variable names as keys and - package data as values. Data just for the observations variable is - also acceptable. See obs package documentation for more information. - mover : boolean - * mover (boolean) keyword to indicate that this instance of the - General-Head Boundary Package can be used with the Water Mover (MVR) - Package. When the MOVER option is specified, additional memory is - allocated within the package to store the available, provided, and - received water. - maxbound : integer - * maxbound (integer) integer value specifying the maximum number of - general-head boundary cells that will be specified for use during any - stress period. - stress_period_data : [cellid, bhead, cond, aux, boundname] - * cellid ((integer, ...)) is the cell identifier, and depends on the - type of grid that is used for the simulation. For a structured grid - that uses the DIS input file, CELLID is the layer, row, and column. - For a grid that uses the DISV input file, CELLID is the layer and - CELL2D number. If the model uses the unstructured discretization - (DISU) input file, CELLID is the node number for the cell. - * bhead (double) is the boundary head. If the Options block includes a - TIMESERIESFILE entry (see the "Time-Variable Input" section), values - can be obtained from a time series by entering the time-series name - in place of a numeric value. - * cond (double) is the hydraulic conductance of the interface between - the aquifer cell and the boundary. If the Options block includes a - TIMESERIESFILE entry (see the "Time-Variable Input" section), values - can be obtained from a time series by entering the time-series name - in place of a numeric value. - * aux (double) represents the values of the auxiliary variables for - each general-head boundary. The values of auxiliary variables must be - present for each general-head boundary. The values must be specified - in the order of the auxiliary variables specified in the OPTIONS - block. If the package supports time series and the Options block - includes a TIMESERIESFILE entry (see the "Time-Variable Input" - section), values can be obtained from a time series by entering the - time-series name in place of a numeric value. - * boundname (string) name of the general-head boundary cell. BOUNDNAME - is an ASCII character variable that can contain as many as 40 - characters. If BOUNDNAME contains spaces in it, then the entire name - must be enclosed within single quotes. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - auxiliary = ListTemplateGenerator(('gwf6', 'ghb', 'options', - 'auxiliary')) - ts_filerecord = ListTemplateGenerator(('gwf6', 'ghb', 'options', - 'ts_filerecord')) - obs_filerecord = ListTemplateGenerator(('gwf6', 'ghb', 'options', - 'obs_filerecord')) - stress_period_data = ListTemplateGenerator(('gwf6', 'ghb', 'period', - 'stress_period_data')) - package_abbr = "gwfghb" - _package_type = "ghb" - dfn_file_name = "gwf-ghb.dfn" - - dfn = [["block options", "name auxiliary", "type string", - "shape (naux)", "reader urword", "optional true"], - ["block options", "name auxmultname", "type string", "shape", - "reader urword", "optional true"], - ["block options", "name boundnames", "type keyword", "shape", - "reader urword", "optional true"], - ["block options", "name print_input", "type keyword", - "reader urword", "optional true"], - ["block options", "name print_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name save_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name ts_filerecord", - "type record ts6 filein ts6_filename", "shape", "reader urword", - "tagged true", "optional true", "construct_package ts", - "construct_data timeseries", "parameter_name timeseries"], - ["block options", "name ts6", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name filein", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name ts6_filename", "type string", - "preserve_case true", "in_record true", "reader urword", - "optional false", "tagged false"], - ["block options", "name obs_filerecord", - "type record obs6 filein obs6_filename", "shape", "reader urword", - "tagged true", "optional true", "construct_package obs", - "construct_data continuous", "parameter_name observations"], - ["block options", "name obs6", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name obs6_filename", "type string", - "preserve_case true", "in_record true", "tagged false", - "reader urword", "optional false"], - ["block options", "name mover", "type keyword", "tagged true", - "reader urword", "optional true"], - ["block dimensions", "name maxbound", "type integer", - "reader urword", "optional false"], - ["block period", "name iper", "type integer", - "block_variable True", "in_record true", "tagged false", "shape", - "valid", "reader urword", "optional false"], - ["block period", "name stress_period_data", - "type recarray cellid bhead cond aux boundname", - "shape (maxbound)", "reader urword"], - ["block period", "name cellid", "type integer", - "shape (ncelldim)", "tagged false", "in_record true", - "reader urword"], - ["block period", "name bhead", "type double precision", "shape", - "tagged false", "in_record true", "reader urword", - "time_series true"], - ["block period", "name cond", "type double precision", "shape", - "tagged false", "in_record true", "reader urword", - "time_series true"], - ["block period", "name aux", "type double precision", - "in_record true", "tagged false", "shape (naux)", "reader urword", - "optional true", "time_series true"], - ["block period", "name boundname", "type string", "shape", - "tagged false", "in_record true", "reader urword", - "optional true"]] - - def __init__(self, model, loading_package=False, auxiliary=None, - auxmultname=None, boundnames=None, print_input=None, - print_flows=None, save_flows=None, timeseries=None, - observations=None, mover=None, maxbound=None, - stress_period_data=None, filename=None, pname=None, - parent_file=None): - super(ModflowGwfghb, self).__init__(model, "ghb", filename, pname, - loading_package, parent_file) - - # set up variables - self.auxiliary = self.build_mfdata("auxiliary", auxiliary) - self.auxmultname = self.build_mfdata("auxmultname", auxmultname) - self.boundnames = self.build_mfdata("boundnames", boundnames) - self.print_input = self.build_mfdata("print_input", print_input) - self.print_flows = self.build_mfdata("print_flows", print_flows) - self.save_flows = self.build_mfdata("save_flows", save_flows) - self._ts_filerecord = self.build_mfdata("ts_filerecord", - None) - self._ts_package = self.build_child_package("ts", timeseries, - "timeseries", - self._ts_filerecord) - self._obs_filerecord = self.build_mfdata("obs_filerecord", - None) - self._obs_package = self.build_child_package("obs", observations, - "continuous", - self._obs_filerecord) - self.mover = self.build_mfdata("mover", mover) - self.maxbound = self.build_mfdata("maxbound", maxbound) - self.stress_period_data = self.build_mfdata("stress_period_data", - stress_period_data) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ListTemplateGenerator + + +class ModflowGwfghb(mfpackage.MFPackage): + """ + ModflowGwfghb defines a ghb package within a gwf6 model. + + Parameters + ---------- + model : MFModel + Model that this package is a part of. Package is automatically + added to model when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + auxiliary : [string] + * auxiliary (string) defines an array of one or more auxiliary variable + names. There is no limit on the number of auxiliary variables that + can be provided on this line; however, lists of information provided + in subsequent blocks must have a column of data for each auxiliary + variable name defined here. The number of auxiliary variables + detected on this line determines the value for naux. Comments cannot + be provided anywhere on this line as they will be interpreted as + auxiliary variable names. Auxiliary variables may not be used by the + package, but they will be available for use by other parts of the + program. The program will terminate with an error if auxiliary + variables are specified on more than one line in the options block. + auxmultname : string + * auxmultname (string) name of auxiliary variable to be used as + multiplier of general-head boundary conductance. + boundnames : boolean + * boundnames (boolean) keyword to indicate that boundary names may be + provided with the list of general-head boundary cells. + print_input : boolean + * print_input (boolean) keyword to indicate that the list of general- + head boundary information will be written to the listing file + immediately after it is read. + print_flows : boolean + * print_flows (boolean) keyword to indicate that the list of general- + head boundary flow rates will be printed to the listing file for + every stress period time step in which "BUDGET PRINT" is specified in + Output Control. If there is no Output Control option and + "PRINT_FLOWS" is specified, then flow rates are printed for the last + time step of each stress period. + save_flows : boolean + * save_flows (boolean) keyword to indicate that general-head boundary + flow terms will be written to the file specified with "BUDGET + FILEOUT" in Output Control. + timeseries : {varname:data} or timeseries data + * Contains data for the ts package. Data can be stored in a dictionary + containing data for the ts package with variable names as keys and + package data as values. Data just for the timeseries variable is also + acceptable. See ts package documentation for more information. + observations : {varname:data} or continuous data + * Contains data for the obs package. Data can be stored in a dictionary + containing data for the obs package with variable names as keys and + package data as values. Data just for the observations variable is + also acceptable. See obs package documentation for more information. + mover : boolean + * mover (boolean) keyword to indicate that this instance of the + General-Head Boundary Package can be used with the Water Mover (MVR) + Package. When the MOVER option is specified, additional memory is + allocated within the package to store the available, provided, and + received water. + maxbound : integer + * maxbound (integer) integer value specifying the maximum number of + general-head boundary cells that will be specified for use during any + stress period. + stress_period_data : [cellid, bhead, cond, aux, boundname] + * cellid ((integer, ...)) is the cell identifier, and depends on the + type of grid that is used for the simulation. For a structured grid + that uses the DIS input file, CELLID is the layer, row, and column. + For a grid that uses the DISV input file, CELLID is the layer and + CELL2D number. If the model uses the unstructured discretization + (DISU) input file, CELLID is the node number for the cell. + * bhead (double) is the boundary head. If the Options block includes a + TIMESERIESFILE entry (see the "Time-Variable Input" section), values + can be obtained from a time series by entering the time-series name + in place of a numeric value. + * cond (double) is the hydraulic conductance of the interface between + the aquifer cell and the boundary. If the Options block includes a + TIMESERIESFILE entry (see the "Time-Variable Input" section), values + can be obtained from a time series by entering the time-series name + in place of a numeric value. + * aux (double) represents the values of the auxiliary variables for + each general-head boundary. The values of auxiliary variables must be + present for each general-head boundary. The values must be specified + in the order of the auxiliary variables specified in the OPTIONS + block. If the package supports time series and the Options block + includes a TIMESERIESFILE entry (see the "Time-Variable Input" + section), values can be obtained from a time series by entering the + time-series name in place of a numeric value. + * boundname (string) name of the general-head boundary cell. BOUNDNAME + is an ASCII character variable that can contain as many as 40 + characters. If BOUNDNAME contains spaces in it, then the entire name + must be enclosed within single quotes. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + auxiliary = ListTemplateGenerator(('gwf6', 'ghb', 'options', + 'auxiliary')) + ts_filerecord = ListTemplateGenerator(('gwf6', 'ghb', 'options', + 'ts_filerecord')) + obs_filerecord = ListTemplateGenerator(('gwf6', 'ghb', 'options', + 'obs_filerecord')) + stress_period_data = ListTemplateGenerator(('gwf6', 'ghb', 'period', + 'stress_period_data')) + package_abbr = "gwfghb" + _package_type = "ghb" + dfn_file_name = "gwf-ghb.dfn" + + dfn = [["block options", "name auxiliary", "type string", + "shape (naux)", "reader urword", "optional true"], + ["block options", "name auxmultname", "type string", "shape", + "reader urword", "optional true"], + ["block options", "name boundnames", "type keyword", "shape", + "reader urword", "optional true"], + ["block options", "name print_input", "type keyword", + "reader urword", "optional true"], + ["block options", "name print_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name save_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name ts_filerecord", + "type record ts6 filein ts6_filename", "shape", "reader urword", + "tagged true", "optional true", "construct_package ts", + "construct_data timeseries", "parameter_name timeseries"], + ["block options", "name ts6", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name filein", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name ts6_filename", "type string", + "preserve_case true", "in_record true", "reader urword", + "optional false", "tagged false"], + ["block options", "name obs_filerecord", + "type record obs6 filein obs6_filename", "shape", "reader urword", + "tagged true", "optional true", "construct_package obs", + "construct_data continuous", "parameter_name observations"], + ["block options", "name obs6", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name obs6_filename", "type string", + "preserve_case true", "in_record true", "tagged false", + "reader urword", "optional false"], + ["block options", "name mover", "type keyword", "tagged true", + "reader urword", "optional true"], + ["block dimensions", "name maxbound", "type integer", + "reader urword", "optional false"], + ["block period", "name iper", "type integer", + "block_variable True", "in_record true", "tagged false", "shape", + "valid", "reader urword", "optional false"], + ["block period", "name stress_period_data", + "type recarray cellid bhead cond aux boundname", + "shape (maxbound)", "reader urword"], + ["block period", "name cellid", "type integer", + "shape (ncelldim)", "tagged false", "in_record true", + "reader urword"], + ["block period", "name bhead", "type double precision", "shape", + "tagged false", "in_record true", "reader urword", + "time_series true"], + ["block period", "name cond", "type double precision", "shape", + "tagged false", "in_record true", "reader urword", + "time_series true"], + ["block period", "name aux", "type double precision", + "in_record true", "tagged false", "shape (naux)", "reader urword", + "optional true", "time_series true"], + ["block period", "name boundname", "type string", "shape", + "tagged false", "in_record true", "reader urword", + "optional true"]] + + def __init__(self, model, loading_package=False, auxiliary=None, + auxmultname=None, boundnames=None, print_input=None, + print_flows=None, save_flows=None, timeseries=None, + observations=None, mover=None, maxbound=None, + stress_period_data=None, filename=None, pname=None, + parent_file=None): + super(ModflowGwfghb, self).__init__(model, "ghb", filename, pname, + loading_package, parent_file) + + # set up variables + self.auxiliary = self.build_mfdata("auxiliary", auxiliary) + self.auxmultname = self.build_mfdata("auxmultname", auxmultname) + self.boundnames = self.build_mfdata("boundnames", boundnames) + self.print_input = self.build_mfdata("print_input", print_input) + self.print_flows = self.build_mfdata("print_flows", print_flows) + self.save_flows = self.build_mfdata("save_flows", save_flows) + self._ts_filerecord = self.build_mfdata("ts_filerecord", + None) + self._ts_package = self.build_child_package("ts", timeseries, + "timeseries", + self._ts_filerecord) + self._obs_filerecord = self.build_mfdata("obs_filerecord", + None) + self._obs_package = self.build_child_package("obs", observations, + "continuous", + self._obs_filerecord) + self.mover = self.build_mfdata("mover", mover) + self.maxbound = self.build_mfdata("maxbound", maxbound) + self.stress_period_data = self.build_mfdata("stress_period_data", + stress_period_data) + self._init_complete = True diff --git a/flopy/mf6/modflow/mfgwfgnc.py b/flopy/mf6/modflow/mfgwfgnc.py index 4dbf62deba..6f2c788cc1 100644 --- a/flopy/mf6/modflow/mfgwfgnc.py +++ b/flopy/mf6/modflow/mfgwfgnc.py @@ -1,134 +1,134 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ListTemplateGenerator - - -class ModflowGwfgnc(mfpackage.MFPackage): - """ - ModflowGwfgnc defines a gnc package within a gwf6 model. - - Parameters - ---------- - model : MFModel - Model that this package is a part of. Package is automatically - added to model when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - print_input : boolean - * print_input (boolean) keyword to indicate that the list of GNC - information will be written to the listing file immediately after it - is read. - print_flows : boolean - * print_flows (boolean) keyword to indicate that the list of GNC flow - rates will be printed to the listing file for every stress period - time step in which "BUDGET PRINT" is specified in Output Control. If - there is no Output Control option and "PRINT_FLOWS" is specified, - then flow rates are printed for the last time step of each stress - period. - explicit : boolean - * explicit (boolean) keyword to indicate that the ghost node correction - is applied in an explicit manner on the right-hand side of the - matrix. The explicit approach will likely require additional outer - iterations. If the keyword is not specified, then the correction will - be applied in an implicit manner on the left-hand side. The implicit - approach will likely converge better, but may require additional - memory. If the EXPLICIT keyword is not specified, then the BICGSTAB - linear acceleration option should be specified within the LINEAR - block of the Sparse Matrix Solver. - numgnc : integer - * numgnc (integer) is the number of GNC entries. - numalphaj : integer - * numalphaj (integer) is the number of contributing factors. - gncdata : [cellidn, cellidm, cellidsj, alphasj] - * cellidn ((integer, ...)) is the cellid of the cell, :math:`n`, in - which the ghost node is located. For a structured grid that uses the - DIS input file, CELLIDN is the layer, row, and column numbers of the - cell. For a grid that uses the DISV input file, CELLIDN is the layer - number and CELL2D number for the two cells. If the model uses the - unstructured discretization (DISU) input file, then CELLIDN is the - node number for the cell. - * cellidm ((integer, ...)) is the cellid of the connecting cell, - :math:`m`, to which flow occurs from the ghost node. For a structured - grid that uses the DIS input file, CELLIDM is the layer, row, and - column numbers of the cell. For a grid that uses the DISV input file, - CELLIDM is the layer number and CELL2D number for the two cells. If - the model uses the unstructured discretization (DISU) input file, - then CELLIDM is the node number for the cell. - * cellidsj ((integer, ...)) is the array of CELLIDS for the - contributing j cells, which contribute to the interpolated head value - at the ghost node. This item contains one CELLID for each of the - contributing cells of the ghost node. Note that if the number of - actual contributing cells needed by the user is less than NUMALPHAJ - for any ghost node, then a dummy CELLID of zero(s) should be inserted - with an associated contributing factor of zero. For a structured grid - that uses the DIS input file, CELLID is the layer, row, and column - numbers of the cell. For a grid that uses the DISV input file, CELLID - is the layer number and cell2d number for the two cells. If the model - uses the unstructured discretization (DISU) input file, then CELLID - is the node number for the cell. - * alphasj (double) is the contributing factors for each contributing - node in CELLIDSJ. Note that if the number of actual contributing - cells is less than NUMALPHAJ for any ghost node, then dummy CELLIDS - should be inserted with an associated contributing factor of zero. - The sum of ALPHASJ should be less than one. This is because one minus - the sum of ALPHASJ is equal to the alpha term (alpha n in equation - 4-61 of the GWF Model report) that is multiplied by the head in cell - n. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - gncdata = ListTemplateGenerator(('gwf6', 'gnc', 'gncdata', - 'gncdata')) - package_abbr = "gwfgnc" - _package_type = "gnc" - dfn_file_name = "gwf-gnc.dfn" - - dfn = [["block options", "name print_input", "type keyword", - "reader urword", "optional true"], - ["block options", "name print_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name explicit", "type keyword", "tagged true", - "reader urword", "optional true"], - ["block dimensions", "name numgnc", "type integer", - "reader urword", "optional false"], - ["block dimensions", "name numalphaj", "type integer", - "reader urword", "optional false"], - ["block gncdata", "name gncdata", - "type recarray cellidn cellidm cellidsj alphasj", - "shape (maxbound)", "reader urword"], - ["block gncdata", "name cellidn", "type integer", "shape", - "tagged false", "in_record true", "reader urword", - "numeric_index true"], - ["block gncdata", "name cellidm", "type integer", "shape", - "tagged false", "in_record true", "reader urword", - "numeric_index true"], - ["block gncdata", "name cellidsj", "type integer", - "shape (numalphaj)", "tagged false", "in_record true", - "reader urword", "numeric_index true"], - ["block gncdata", "name alphasj", "type double precision", - "shape (numalphaj)", "tagged false", "in_record true", - "reader urword"]] - - def __init__(self, model, loading_package=False, print_input=None, - print_flows=None, explicit=None, numgnc=None, numalphaj=None, - gncdata=None, filename=None, pname=None, parent_file=None): - super(ModflowGwfgnc, self).__init__(model, "gnc", filename, pname, - loading_package, parent_file) - - # set up variables - self.print_input = self.build_mfdata("print_input", print_input) - self.print_flows = self.build_mfdata("print_flows", print_flows) - self.explicit = self.build_mfdata("explicit", explicit) - self.numgnc = self.build_mfdata("numgnc", numgnc) - self.numalphaj = self.build_mfdata("numalphaj", numalphaj) - self.gncdata = self.build_mfdata("gncdata", gncdata) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ListTemplateGenerator + + +class ModflowGwfgnc(mfpackage.MFPackage): + """ + ModflowGwfgnc defines a gnc package within a gwf6 model. + + Parameters + ---------- + model : MFModel + Model that this package is a part of. Package is automatically + added to model when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + print_input : boolean + * print_input (boolean) keyword to indicate that the list of GNC + information will be written to the listing file immediately after it + is read. + print_flows : boolean + * print_flows (boolean) keyword to indicate that the list of GNC flow + rates will be printed to the listing file for every stress period + time step in which "BUDGET PRINT" is specified in Output Control. If + there is no Output Control option and "PRINT_FLOWS" is specified, + then flow rates are printed for the last time step of each stress + period. + explicit : boolean + * explicit (boolean) keyword to indicate that the ghost node correction + is applied in an explicit manner on the right-hand side of the + matrix. The explicit approach will likely require additional outer + iterations. If the keyword is not specified, then the correction will + be applied in an implicit manner on the left-hand side. The implicit + approach will likely converge better, but may require additional + memory. If the EXPLICIT keyword is not specified, then the BICGSTAB + linear acceleration option should be specified within the LINEAR + block of the Sparse Matrix Solver. + numgnc : integer + * numgnc (integer) is the number of GNC entries. + numalphaj : integer + * numalphaj (integer) is the number of contributing factors. + gncdata : [cellidn, cellidm, cellidsj, alphasj] + * cellidn ((integer, ...)) is the cellid of the cell, :math:`n`, in + which the ghost node is located. For a structured grid that uses the + DIS input file, CELLIDN is the layer, row, and column numbers of the + cell. For a grid that uses the DISV input file, CELLIDN is the layer + number and CELL2D number for the two cells. If the model uses the + unstructured discretization (DISU) input file, then CELLIDN is the + node number for the cell. + * cellidm ((integer, ...)) is the cellid of the connecting cell, + :math:`m`, to which flow occurs from the ghost node. For a structured + grid that uses the DIS input file, CELLIDM is the layer, row, and + column numbers of the cell. For a grid that uses the DISV input file, + CELLIDM is the layer number and CELL2D number for the two cells. If + the model uses the unstructured discretization (DISU) input file, + then CELLIDM is the node number for the cell. + * cellidsj ((integer, ...)) is the array of CELLIDS for the + contributing j cells, which contribute to the interpolated head value + at the ghost node. This item contains one CELLID for each of the + contributing cells of the ghost node. Note that if the number of + actual contributing cells needed by the user is less than NUMALPHAJ + for any ghost node, then a dummy CELLID of zero(s) should be inserted + with an associated contributing factor of zero. For a structured grid + that uses the DIS input file, CELLID is the layer, row, and column + numbers of the cell. For a grid that uses the DISV input file, CELLID + is the layer number and cell2d number for the two cells. If the model + uses the unstructured discretization (DISU) input file, then CELLID + is the node number for the cell. + * alphasj (double) is the contributing factors for each contributing + node in CELLIDSJ. Note that if the number of actual contributing + cells is less than NUMALPHAJ for any ghost node, then dummy CELLIDS + should be inserted with an associated contributing factor of zero. + The sum of ALPHASJ should be less than one. This is because one minus + the sum of ALPHASJ is equal to the alpha term (alpha n in equation + 4-61 of the GWF Model report) that is multiplied by the head in cell + n. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + gncdata = ListTemplateGenerator(('gwf6', 'gnc', 'gncdata', + 'gncdata')) + package_abbr = "gwfgnc" + _package_type = "gnc" + dfn_file_name = "gwf-gnc.dfn" + + dfn = [["block options", "name print_input", "type keyword", + "reader urword", "optional true"], + ["block options", "name print_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name explicit", "type keyword", "tagged true", + "reader urword", "optional true"], + ["block dimensions", "name numgnc", "type integer", + "reader urword", "optional false"], + ["block dimensions", "name numalphaj", "type integer", + "reader urword", "optional false"], + ["block gncdata", "name gncdata", + "type recarray cellidn cellidm cellidsj alphasj", + "shape (maxbound)", "reader urword"], + ["block gncdata", "name cellidn", "type integer", "shape", + "tagged false", "in_record true", "reader urword", + "numeric_index true"], + ["block gncdata", "name cellidm", "type integer", "shape", + "tagged false", "in_record true", "reader urword", + "numeric_index true"], + ["block gncdata", "name cellidsj", "type integer", + "shape (numalphaj)", "tagged false", "in_record true", + "reader urword", "numeric_index true"], + ["block gncdata", "name alphasj", "type double precision", + "shape (numalphaj)", "tagged false", "in_record true", + "reader urword"]] + + def __init__(self, model, loading_package=False, print_input=None, + print_flows=None, explicit=None, numgnc=None, numalphaj=None, + gncdata=None, filename=None, pname=None, parent_file=None): + super(ModflowGwfgnc, self).__init__(model, "gnc", filename, pname, + loading_package, parent_file) + + # set up variables + self.print_input = self.build_mfdata("print_input", print_input) + self.print_flows = self.build_mfdata("print_flows", print_flows) + self.explicit = self.build_mfdata("explicit", explicit) + self.numgnc = self.build_mfdata("numgnc", numgnc) + self.numalphaj = self.build_mfdata("numalphaj", numalphaj) + self.gncdata = self.build_mfdata("gncdata", gncdata) + self._init_complete = True diff --git a/flopy/mf6/modflow/mfgwfgwf.py b/flopy/mf6/modflow/mfgwfgwf.py index 54d7c90705..8364715059 100644 --- a/flopy/mf6/modflow/mfgwfgwf.py +++ b/flopy/mf6/modflow/mfgwfgwf.py @@ -1,272 +1,272 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ListTemplateGenerator - - -class ModflowGwfgwf(mfpackage.MFPackage): - """ - ModflowGwfgwf defines a gwfgwf package. - - Parameters - ---------- - simulation : MFSimulation - Simulation that this package is a part of. Package is automatically - added to simulation when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - exgtype : - * is the exchange type (GWF-GWF or GWF-GWT). - exgmnamea : - * is the name of the first model that is part of this exchange. - exgmnameb : - * is the name of the second model that is part of this exchange. - auxiliary : [string] - * auxiliary (string) an array of auxiliary variable names. There is no - limit on the number of auxiliary variables that can be provided. Most - auxiliary variables will not be used by the GWF-GWF Exchange, but - they will be available for use by other parts of the program. If an - auxiliary variable with the name "ANGLDEGX" is found, then this - information will be used as the angle (provided in degrees) between - the connection face normal and the x axis, where a value of zero - indicates that a normal vector points directly along the positive x - axis. The connection face normal is a normal vector on the cell face - shared between the cell in model 1 and the cell in model 2 pointing - away from the model 1 cell. Additional information on "ANGLDEGX" is - provided in the description of the DISU Package. If an auxiliary - variable with the name "CDIST" is found, then this information will - be used as the straight-line connection distance, including the - vertical component, between the two cell centers. Both ANGLDEGX and - CDIST are required if specific discharge is calculated for either of - the groundwater models. - print_input : boolean - * print_input (boolean) keyword to indicate that the list of exchange - entries will be echoed to the listing file immediately after it is - read. - print_flows : boolean - * print_flows (boolean) keyword to indicate that the list of exchange - flow rates will be printed to the listing file for every stress - period in which "SAVE BUDGET" is specified in Output Control. - save_flows : boolean - * save_flows (boolean) keyword to indicate that cell-by-cell flow terms - will be written to the budget file for each model provided that the - Output Control for the models are set up with the "BUDGET SAVE FILE" - option. - cell_averaging : string - * cell_averaging (string) is a keyword and text keyword to indicate the - method that will be used for calculating the conductance for - horizontal cell connections. The text value for CELL_AVERAGING can be - "HARMONIC", "LOGARITHMIC", or "AMT-LMK", which means "arithmetic-mean - thickness and logarithmic-mean hydraulic conductivity". If the user - does not specify a value for CELL_AVERAGING, then the harmonic-mean - method will be used. - cvoptions : [dewatered] - * dewatered (string) If the DEWATERED keyword is specified, then the - vertical conductance is calculated using only the saturated thickness - and properties of the overlying cell if the head in the underlying - cell is below its top. - newton : boolean - * newton (boolean) keyword that activates the Newton-Raphson - formulation for groundwater flow between connected, convertible - groundwater cells. Cells will not dry when this option is used. - gnc_filerecord : [gnc6_filename] - * gnc6_filename (string) is the file name for ghost node correction - input file. Information for the ghost nodes are provided in the file - provided with these keywords. The format for specifying the ghost - nodes is the same as described for the GNC Package of the GWF Model. - This includes specifying OPTIONS, DIMENSIONS, and GNCDATA blocks. The - order of the ghost nodes must follow the same order as the order of - the cells in the EXCHANGEDATA block. For the GNCDATA, noden and all - of the nodej values are assumed to be located in model 1, and nodem - is assumed to be in model 2. - mvr_filerecord : [mvr6_filename] - * mvr6_filename (string) is the file name of the water mover input file - to apply to this exchange. Information for the water mover are - provided in the file provided with these keywords. The format for - specifying the water mover information is the same as described for - the Water Mover (MVR) Package of the GWF Model, with two exceptions. - First, in the PACKAGES block, the model name must be included as a - separate string before each package. Second, the appropriate model - name must be included before package name 1 and package name 2 in the - BEGIN PERIOD block. This allows providers and receivers to be located - in both models listed as part of this exchange. - observations : {varname:data} or continuous data - * Contains data for the obs package. Data can be stored in a dictionary - containing data for the obs package with variable names as keys and - package data as values. Data just for the observations variable is - also acceptable. See obs package documentation for more information. - nexg : integer - * nexg (integer) keyword and integer value specifying the number of - GWF-GWF exchanges. - exchangedata : [cellidm1, cellidm2, ihc, cl1, cl2, hwva, aux] - * cellidm1 ((integer, ...)) is the cellid of the cell in model 1 as - specified in the simulation name file. For a structured grid that - uses the DIS input file, CELLIDM1 is the layer, row, and column - numbers of the cell. For a grid that uses the DISV input file, - CELLIDM1 is the layer number and CELL2D number for the two cells. If - the model uses the unstructured discretization (DISU) input file, - then CELLIDM1 is the node number for the cell. - * cellidm2 ((integer, ...)) is the cellid of the cell in model 2 as - specified in the simulation name file. For a structured grid that - uses the DIS input file, CELLIDM2 is the layer, row, and column - numbers of the cell. For a grid that uses the DISV input file, - CELLIDM2 is the layer number and CELL2D number for the two cells. If - the model uses the unstructured discretization (DISU) input file, - then CELLIDM2 is the node number for the cell. - * ihc (integer) is an integer flag indicating the direction between - node n and all of its m connections. If IHC = 0 then the connection - is vertical. If IHC = 1 then the connection is horizontal. If IHC = 2 - then the connection is horizontal for a vertically staggered grid. - * cl1 (double) is the distance between the center of cell 1 and the its - shared face with cell 2. - * cl2 (double) is the distance between the center of cell 2 and the its - shared face with cell 1. - * hwva (double) is the horizontal width of the flow connection between - cell 1 and cell 2 if IHC :math:`>` 0, or it is the area perpendicular - to flow of the vertical connection between cell 1 and cell 2 if IHC = - 0. - * aux (double) represents the values of the auxiliary variables for - each GWFGWF Exchange. The values of auxiliary variables must be - present for each exchange. The values must be specified in the order - of the auxiliary variables specified in the OPTIONS block. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - auxiliary = ListTemplateGenerator(('gwfgwf', 'options', 'auxiliary')) - gnc_filerecord = ListTemplateGenerator(('gwfgwf', 'options', - 'gnc_filerecord')) - mvr_filerecord = ListTemplateGenerator(('gwfgwf', 'options', - 'mvr_filerecord')) - obs_filerecord = ListTemplateGenerator(('gwfgwf', 'options', - 'obs_filerecord')) - exchangedata = ListTemplateGenerator(('gwfgwf', 'exchangedata', - 'exchangedata')) - package_abbr = "gwfgwf" - _package_type = "gwfgwf" - dfn_file_name = "exg-gwfgwf.dfn" - - dfn = [["block options", "name auxiliary", "type string", - "shape (naux)", "reader urword", "optional true"], - ["block options", "name print_input", "type keyword", - "reader urword", "optional true"], - ["block options", "name print_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name save_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name cell_averaging", "type string", - "valid harmonic logarithmic amt-lmk", "reader urword", - "optional true"], - ["block options", "name cvoptions", - "type record variablecv dewatered", "reader urword", - "optional true"], - ["block options", "name variablecv", "in_record true", - "type keyword", "reader urword"], - ["block options", "name dewatered", "in_record true", - "type keyword", "reader urword", "optional true"], - ["block options", "name newton", "type keyword", "reader urword", - "optional true"], - ["block options", "name gnc_filerecord", - "type record gnc6 filein gnc6_filename", "shape", "reader urword", - "tagged true", "optional true"], - ["block options", "name filein", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name gnc6", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name gnc6_filename", "type string", - "preserve_case true", "in_record true", "tagged false", - "reader urword", "optional false"], - ["block options", "name mvr_filerecord", - "type record mvr6 filein mvr6_filename", "shape", "reader urword", - "tagged true", "optional true"], - ["block options", "name mvr6", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name mvr6_filename", "type string", - "preserve_case true", "in_record true", "tagged false", - "reader urword", "optional false"], - ["block options", "name obs_filerecord", - "type record obs6 filein obs6_filename", "shape", "reader urword", - "tagged true", "optional true", "construct_package obs", - "construct_data continuous", "parameter_name observations"], - ["block options", "name obs6", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name obs6_filename", "type string", - "preserve_case true", "in_record true", "tagged false", - "reader urword", "optional false"], - ["block dimensions", "name nexg", "type integer", - "reader urword", "optional false"], - ["block exchangedata", "name exchangedata", - "type recarray cellidm1 cellidm2 ihc cl1 cl2 hwva aux", - "reader urword", "optional false"], - ["block exchangedata", "name cellidm1", "type integer", - "in_record true", "tagged false", "reader urword", - "optional false", "numeric_index true"], - ["block exchangedata", "name cellidm2", "type integer", - "in_record true", "tagged false", "reader urword", - "optional false", "numeric_index true"], - ["block exchangedata", "name ihc", "type integer", - "in_record true", "tagged false", "reader urword", - "optional false"], - ["block exchangedata", "name cl1", "type double precision", - "in_record true", "tagged false", "reader urword", - "optional false"], - ["block exchangedata", "name cl2", "type double precision", - "in_record true", "tagged false", "reader urword", - "optional false"], - ["block exchangedata", "name hwva", "type double precision", - "in_record true", "tagged false", "reader urword", - "optional false"], - ["block exchangedata", "name aux", "type double precision", - "in_record true", "tagged false", "shape (naux)", "reader urword", - "optional true"]] - - def __init__(self, simulation, loading_package=False, exgtype=None, - exgmnamea=None, exgmnameb=None, auxiliary=None, - print_input=None, print_flows=None, save_flows=None, - cell_averaging=None, cvoptions=None, newton=None, - gnc_filerecord=None, mvr_filerecord=None, observations=None, - nexg=None, exchangedata=None, filename=None, pname=None, - parent_file=None): - super(ModflowGwfgwf, self).__init__(simulation, "gwfgwf", filename, pname, - loading_package, parent_file) - - # set up variables - self.exgtype = exgtype - - self.exgmnamea = exgmnamea - - self.exgmnameb = exgmnameb - - simulation.register_exchange_file(self) - - self.auxiliary = self.build_mfdata("auxiliary", auxiliary) - self.print_input = self.build_mfdata("print_input", print_input) - self.print_flows = self.build_mfdata("print_flows", print_flows) - self.save_flows = self.build_mfdata("save_flows", save_flows) - self.cell_averaging = self.build_mfdata("cell_averaging", - cell_averaging) - self.cvoptions = self.build_mfdata("cvoptions", cvoptions) - self.newton = self.build_mfdata("newton", newton) - self.gnc_filerecord = self.build_mfdata("gnc_filerecord", - gnc_filerecord) - self.mvr_filerecord = self.build_mfdata("mvr_filerecord", - mvr_filerecord) - self._obs_filerecord = self.build_mfdata("obs_filerecord", - None) - self._obs_package = self.build_child_package("obs", observations, - "continuous", - self._obs_filerecord) - self.nexg = self.build_mfdata("nexg", nexg) - self.exchangedata = self.build_mfdata("exchangedata", exchangedata) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ListTemplateGenerator + + +class ModflowGwfgwf(mfpackage.MFPackage): + """ + ModflowGwfgwf defines a gwfgwf package. + + Parameters + ---------- + simulation : MFSimulation + Simulation that this package is a part of. Package is automatically + added to simulation when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + exgtype : + * is the exchange type (GWF-GWF or GWF-GWT). + exgmnamea : + * is the name of the first model that is part of this exchange. + exgmnameb : + * is the name of the second model that is part of this exchange. + auxiliary : [string] + * auxiliary (string) an array of auxiliary variable names. There is no + limit on the number of auxiliary variables that can be provided. Most + auxiliary variables will not be used by the GWF-GWF Exchange, but + they will be available for use by other parts of the program. If an + auxiliary variable with the name "ANGLDEGX" is found, then this + information will be used as the angle (provided in degrees) between + the connection face normal and the x axis, where a value of zero + indicates that a normal vector points directly along the positive x + axis. The connection face normal is a normal vector on the cell face + shared between the cell in model 1 and the cell in model 2 pointing + away from the model 1 cell. Additional information on "ANGLDEGX" is + provided in the description of the DISU Package. If an auxiliary + variable with the name "CDIST" is found, then this information will + be used as the straight-line connection distance, including the + vertical component, between the two cell centers. Both ANGLDEGX and + CDIST are required if specific discharge is calculated for either of + the groundwater models. + print_input : boolean + * print_input (boolean) keyword to indicate that the list of exchange + entries will be echoed to the listing file immediately after it is + read. + print_flows : boolean + * print_flows (boolean) keyword to indicate that the list of exchange + flow rates will be printed to the listing file for every stress + period in which "SAVE BUDGET" is specified in Output Control. + save_flows : boolean + * save_flows (boolean) keyword to indicate that cell-by-cell flow terms + will be written to the budget file for each model provided that the + Output Control for the models are set up with the "BUDGET SAVE FILE" + option. + cell_averaging : string + * cell_averaging (string) is a keyword and text keyword to indicate the + method that will be used for calculating the conductance for + horizontal cell connections. The text value for CELL_AVERAGING can be + "HARMONIC", "LOGARITHMIC", or "AMT-LMK", which means "arithmetic-mean + thickness and logarithmic-mean hydraulic conductivity". If the user + does not specify a value for CELL_AVERAGING, then the harmonic-mean + method will be used. + cvoptions : [dewatered] + * dewatered (string) If the DEWATERED keyword is specified, then the + vertical conductance is calculated using only the saturated thickness + and properties of the overlying cell if the head in the underlying + cell is below its top. + newton : boolean + * newton (boolean) keyword that activates the Newton-Raphson + formulation for groundwater flow between connected, convertible + groundwater cells. Cells will not dry when this option is used. + gnc_filerecord : [gnc6_filename] + * gnc6_filename (string) is the file name for ghost node correction + input file. Information for the ghost nodes are provided in the file + provided with these keywords. The format for specifying the ghost + nodes is the same as described for the GNC Package of the GWF Model. + This includes specifying OPTIONS, DIMENSIONS, and GNCDATA blocks. The + order of the ghost nodes must follow the same order as the order of + the cells in the EXCHANGEDATA block. For the GNCDATA, noden and all + of the nodej values are assumed to be located in model 1, and nodem + is assumed to be in model 2. + mvr_filerecord : [mvr6_filename] + * mvr6_filename (string) is the file name of the water mover input file + to apply to this exchange. Information for the water mover are + provided in the file provided with these keywords. The format for + specifying the water mover information is the same as described for + the Water Mover (MVR) Package of the GWF Model, with two exceptions. + First, in the PACKAGES block, the model name must be included as a + separate string before each package. Second, the appropriate model + name must be included before package name 1 and package name 2 in the + BEGIN PERIOD block. This allows providers and receivers to be located + in both models listed as part of this exchange. + observations : {varname:data} or continuous data + * Contains data for the obs package. Data can be stored in a dictionary + containing data for the obs package with variable names as keys and + package data as values. Data just for the observations variable is + also acceptable. See obs package documentation for more information. + nexg : integer + * nexg (integer) keyword and integer value specifying the number of + GWF-GWF exchanges. + exchangedata : [cellidm1, cellidm2, ihc, cl1, cl2, hwva, aux] + * cellidm1 ((integer, ...)) is the cellid of the cell in model 1 as + specified in the simulation name file. For a structured grid that + uses the DIS input file, CELLIDM1 is the layer, row, and column + numbers of the cell. For a grid that uses the DISV input file, + CELLIDM1 is the layer number and CELL2D number for the two cells. If + the model uses the unstructured discretization (DISU) input file, + then CELLIDM1 is the node number for the cell. + * cellidm2 ((integer, ...)) is the cellid of the cell in model 2 as + specified in the simulation name file. For a structured grid that + uses the DIS input file, CELLIDM2 is the layer, row, and column + numbers of the cell. For a grid that uses the DISV input file, + CELLIDM2 is the layer number and CELL2D number for the two cells. If + the model uses the unstructured discretization (DISU) input file, + then CELLIDM2 is the node number for the cell. + * ihc (integer) is an integer flag indicating the direction between + node n and all of its m connections. If IHC = 0 then the connection + is vertical. If IHC = 1 then the connection is horizontal. If IHC = 2 + then the connection is horizontal for a vertically staggered grid. + * cl1 (double) is the distance between the center of cell 1 and the its + shared face with cell 2. + * cl2 (double) is the distance between the center of cell 2 and the its + shared face with cell 1. + * hwva (double) is the horizontal width of the flow connection between + cell 1 and cell 2 if IHC :math:`>` 0, or it is the area perpendicular + to flow of the vertical connection between cell 1 and cell 2 if IHC = + 0. + * aux (double) represents the values of the auxiliary variables for + each GWFGWF Exchange. The values of auxiliary variables must be + present for each exchange. The values must be specified in the order + of the auxiliary variables specified in the OPTIONS block. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + auxiliary = ListTemplateGenerator(('gwfgwf', 'options', 'auxiliary')) + gnc_filerecord = ListTemplateGenerator(('gwfgwf', 'options', + 'gnc_filerecord')) + mvr_filerecord = ListTemplateGenerator(('gwfgwf', 'options', + 'mvr_filerecord')) + obs_filerecord = ListTemplateGenerator(('gwfgwf', 'options', + 'obs_filerecord')) + exchangedata = ListTemplateGenerator(('gwfgwf', 'exchangedata', + 'exchangedata')) + package_abbr = "gwfgwf" + _package_type = "gwfgwf" + dfn_file_name = "exg-gwfgwf.dfn" + + dfn = [["block options", "name auxiliary", "type string", + "shape (naux)", "reader urword", "optional true"], + ["block options", "name print_input", "type keyword", + "reader urword", "optional true"], + ["block options", "name print_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name save_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name cell_averaging", "type string", + "valid harmonic logarithmic amt-lmk", "reader urword", + "optional true"], + ["block options", "name cvoptions", + "type record variablecv dewatered", "reader urword", + "optional true"], + ["block options", "name variablecv", "in_record true", + "type keyword", "reader urword"], + ["block options", "name dewatered", "in_record true", + "type keyword", "reader urword", "optional true"], + ["block options", "name newton", "type keyword", "reader urword", + "optional true"], + ["block options", "name gnc_filerecord", + "type record gnc6 filein gnc6_filename", "shape", "reader urword", + "tagged true", "optional true"], + ["block options", "name filein", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name gnc6", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name gnc6_filename", "type string", + "preserve_case true", "in_record true", "tagged false", + "reader urword", "optional false"], + ["block options", "name mvr_filerecord", + "type record mvr6 filein mvr6_filename", "shape", "reader urword", + "tagged true", "optional true"], + ["block options", "name mvr6", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name mvr6_filename", "type string", + "preserve_case true", "in_record true", "tagged false", + "reader urword", "optional false"], + ["block options", "name obs_filerecord", + "type record obs6 filein obs6_filename", "shape", "reader urword", + "tagged true", "optional true", "construct_package obs", + "construct_data continuous", "parameter_name observations"], + ["block options", "name obs6", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name obs6_filename", "type string", + "preserve_case true", "in_record true", "tagged false", + "reader urword", "optional false"], + ["block dimensions", "name nexg", "type integer", + "reader urword", "optional false"], + ["block exchangedata", "name exchangedata", + "type recarray cellidm1 cellidm2 ihc cl1 cl2 hwva aux", + "reader urword", "optional false"], + ["block exchangedata", "name cellidm1", "type integer", + "in_record true", "tagged false", "reader urword", + "optional false", "numeric_index true"], + ["block exchangedata", "name cellidm2", "type integer", + "in_record true", "tagged false", "reader urword", + "optional false", "numeric_index true"], + ["block exchangedata", "name ihc", "type integer", + "in_record true", "tagged false", "reader urword", + "optional false"], + ["block exchangedata", "name cl1", "type double precision", + "in_record true", "tagged false", "reader urword", + "optional false"], + ["block exchangedata", "name cl2", "type double precision", + "in_record true", "tagged false", "reader urword", + "optional false"], + ["block exchangedata", "name hwva", "type double precision", + "in_record true", "tagged false", "reader urword", + "optional false"], + ["block exchangedata", "name aux", "type double precision", + "in_record true", "tagged false", "shape (naux)", "reader urword", + "optional true"]] + + def __init__(self, simulation, loading_package=False, exgtype=None, + exgmnamea=None, exgmnameb=None, auxiliary=None, + print_input=None, print_flows=None, save_flows=None, + cell_averaging=None, cvoptions=None, newton=None, + gnc_filerecord=None, mvr_filerecord=None, observations=None, + nexg=None, exchangedata=None, filename=None, pname=None, + parent_file=None): + super(ModflowGwfgwf, self).__init__(simulation, "gwfgwf", filename, pname, + loading_package, parent_file) + + # set up variables + self.exgtype = exgtype + + self.exgmnamea = exgmnamea + + self.exgmnameb = exgmnameb + + simulation.register_exchange_file(self) + + self.auxiliary = self.build_mfdata("auxiliary", auxiliary) + self.print_input = self.build_mfdata("print_input", print_input) + self.print_flows = self.build_mfdata("print_flows", print_flows) + self.save_flows = self.build_mfdata("save_flows", save_flows) + self.cell_averaging = self.build_mfdata("cell_averaging", + cell_averaging) + self.cvoptions = self.build_mfdata("cvoptions", cvoptions) + self.newton = self.build_mfdata("newton", newton) + self.gnc_filerecord = self.build_mfdata("gnc_filerecord", + gnc_filerecord) + self.mvr_filerecord = self.build_mfdata("mvr_filerecord", + mvr_filerecord) + self._obs_filerecord = self.build_mfdata("obs_filerecord", + None) + self._obs_package = self.build_child_package("obs", observations, + "continuous", + self._obs_filerecord) + self.nexg = self.build_mfdata("nexg", nexg) + self.exchangedata = self.build_mfdata("exchangedata", exchangedata) + self._init_complete = True diff --git a/flopy/mf6/modflow/mfgwfhfb.py b/flopy/mf6/modflow/mfgwfhfb.py index 038ea7f9bc..b111d4405a 100644 --- a/flopy/mf6/modflow/mfgwfhfb.py +++ b/flopy/mf6/modflow/mfgwfhfb.py @@ -1,95 +1,95 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ListTemplateGenerator - - -class ModflowGwfhfb(mfpackage.MFPackage): - """ - ModflowGwfhfb defines a hfb package within a gwf6 model. - - Parameters - ---------- - model : MFModel - Model that this package is a part of. Package is automatically - added to model when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - print_input : boolean - * print_input (boolean) keyword to indicate that the list of horizontal - flow barriers will be written to the listing file immediately after - it is read. - maxhfb : integer - * maxhfb (integer) integer value specifying the maximum number of - horizontal flow barriers that will be entered in this input file. The - value of MAXHFB is used to allocate memory for the horizontal flow - barriers. - stress_period_data : [cellid1, cellid2, hydchr] - * cellid1 ((integer, ...)) identifier for the first cell. For a - structured grid that uses the DIS input file, CELLID1 is the layer, - row, and column numbers of the cell. For a grid that uses the DISV - input file, CELLID1 is the layer number and CELL2D number for the two - cells. If the model uses the unstructured discretization (DISU) input - file, then CELLID1 is the node numbers for the cell. The barrier is - located between cells designated as CELLID1 and CELLID2. For models - that use the DIS and DISV grid types, the layer number for CELLID1 - and CELLID2 must be the same. For all grid types, cells must be - horizontally adjacent or the program will terminate with an error. - * cellid2 ((integer, ...)) identifier for the second cell. See CELLID1 - for description of how to specify. - * hydchr (double) is the hydraulic characteristic of the horizontal- - flow barrier. The hydraulic characteristic is the barrier hydraulic - conductivity divided by the width of the horizontal-flow barrier. If - the hydraulic characteristic is negative, then the absolute value of - HYDCHR acts as a multiplier to the conductance between the two model - cells specified as containing the barrier. For example, if the value - for HYDCHR was specified as -1.5, the conductance calculated for the - two cells would be multiplied by 1.5. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - stress_period_data = ListTemplateGenerator(('gwf6', 'hfb', 'period', - 'stress_period_data')) - package_abbr = "gwfhfb" - _package_type = "hfb" - dfn_file_name = "gwf-hfb.dfn" - - dfn = [["block options", "name print_input", "type keyword", - "reader urword", "optional true"], - ["block dimensions", "name maxhfb", "type integer", - "reader urword", "optional false"], - ["block period", "name iper", "type integer", - "block_variable True", "in_record true", "tagged false", "shape", - "valid", "reader urword", "optional false"], - ["block period", "name stress_period_data", - "type recarray cellid1 cellid2 hydchr", "shape (maxhfb)", - "reader urword"], - ["block period", "name cellid1", "type integer", - "shape (ncelldim)", "tagged false", "in_record true", - "reader urword"], - ["block period", "name cellid2", "type integer", - "shape (ncelldim)", "tagged false", "in_record true", - "reader urword"], - ["block period", "name hydchr", "type double precision", "shape", - "tagged false", "in_record true", "reader urword"]] - - def __init__(self, model, loading_package=False, print_input=None, - maxhfb=None, stress_period_data=None, filename=None, - pname=None, parent_file=None): - super(ModflowGwfhfb, self).__init__(model, "hfb", filename, pname, - loading_package, parent_file) - - # set up variables - self.print_input = self.build_mfdata("print_input", print_input) - self.maxhfb = self.build_mfdata("maxhfb", maxhfb) - self.stress_period_data = self.build_mfdata("stress_period_data", - stress_period_data) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ListTemplateGenerator + + +class ModflowGwfhfb(mfpackage.MFPackage): + """ + ModflowGwfhfb defines a hfb package within a gwf6 model. + + Parameters + ---------- + model : MFModel + Model that this package is a part of. Package is automatically + added to model when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + print_input : boolean + * print_input (boolean) keyword to indicate that the list of horizontal + flow barriers will be written to the listing file immediately after + it is read. + maxhfb : integer + * maxhfb (integer) integer value specifying the maximum number of + horizontal flow barriers that will be entered in this input file. The + value of MAXHFB is used to allocate memory for the horizontal flow + barriers. + stress_period_data : [cellid1, cellid2, hydchr] + * cellid1 ((integer, ...)) identifier for the first cell. For a + structured grid that uses the DIS input file, CELLID1 is the layer, + row, and column numbers of the cell. For a grid that uses the DISV + input file, CELLID1 is the layer number and CELL2D number for the two + cells. If the model uses the unstructured discretization (DISU) input + file, then CELLID1 is the node numbers for the cell. The barrier is + located between cells designated as CELLID1 and CELLID2. For models + that use the DIS and DISV grid types, the layer number for CELLID1 + and CELLID2 must be the same. For all grid types, cells must be + horizontally adjacent or the program will terminate with an error. + * cellid2 ((integer, ...)) identifier for the second cell. See CELLID1 + for description of how to specify. + * hydchr (double) is the hydraulic characteristic of the horizontal- + flow barrier. The hydraulic characteristic is the barrier hydraulic + conductivity divided by the width of the horizontal-flow barrier. If + the hydraulic characteristic is negative, then the absolute value of + HYDCHR acts as a multiplier to the conductance between the two model + cells specified as containing the barrier. For example, if the value + for HYDCHR was specified as -1.5, the conductance calculated for the + two cells would be multiplied by 1.5. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + stress_period_data = ListTemplateGenerator(('gwf6', 'hfb', 'period', + 'stress_period_data')) + package_abbr = "gwfhfb" + _package_type = "hfb" + dfn_file_name = "gwf-hfb.dfn" + + dfn = [["block options", "name print_input", "type keyword", + "reader urword", "optional true"], + ["block dimensions", "name maxhfb", "type integer", + "reader urword", "optional false"], + ["block period", "name iper", "type integer", + "block_variable True", "in_record true", "tagged false", "shape", + "valid", "reader urword", "optional false"], + ["block period", "name stress_period_data", + "type recarray cellid1 cellid2 hydchr", "shape (maxhfb)", + "reader urword"], + ["block period", "name cellid1", "type integer", + "shape (ncelldim)", "tagged false", "in_record true", + "reader urword"], + ["block period", "name cellid2", "type integer", + "shape (ncelldim)", "tagged false", "in_record true", + "reader urword"], + ["block period", "name hydchr", "type double precision", "shape", + "tagged false", "in_record true", "reader urword"]] + + def __init__(self, model, loading_package=False, print_input=None, + maxhfb=None, stress_period_data=None, filename=None, + pname=None, parent_file=None): + super(ModflowGwfhfb, self).__init__(model, "hfb", filename, pname, + loading_package, parent_file) + + # set up variables + self.print_input = self.build_mfdata("print_input", print_input) + self.maxhfb = self.build_mfdata("maxhfb", maxhfb) + self.stress_period_data = self.build_mfdata("stress_period_data", + stress_period_data) + self._init_complete = True diff --git a/flopy/mf6/modflow/mfgwfic.py b/flopy/mf6/modflow/mfgwfic.py index 5b7ac8531b..0a0e33168a 100644 --- a/flopy/mf6/modflow/mfgwfic.py +++ b/flopy/mf6/modflow/mfgwfic.py @@ -1,56 +1,56 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ArrayTemplateGenerator - - -class ModflowGwfic(mfpackage.MFPackage): - """ - ModflowGwfic defines a ic package within a gwf6 model. - - Parameters - ---------- - model : MFModel - Model that this package is a part of. Package is automatically - added to model when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - strt : [double] - * strt (double) is the initial (starting) head---that is, head at the - beginning of the GWF Model simulation. STRT must be specified for all - simulations, including steady-state simulations. One value is read - for every model cell. For simulations in which the first stress - period is steady state, the values used for STRT generally do not - affect the simulation (exceptions may occur if cells go dry and (or) - rewet). The execution time, however, will be less if STRT includes - hydraulic heads that are close to the steady-state solution. A head - value lower than the cell bottom can be provided if a cell should - start as dry. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - strt = ArrayTemplateGenerator(('gwf6', 'ic', 'griddata', 'strt')) - package_abbr = "gwfic" - _package_type = "ic" - dfn_file_name = "gwf-ic.dfn" - - dfn = [["block griddata", "name strt", "type double precision", - "shape (nodes)", "reader readarray", "layered true", - "default_value 1.0"]] - - def __init__(self, model, loading_package=False, strt=1.0, filename=None, - pname=None, parent_file=None): - super(ModflowGwfic, self).__init__(model, "ic", filename, pname, - loading_package, parent_file) - - # set up variables - self.strt = self.build_mfdata("strt", strt) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ArrayTemplateGenerator + + +class ModflowGwfic(mfpackage.MFPackage): + """ + ModflowGwfic defines a ic package within a gwf6 model. + + Parameters + ---------- + model : MFModel + Model that this package is a part of. Package is automatically + added to model when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + strt : [double] + * strt (double) is the initial (starting) head---that is, head at the + beginning of the GWF Model simulation. STRT must be specified for all + simulations, including steady-state simulations. One value is read + for every model cell. For simulations in which the first stress + period is steady state, the values used for STRT generally do not + affect the simulation (exceptions may occur if cells go dry and (or) + rewet). The execution time, however, will be less if STRT includes + hydraulic heads that are close to the steady-state solution. A head + value lower than the cell bottom can be provided if a cell should + start as dry. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + strt = ArrayTemplateGenerator(('gwf6', 'ic', 'griddata', 'strt')) + package_abbr = "gwfic" + _package_type = "ic" + dfn_file_name = "gwf-ic.dfn" + + dfn = [["block griddata", "name strt", "type double precision", + "shape (nodes)", "reader readarray", "layered true", + "default_value 1.0"]] + + def __init__(self, model, loading_package=False, strt=1.0, filename=None, + pname=None, parent_file=None): + super(ModflowGwfic, self).__init__(model, "ic", filename, pname, + loading_package, parent_file) + + # set up variables + self.strt = self.build_mfdata("strt", strt) + self._init_complete = True diff --git a/flopy/mf6/modflow/mfgwflak.py b/flopy/mf6/modflow/mfgwflak.py index 3f7bbaed73..a44e23f3c9 100644 --- a/flopy/mf6/modflow/mfgwflak.py +++ b/flopy/mf6/modflow/mfgwflak.py @@ -1,670 +1,670 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ListTemplateGenerator - - -class ModflowGwflak(mfpackage.MFPackage): - """ - ModflowGwflak defines a lak package within a gwf6 model. - - Parameters - ---------- - model : MFModel - Model that this package is a part of. Package is automatically - added to model when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - auxiliary : [string] - * auxiliary (string) defines an array of one or more auxiliary variable - names. There is no limit on the number of auxiliary variables that - can be provided on this line; however, lists of information provided - in subsequent blocks must have a column of data for each auxiliary - variable name defined here. The number of auxiliary variables - detected on this line determines the value for naux. Comments cannot - be provided anywhere on this line as they will be interpreted as - auxiliary variable names. Auxiliary variables may not be used by the - package, but they will be available for use by other parts of the - program. The program will terminate with an error if auxiliary - variables are specified on more than one line in the options block. - boundnames : boolean - * boundnames (boolean) keyword to indicate that boundary names may be - provided with the list of lake cells. - print_input : boolean - * print_input (boolean) keyword to indicate that the list of lake - information will be written to the listing file immediately after it - is read. - print_stage : boolean - * print_stage (boolean) keyword to indicate that the list of lake - stages will be printed to the listing file for every stress period in - which "HEAD PRINT" is specified in Output Control. If there is no - Output Control option and PRINT_STAGE is specified, then stages are - printed for the last time step of each stress period. - print_flows : boolean - * print_flows (boolean) keyword to indicate that the list of lake flow - rates will be printed to the listing file for every stress period - time step in which "BUDGET PRINT" is specified in Output Control. If - there is no Output Control option and "PRINT_FLOWS" is specified, - then flow rates are printed for the last time step of each stress - period. - save_flows : boolean - * save_flows (boolean) keyword to indicate that lake flow terms will be - written to the file specified with "BUDGET FILEOUT" in Output - Control. - stage_filerecord : [stagefile] - * stagefile (string) name of the binary output file to write stage - information. - budget_filerecord : [budgetfile] - * budgetfile (string) name of the binary output file to write budget - information. - timeseries : {varname:data} or timeseries data - * Contains data for the ts package. Data can be stored in a dictionary - containing data for the ts package with variable names as keys and - package data as values. Data just for the timeseries variable is also - acceptable. See ts package documentation for more information. - observations : {varname:data} or continuous data - * Contains data for the obs package. Data can be stored in a dictionary - containing data for the obs package with variable names as keys and - package data as values. Data just for the observations variable is - also acceptable. See obs package documentation for more information. - mover : boolean - * mover (boolean) keyword to indicate that this instance of the LAK - Package can be used with the Water Mover (MVR) Package. When the - MOVER option is specified, additional memory is allocated within the - package to store the available, provided, and received water. - surfdep : double - * surfdep (double) real value that defines the surface depression depth - for VERTICAL lake-GWF connections. If specified, SURFDEP must be - greater than or equal to zero. If SURFDEP is not specified, a default - value of zero is used for all vertical lake-GWF connections. - time_conversion : double - * time_conversion (double) value that is used in converting outlet flow - terms that use Manning's equation or gravitational acceleration to - consistent time units. TIME_CONVERSION should be set to 1.0, 60.0, - 3,600.0, 86,400.0, and 31,557,600.0 when using time units - (TIME_UNITS) of seconds, minutes, hours, days, or years in the - simulation, respectively. CONVTIME does not need to be specified if - no lake outlets are specified or TIME_UNITS are seconds. - length_conversion : double - * length_conversion (double) real value that is used in converting - outlet flow terms that use Manning's equation or gravitational - acceleration to consistent length units. LENGTH_CONVERSION should be - set to 3.28081, 1.0, and 100.0 when using length units (LENGTH_UNITS) - of feet, meters, or centimeters in the simulation, respectively. - LENGTH_CONVERSION does not need to be specified if no lake outlets - are specified or LENGTH_UNITS are meters. - nlakes : integer - * nlakes (integer) value specifying the number of lakes that will be - simulated for all stress periods. - noutlets : integer - * noutlets (integer) value specifying the number of outlets that will - be simulated for all stress periods. If NOUTLETS is not specified, a - default value of zero is used. - ntables : integer - * ntables (integer) value specifying the number of lakes tables that - will be used to define the lake stage, volume relation, and surface - area. If NTABLES is not specified, a default value of zero is used. - packagedata : [lakeno, strt, nlakeconn, aux, boundname] - * lakeno (integer) integer value that defines the lake number - associated with the specified PACKAGEDATA data on the line. LAKENO - must be greater than zero and less than or equal to NLAKES. Lake - information must be specified for every lake or the program will - terminate with an error. The program will also terminate with an - error if information for a lake is specified more than once. - * strt (double) real value that defines the starting stage for the - lake. - * nlakeconn (integer) integer value that defines the number of GWF - cells connected to this (LAKENO) lake. There can only be one vertical - lake connection to each GWF cell. NLAKECONN must be greater than - zero. - * aux (double) represents the values of the auxiliary variables for - each lake. The values of auxiliary variables must be present for each - lake. The values must be specified in the order of the auxiliary - variables specified in the OPTIONS block. If the package supports - time series and the Options block includes a TIMESERIESFILE entry - (see the "Time-Variable Input" section), values can be obtained from - a time series by entering the time-series name in place of a numeric - value. - * boundname (string) name of the lake cell. BOUNDNAME is an ASCII - character variable that can contain as many as 40 characters. If - BOUNDNAME contains spaces in it, then the entire name must be - enclosed within single quotes. - connectiondata : [lakeno, iconn, cellid, claktype, bedleak, belev, telev, - connlen, connwidth] - * lakeno (integer) integer value that defines the lake number - associated with the specified CONNECTIONDATA data on the line. LAKENO - must be greater than zero and less than or equal to NLAKES. Lake - connection information must be specified for every lake connection to - the GWF model (NLAKECONN) or the program will terminate with an - error. The program will also terminate with an error if connection - information for a lake connection to the GWF model is specified more - than once. - * iconn (integer) integer value that defines the GWF connection number - for this lake connection entry. ICONN must be greater than zero and - less than or equal to NLAKECONN for lake LAKENO. - * cellid ((integer, ...)) is the cell identifier, and depends on the - type of grid that is used for the simulation. For a structured grid - that uses the DIS input file, CELLID is the layer, row, and column. - For a grid that uses the DISV input file, CELLID is the layer and - CELL2D number. If the model uses the unstructured discretization - (DISU) input file, CELLID is the node number for the cell. - * claktype (string) character string that defines the lake-GWF - connection type for the lake connection. Possible lake-GWF connection - type strings include: VERTICAL--character keyword to indicate the - lake-GWF connection is vertical and connection conductance - calculations use the hydraulic conductivity corresponding to the - :math:`K_{33}` tensor component defined for CELLID in the NPF - package. HORIZONTAL--character keyword to indicate the lake-GWF - connection is horizontal and connection conductance calculations use - the hydraulic conductivity corresponding to the :math:`K_{11}` tensor - component defined for CELLID in the NPF package. EMBEDDEDH--character - keyword to indicate the lake-GWF connection is embedded in a single - cell and connection conductance calculations use the hydraulic - conductivity corresponding to the :math:`K_{11}` tensor component - defined for CELLID in the NPF package. EMBEDDEDV--character keyword - to indicate the lake-GWF connection is embedded in a single cell and - connection conductance calculations use the hydraulic conductivity - corresponding to the :math:`K_{33}` tensor component defined for - CELLID in the NPF package. Embedded lakes can only be connected to a - single cell (NLAKECONN = 1) and there must be a lake table associated - with each embedded lake. - * bedleak (double) character string or real value that defines the bed - leakance for the lake-GWF connection. BEDLEAK must be greater than or - equal to zero or specified to be NONE. If BEDLEAK is specified to be - NONE, the lake-GWF connection conductance is solely a function of - aquifer properties in the connected GWF cell and lakebed sediments - are assumed to be absent. - * belev (double) real value that defines the bottom elevation for a - HORIZONTAL lake-GWF connection. Any value can be specified if - CLAKTYPE is VERTICAL, EMBEDDEDH, or EMBEDDEDV. If CLAKTYPE is - HORIZONTAL and BELEV is not equal to TELEV, BELEV must be greater - than or equal to the bottom of the GWF cell CELLID. If BELEV is equal - to TELEV, BELEV is reset to the bottom of the GWF cell CELLID. - * telev (double) real value that defines the top elevation for a - HORIZONTAL lake-GWF connection. Any value can be specified if - CLAKTYPE is VERTICAL, EMBEDDEDH, or EMBEDDEDV. If CLAKTYPE is - HORIZONTAL and TELEV is not equal to BELEV, TELEV must be less than - or equal to the top of the GWF cell CELLID. If TELEV is equal to - BELEV, TELEV is reset to the top of the GWF cell CELLID. - * connlen (double) real value that defines the distance between the - connected GWF CELLID node and the lake for a HORIZONTAL, EMBEDDEDH, - or EMBEDDEDV lake-GWF connection. CONLENN must be greater than zero - for a HORIZONTAL, EMBEDDEDH, or EMBEDDEDV lake-GWF connection. Any - value can be specified if CLAKTYPE is VERTICAL. - * connwidth (double) real value that defines the connection face width - for a HORIZONTAL lake-GWF connection. CONNWIDTH must be greater than - zero for a HORIZONTAL lake-GWF connection. Any value can be specified - if CLAKTYPE is VERTICAL, EMBEDDEDH, or EMBEDDEDV. - tables : [lakeno, tab6_filename] - * lakeno (integer) integer value that defines the lake number - associated with the specified TABLES data on the line. LAKENO must be - greater than zero and less than or equal to NLAKES. The program will - terminate with an error if table information for a lake is specified - more than once or the number of specified tables is less than - NTABLES. - * tab6_filename (string) character string that defines the path and - filename for the file containing lake table data for the lake - connection. The CTABNAME file includes the number of entries in the - file and the relation between stage, surface area, and volume for - each entry in the file. Lake table files for EMBEDDEDH and EMBEDDEDV - lake-GWF connections also include lake-GWF exchange area data for - each entry in the file. Input instructions for the CTABNAME file is - included at the LAK package lake table file input instructions - section. - outlets : [outletno, lakein, lakeout, couttype, invert, width, rough, - slope] - * outletno (integer) integer value that defines the outlet number - associated with the specified OUTLETS data on the line. OUTLETNO must - be greater than zero and less than or equal to NOUTLETS. Outlet - information must be specified for every outlet or the program will - terminate with an error. The program will also terminate with an - error if information for a outlet is specified more than once. - * lakein (integer) integer value that defines the lake number that - outlet is connected to. LAKEIN must be greater than zero and less - than or equal to NLAKES. - * lakeout (integer) integer value that defines the lake number that - outlet discharge from lake outlet OUTLETNO is routed to. LAKEOUT must - be greater than or equal to zero and less than or equal to NLAKES. If - LAKEOUT is zero, outlet discharge from lake outlet OUTLETNO is - discharged to an external boundary. - * couttype (string) character string that defines the outlet type for - the outlet OUTLETNO. Possible COUTTYPE strings include: SPECIFIED-- - character keyword to indicate the outlet is defined as a specified - flow. MANNING--character keyword to indicate the outlet is defined - using Manning's equation. WEIR--character keyword to indicate the - outlet is defined using a sharp weir equation. - * invert (double) real value that defines the invert elevation for the - lake outlet. Any value can be specified if COUTTYPE is SPECIFIED. If - the Options block includes a TIMESERIESFILE entry (see the "Time- - Variable Input" section), values can be obtained from a time series - by entering the time-series name in place of a numeric value. - * width (double) real value that defines the width of the lake outlet. - Any value can be specified if COUTTYPE is SPECIFIED. If the Options - block includes a TIMESERIESFILE entry (see the "Time-Variable Input" - section), values can be obtained from a time series by entering the - time-series name in place of a numeric value. - * rough (double) real value that defines the roughness coefficient for - the lake outlet. Any value can be specified if COUTTYPE is not - MANNING. If the Options block includes a TIMESERIESFILE entry (see - the "Time-Variable Input" section), values can be obtained from a - time series by entering the time-series name in place of a numeric - value. - * slope (double) real value that defines the bed slope for the lake - outlet. Any value can be specified if COUTTYPE is not MANNING. If the - Options block includes a TIMESERIESFILE entry (see the "Time-Variable - Input" section), values can be obtained from a time series by - entering the time-series name in place of a numeric value. - lakeperioddata : [lakeno, laksetting] - * lakeno (integer) integer value that defines the lake number - associated with the specified PERIOD data on the line. LAKENO must be - greater than zero and less than or equal to NLAKES. - * laksetting (keystring) line of information that is parsed into a - keyword and values. Keyword values that can be used to start the - LAKSETTING string include: STATUS, STAGE, RAINFALL, EVAPORATION, - RUNOFFON, WITHDRAWAL, and AUXILIARY. - status : [string] - * status (string) keyword option to define lake status. STATUS - can be ACTIVE, INACTIVE, or CONSTANT. By default, STATUS is - ACTIVE. - stage : [string] - * stage (string) real or character value that defines the stage - for the lake. The specified STAGE is only applied if the lake - is a constant stage lake. If the Options block includes a - TIMESERIESFILE entry (see the "Time-Variable Input" section), - values can be obtained from a time series by entering the - time-series name in place of a numeric value. - rainfall : [string] - * rainfall (string) real or character value that defines the - rainfall rate :math:`(LT^{-1})` for the lake. Value must be - greater than or equal to zero. If the Options block includes - a TIMESERIESFILE entry (see the "Time-Variable Input" - section), values can be obtained from a time series by - entering the time-series name in place of a numeric value. - evaporation : [string] - * evaporation (string) real or character value that defines the - maximum evaporation rate :math:`(LT^{-1})` for the lake. - Value must be greater than or equal to zero. If the Options - block includes a TIMESERIESFILE entry (see the "Time-Variable - Input" section), values can be obtained from a time series by - entering the time-series name in place of a numeric value. - runoff : [string] - * runoff (string) real or character value that defines the - runoff rate :math:`(L^3 T^{-1})` for the lake. Value must be - greater than or equal to zero. If the Options block includes - a TIMESERIESFILE entry (see the "Time-Variable Input" - section), values can be obtained from a time series by - entering the time-series name in place of a numeric value. - withdrawal : [string] - * withdrawal (string) real or character value that defines the - maximum withdrawal rate :math:`(L^3 T^{-1})` for the lake. - Value must be greater than or equal to zero. If the Options - block includes a TIMESERIESFILE entry (see the "Time-Variable - Input" section), values can be obtained from a time series by - entering the time-series name in place of a numeric value. - auxiliaryrecord : [auxname, auxval] - * auxname (string) name for the auxiliary variable to be - assigned AUXVAL. AUXNAME must match one of the auxiliary - variable names defined in the OPTIONS block. If AUXNAME does - not match one of the auxiliary variable names defined in the - OPTIONS block the data are ignored. - * auxval (double) value for the auxiliary variable. If the - Options block includes a TIMESERIESFILE entry (see the "Time- - Variable Input" section), values can be obtained from a time - series by entering the time-series name in place of a numeric - value. - outletperioddata : [outletno, outletsetting] - * outletno (integer) integer value that defines the outlet number - associated with the specified PERIOD data on the line. OUTLETNO must - be greater than zero and less than or equal to NOUTLETS. - * outletsetting (keystring) line of information that is parsed into a - keyword and values. Keyword values that can be used to start the - OUTLETSETTING string include: RATE, INVERT, WIDTH, SLOPE, and ROUGH. - rate : [string] - * rate (string) real or character value that defines the - extraction rate for the lake outflow. A positive value - indicates inflow and a negative value indicates outflow from - the lake. RATE only applies to active (IBOUND :math:`>` 0) - lakes. A specified RATE is only applied if COUTTYPE for the - OUTLETNO is SPECIFIED. If the Options block includes a - TIMESERIESFILE entry (see the "Time-Variable Input" section), - values can be obtained from a time series by entering the - time-series name in place of a numeric value. By default, the - RATE for each SPECIFIED lake outlet is zero. - invert : [string] - * invert (string) real or character value that defines the - invert elevation for the lake outlet. A specified INVERT - value is only used for active lakes if COUTTYPE for lake - outlet OUTLETNO is not SPECIFIED. If the Options block - includes a TIMESERIESFILE entry (see the "Time-Variable - Input" section), values can be obtained from a time series by - entering the time-series name in place of a numeric value. - width : [string] - * width (string) real or character value that defines the width - of the lake outlet. A specified WIDTH value is only used for - active lakes if COUTTYPE for lake outlet OUTLETNO is not - SPECIFIED. If the Options block includes a TIMESERIESFILE - entry (see the "Time-Variable Input" section), values can be - obtained from a time series by entering the time-series name - in place of a numeric value. - slope : [string] - * slope (string) real or character value that defines the bed - slope for the lake outlet. A specified SLOPE value is only - used for active lakes if COUTTYPE for lake outlet OUTLETNO is - MANNING. If the Options block includes a TIMESERIESFILE entry - (see the "Time-Variable Input" section), values can be - obtained from a time series by entering the time-series name - in place of a numeric value. - rough : [string] - * rough (string) real value that defines the roughness - coefficient for the lake outlet. Any value can be specified - if COUTTYPE is not MANNING. If the Options block includes a - TIMESERIESFILE entry (see the "Time-Variable Input" section), - values can be obtained from a time series by entering the - time-series name in place of a numeric value. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - auxiliary = ListTemplateGenerator(('gwf6', 'lak', 'options', - 'auxiliary')) - stage_filerecord = ListTemplateGenerator(('gwf6', 'lak', 'options', - 'stage_filerecord')) - budget_filerecord = ListTemplateGenerator(('gwf6', 'lak', 'options', - 'budget_filerecord')) - ts_filerecord = ListTemplateGenerator(('gwf6', 'lak', 'options', - 'ts_filerecord')) - obs_filerecord = ListTemplateGenerator(('gwf6', 'lak', 'options', - 'obs_filerecord')) - packagedata = ListTemplateGenerator(('gwf6', 'lak', 'packagedata', - 'packagedata')) - connectiondata = ListTemplateGenerator(('gwf6', 'lak', - 'connectiondata', - 'connectiondata')) - tables = ListTemplateGenerator(('gwf6', 'lak', 'tables', 'tables')) - outlets = ListTemplateGenerator(('gwf6', 'lak', 'outlets', - 'outlets')) - lakeperioddata = ListTemplateGenerator(('gwf6', 'lak', 'period', - 'lakeperioddata')) - outletperioddata = ListTemplateGenerator(('gwf6', 'lak', 'period', - 'outletperioddata')) - package_abbr = "gwflak" - _package_type = "lak" - dfn_file_name = "gwf-lak.dfn" - - dfn = [["block options", "name auxiliary", "type string", - "shape (naux)", "reader urword", "optional true"], - ["block options", "name boundnames", "type keyword", "shape", - "reader urword", "optional true"], - ["block options", "name print_input", "type keyword", - "reader urword", "optional true"], - ["block options", "name print_stage", "type keyword", - "reader urword", "optional true"], - ["block options", "name print_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name save_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name stage_filerecord", - "type record stage fileout stagefile", "shape", "reader urword", - "tagged true", "optional true"], - ["block options", "name stage", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name stagefile", "type string", - "preserve_case true", "shape", "in_record true", "reader urword", - "tagged false", "optional false"], - ["block options", "name budget_filerecord", - "type record budget fileout budgetfile", "shape", "reader urword", - "tagged true", "optional true"], - ["block options", "name budget", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name fileout", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name budgetfile", "type string", - "preserve_case true", "shape", "in_record true", "reader urword", - "tagged false", "optional false"], - ["block options", "name ts_filerecord", - "type record ts6 filein ts6_filename", "shape", "reader urword", - "tagged true", "optional true", "construct_package ts", - "construct_data timeseries", "parameter_name timeseries"], - ["block options", "name ts6", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name filein", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name ts6_filename", "type string", - "preserve_case true", "in_record true", "reader urword", - "optional false", "tagged false"], - ["block options", "name obs_filerecord", - "type record obs6 filein obs6_filename", "shape", "reader urword", - "tagged true", "optional true", "construct_package obs", - "construct_data continuous", "parameter_name observations"], - ["block options", "name obs6", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name obs6_filename", "type string", - "preserve_case true", "in_record true", "tagged false", - "reader urword", "optional false"], - ["block options", "name mover", "type keyword", "tagged true", - "reader urword", "optional true"], - ["block options", "name surfdep", "type double precision", - "reader urword", "optional true"], - ["block options", "name time_conversion", - "type double precision", "reader urword", "optional true"], - ["block options", "name length_conversion", - "type double precision", "reader urword", "optional true"], - ["block dimensions", "name nlakes", "type integer", - "reader urword", "optional false"], - ["block dimensions", "name noutlets", "type integer", - "reader urword", "optional false"], - ["block dimensions", "name ntables", "type integer", - "reader urword", "optional false"], - ["block packagedata", "name packagedata", - "type recarray lakeno strt nlakeconn aux boundname", - "shape (maxbound)", "reader urword"], - ["block packagedata", "name lakeno", "type integer", "shape", - "tagged false", "in_record true", "reader urword", - "numeric_index true"], - ["block packagedata", "name strt", "type double precision", - "shape", "tagged false", "in_record true", "reader urword"], - ["block packagedata", "name nlakeconn", "type integer", "shape", - "tagged false", "in_record true", "reader urword"], - ["block packagedata", "name aux", "type double precision", - "in_record true", "tagged false", "shape (naux)", "reader urword", - "time_series true", "optional true"], - ["block packagedata", "name boundname", "type string", "shape", - "tagged false", "in_record true", "reader urword", - "optional true"], - ["block connectiondata", "name connectiondata", - "type recarray lakeno iconn cellid claktype bedleak belev telev " - "connlen connwidth", - "shape (sum(nlakeconn))", "reader urword"], - ["block connectiondata", "name lakeno", "type integer", "shape", - "tagged false", "in_record true", "reader urword", - "numeric_index true"], - ["block connectiondata", "name iconn", "type integer", "shape", - "tagged false", "in_record true", "reader urword", - "numeric_index true"], - ["block connectiondata", "name cellid", "type integer", - "shape (ncelldim)", "tagged false", "in_record true", - "reader urword"], - ["block connectiondata", "name claktype", "type string", "shape", - "tagged false", "in_record true", "reader urword"], - ["block connectiondata", "name bedleak", "type double precision", - "shape", "tagged false", "in_record true", "reader urword"], - ["block connectiondata", "name belev", "type double precision", - "shape", "tagged false", "in_record true", "reader urword"], - ["block connectiondata", "name telev", "type double precision", - "shape", "tagged false", "in_record true", "reader urword"], - ["block connectiondata", "name connlen", "type double precision", - "shape", "tagged false", "in_record true", "reader urword"], - ["block connectiondata", "name connwidth", - "type double precision", "shape", "tagged false", - "in_record true", "reader urword"], - ["block tables", "name tables", - "type recarray lakeno tab6 filein tab6_filename", - "shape (ntables)", "reader urword"], - ["block tables", "name lakeno", "type integer", "shape", - "tagged false", "in_record true", "reader urword", - "numeric_index true"], - ["block tables", "name tab6", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block tables", "name filein", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block tables", "name tab6_filename", "type string", - "preserve_case true", "in_record true", "reader urword", - "optional false", "tagged false"], - ["block outlets", "name outlets", - "type recarray outletno lakein lakeout couttype invert width " - "rough slope", - "shape (noutlets)", "reader urword"], - ["block outlets", "name outletno", "type integer", "shape", - "tagged false", "in_record true", "reader urword", - "numeric_index true"], - ["block outlets", "name lakein", "type integer", "shape", - "tagged false", "in_record true", "reader urword", - "numeric_index true"], - ["block outlets", "name lakeout", "type integer", "shape", - "tagged false", "in_record true", "reader urword", - "numeric_index true"], - ["block outlets", "name couttype", "type string", "shape", - "tagged false", "in_record true", "reader urword"], - ["block outlets", "name invert", "type double precision", - "shape", "tagged false", "in_record true", "reader urword", - "time_series true"], - ["block outlets", "name width", "type double precision", "shape", - "tagged false", "in_record true", "reader urword", - "time_series true"], - ["block outlets", "name rough", "type double precision", "shape", - "tagged false", "in_record true", "reader urword", - "time_series true"], - ["block outlets", "name slope", "type double precision", "shape", - "tagged false", "in_record true", "reader urword", - "time_series true"], - ["block period", "name iper", "type integer", - "block_variable True", "in_record true", "tagged false", "shape", - "valid", "reader urword", "optional false"], - ["block period", "name lakeperioddata", - "type recarray lakeno laksetting", "shape", "reader urword"], - ["block period", "name lakeno", "type integer", "shape", - "tagged false", "in_record true", "reader urword", - "numeric_index true"], - ["block period", "name laksetting", - "type keystring status stage rainfall evaporation runoff " - "withdrawal auxiliaryrecord", - "shape", "tagged false", "in_record true", "reader urword"], - ["block period", "name status", "type string", "shape", - "tagged true", "in_record true", "reader urword"], - ["block period", "name stage", "type string", "shape", - "tagged true", "in_record true", "time_series true", - "reader urword"], - ["block period", "name rainfall", "type string", "shape", - "tagged true", "in_record true", "reader urword", - "time_series true"], - ["block period", "name evaporation", "type string", "shape", - "tagged true", "in_record true", "reader urword", - "time_series true"], - ["block period", "name runoff", "type string", "shape", - "tagged true", "in_record true", "reader urword", - "time_series true"], - ["block period", "name withdrawal", "type string", "shape", - "tagged true", "in_record true", "reader urword", - "time_series true"], - ["block period", "name auxiliaryrecord", - "type record auxiliary auxname auxval", "shape", "tagged", - "in_record true", "reader urword"], - ["block period", "name auxiliary", "type keyword", "shape", - "in_record true", "reader urword"], - ["block period", "name auxname", "type string", "shape", - "tagged false", "in_record true", "reader urword"], - ["block period", "name auxval", "type double precision", "shape", - "tagged false", "in_record true", "reader urword", - "time_series true"], - ["block period", "name outletperioddata", - "type recarray outletno outletsetting", "shape", "reader urword"], - ["block period", "name outletno", "type integer", "shape", - "tagged false", "in_record true", "reader urword", - "numeric_index true"], - ["block period", "name outletsetting", - "type keystring rate invert width slope rough", "shape", - "tagged false", "in_record true", "reader urword"], - ["block period", "name rate", "type string", "shape", - "tagged true", "in_record true", "reader urword", - "time_series true"], - ["block period", "name invert", "type string", "shape", - "tagged true", "in_record true", "reader urword", - "time_series true"], - ["block period", "name rough", "type string", "shape", - "tagged true", "in_record true", "reader urword", - "time_series true"], - ["block period", "name width", "type string", "shape", - "tagged true", "in_record true", "reader urword", - "time_series true"], - ["block period", "name slope", "type string", "shape", - "tagged true", "in_record true", "reader urword", - "time_series true"]] - - def __init__(self, model, loading_package=False, auxiliary=None, - boundnames=None, print_input=None, print_stage=None, - print_flows=None, save_flows=None, stage_filerecord=None, - budget_filerecord=None, timeseries=None, observations=None, - mover=None, surfdep=None, time_conversion=None, - length_conversion=None, nlakes=None, noutlets=None, - ntables=None, packagedata=None, connectiondata=None, - tables=None, outlets=None, lakeperioddata=None, - outletperioddata=None, filename=None, pname=None, - parent_file=None): - super(ModflowGwflak, self).__init__(model, "lak", filename, pname, - loading_package, parent_file) - - # set up variables - self.auxiliary = self.build_mfdata("auxiliary", auxiliary) - self.boundnames = self.build_mfdata("boundnames", boundnames) - self.print_input = self.build_mfdata("print_input", print_input) - self.print_stage = self.build_mfdata("print_stage", print_stage) - self.print_flows = self.build_mfdata("print_flows", print_flows) - self.save_flows = self.build_mfdata("save_flows", save_flows) - self.stage_filerecord = self.build_mfdata("stage_filerecord", - stage_filerecord) - self.budget_filerecord = self.build_mfdata("budget_filerecord", - budget_filerecord) - self._ts_filerecord = self.build_mfdata("ts_filerecord", - None) - self._ts_package = self.build_child_package("ts", timeseries, - "timeseries", - self._ts_filerecord) - self._obs_filerecord = self.build_mfdata("obs_filerecord", - None) - self._obs_package = self.build_child_package("obs", observations, - "continuous", - self._obs_filerecord) - self.mover = self.build_mfdata("mover", mover) - self.surfdep = self.build_mfdata("surfdep", surfdep) - self.time_conversion = self.build_mfdata("time_conversion", - time_conversion) - self.length_conversion = self.build_mfdata("length_conversion", - length_conversion) - self.nlakes = self.build_mfdata("nlakes", nlakes) - self.noutlets = self.build_mfdata("noutlets", noutlets) - self.ntables = self.build_mfdata("ntables", ntables) - self.packagedata = self.build_mfdata("packagedata", packagedata) - self.connectiondata = self.build_mfdata("connectiondata", - connectiondata) - self.tables = self.build_mfdata("tables", tables) - self.outlets = self.build_mfdata("outlets", outlets) - self.lakeperioddata = self.build_mfdata("lakeperioddata", - lakeperioddata) - self.outletperioddata = self.build_mfdata("outletperioddata", - outletperioddata) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ListTemplateGenerator + + +class ModflowGwflak(mfpackage.MFPackage): + """ + ModflowGwflak defines a lak package within a gwf6 model. + + Parameters + ---------- + model : MFModel + Model that this package is a part of. Package is automatically + added to model when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + auxiliary : [string] + * auxiliary (string) defines an array of one or more auxiliary variable + names. There is no limit on the number of auxiliary variables that + can be provided on this line; however, lists of information provided + in subsequent blocks must have a column of data for each auxiliary + variable name defined here. The number of auxiliary variables + detected on this line determines the value for naux. Comments cannot + be provided anywhere on this line as they will be interpreted as + auxiliary variable names. Auxiliary variables may not be used by the + package, but they will be available for use by other parts of the + program. The program will terminate with an error if auxiliary + variables are specified on more than one line in the options block. + boundnames : boolean + * boundnames (boolean) keyword to indicate that boundary names may be + provided with the list of lake cells. + print_input : boolean + * print_input (boolean) keyword to indicate that the list of lake + information will be written to the listing file immediately after it + is read. + print_stage : boolean + * print_stage (boolean) keyword to indicate that the list of lake + stages will be printed to the listing file for every stress period in + which "HEAD PRINT" is specified in Output Control. If there is no + Output Control option and PRINT_STAGE is specified, then stages are + printed for the last time step of each stress period. + print_flows : boolean + * print_flows (boolean) keyword to indicate that the list of lake flow + rates will be printed to the listing file for every stress period + time step in which "BUDGET PRINT" is specified in Output Control. If + there is no Output Control option and "PRINT_FLOWS" is specified, + then flow rates are printed for the last time step of each stress + period. + save_flows : boolean + * save_flows (boolean) keyword to indicate that lake flow terms will be + written to the file specified with "BUDGET FILEOUT" in Output + Control. + stage_filerecord : [stagefile] + * stagefile (string) name of the binary output file to write stage + information. + budget_filerecord : [budgetfile] + * budgetfile (string) name of the binary output file to write budget + information. + timeseries : {varname:data} or timeseries data + * Contains data for the ts package. Data can be stored in a dictionary + containing data for the ts package with variable names as keys and + package data as values. Data just for the timeseries variable is also + acceptable. See ts package documentation for more information. + observations : {varname:data} or continuous data + * Contains data for the obs package. Data can be stored in a dictionary + containing data for the obs package with variable names as keys and + package data as values. Data just for the observations variable is + also acceptable. See obs package documentation for more information. + mover : boolean + * mover (boolean) keyword to indicate that this instance of the LAK + Package can be used with the Water Mover (MVR) Package. When the + MOVER option is specified, additional memory is allocated within the + package to store the available, provided, and received water. + surfdep : double + * surfdep (double) real value that defines the surface depression depth + for VERTICAL lake-GWF connections. If specified, SURFDEP must be + greater than or equal to zero. If SURFDEP is not specified, a default + value of zero is used for all vertical lake-GWF connections. + time_conversion : double + * time_conversion (double) value that is used in converting outlet flow + terms that use Manning's equation or gravitational acceleration to + consistent time units. TIME_CONVERSION should be set to 1.0, 60.0, + 3,600.0, 86,400.0, and 31,557,600.0 when using time units + (TIME_UNITS) of seconds, minutes, hours, days, or years in the + simulation, respectively. CONVTIME does not need to be specified if + no lake outlets are specified or TIME_UNITS are seconds. + length_conversion : double + * length_conversion (double) real value that is used in converting + outlet flow terms that use Manning's equation or gravitational + acceleration to consistent length units. LENGTH_CONVERSION should be + set to 3.28081, 1.0, and 100.0 when using length units (LENGTH_UNITS) + of feet, meters, or centimeters in the simulation, respectively. + LENGTH_CONVERSION does not need to be specified if no lake outlets + are specified or LENGTH_UNITS are meters. + nlakes : integer + * nlakes (integer) value specifying the number of lakes that will be + simulated for all stress periods. + noutlets : integer + * noutlets (integer) value specifying the number of outlets that will + be simulated for all stress periods. If NOUTLETS is not specified, a + default value of zero is used. + ntables : integer + * ntables (integer) value specifying the number of lakes tables that + will be used to define the lake stage, volume relation, and surface + area. If NTABLES is not specified, a default value of zero is used. + packagedata : [lakeno, strt, nlakeconn, aux, boundname] + * lakeno (integer) integer value that defines the lake number + associated with the specified PACKAGEDATA data on the line. LAKENO + must be greater than zero and less than or equal to NLAKES. Lake + information must be specified for every lake or the program will + terminate with an error. The program will also terminate with an + error if information for a lake is specified more than once. + * strt (double) real value that defines the starting stage for the + lake. + * nlakeconn (integer) integer value that defines the number of GWF + cells connected to this (LAKENO) lake. There can only be one vertical + lake connection to each GWF cell. NLAKECONN must be greater than + zero. + * aux (double) represents the values of the auxiliary variables for + each lake. The values of auxiliary variables must be present for each + lake. The values must be specified in the order of the auxiliary + variables specified in the OPTIONS block. If the package supports + time series and the Options block includes a TIMESERIESFILE entry + (see the "Time-Variable Input" section), values can be obtained from + a time series by entering the time-series name in place of a numeric + value. + * boundname (string) name of the lake cell. BOUNDNAME is an ASCII + character variable that can contain as many as 40 characters. If + BOUNDNAME contains spaces in it, then the entire name must be + enclosed within single quotes. + connectiondata : [lakeno, iconn, cellid, claktype, bedleak, belev, telev, + connlen, connwidth] + * lakeno (integer) integer value that defines the lake number + associated with the specified CONNECTIONDATA data on the line. LAKENO + must be greater than zero and less than or equal to NLAKES. Lake + connection information must be specified for every lake connection to + the GWF model (NLAKECONN) or the program will terminate with an + error. The program will also terminate with an error if connection + information for a lake connection to the GWF model is specified more + than once. + * iconn (integer) integer value that defines the GWF connection number + for this lake connection entry. ICONN must be greater than zero and + less than or equal to NLAKECONN for lake LAKENO. + * cellid ((integer, ...)) is the cell identifier, and depends on the + type of grid that is used for the simulation. For a structured grid + that uses the DIS input file, CELLID is the layer, row, and column. + For a grid that uses the DISV input file, CELLID is the layer and + CELL2D number. If the model uses the unstructured discretization + (DISU) input file, CELLID is the node number for the cell. + * claktype (string) character string that defines the lake-GWF + connection type for the lake connection. Possible lake-GWF connection + type strings include: VERTICAL--character keyword to indicate the + lake-GWF connection is vertical and connection conductance + calculations use the hydraulic conductivity corresponding to the + :math:`K_{33}` tensor component defined for CELLID in the NPF + package. HORIZONTAL--character keyword to indicate the lake-GWF + connection is horizontal and connection conductance calculations use + the hydraulic conductivity corresponding to the :math:`K_{11}` tensor + component defined for CELLID in the NPF package. EMBEDDEDH--character + keyword to indicate the lake-GWF connection is embedded in a single + cell and connection conductance calculations use the hydraulic + conductivity corresponding to the :math:`K_{11}` tensor component + defined for CELLID in the NPF package. EMBEDDEDV--character keyword + to indicate the lake-GWF connection is embedded in a single cell and + connection conductance calculations use the hydraulic conductivity + corresponding to the :math:`K_{33}` tensor component defined for + CELLID in the NPF package. Embedded lakes can only be connected to a + single cell (NLAKECONN = 1) and there must be a lake table associated + with each embedded lake. + * bedleak (double) character string or real value that defines the bed + leakance for the lake-GWF connection. BEDLEAK must be greater than or + equal to zero or specified to be NONE. If BEDLEAK is specified to be + NONE, the lake-GWF connection conductance is solely a function of + aquifer properties in the connected GWF cell and lakebed sediments + are assumed to be absent. + * belev (double) real value that defines the bottom elevation for a + HORIZONTAL lake-GWF connection. Any value can be specified if + CLAKTYPE is VERTICAL, EMBEDDEDH, or EMBEDDEDV. If CLAKTYPE is + HORIZONTAL and BELEV is not equal to TELEV, BELEV must be greater + than or equal to the bottom of the GWF cell CELLID. If BELEV is equal + to TELEV, BELEV is reset to the bottom of the GWF cell CELLID. + * telev (double) real value that defines the top elevation for a + HORIZONTAL lake-GWF connection. Any value can be specified if + CLAKTYPE is VERTICAL, EMBEDDEDH, or EMBEDDEDV. If CLAKTYPE is + HORIZONTAL and TELEV is not equal to BELEV, TELEV must be less than + or equal to the top of the GWF cell CELLID. If TELEV is equal to + BELEV, TELEV is reset to the top of the GWF cell CELLID. + * connlen (double) real value that defines the distance between the + connected GWF CELLID node and the lake for a HORIZONTAL, EMBEDDEDH, + or EMBEDDEDV lake-GWF connection. CONLENN must be greater than zero + for a HORIZONTAL, EMBEDDEDH, or EMBEDDEDV lake-GWF connection. Any + value can be specified if CLAKTYPE is VERTICAL. + * connwidth (double) real value that defines the connection face width + for a HORIZONTAL lake-GWF connection. CONNWIDTH must be greater than + zero for a HORIZONTAL lake-GWF connection. Any value can be specified + if CLAKTYPE is VERTICAL, EMBEDDEDH, or EMBEDDEDV. + tables : [lakeno, tab6_filename] + * lakeno (integer) integer value that defines the lake number + associated with the specified TABLES data on the line. LAKENO must be + greater than zero and less than or equal to NLAKES. The program will + terminate with an error if table information for a lake is specified + more than once or the number of specified tables is less than + NTABLES. + * tab6_filename (string) character string that defines the path and + filename for the file containing lake table data for the lake + connection. The CTABNAME file includes the number of entries in the + file and the relation between stage, surface area, and volume for + each entry in the file. Lake table files for EMBEDDEDH and EMBEDDEDV + lake-GWF connections also include lake-GWF exchange area data for + each entry in the file. Input instructions for the CTABNAME file is + included at the LAK package lake table file input instructions + section. + outlets : [outletno, lakein, lakeout, couttype, invert, width, rough, + slope] + * outletno (integer) integer value that defines the outlet number + associated with the specified OUTLETS data on the line. OUTLETNO must + be greater than zero and less than or equal to NOUTLETS. Outlet + information must be specified for every outlet or the program will + terminate with an error. The program will also terminate with an + error if information for a outlet is specified more than once. + * lakein (integer) integer value that defines the lake number that + outlet is connected to. LAKEIN must be greater than zero and less + than or equal to NLAKES. + * lakeout (integer) integer value that defines the lake number that + outlet discharge from lake outlet OUTLETNO is routed to. LAKEOUT must + be greater than or equal to zero and less than or equal to NLAKES. If + LAKEOUT is zero, outlet discharge from lake outlet OUTLETNO is + discharged to an external boundary. + * couttype (string) character string that defines the outlet type for + the outlet OUTLETNO. Possible COUTTYPE strings include: SPECIFIED-- + character keyword to indicate the outlet is defined as a specified + flow. MANNING--character keyword to indicate the outlet is defined + using Manning's equation. WEIR--character keyword to indicate the + outlet is defined using a sharp weir equation. + * invert (double) real value that defines the invert elevation for the + lake outlet. Any value can be specified if COUTTYPE is SPECIFIED. If + the Options block includes a TIMESERIESFILE entry (see the "Time- + Variable Input" section), values can be obtained from a time series + by entering the time-series name in place of a numeric value. + * width (double) real value that defines the width of the lake outlet. + Any value can be specified if COUTTYPE is SPECIFIED. If the Options + block includes a TIMESERIESFILE entry (see the "Time-Variable Input" + section), values can be obtained from a time series by entering the + time-series name in place of a numeric value. + * rough (double) real value that defines the roughness coefficient for + the lake outlet. Any value can be specified if COUTTYPE is not + MANNING. If the Options block includes a TIMESERIESFILE entry (see + the "Time-Variable Input" section), values can be obtained from a + time series by entering the time-series name in place of a numeric + value. + * slope (double) real value that defines the bed slope for the lake + outlet. Any value can be specified if COUTTYPE is not MANNING. If the + Options block includes a TIMESERIESFILE entry (see the "Time-Variable + Input" section), values can be obtained from a time series by + entering the time-series name in place of a numeric value. + lakeperioddata : [lakeno, laksetting] + * lakeno (integer) integer value that defines the lake number + associated with the specified PERIOD data on the line. LAKENO must be + greater than zero and less than or equal to NLAKES. + * laksetting (keystring) line of information that is parsed into a + keyword and values. Keyword values that can be used to start the + LAKSETTING string include: STATUS, STAGE, RAINFALL, EVAPORATION, + RUNOFFON, WITHDRAWAL, and AUXILIARY. + status : [string] + * status (string) keyword option to define lake status. STATUS + can be ACTIVE, INACTIVE, or CONSTANT. By default, STATUS is + ACTIVE. + stage : [string] + * stage (string) real or character value that defines the stage + for the lake. The specified STAGE is only applied if the lake + is a constant stage lake. If the Options block includes a + TIMESERIESFILE entry (see the "Time-Variable Input" section), + values can be obtained from a time series by entering the + time-series name in place of a numeric value. + rainfall : [string] + * rainfall (string) real or character value that defines the + rainfall rate :math:`(LT^{-1})` for the lake. Value must be + greater than or equal to zero. If the Options block includes + a TIMESERIESFILE entry (see the "Time-Variable Input" + section), values can be obtained from a time series by + entering the time-series name in place of a numeric value. + evaporation : [string] + * evaporation (string) real or character value that defines the + maximum evaporation rate :math:`(LT^{-1})` for the lake. + Value must be greater than or equal to zero. If the Options + block includes a TIMESERIESFILE entry (see the "Time-Variable + Input" section), values can be obtained from a time series by + entering the time-series name in place of a numeric value. + runoff : [string] + * runoff (string) real or character value that defines the + runoff rate :math:`(L^3 T^{-1})` for the lake. Value must be + greater than or equal to zero. If the Options block includes + a TIMESERIESFILE entry (see the "Time-Variable Input" + section), values can be obtained from a time series by + entering the time-series name in place of a numeric value. + withdrawal : [string] + * withdrawal (string) real or character value that defines the + maximum withdrawal rate :math:`(L^3 T^{-1})` for the lake. + Value must be greater than or equal to zero. If the Options + block includes a TIMESERIESFILE entry (see the "Time-Variable + Input" section), values can be obtained from a time series by + entering the time-series name in place of a numeric value. + auxiliaryrecord : [auxname, auxval] + * auxname (string) name for the auxiliary variable to be + assigned AUXVAL. AUXNAME must match one of the auxiliary + variable names defined in the OPTIONS block. If AUXNAME does + not match one of the auxiliary variable names defined in the + OPTIONS block the data are ignored. + * auxval (double) value for the auxiliary variable. If the + Options block includes a TIMESERIESFILE entry (see the "Time- + Variable Input" section), values can be obtained from a time + series by entering the time-series name in place of a numeric + value. + outletperioddata : [outletno, outletsetting] + * outletno (integer) integer value that defines the outlet number + associated with the specified PERIOD data on the line. OUTLETNO must + be greater than zero and less than or equal to NOUTLETS. + * outletsetting (keystring) line of information that is parsed into a + keyword and values. Keyword values that can be used to start the + OUTLETSETTING string include: RATE, INVERT, WIDTH, SLOPE, and ROUGH. + rate : [string] + * rate (string) real or character value that defines the + extraction rate for the lake outflow. A positive value + indicates inflow and a negative value indicates outflow from + the lake. RATE only applies to active (IBOUND :math:`>` 0) + lakes. A specified RATE is only applied if COUTTYPE for the + OUTLETNO is SPECIFIED. If the Options block includes a + TIMESERIESFILE entry (see the "Time-Variable Input" section), + values can be obtained from a time series by entering the + time-series name in place of a numeric value. By default, the + RATE for each SPECIFIED lake outlet is zero. + invert : [string] + * invert (string) real or character value that defines the + invert elevation for the lake outlet. A specified INVERT + value is only used for active lakes if COUTTYPE for lake + outlet OUTLETNO is not SPECIFIED. If the Options block + includes a TIMESERIESFILE entry (see the "Time-Variable + Input" section), values can be obtained from a time series by + entering the time-series name in place of a numeric value. + width : [string] + * width (string) real or character value that defines the width + of the lake outlet. A specified WIDTH value is only used for + active lakes if COUTTYPE for lake outlet OUTLETNO is not + SPECIFIED. If the Options block includes a TIMESERIESFILE + entry (see the "Time-Variable Input" section), values can be + obtained from a time series by entering the time-series name + in place of a numeric value. + slope : [string] + * slope (string) real or character value that defines the bed + slope for the lake outlet. A specified SLOPE value is only + used for active lakes if COUTTYPE for lake outlet OUTLETNO is + MANNING. If the Options block includes a TIMESERIESFILE entry + (see the "Time-Variable Input" section), values can be + obtained from a time series by entering the time-series name + in place of a numeric value. + rough : [string] + * rough (string) real value that defines the roughness + coefficient for the lake outlet. Any value can be specified + if COUTTYPE is not MANNING. If the Options block includes a + TIMESERIESFILE entry (see the "Time-Variable Input" section), + values can be obtained from a time series by entering the + time-series name in place of a numeric value. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + auxiliary = ListTemplateGenerator(('gwf6', 'lak', 'options', + 'auxiliary')) + stage_filerecord = ListTemplateGenerator(('gwf6', 'lak', 'options', + 'stage_filerecord')) + budget_filerecord = ListTemplateGenerator(('gwf6', 'lak', 'options', + 'budget_filerecord')) + ts_filerecord = ListTemplateGenerator(('gwf6', 'lak', 'options', + 'ts_filerecord')) + obs_filerecord = ListTemplateGenerator(('gwf6', 'lak', 'options', + 'obs_filerecord')) + packagedata = ListTemplateGenerator(('gwf6', 'lak', 'packagedata', + 'packagedata')) + connectiondata = ListTemplateGenerator(('gwf6', 'lak', + 'connectiondata', + 'connectiondata')) + tables = ListTemplateGenerator(('gwf6', 'lak', 'tables', 'tables')) + outlets = ListTemplateGenerator(('gwf6', 'lak', 'outlets', + 'outlets')) + lakeperioddata = ListTemplateGenerator(('gwf6', 'lak', 'period', + 'lakeperioddata')) + outletperioddata = ListTemplateGenerator(('gwf6', 'lak', 'period', + 'outletperioddata')) + package_abbr = "gwflak" + _package_type = "lak" + dfn_file_name = "gwf-lak.dfn" + + dfn = [["block options", "name auxiliary", "type string", + "shape (naux)", "reader urword", "optional true"], + ["block options", "name boundnames", "type keyword", "shape", + "reader urword", "optional true"], + ["block options", "name print_input", "type keyword", + "reader urword", "optional true"], + ["block options", "name print_stage", "type keyword", + "reader urword", "optional true"], + ["block options", "name print_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name save_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name stage_filerecord", + "type record stage fileout stagefile", "shape", "reader urword", + "tagged true", "optional true"], + ["block options", "name stage", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name stagefile", "type string", + "preserve_case true", "shape", "in_record true", "reader urword", + "tagged false", "optional false"], + ["block options", "name budget_filerecord", + "type record budget fileout budgetfile", "shape", "reader urword", + "tagged true", "optional true"], + ["block options", "name budget", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name fileout", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name budgetfile", "type string", + "preserve_case true", "shape", "in_record true", "reader urword", + "tagged false", "optional false"], + ["block options", "name ts_filerecord", + "type record ts6 filein ts6_filename", "shape", "reader urword", + "tagged true", "optional true", "construct_package ts", + "construct_data timeseries", "parameter_name timeseries"], + ["block options", "name ts6", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name filein", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name ts6_filename", "type string", + "preserve_case true", "in_record true", "reader urword", + "optional false", "tagged false"], + ["block options", "name obs_filerecord", + "type record obs6 filein obs6_filename", "shape", "reader urword", + "tagged true", "optional true", "construct_package obs", + "construct_data continuous", "parameter_name observations"], + ["block options", "name obs6", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name obs6_filename", "type string", + "preserve_case true", "in_record true", "tagged false", + "reader urword", "optional false"], + ["block options", "name mover", "type keyword", "tagged true", + "reader urword", "optional true"], + ["block options", "name surfdep", "type double precision", + "reader urword", "optional true"], + ["block options", "name time_conversion", + "type double precision", "reader urword", "optional true"], + ["block options", "name length_conversion", + "type double precision", "reader urword", "optional true"], + ["block dimensions", "name nlakes", "type integer", + "reader urword", "optional false"], + ["block dimensions", "name noutlets", "type integer", + "reader urword", "optional false"], + ["block dimensions", "name ntables", "type integer", + "reader urword", "optional false"], + ["block packagedata", "name packagedata", + "type recarray lakeno strt nlakeconn aux boundname", + "shape (maxbound)", "reader urword"], + ["block packagedata", "name lakeno", "type integer", "shape", + "tagged false", "in_record true", "reader urword", + "numeric_index true"], + ["block packagedata", "name strt", "type double precision", + "shape", "tagged false", "in_record true", "reader urword"], + ["block packagedata", "name nlakeconn", "type integer", "shape", + "tagged false", "in_record true", "reader urword"], + ["block packagedata", "name aux", "type double precision", + "in_record true", "tagged false", "shape (naux)", "reader urword", + "time_series true", "optional true"], + ["block packagedata", "name boundname", "type string", "shape", + "tagged false", "in_record true", "reader urword", + "optional true"], + ["block connectiondata", "name connectiondata", + "type recarray lakeno iconn cellid claktype bedleak belev telev " + "connlen connwidth", + "shape (sum(nlakeconn))", "reader urword"], + ["block connectiondata", "name lakeno", "type integer", "shape", + "tagged false", "in_record true", "reader urword", + "numeric_index true"], + ["block connectiondata", "name iconn", "type integer", "shape", + "tagged false", "in_record true", "reader urword", + "numeric_index true"], + ["block connectiondata", "name cellid", "type integer", + "shape (ncelldim)", "tagged false", "in_record true", + "reader urword"], + ["block connectiondata", "name claktype", "type string", "shape", + "tagged false", "in_record true", "reader urword"], + ["block connectiondata", "name bedleak", "type double precision", + "shape", "tagged false", "in_record true", "reader urword"], + ["block connectiondata", "name belev", "type double precision", + "shape", "tagged false", "in_record true", "reader urword"], + ["block connectiondata", "name telev", "type double precision", + "shape", "tagged false", "in_record true", "reader urword"], + ["block connectiondata", "name connlen", "type double precision", + "shape", "tagged false", "in_record true", "reader urword"], + ["block connectiondata", "name connwidth", + "type double precision", "shape", "tagged false", + "in_record true", "reader urword"], + ["block tables", "name tables", + "type recarray lakeno tab6 filein tab6_filename", + "shape (ntables)", "reader urword"], + ["block tables", "name lakeno", "type integer", "shape", + "tagged false", "in_record true", "reader urword", + "numeric_index true"], + ["block tables", "name tab6", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block tables", "name filein", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block tables", "name tab6_filename", "type string", + "preserve_case true", "in_record true", "reader urword", + "optional false", "tagged false"], + ["block outlets", "name outlets", + "type recarray outletno lakein lakeout couttype invert width " + "rough slope", + "shape (noutlets)", "reader urword"], + ["block outlets", "name outletno", "type integer", "shape", + "tagged false", "in_record true", "reader urword", + "numeric_index true"], + ["block outlets", "name lakein", "type integer", "shape", + "tagged false", "in_record true", "reader urword", + "numeric_index true"], + ["block outlets", "name lakeout", "type integer", "shape", + "tagged false", "in_record true", "reader urword", + "numeric_index true"], + ["block outlets", "name couttype", "type string", "shape", + "tagged false", "in_record true", "reader urword"], + ["block outlets", "name invert", "type double precision", + "shape", "tagged false", "in_record true", "reader urword", + "time_series true"], + ["block outlets", "name width", "type double precision", "shape", + "tagged false", "in_record true", "reader urword", + "time_series true"], + ["block outlets", "name rough", "type double precision", "shape", + "tagged false", "in_record true", "reader urword", + "time_series true"], + ["block outlets", "name slope", "type double precision", "shape", + "tagged false", "in_record true", "reader urword", + "time_series true"], + ["block period", "name iper", "type integer", + "block_variable True", "in_record true", "tagged false", "shape", + "valid", "reader urword", "optional false"], + ["block period", "name lakeperioddata", + "type recarray lakeno laksetting", "shape", "reader urword"], + ["block period", "name lakeno", "type integer", "shape", + "tagged false", "in_record true", "reader urword", + "numeric_index true"], + ["block period", "name laksetting", + "type keystring status stage rainfall evaporation runoff " + "withdrawal auxiliaryrecord", + "shape", "tagged false", "in_record true", "reader urword"], + ["block period", "name status", "type string", "shape", + "tagged true", "in_record true", "reader urword"], + ["block period", "name stage", "type string", "shape", + "tagged true", "in_record true", "time_series true", + "reader urword"], + ["block period", "name rainfall", "type string", "shape", + "tagged true", "in_record true", "reader urword", + "time_series true"], + ["block period", "name evaporation", "type string", "shape", + "tagged true", "in_record true", "reader urword", + "time_series true"], + ["block period", "name runoff", "type string", "shape", + "tagged true", "in_record true", "reader urword", + "time_series true"], + ["block period", "name withdrawal", "type string", "shape", + "tagged true", "in_record true", "reader urword", + "time_series true"], + ["block period", "name auxiliaryrecord", + "type record auxiliary auxname auxval", "shape", "tagged", + "in_record true", "reader urword"], + ["block period", "name auxiliary", "type keyword", "shape", + "in_record true", "reader urword"], + ["block period", "name auxname", "type string", "shape", + "tagged false", "in_record true", "reader urword"], + ["block period", "name auxval", "type double precision", "shape", + "tagged false", "in_record true", "reader urword", + "time_series true"], + ["block period", "name outletperioddata", + "type recarray outletno outletsetting", "shape", "reader urword"], + ["block period", "name outletno", "type integer", "shape", + "tagged false", "in_record true", "reader urword", + "numeric_index true"], + ["block period", "name outletsetting", + "type keystring rate invert width slope rough", "shape", + "tagged false", "in_record true", "reader urword"], + ["block period", "name rate", "type string", "shape", + "tagged true", "in_record true", "reader urword", + "time_series true"], + ["block period", "name invert", "type string", "shape", + "tagged true", "in_record true", "reader urword", + "time_series true"], + ["block period", "name rough", "type string", "shape", + "tagged true", "in_record true", "reader urword", + "time_series true"], + ["block period", "name width", "type string", "shape", + "tagged true", "in_record true", "reader urword", + "time_series true"], + ["block period", "name slope", "type string", "shape", + "tagged true", "in_record true", "reader urword", + "time_series true"]] + + def __init__(self, model, loading_package=False, auxiliary=None, + boundnames=None, print_input=None, print_stage=None, + print_flows=None, save_flows=None, stage_filerecord=None, + budget_filerecord=None, timeseries=None, observations=None, + mover=None, surfdep=None, time_conversion=None, + length_conversion=None, nlakes=None, noutlets=None, + ntables=None, packagedata=None, connectiondata=None, + tables=None, outlets=None, lakeperioddata=None, + outletperioddata=None, filename=None, pname=None, + parent_file=None): + super(ModflowGwflak, self).__init__(model, "lak", filename, pname, + loading_package, parent_file) + + # set up variables + self.auxiliary = self.build_mfdata("auxiliary", auxiliary) + self.boundnames = self.build_mfdata("boundnames", boundnames) + self.print_input = self.build_mfdata("print_input", print_input) + self.print_stage = self.build_mfdata("print_stage", print_stage) + self.print_flows = self.build_mfdata("print_flows", print_flows) + self.save_flows = self.build_mfdata("save_flows", save_flows) + self.stage_filerecord = self.build_mfdata("stage_filerecord", + stage_filerecord) + self.budget_filerecord = self.build_mfdata("budget_filerecord", + budget_filerecord) + self._ts_filerecord = self.build_mfdata("ts_filerecord", + None) + self._ts_package = self.build_child_package("ts", timeseries, + "timeseries", + self._ts_filerecord) + self._obs_filerecord = self.build_mfdata("obs_filerecord", + None) + self._obs_package = self.build_child_package("obs", observations, + "continuous", + self._obs_filerecord) + self.mover = self.build_mfdata("mover", mover) + self.surfdep = self.build_mfdata("surfdep", surfdep) + self.time_conversion = self.build_mfdata("time_conversion", + time_conversion) + self.length_conversion = self.build_mfdata("length_conversion", + length_conversion) + self.nlakes = self.build_mfdata("nlakes", nlakes) + self.noutlets = self.build_mfdata("noutlets", noutlets) + self.ntables = self.build_mfdata("ntables", ntables) + self.packagedata = self.build_mfdata("packagedata", packagedata) + self.connectiondata = self.build_mfdata("connectiondata", + connectiondata) + self.tables = self.build_mfdata("tables", tables) + self.outlets = self.build_mfdata("outlets", outlets) + self.lakeperioddata = self.build_mfdata("lakeperioddata", + lakeperioddata) + self.outletperioddata = self.build_mfdata("outletperioddata", + outletperioddata) + self._init_complete = True diff --git a/flopy/mf6/modflow/mfgwfmaw.py b/flopy/mf6/modflow/mfgwfmaw.py index 057adc6b16..b77f4376c9 100644 --- a/flopy/mf6/modflow/mfgwfmaw.py +++ b/flopy/mf6/modflow/mfgwfmaw.py @@ -1,543 +1,543 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ListTemplateGenerator - - -class ModflowGwfmaw(mfpackage.MFPackage): - """ - ModflowGwfmaw defines a maw package within a gwf6 model. - - Parameters - ---------- - model : MFModel - Model that this package is a part of. Package is automatically - added to model when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - auxiliary : [string] - * auxiliary (string) defines an array of one or more auxiliary variable - names. There is no limit on the number of auxiliary variables that - can be provided on this line; however, lists of information provided - in subsequent blocks must have a column of data for each auxiliary - variable name defined here. The number of auxiliary variables - detected on this line determines the value for naux. Comments cannot - be provided anywhere on this line as they will be interpreted as - auxiliary variable names. Auxiliary variables may not be used by the - package, but they will be available for use by other parts of the - program. The program will terminate with an error if auxiliary - variables are specified on more than one line in the options block. - boundnames : boolean - * boundnames (boolean) keyword to indicate that boundary names may be - provided with the list of multi-aquifer well cells. - print_input : boolean - * print_input (boolean) keyword to indicate that the list of multi- - aquifer well information will be written to the listing file - immediately after it is read. - print_head : boolean - * print_head (boolean) keyword to indicate that the list of multi- - aquifer well heads will be printed to the listing file for every - stress period in which "HEAD PRINT" is specified in Output Control. - If there is no Output Control option and PRINT_HEAD is specified, - then heads are printed for the last time step of each stress period. - print_flows : boolean - * print_flows (boolean) keyword to indicate that the list of multi- - aquifer well flow rates will be printed to the listing file for every - stress period time step in which "BUDGET PRINT" is specified in - Output Control. If there is no Output Control option and - "PRINT_FLOWS" is specified, then flow rates are printed for the last - time step of each stress period. - save_flows : boolean - * save_flows (boolean) keyword to indicate that multi-aquifer well flow - terms will be written to the file specified with "BUDGET FILEOUT" in - Output Control. - stage_filerecord : [headfile] - * headfile (string) name of the binary output file to write stage - information. - budget_filerecord : [budgetfile] - * budgetfile (string) name of the binary output file to write budget - information. - no_well_storage : boolean - * no_well_storage (boolean) keyword that deactivates inclusion of well - storage contributions to the multi-aquifer well package continuity - equation. - flowing_wells : boolean - * flowing_wells (boolean) keyword that activates the flowing wells - option for the multi-aquifer well package. - shutdown_theta : double - * shutdown_theta (double) value that defines the weight applied to - discharge rate for wells that limit the water level in a discharging - well (defined using the HEAD_LIMIT keyword in the stress period - data). SHUTDOWN_THETA is used to control discharge rate oscillations - when the flow rate from the aquifer is less than the specified flow - rate from the aquifer to the well. Values range between 0.0 and 1.0, - and larger values increase the weight (decrease under-relaxation) - applied to the well discharge rate. The HEAD_LIMIT option has been - included to facilitate backward compatibility with previous versions - of MODFLOW but use of the RATE_SCALING option instead of the - HEAD_LIMIT option is recommended. By default, SHUTDOWN_THETA is 0.7. - shutdown_kappa : double - * shutdown_kappa (double) value that defines the weight applied to - discharge rate for wells that limit the water level in a discharging - well (defined using the HEAD_LIMIT keyword in the stress period - data). SHUTDOWN_KAPPA is used to control discharge rate oscillations - when the flow rate from the aquifer is less than the specified flow - rate from the aquifer to the well. Values range between 0.0 and 1.0, - and larger values increase the weight applied to the well discharge - rate. The HEAD_LIMIT option has been included to facilitate backward - compatibility with previous versions of MODFLOW but use of the - RATE_SCALING option instead of the HEAD_LIMIT option is recommended. - By default, SHUTDOWN_KAPPA is 0.0001. - timeseries : {varname:data} or timeseries data - * Contains data for the ts package. Data can be stored in a dictionary - containing data for the ts package with variable names as keys and - package data as values. Data just for the timeseries variable is also - acceptable. See ts package documentation for more information. - observations : {varname:data} or continuous data - * Contains data for the obs package. Data can be stored in a dictionary - containing data for the obs package with variable names as keys and - package data as values. Data just for the observations variable is - also acceptable. See obs package documentation for more information. - mover : boolean - * mover (boolean) keyword to indicate that this instance of the MAW - Package can be used with the Water Mover (MVR) Package. When the - MOVER option is specified, additional memory is allocated within the - package to store the available, provided, and received water. - nmawwells : integer - * nmawwells (integer) integer value specifying the number of multi- - aquifer wells that will be simulated for all stress periods. - packagedata : [wellno, radius, bottom, strt, condeqn, ngwfnodes, aux, - boundname] - * wellno (integer) integer value that defines the well number - associated with the specified PACKAGEDATA data on the line. WELLNO - must be greater than zero and less than or equal to NMAWWELLS. Multi- - aquifer well information must be specified for every multi-aquifer - well or the program will terminate with an error. The program will - also terminate with an error if information for a multi-aquifer well - is specified more than once. - * radius (double) radius for the multi-aquifer well. - * bottom (double) bottom elevation of the multi-aquifer well. The well - bottom is reset to the cell bottom in the lowermost GWF cell - connection in cases where the specified well bottom is above the - bottom of this GWF cell. - * strt (double) starting head for the multi-aquifer well. - * condeqn (string) character string that defines the conductance - equation that is used to calculate the saturated conductance for the - multi-aquifer well. Possible multi-aquifer well CONDEQN strings - include: SPECIFIED--character keyword to indicate the multi-aquifer - well saturated conductance will be specified. THIEM--character - keyword to indicate the multi-aquifer well saturated conductance will - be calculated using the Thiem equation, which considers the cell top - and bottom, aquifer hydraulic conductivity, and effective cell and - well radius. SKIN--character keyword to indicate that the multi- - aquifer well saturated conductance will be calculated using the cell - top and bottom, aquifer and screen hydraulic conductivity, and well - and skin radius. CUMULATIVE--character keyword to indicate that the - multi-aquifer well saturated conductance will be calculated using a - combination of the Thiem and SKIN equations. MEAN--character keyword - to indicate the multi-aquifer well saturated conductance will be - calculated using the aquifer and screen top and bottom, aquifer and - screen hydraulic conductivity, and well and skin radius. - * ngwfnodes (integer) integer value that defines the number of GWF - nodes connected to this (WELLNO) multi-aquifer well. NGWFNODES must - be greater than zero. - * aux (double) represents the values of the auxiliary variables for - each multi-aquifer well. The values of auxiliary variables must be - present for each multi-aquifer well. The values must be specified in - the order of the auxiliary variables specified in the OPTIONS block. - If the package supports time series and the Options block includes a - TIMESERIESFILE entry (see the "Time-Variable Input" section), values - can be obtained from a time series by entering the time-series name - in place of a numeric value. - * boundname (string) name of the multi-aquifer well cell. BOUNDNAME is - an ASCII character variable that can contain as many as 40 - characters. If BOUNDNAME contains spaces in it, then the entire name - must be enclosed within single quotes. - connectiondata : [wellno, icon, cellid, scrn_top, scrn_bot, hk_skin, - radius_skin] - * wellno (integer) integer value that defines the well number - associated with the specified CONNECTIONDATA data on the line. WELLNO - must be greater than zero and less than or equal to NMAWWELLS. Multi- - aquifer well connection information must be specified for every - multi-aquifer well connection to the GWF model (NGWFNODES) or the - program will terminate with an error. The program will also terminate - with an error if connection information for a multi-aquifer well - connection to the GWF model is specified more than once. - * icon (integer) integer value that defines the GWF connection number - for this multi-aquifer well connection entry. ICONN must be greater - than zero and less than or equal to NGWFNODES for multi-aquifer well - WELLNO. - * cellid ((integer, ...)) is the cell identifier, and depends on the - type of grid that is used for the simulation. For a structured grid - that uses the DIS input file, CELLID is the layer, row, and column. - For a grid that uses the DISV input file, CELLID is the layer and - CELL2D number. If the model uses the unstructured discretization - (DISU) input file, CELLID is the node number for the cell. One or - more screened intervals can be connected to the same CELLID if - CONDEQN for a well is MEAN. The program will terminate with an error - if MAW wells using SPECIFIED, THIEM, SKIN, or CUMULATIVE conductance - equations have more than one connection to the same CELLID. - * scrn_top (double) value that defines the top elevation of the screen - for the multi-aquifer well connection. If the specified SCRN_TOP is - greater than the top of the GWF cell it is set equal to the top of - the cell. SCRN_TOP can be any value if CONDEQN is SPECIFIED, THIEM, - SKIN, or COMPOSITE and SCRN_TOP is set to the top of the cell. - * scrn_bot (double) value that defines the bottom elevation of the - screen for the multi-aquifer well connection. If the specified - SCRN_BOT is less than the bottom of the GWF cell it is set equal to - the bottom of the cell. SCRN_BOT can be any value if CONDEQN is - SPECIFIED, THIEM, SKIN, or COMPOSITE and SCRN_BOT is set to the - bottom of the cell. - * hk_skin (double) value that defines the skin (filter pack) hydraulic - conductivity (if CONDEQN for the multi-aquifer well is SKIN, - CUMULATIVE, or MEAN) or conductance (if CONDEQN for the multi-aquifer - well is SPECIFIED) for each GWF node connected to the multi-aquifer - well (NGWFNODES). HK_SKIN can be any value if CONDEQN is THIEM. - * radius_skin (double) real value that defines the skin radius (filter - pack radius) for the multi-aquifer well. RADIUS_SKIN can be any value - if CONDEQN is SPECIFIED or THIEM. Otherwise, RADIUS_SKIN must be - greater than RADIUS for the multi-aquifer well. - perioddata : [wellno, mawsetting] - * wellno (integer) integer value that defines the well number - associated with the specified PERIOD data on the line. WELLNO must be - greater than zero and less than or equal to NMAWWELLS. - * mawsetting (keystring) line of information that is parsed into a - keyword and values. Keyword values that can be used to start the - MAWSETTING string include: STATUS, FLOWING_WELL, RATE, WELL_HEAD, - HEAD_LIMIT, SHUT_OFF, RATE_SCALING, and AUXILIARY. - status : [string] - * status (string) keyword option to define well status. STATUS - can be ACTIVE, INACTIVE, or CONSTANT. By default, STATUS is - ACTIVE. - flowing_wellrecord : [fwelev, fwcond, fwrlen] - * fwelev (double) elevation used to determine whether or not - the well is flowing. - * fwcond (double) conductance used to calculate the discharge - of a free flowing well. Flow occurs when the head in the well - is above the well top elevation (FWELEV). - * fwrlen (double) length used to reduce the conductance of the - flowing well. When the head in the well drops below the well - top plus the reduction length, then the conductance is - reduced. This reduction length can be used to improve the - stability of simulations with flowing wells so that there is - not an abrupt change in flowing well rates. - rate : [double] - * rate (double) is the volumetric pumping rate for the multi- - aquifer well. A positive value indicates recharge and a - negative value indicates discharge (pumping). RATE only - applies to active (IBOUND :math:`>` 0) multi-aquifer wells. - If the Options block includes a TIMESERIESFILE entry (see the - "Time-Variable Input" section), values can be obtained from a - time series by entering the time-series name in place of a - numeric value. By default, the RATE for each multi-aquifer - well is zero. - well_head : [double] - * well_head (double) is the head in the multi-aquifer well. - WELL_HEAD is only applied to constant head (STATUS is - CONSTANT) and inactive (STATUS is INACTIVE) multi-aquifer - wells. If the Options block includes a TIMESERIESFILE entry - (see the "Time-Variable Input" section), values can be - obtained from a time series by entering the time-series name - in place of a numeric value. - head_limit : [string] - * head_limit (string) is the limiting water level (head) in the - well, which is the minimum of the well RATE or the well - inflow rate from the aquifer. HEAD_LIMIT can be applied to - extraction wells (RATE :math:`<` 0) or injection wells (RATE - :math:`>` 0). HEAD\_LIMIT can be deactivated by specifying - the text string `OFF'. The HEAD\_LIMIT option is based on the - HEAD\_LIMIT functionality available in the - MNW2~\citep{konikow2009} package for MODFLOW-2005. The - HEAD\_LIMIT option has been included to facilitate backward - compatibility with previous versions of MODFLOW but use of - the RATE\_SCALING option instead of the HEAD\_LIMIT option is - recommended. By default, HEAD\_LIMIT is `OFF'. - shutoffrecord : [minrate, maxrate] - * minrate (double) is the minimum rate that a well must exceed - to shutoff a well during a stress period. The well will shut - down during a time step if the flow rate to the well from the - aquifer is less than MINRATE. If a well is shut down during a - time step, reactivation of the well cannot occur until the - next time step to reduce oscillations. MINRATE must be less - than maxrate. - * maxrate (double) is the maximum rate that a well must exceed - to reactivate a well during a stress period. The well will - reactivate during a timestep if the well was shutdown during - the previous time step and the flow rate to the well from the - aquifer exceeds maxrate. Reactivation of the well cannot - occur until the next time step if a well is shutdown to - reduce oscillations. maxrate must be greater than MINRATE. - rate_scalingrecord : [pump_elevation, scaling_length] - * pump_elevation (double) is the elevation of the multi-aquifer - well pump (PUMP_ELEVATION). PUMP_ELEVATION should not be less - than the bottom elevation (BOTTOM) of the multi-aquifer well. - * scaling_length (double) height above the pump elevation - (SCALING_LENGTH). If the simulated well head is below this - elevation (pump elevation plus the scaling length), then the - pumping rate is reduced. - auxiliaryrecord : [auxname, auxval] - * auxname (string) name for the auxiliary variable to be - assigned AUXVAL. AUXNAME must match one of the auxiliary - variable names defined in the OPTIONS block. If AUXNAME does - not match one of the auxiliary variable names defined in the - OPTIONS block the data are ignored. - * auxval (double) value for the auxiliary variable. If the - Options block includes a TIMESERIESFILE entry (see the "Time- - Variable Input" section), values can be obtained from a time - series by entering the time-series name in place of a numeric - value. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - auxiliary = ListTemplateGenerator(('gwf6', 'maw', 'options', - 'auxiliary')) - stage_filerecord = ListTemplateGenerator(('gwf6', 'maw', 'options', - 'stage_filerecord')) - budget_filerecord = ListTemplateGenerator(('gwf6', 'maw', 'options', - 'budget_filerecord')) - ts_filerecord = ListTemplateGenerator(('gwf6', 'maw', 'options', - 'ts_filerecord')) - obs_filerecord = ListTemplateGenerator(('gwf6', 'maw', 'options', - 'obs_filerecord')) - packagedata = ListTemplateGenerator(('gwf6', 'maw', 'packagedata', - 'packagedata')) - connectiondata = ListTemplateGenerator(('gwf6', 'maw', - 'connectiondata', - 'connectiondata')) - perioddata = ListTemplateGenerator(('gwf6', 'maw', 'period', - 'perioddata')) - package_abbr = "gwfmaw" - _package_type = "maw" - dfn_file_name = "gwf-maw.dfn" - - dfn = [["block options", "name auxiliary", "type string", - "shape (naux)", "reader urword", "optional true"], - ["block options", "name boundnames", "type keyword", "shape", - "reader urword", "optional true"], - ["block options", "name print_input", "type keyword", - "reader urword", "optional true"], - ["block options", "name print_head", "type keyword", - "reader urword", "optional true"], - ["block options", "name print_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name save_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name stage_filerecord", - "type record head fileout headfile", "shape", "reader urword", - "tagged true", "optional true"], - ["block options", "name head", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name headfile", "type string", - "preserve_case true", "shape", "in_record true", "reader urword", - "tagged false", "optional false"], - ["block options", "name budget_filerecord", - "type record budget fileout budgetfile", "shape", "reader urword", - "tagged true", "optional true"], - ["block options", "name budget", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name fileout", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name budgetfile", "type string", - "preserve_case true", "shape", "in_record true", "reader urword", - "tagged false", "optional false"], - ["block options", "name no_well_storage", "type keyword", - "reader urword", "optional true"], - ["block options", "name flowing_wells", "type keyword", - "reader urword", "optional true"], - ["block options", "name shutdown_theta", "type double precision", - "reader urword", "optional true"], - ["block options", "name shutdown_kappa", "type double precision", - "reader urword", "optional true"], - ["block options", "name ts_filerecord", - "type record ts6 filein ts6_filename", "shape", "reader urword", - "tagged true", "optional true", "construct_package ts", - "construct_data timeseries", "parameter_name timeseries"], - ["block options", "name ts6", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name filein", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name ts6_filename", "type string", - "preserve_case true", "in_record true", "reader urword", - "optional false", "tagged false"], - ["block options", "name obs_filerecord", - "type record obs6 filein obs6_filename", "shape", "reader urword", - "tagged true", "optional true", "construct_package obs", - "construct_data continuous", "parameter_name observations"], - ["block options", "name obs6", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name obs6_filename", "type string", - "preserve_case true", "in_record true", "tagged false", - "reader urword", "optional false"], - ["block options", "name mover", "type keyword", "tagged true", - "reader urword", "optional true"], - ["block dimensions", "name nmawwells", "type integer", - "reader urword", "optional false"], - ["block packagedata", "name packagedata", - "type recarray wellno radius bottom strt condeqn ngwfnodes aux " - "boundname", - "shape (nmawwells)", "reader urword"], - ["block packagedata", "name wellno", "type integer", "shape", - "tagged false", "in_record true", "reader urword", - "numeric_index true"], - ["block packagedata", "name radius", "type double precision", - "shape", "tagged false", "in_record true", "reader urword"], - ["block packagedata", "name bottom", "type double precision", - "shape", "tagged false", "in_record true", "reader urword"], - ["block packagedata", "name strt", "type double precision", - "shape", "tagged false", "in_record true", "reader urword"], - ["block packagedata", "name condeqn", "type string", "shape", - "tagged false", "in_record true", "reader urword"], - ["block packagedata", "name ngwfnodes", "type integer", "shape", - "tagged false", "in_record true", "reader urword"], - ["block packagedata", "name aux", "type double precision", - "in_record true", "tagged false", "shape (naux)", "reader urword", - "time_series true", "optional true"], - ["block packagedata", "name boundname", "type string", "shape", - "tagged false", "in_record true", "reader urword", - "optional true"], - ["block connectiondata", "name connectiondata", - "type recarray wellno icon cellid scrn_top scrn_bot hk_skin " - "radius_skin", - "reader urword"], - ["block connectiondata", "name wellno", "type integer", "shape", - "tagged false", "in_record true", "reader urword", - "numeric_index true"], - ["block connectiondata", "name icon", "type integer", "shape", - "tagged false", "in_record true", "reader urword", - "numeric_index true"], - ["block connectiondata", "name cellid", "type integer", - "shape (ncelldim)", "tagged false", "in_record true", - "reader urword"], - ["block connectiondata", "name scrn_top", - "type double precision", "shape", "tagged false", - "in_record true", "reader urword"], - ["block connectiondata", "name scrn_bot", - "type double precision", "shape", "tagged false", - "in_record true", "reader urword"], - ["block connectiondata", "name hk_skin", "type double precision", - "shape", "tagged false", "in_record true", "reader urword"], - ["block connectiondata", "name radius_skin", - "type double precision", "shape", "tagged false", - "in_record true", "reader urword"], - ["block period", "name iper", "type integer", - "block_variable True", "in_record true", "tagged false", "shape", - "valid", "reader urword", "optional false"], - ["block period", "name perioddata", - "type recarray wellno mawsetting", "shape", "reader urword"], - ["block period", "name wellno", "type integer", "shape", - "tagged false", "in_record true", "reader urword", - "numeric_index true"], - ["block period", "name mawsetting", - "type keystring status flowing_wellrecord rate well_head " - "head_limit shutoffrecord rate_scalingrecord auxiliaryrecord", - "shape", "tagged false", "in_record true", "reader urword"], - ["block period", "name status", "type string", "shape", - "tagged true", "in_record true", "reader urword"], - ["block period", "name flowing_wellrecord", - "type record flowing_well fwelev fwcond fwrlen", "shape", - "tagged", "in_record true", "reader urword"], - ["block period", "name flowing_well", "type keyword", "shape", - "in_record true", "reader urword"], - ["block period", "name fwelev", "type double precision", "shape", - "tagged false", "in_record true", "reader urword"], - ["block period", "name fwcond", "type double precision", "shape", - "tagged false", "in_record true", "reader urword"], - ["block period", "name fwrlen", "type double precision", "shape", - "tagged false", "in_record true", "reader urword"], - ["block period", "name rate", "type double precision", "shape", - "tagged true", "in_record true", "reader urword", - "time_series true"], - ["block period", "name well_head", "type double precision", - "shape", "tagged true", "in_record true", "reader urword", - "time_series true"], - ["block period", "name head_limit", "type string", "shape", - "tagged true", "in_record true", "reader urword"], - ["block period", "name shutoffrecord", - "type record shut_off minrate maxrate", "shape", "tagged", - "in_record true", "reader urword"], - ["block period", "name shut_off", "type keyword", "shape", - "in_record true", "reader urword"], - ["block period", "name minrate", "type double precision", - "shape", "tagged false", "in_record true", "reader urword"], - ["block period", "name maxrate", "type double precision", - "shape", "tagged false", "in_record true", "reader urword"], - ["block period", "name rate_scalingrecord", - "type record rate_scaling pump_elevation scaling_length", "shape", - "tagged", "in_record true", "reader urword"], - ["block period", "name rate_scaling", "type keyword", "shape", - "in_record true", "reader urword"], - ["block period", "name pump_elevation", "type double precision", - "shape", "tagged false", "in_record true", "reader urword"], - ["block period", "name scaling_length", "type double precision", - "shape", "tagged false", "in_record true", "reader urword"], - ["block period", "name auxiliaryrecord", - "type record auxiliary auxname auxval", "shape", "tagged", - "in_record true", "reader urword"], - ["block period", "name auxiliary", "type keyword", "shape", - "in_record true", "reader urword"], - ["block period", "name auxname", "type string", "shape", - "tagged false", "in_record true", "reader urword"], - ["block period", "name auxval", "type double precision", "shape", - "tagged false", "in_record true", "reader urword", - "time_series true"]] - - def __init__(self, model, loading_package=False, auxiliary=None, - boundnames=None, print_input=None, print_head=None, - print_flows=None, save_flows=None, stage_filerecord=None, - budget_filerecord=None, no_well_storage=None, - flowing_wells=None, shutdown_theta=None, shutdown_kappa=None, - timeseries=None, observations=None, mover=None, - nmawwells=None, packagedata=None, connectiondata=None, - perioddata=None, filename=None, pname=None, parent_file=None): - super(ModflowGwfmaw, self).__init__(model, "maw", filename, pname, - loading_package, parent_file) - - # set up variables - self.auxiliary = self.build_mfdata("auxiliary", auxiliary) - self.boundnames = self.build_mfdata("boundnames", boundnames) - self.print_input = self.build_mfdata("print_input", print_input) - self.print_head = self.build_mfdata("print_head", print_head) - self.print_flows = self.build_mfdata("print_flows", print_flows) - self.save_flows = self.build_mfdata("save_flows", save_flows) - self.stage_filerecord = self.build_mfdata("stage_filerecord", - stage_filerecord) - self.budget_filerecord = self.build_mfdata("budget_filerecord", - budget_filerecord) - self.no_well_storage = self.build_mfdata("no_well_storage", - no_well_storage) - self.flowing_wells = self.build_mfdata("flowing_wells", flowing_wells) - self.shutdown_theta = self.build_mfdata("shutdown_theta", - shutdown_theta) - self.shutdown_kappa = self.build_mfdata("shutdown_kappa", - shutdown_kappa) - self._ts_filerecord = self.build_mfdata("ts_filerecord", - None) - self._ts_package = self.build_child_package("ts", timeseries, - "timeseries", - self._ts_filerecord) - self._obs_filerecord = self.build_mfdata("obs_filerecord", - None) - self._obs_package = self.build_child_package("obs", observations, - "continuous", - self._obs_filerecord) - self.mover = self.build_mfdata("mover", mover) - self.nmawwells = self.build_mfdata("nmawwells", nmawwells) - self.packagedata = self.build_mfdata("packagedata", packagedata) - self.connectiondata = self.build_mfdata("connectiondata", - connectiondata) - self.perioddata = self.build_mfdata("perioddata", perioddata) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ListTemplateGenerator + + +class ModflowGwfmaw(mfpackage.MFPackage): + """ + ModflowGwfmaw defines a maw package within a gwf6 model. + + Parameters + ---------- + model : MFModel + Model that this package is a part of. Package is automatically + added to model when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + auxiliary : [string] + * auxiliary (string) defines an array of one or more auxiliary variable + names. There is no limit on the number of auxiliary variables that + can be provided on this line; however, lists of information provided + in subsequent blocks must have a column of data for each auxiliary + variable name defined here. The number of auxiliary variables + detected on this line determines the value for naux. Comments cannot + be provided anywhere on this line as they will be interpreted as + auxiliary variable names. Auxiliary variables may not be used by the + package, but they will be available for use by other parts of the + program. The program will terminate with an error if auxiliary + variables are specified on more than one line in the options block. + boundnames : boolean + * boundnames (boolean) keyword to indicate that boundary names may be + provided with the list of multi-aquifer well cells. + print_input : boolean + * print_input (boolean) keyword to indicate that the list of multi- + aquifer well information will be written to the listing file + immediately after it is read. + print_head : boolean + * print_head (boolean) keyword to indicate that the list of multi- + aquifer well heads will be printed to the listing file for every + stress period in which "HEAD PRINT" is specified in Output Control. + If there is no Output Control option and PRINT_HEAD is specified, + then heads are printed for the last time step of each stress period. + print_flows : boolean + * print_flows (boolean) keyword to indicate that the list of multi- + aquifer well flow rates will be printed to the listing file for every + stress period time step in which "BUDGET PRINT" is specified in + Output Control. If there is no Output Control option and + "PRINT_FLOWS" is specified, then flow rates are printed for the last + time step of each stress period. + save_flows : boolean + * save_flows (boolean) keyword to indicate that multi-aquifer well flow + terms will be written to the file specified with "BUDGET FILEOUT" in + Output Control. + stage_filerecord : [headfile] + * headfile (string) name of the binary output file to write stage + information. + budget_filerecord : [budgetfile] + * budgetfile (string) name of the binary output file to write budget + information. + no_well_storage : boolean + * no_well_storage (boolean) keyword that deactivates inclusion of well + storage contributions to the multi-aquifer well package continuity + equation. + flowing_wells : boolean + * flowing_wells (boolean) keyword that activates the flowing wells + option for the multi-aquifer well package. + shutdown_theta : double + * shutdown_theta (double) value that defines the weight applied to + discharge rate for wells that limit the water level in a discharging + well (defined using the HEAD_LIMIT keyword in the stress period + data). SHUTDOWN_THETA is used to control discharge rate oscillations + when the flow rate from the aquifer is less than the specified flow + rate from the aquifer to the well. Values range between 0.0 and 1.0, + and larger values increase the weight (decrease under-relaxation) + applied to the well discharge rate. The HEAD_LIMIT option has been + included to facilitate backward compatibility with previous versions + of MODFLOW but use of the RATE_SCALING option instead of the + HEAD_LIMIT option is recommended. By default, SHUTDOWN_THETA is 0.7. + shutdown_kappa : double + * shutdown_kappa (double) value that defines the weight applied to + discharge rate for wells that limit the water level in a discharging + well (defined using the HEAD_LIMIT keyword in the stress period + data). SHUTDOWN_KAPPA is used to control discharge rate oscillations + when the flow rate from the aquifer is less than the specified flow + rate from the aquifer to the well. Values range between 0.0 and 1.0, + and larger values increase the weight applied to the well discharge + rate. The HEAD_LIMIT option has been included to facilitate backward + compatibility with previous versions of MODFLOW but use of the + RATE_SCALING option instead of the HEAD_LIMIT option is recommended. + By default, SHUTDOWN_KAPPA is 0.0001. + timeseries : {varname:data} or timeseries data + * Contains data for the ts package. Data can be stored in a dictionary + containing data for the ts package with variable names as keys and + package data as values. Data just for the timeseries variable is also + acceptable. See ts package documentation for more information. + observations : {varname:data} or continuous data + * Contains data for the obs package. Data can be stored in a dictionary + containing data for the obs package with variable names as keys and + package data as values. Data just for the observations variable is + also acceptable. See obs package documentation for more information. + mover : boolean + * mover (boolean) keyword to indicate that this instance of the MAW + Package can be used with the Water Mover (MVR) Package. When the + MOVER option is specified, additional memory is allocated within the + package to store the available, provided, and received water. + nmawwells : integer + * nmawwells (integer) integer value specifying the number of multi- + aquifer wells that will be simulated for all stress periods. + packagedata : [wellno, radius, bottom, strt, condeqn, ngwfnodes, aux, + boundname] + * wellno (integer) integer value that defines the well number + associated with the specified PACKAGEDATA data on the line. WELLNO + must be greater than zero and less than or equal to NMAWWELLS. Multi- + aquifer well information must be specified for every multi-aquifer + well or the program will terminate with an error. The program will + also terminate with an error if information for a multi-aquifer well + is specified more than once. + * radius (double) radius for the multi-aquifer well. + * bottom (double) bottom elevation of the multi-aquifer well. The well + bottom is reset to the cell bottom in the lowermost GWF cell + connection in cases where the specified well bottom is above the + bottom of this GWF cell. + * strt (double) starting head for the multi-aquifer well. + * condeqn (string) character string that defines the conductance + equation that is used to calculate the saturated conductance for the + multi-aquifer well. Possible multi-aquifer well CONDEQN strings + include: SPECIFIED--character keyword to indicate the multi-aquifer + well saturated conductance will be specified. THIEM--character + keyword to indicate the multi-aquifer well saturated conductance will + be calculated using the Thiem equation, which considers the cell top + and bottom, aquifer hydraulic conductivity, and effective cell and + well radius. SKIN--character keyword to indicate that the multi- + aquifer well saturated conductance will be calculated using the cell + top and bottom, aquifer and screen hydraulic conductivity, and well + and skin radius. CUMULATIVE--character keyword to indicate that the + multi-aquifer well saturated conductance will be calculated using a + combination of the Thiem and SKIN equations. MEAN--character keyword + to indicate the multi-aquifer well saturated conductance will be + calculated using the aquifer and screen top and bottom, aquifer and + screen hydraulic conductivity, and well and skin radius. + * ngwfnodes (integer) integer value that defines the number of GWF + nodes connected to this (WELLNO) multi-aquifer well. NGWFNODES must + be greater than zero. + * aux (double) represents the values of the auxiliary variables for + each multi-aquifer well. The values of auxiliary variables must be + present for each multi-aquifer well. The values must be specified in + the order of the auxiliary variables specified in the OPTIONS block. + If the package supports time series and the Options block includes a + TIMESERIESFILE entry (see the "Time-Variable Input" section), values + can be obtained from a time series by entering the time-series name + in place of a numeric value. + * boundname (string) name of the multi-aquifer well cell. BOUNDNAME is + an ASCII character variable that can contain as many as 40 + characters. If BOUNDNAME contains spaces in it, then the entire name + must be enclosed within single quotes. + connectiondata : [wellno, icon, cellid, scrn_top, scrn_bot, hk_skin, + radius_skin] + * wellno (integer) integer value that defines the well number + associated with the specified CONNECTIONDATA data on the line. WELLNO + must be greater than zero and less than or equal to NMAWWELLS. Multi- + aquifer well connection information must be specified for every + multi-aquifer well connection to the GWF model (NGWFNODES) or the + program will terminate with an error. The program will also terminate + with an error if connection information for a multi-aquifer well + connection to the GWF model is specified more than once. + * icon (integer) integer value that defines the GWF connection number + for this multi-aquifer well connection entry. ICONN must be greater + than zero and less than or equal to NGWFNODES for multi-aquifer well + WELLNO. + * cellid ((integer, ...)) is the cell identifier, and depends on the + type of grid that is used for the simulation. For a structured grid + that uses the DIS input file, CELLID is the layer, row, and column. + For a grid that uses the DISV input file, CELLID is the layer and + CELL2D number. If the model uses the unstructured discretization + (DISU) input file, CELLID is the node number for the cell. One or + more screened intervals can be connected to the same CELLID if + CONDEQN for a well is MEAN. The program will terminate with an error + if MAW wells using SPECIFIED, THIEM, SKIN, or CUMULATIVE conductance + equations have more than one connection to the same CELLID. + * scrn_top (double) value that defines the top elevation of the screen + for the multi-aquifer well connection. If the specified SCRN_TOP is + greater than the top of the GWF cell it is set equal to the top of + the cell. SCRN_TOP can be any value if CONDEQN is SPECIFIED, THIEM, + SKIN, or COMPOSITE and SCRN_TOP is set to the top of the cell. + * scrn_bot (double) value that defines the bottom elevation of the + screen for the multi-aquifer well connection. If the specified + SCRN_BOT is less than the bottom of the GWF cell it is set equal to + the bottom of the cell. SCRN_BOT can be any value if CONDEQN is + SPECIFIED, THIEM, SKIN, or COMPOSITE and SCRN_BOT is set to the + bottom of the cell. + * hk_skin (double) value that defines the skin (filter pack) hydraulic + conductivity (if CONDEQN for the multi-aquifer well is SKIN, + CUMULATIVE, or MEAN) or conductance (if CONDEQN for the multi-aquifer + well is SPECIFIED) for each GWF node connected to the multi-aquifer + well (NGWFNODES). HK_SKIN can be any value if CONDEQN is THIEM. + * radius_skin (double) real value that defines the skin radius (filter + pack radius) for the multi-aquifer well. RADIUS_SKIN can be any value + if CONDEQN is SPECIFIED or THIEM. Otherwise, RADIUS_SKIN must be + greater than RADIUS for the multi-aquifer well. + perioddata : [wellno, mawsetting] + * wellno (integer) integer value that defines the well number + associated with the specified PERIOD data on the line. WELLNO must be + greater than zero and less than or equal to NMAWWELLS. + * mawsetting (keystring) line of information that is parsed into a + keyword and values. Keyword values that can be used to start the + MAWSETTING string include: STATUS, FLOWING_WELL, RATE, WELL_HEAD, + HEAD_LIMIT, SHUT_OFF, RATE_SCALING, and AUXILIARY. + status : [string] + * status (string) keyword option to define well status. STATUS + can be ACTIVE, INACTIVE, or CONSTANT. By default, STATUS is + ACTIVE. + flowing_wellrecord : [fwelev, fwcond, fwrlen] + * fwelev (double) elevation used to determine whether or not + the well is flowing. + * fwcond (double) conductance used to calculate the discharge + of a free flowing well. Flow occurs when the head in the well + is above the well top elevation (FWELEV). + * fwrlen (double) length used to reduce the conductance of the + flowing well. When the head in the well drops below the well + top plus the reduction length, then the conductance is + reduced. This reduction length can be used to improve the + stability of simulations with flowing wells so that there is + not an abrupt change in flowing well rates. + rate : [double] + * rate (double) is the volumetric pumping rate for the multi- + aquifer well. A positive value indicates recharge and a + negative value indicates discharge (pumping). RATE only + applies to active (IBOUND :math:`>` 0) multi-aquifer wells. + If the Options block includes a TIMESERIESFILE entry (see the + "Time-Variable Input" section), values can be obtained from a + time series by entering the time-series name in place of a + numeric value. By default, the RATE for each multi-aquifer + well is zero. + well_head : [double] + * well_head (double) is the head in the multi-aquifer well. + WELL_HEAD is only applied to constant head (STATUS is + CONSTANT) and inactive (STATUS is INACTIVE) multi-aquifer + wells. If the Options block includes a TIMESERIESFILE entry + (see the "Time-Variable Input" section), values can be + obtained from a time series by entering the time-series name + in place of a numeric value. + head_limit : [string] + * head_limit (string) is the limiting water level (head) in the + well, which is the minimum of the well RATE or the well + inflow rate from the aquifer. HEAD_LIMIT can be applied to + extraction wells (RATE :math:`<` 0) or injection wells (RATE + :math:`>` 0). HEAD\_LIMIT can be deactivated by specifying + the text string `OFF'. The HEAD\_LIMIT option is based on the + HEAD\_LIMIT functionality available in the + MNW2~\citep{konikow2009} package for MODFLOW-2005. The + HEAD\_LIMIT option has been included to facilitate backward + compatibility with previous versions of MODFLOW but use of + the RATE\_SCALING option instead of the HEAD\_LIMIT option is + recommended. By default, HEAD\_LIMIT is `OFF'. + shutoffrecord : [minrate, maxrate] + * minrate (double) is the minimum rate that a well must exceed + to shutoff a well during a stress period. The well will shut + down during a time step if the flow rate to the well from the + aquifer is less than MINRATE. If a well is shut down during a + time step, reactivation of the well cannot occur until the + next time step to reduce oscillations. MINRATE must be less + than maxrate. + * maxrate (double) is the maximum rate that a well must exceed + to reactivate a well during a stress period. The well will + reactivate during a timestep if the well was shutdown during + the previous time step and the flow rate to the well from the + aquifer exceeds maxrate. Reactivation of the well cannot + occur until the next time step if a well is shutdown to + reduce oscillations. maxrate must be greater than MINRATE. + rate_scalingrecord : [pump_elevation, scaling_length] + * pump_elevation (double) is the elevation of the multi-aquifer + well pump (PUMP_ELEVATION). PUMP_ELEVATION should not be less + than the bottom elevation (BOTTOM) of the multi-aquifer well. + * scaling_length (double) height above the pump elevation + (SCALING_LENGTH). If the simulated well head is below this + elevation (pump elevation plus the scaling length), then the + pumping rate is reduced. + auxiliaryrecord : [auxname, auxval] + * auxname (string) name for the auxiliary variable to be + assigned AUXVAL. AUXNAME must match one of the auxiliary + variable names defined in the OPTIONS block. If AUXNAME does + not match one of the auxiliary variable names defined in the + OPTIONS block the data are ignored. + * auxval (double) value for the auxiliary variable. If the + Options block includes a TIMESERIESFILE entry (see the "Time- + Variable Input" section), values can be obtained from a time + series by entering the time-series name in place of a numeric + value. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + auxiliary = ListTemplateGenerator(('gwf6', 'maw', 'options', + 'auxiliary')) + stage_filerecord = ListTemplateGenerator(('gwf6', 'maw', 'options', + 'stage_filerecord')) + budget_filerecord = ListTemplateGenerator(('gwf6', 'maw', 'options', + 'budget_filerecord')) + ts_filerecord = ListTemplateGenerator(('gwf6', 'maw', 'options', + 'ts_filerecord')) + obs_filerecord = ListTemplateGenerator(('gwf6', 'maw', 'options', + 'obs_filerecord')) + packagedata = ListTemplateGenerator(('gwf6', 'maw', 'packagedata', + 'packagedata')) + connectiondata = ListTemplateGenerator(('gwf6', 'maw', + 'connectiondata', + 'connectiondata')) + perioddata = ListTemplateGenerator(('gwf6', 'maw', 'period', + 'perioddata')) + package_abbr = "gwfmaw" + _package_type = "maw" + dfn_file_name = "gwf-maw.dfn" + + dfn = [["block options", "name auxiliary", "type string", + "shape (naux)", "reader urword", "optional true"], + ["block options", "name boundnames", "type keyword", "shape", + "reader urword", "optional true"], + ["block options", "name print_input", "type keyword", + "reader urword", "optional true"], + ["block options", "name print_head", "type keyword", + "reader urword", "optional true"], + ["block options", "name print_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name save_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name stage_filerecord", + "type record head fileout headfile", "shape", "reader urword", + "tagged true", "optional true"], + ["block options", "name head", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name headfile", "type string", + "preserve_case true", "shape", "in_record true", "reader urword", + "tagged false", "optional false"], + ["block options", "name budget_filerecord", + "type record budget fileout budgetfile", "shape", "reader urword", + "tagged true", "optional true"], + ["block options", "name budget", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name fileout", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name budgetfile", "type string", + "preserve_case true", "shape", "in_record true", "reader urword", + "tagged false", "optional false"], + ["block options", "name no_well_storage", "type keyword", + "reader urword", "optional true"], + ["block options", "name flowing_wells", "type keyword", + "reader urword", "optional true"], + ["block options", "name shutdown_theta", "type double precision", + "reader urword", "optional true"], + ["block options", "name shutdown_kappa", "type double precision", + "reader urword", "optional true"], + ["block options", "name ts_filerecord", + "type record ts6 filein ts6_filename", "shape", "reader urword", + "tagged true", "optional true", "construct_package ts", + "construct_data timeseries", "parameter_name timeseries"], + ["block options", "name ts6", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name filein", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name ts6_filename", "type string", + "preserve_case true", "in_record true", "reader urword", + "optional false", "tagged false"], + ["block options", "name obs_filerecord", + "type record obs6 filein obs6_filename", "shape", "reader urword", + "tagged true", "optional true", "construct_package obs", + "construct_data continuous", "parameter_name observations"], + ["block options", "name obs6", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name obs6_filename", "type string", + "preserve_case true", "in_record true", "tagged false", + "reader urword", "optional false"], + ["block options", "name mover", "type keyword", "tagged true", + "reader urword", "optional true"], + ["block dimensions", "name nmawwells", "type integer", + "reader urword", "optional false"], + ["block packagedata", "name packagedata", + "type recarray wellno radius bottom strt condeqn ngwfnodes aux " + "boundname", + "shape (nmawwells)", "reader urword"], + ["block packagedata", "name wellno", "type integer", "shape", + "tagged false", "in_record true", "reader urword", + "numeric_index true"], + ["block packagedata", "name radius", "type double precision", + "shape", "tagged false", "in_record true", "reader urword"], + ["block packagedata", "name bottom", "type double precision", + "shape", "tagged false", "in_record true", "reader urword"], + ["block packagedata", "name strt", "type double precision", + "shape", "tagged false", "in_record true", "reader urword"], + ["block packagedata", "name condeqn", "type string", "shape", + "tagged false", "in_record true", "reader urword"], + ["block packagedata", "name ngwfnodes", "type integer", "shape", + "tagged false", "in_record true", "reader urword"], + ["block packagedata", "name aux", "type double precision", + "in_record true", "tagged false", "shape (naux)", "reader urword", + "time_series true", "optional true"], + ["block packagedata", "name boundname", "type string", "shape", + "tagged false", "in_record true", "reader urword", + "optional true"], + ["block connectiondata", "name connectiondata", + "type recarray wellno icon cellid scrn_top scrn_bot hk_skin " + "radius_skin", + "reader urword"], + ["block connectiondata", "name wellno", "type integer", "shape", + "tagged false", "in_record true", "reader urword", + "numeric_index true"], + ["block connectiondata", "name icon", "type integer", "shape", + "tagged false", "in_record true", "reader urword", + "numeric_index true"], + ["block connectiondata", "name cellid", "type integer", + "shape (ncelldim)", "tagged false", "in_record true", + "reader urword"], + ["block connectiondata", "name scrn_top", + "type double precision", "shape", "tagged false", + "in_record true", "reader urword"], + ["block connectiondata", "name scrn_bot", + "type double precision", "shape", "tagged false", + "in_record true", "reader urword"], + ["block connectiondata", "name hk_skin", "type double precision", + "shape", "tagged false", "in_record true", "reader urword"], + ["block connectiondata", "name radius_skin", + "type double precision", "shape", "tagged false", + "in_record true", "reader urword"], + ["block period", "name iper", "type integer", + "block_variable True", "in_record true", "tagged false", "shape", + "valid", "reader urword", "optional false"], + ["block period", "name perioddata", + "type recarray wellno mawsetting", "shape", "reader urword"], + ["block period", "name wellno", "type integer", "shape", + "tagged false", "in_record true", "reader urword", + "numeric_index true"], + ["block period", "name mawsetting", + "type keystring status flowing_wellrecord rate well_head " + "head_limit shutoffrecord rate_scalingrecord auxiliaryrecord", + "shape", "tagged false", "in_record true", "reader urword"], + ["block period", "name status", "type string", "shape", + "tagged true", "in_record true", "reader urword"], + ["block period", "name flowing_wellrecord", + "type record flowing_well fwelev fwcond fwrlen", "shape", + "tagged", "in_record true", "reader urword"], + ["block period", "name flowing_well", "type keyword", "shape", + "in_record true", "reader urword"], + ["block period", "name fwelev", "type double precision", "shape", + "tagged false", "in_record true", "reader urword"], + ["block period", "name fwcond", "type double precision", "shape", + "tagged false", "in_record true", "reader urword"], + ["block period", "name fwrlen", "type double precision", "shape", + "tagged false", "in_record true", "reader urword"], + ["block period", "name rate", "type double precision", "shape", + "tagged true", "in_record true", "reader urword", + "time_series true"], + ["block period", "name well_head", "type double precision", + "shape", "tagged true", "in_record true", "reader urword", + "time_series true"], + ["block period", "name head_limit", "type string", "shape", + "tagged true", "in_record true", "reader urword"], + ["block period", "name shutoffrecord", + "type record shut_off minrate maxrate", "shape", "tagged", + "in_record true", "reader urword"], + ["block period", "name shut_off", "type keyword", "shape", + "in_record true", "reader urword"], + ["block period", "name minrate", "type double precision", + "shape", "tagged false", "in_record true", "reader urword"], + ["block period", "name maxrate", "type double precision", + "shape", "tagged false", "in_record true", "reader urword"], + ["block period", "name rate_scalingrecord", + "type record rate_scaling pump_elevation scaling_length", "shape", + "tagged", "in_record true", "reader urword"], + ["block period", "name rate_scaling", "type keyword", "shape", + "in_record true", "reader urword"], + ["block period", "name pump_elevation", "type double precision", + "shape", "tagged false", "in_record true", "reader urword"], + ["block period", "name scaling_length", "type double precision", + "shape", "tagged false", "in_record true", "reader urword"], + ["block period", "name auxiliaryrecord", + "type record auxiliary auxname auxval", "shape", "tagged", + "in_record true", "reader urword"], + ["block period", "name auxiliary", "type keyword", "shape", + "in_record true", "reader urword"], + ["block period", "name auxname", "type string", "shape", + "tagged false", "in_record true", "reader urword"], + ["block period", "name auxval", "type double precision", "shape", + "tagged false", "in_record true", "reader urword", + "time_series true"]] + + def __init__(self, model, loading_package=False, auxiliary=None, + boundnames=None, print_input=None, print_head=None, + print_flows=None, save_flows=None, stage_filerecord=None, + budget_filerecord=None, no_well_storage=None, + flowing_wells=None, shutdown_theta=None, shutdown_kappa=None, + timeseries=None, observations=None, mover=None, + nmawwells=None, packagedata=None, connectiondata=None, + perioddata=None, filename=None, pname=None, parent_file=None): + super(ModflowGwfmaw, self).__init__(model, "maw", filename, pname, + loading_package, parent_file) + + # set up variables + self.auxiliary = self.build_mfdata("auxiliary", auxiliary) + self.boundnames = self.build_mfdata("boundnames", boundnames) + self.print_input = self.build_mfdata("print_input", print_input) + self.print_head = self.build_mfdata("print_head", print_head) + self.print_flows = self.build_mfdata("print_flows", print_flows) + self.save_flows = self.build_mfdata("save_flows", save_flows) + self.stage_filerecord = self.build_mfdata("stage_filerecord", + stage_filerecord) + self.budget_filerecord = self.build_mfdata("budget_filerecord", + budget_filerecord) + self.no_well_storage = self.build_mfdata("no_well_storage", + no_well_storage) + self.flowing_wells = self.build_mfdata("flowing_wells", flowing_wells) + self.shutdown_theta = self.build_mfdata("shutdown_theta", + shutdown_theta) + self.shutdown_kappa = self.build_mfdata("shutdown_kappa", + shutdown_kappa) + self._ts_filerecord = self.build_mfdata("ts_filerecord", + None) + self._ts_package = self.build_child_package("ts", timeseries, + "timeseries", + self._ts_filerecord) + self._obs_filerecord = self.build_mfdata("obs_filerecord", + None) + self._obs_package = self.build_child_package("obs", observations, + "continuous", + self._obs_filerecord) + self.mover = self.build_mfdata("mover", mover) + self.nmawwells = self.build_mfdata("nmawwells", nmawwells) + self.packagedata = self.build_mfdata("packagedata", packagedata) + self.connectiondata = self.build_mfdata("connectiondata", + connectiondata) + self.perioddata = self.build_mfdata("perioddata", perioddata) + self._init_complete = True diff --git a/flopy/mf6/modflow/mfgwfmvr.py b/flopy/mf6/modflow/mfgwfmvr.py index 0260eda2a6..14309afb72 100644 --- a/flopy/mf6/modflow/mfgwfmvr.py +++ b/flopy/mf6/modflow/mfgwfmvr.py @@ -1,178 +1,178 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ListTemplateGenerator - - -class ModflowGwfmvr(mfpackage.MFPackage): - """ - ModflowGwfmvr defines a mvr package within a gwf6 model. - - Parameters - ---------- - model : MFModel - Model that this package is a part of. Package is automatically - added to model when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - print_input : boolean - * print_input (boolean) keyword to indicate that the list of MVR - information will be written to the listing file immediately after it - is read. - print_flows : boolean - * print_flows (boolean) keyword to indicate that the list of MVR flow - rates will be printed to the listing file for every stress period - time step in which "BUDGET PRINT" is specified in Output Control. If - there is no Output Control option and "PRINT_FLOWS" is specified, - then flow rates are printed for the last time step of each stress - period. - modelnames : boolean - * modelnames (boolean) keyword to indicate that all package names will - be preceded by the model name for the package. Model names are - required when the Mover Package is used with a GWF-GWF Exchange. The - MODELNAME keyword should not be used for a Mover Package that is for - a single GWF Model. - budget_filerecord : [budgetfile] - * budgetfile (string) name of the output file to write budget - information. - maxmvr : integer - * maxmvr (integer) integer value specifying the maximum number of water - mover entries that will specified for any stress period. - maxpackages : integer - * maxpackages (integer) integer value specifying the number of unique - packages that are included in this water mover input file. - packages : [mname, pname] - * mname (string) name of model containing the package. Model names are - assigned by the user in the simulation name file. - * pname (string) is the name of a package that may be included in a - subsequent stress period block. The package name is assigned in the - name file for the GWF Model. Package names are optionally provided in - the name file. If they are not provided by the user, then packages - are assigned a default value, which is the package acronym followed - by a hyphen and the package number. For example, the first Drain - Package is named DRN-1. The second Drain Package is named DRN-2, and - so forth. - perioddata : [mname1, pname1, id1, mname2, pname2, id2, mvrtype, value] - * mname1 (string) name of model containing the package, PNAME1. - * pname1 (string) is the package name for the provider. The package - PNAME1 must be designated to provide water through the MVR Package by - specifying the keyword "MOVER" in its OPTIONS block. - * id1 (integer) is the identifier for the provider. For the standard - boundary packages, the provider identifier is the number of the - boundary as it is listed in the package input file. (Note that the - order of these boundaries may change by stress period, which must be - accounted for in the Mover Package.) So the first well has an - identifier of one. The second is two, and so forth. For the advanced - packages, the identifier is the reach number (SFR Package), well - number (MAW Package), or UZF cell number. For the Lake Package, ID1 - is the lake outlet number. Thus, outflows from a single lake can be - routed to different streams, for example. - * mname2 (string) name of model containing the package, PNAME2. - * pname2 (string) is the package name for the receiver. The package - PNAME2 must be designated to receive water from the MVR Package by - specifying the keyword "MOVER" in its OPTIONS block. - * id2 (integer) is the identifier for the receiver. The receiver - identifier is the reach number (SFR Package), Lake number (LAK - Package), well number (MAW Package), or UZF cell number. - * mvrtype (string) is the character string signifying the method for - determining how much water will be moved. Supported values are - "FACTOR" "EXCESS" "THRESHOLD" and "UPTO". These four options - determine how the receiver flow rate, :math:`Q_R`, is calculated. - These options are based the options available in the SFR2 Package for - diverting stream flow. - * value (double) is the value to be used in the equation for - calculating the amount of water to move. For the "FACTOR" option, - VALUE is the :math:`\\alpha` factor. For the remaining options, VALUE - is the specified flow rate, :math:`Q_S`. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - budget_filerecord = ListTemplateGenerator(('gwf6', 'mvr', 'options', - 'budget_filerecord')) - packages = ListTemplateGenerator(('gwf6', 'mvr', 'packages', - 'packages')) - perioddata = ListTemplateGenerator(('gwf6', 'mvr', 'period', - 'perioddata')) - package_abbr = "gwfmvr" - _package_type = "mvr" - dfn_file_name = "gwf-mvr.dfn" - - dfn = [["block options", "name print_input", "type keyword", - "reader urword", "optional true"], - ["block options", "name print_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name modelnames", "type keyword", - "reader urword", "optional true"], - ["block options", "name budget_filerecord", - "type record budget fileout budgetfile", "shape", "reader urword", - "tagged true", "optional true"], - ["block options", "name budget", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name fileout", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name budgetfile", "type string", - "preserve_case true", "shape", "in_record true", "reader urword", - "tagged false", "optional false"], - ["block dimensions", "name maxmvr", "type integer", - "reader urword", "optional false"], - ["block dimensions", "name maxpackages", "type integer", - "reader urword", "optional false"], - ["block packages", "name packages", "type recarray mname pname", - "reader urword", "shape (npackages)", "optional false"], - ["block packages", "name mname", "type string", "reader urword", - "shape", "tagged false", "in_record true", "optional true"], - ["block packages", "name pname", "type string", "reader urword", - "shape", "tagged false", "in_record true", "optional false"], - ["block period", "name iper", "type integer", - "block_variable True", "in_record true", "tagged false", "shape", - "valid", "reader urword", "optional false"], - ["block period", "name perioddata", - "type recarray mname1 pname1 id1 mname2 pname2 id2 mvrtype value", - "shape (maxbound)", "reader urword"], - ["block period", "name mname1", "type string", "reader urword", - "shape", "tagged false", "in_record true", "optional true"], - ["block period", "name pname1", "type string", "shape", - "tagged false", "in_record true", "reader urword"], - ["block period", "name id1", "type integer", "shape", - "tagged false", "in_record true", "reader urword", - "numeric_index true"], - ["block period", "name mname2", "type string", "reader urword", - "shape", "tagged false", "in_record true", "optional true"], - ["block period", "name pname2", "type string", "shape", - "tagged false", "in_record true", "reader urword"], - ["block period", "name id2", "type integer", "shape", - "tagged false", "in_record true", "reader urword", - "numeric_index true"], - ["block period", "name mvrtype", "type string", "shape", - "tagged false", "in_record true", "reader urword"], - ["block period", "name value", "type double precision", "shape", - "tagged false", "in_record true", "reader urword"]] - - def __init__(self, model, loading_package=False, print_input=None, - print_flows=None, modelnames=None, budget_filerecord=None, - maxmvr=None, maxpackages=None, packages=None, perioddata=None, - filename=None, pname=None, parent_file=None): - super(ModflowGwfmvr, self).__init__(model, "mvr", filename, pname, - loading_package, parent_file) - - # set up variables - self.print_input = self.build_mfdata("print_input", print_input) - self.print_flows = self.build_mfdata("print_flows", print_flows) - self.modelnames = self.build_mfdata("modelnames", modelnames) - self.budget_filerecord = self.build_mfdata("budget_filerecord", - budget_filerecord) - self.maxmvr = self.build_mfdata("maxmvr", maxmvr) - self.maxpackages = self.build_mfdata("maxpackages", maxpackages) - self.packages = self.build_mfdata("packages", packages) - self.perioddata = self.build_mfdata("perioddata", perioddata) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ListTemplateGenerator + + +class ModflowGwfmvr(mfpackage.MFPackage): + """ + ModflowGwfmvr defines a mvr package within a gwf6 model. + + Parameters + ---------- + model : MFModel + Model that this package is a part of. Package is automatically + added to model when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + print_input : boolean + * print_input (boolean) keyword to indicate that the list of MVR + information will be written to the listing file immediately after it + is read. + print_flows : boolean + * print_flows (boolean) keyword to indicate that the list of MVR flow + rates will be printed to the listing file for every stress period + time step in which "BUDGET PRINT" is specified in Output Control. If + there is no Output Control option and "PRINT_FLOWS" is specified, + then flow rates are printed for the last time step of each stress + period. + modelnames : boolean + * modelnames (boolean) keyword to indicate that all package names will + be preceded by the model name for the package. Model names are + required when the Mover Package is used with a GWF-GWF Exchange. The + MODELNAME keyword should not be used for a Mover Package that is for + a single GWF Model. + budget_filerecord : [budgetfile] + * budgetfile (string) name of the output file to write budget + information. + maxmvr : integer + * maxmvr (integer) integer value specifying the maximum number of water + mover entries that will specified for any stress period. + maxpackages : integer + * maxpackages (integer) integer value specifying the number of unique + packages that are included in this water mover input file. + packages : [mname, pname] + * mname (string) name of model containing the package. Model names are + assigned by the user in the simulation name file. + * pname (string) is the name of a package that may be included in a + subsequent stress period block. The package name is assigned in the + name file for the GWF Model. Package names are optionally provided in + the name file. If they are not provided by the user, then packages + are assigned a default value, which is the package acronym followed + by a hyphen and the package number. For example, the first Drain + Package is named DRN-1. The second Drain Package is named DRN-2, and + so forth. + perioddata : [mname1, pname1, id1, mname2, pname2, id2, mvrtype, value] + * mname1 (string) name of model containing the package, PNAME1. + * pname1 (string) is the package name for the provider. The package + PNAME1 must be designated to provide water through the MVR Package by + specifying the keyword "MOVER" in its OPTIONS block. + * id1 (integer) is the identifier for the provider. For the standard + boundary packages, the provider identifier is the number of the + boundary as it is listed in the package input file. (Note that the + order of these boundaries may change by stress period, which must be + accounted for in the Mover Package.) So the first well has an + identifier of one. The second is two, and so forth. For the advanced + packages, the identifier is the reach number (SFR Package), well + number (MAW Package), or UZF cell number. For the Lake Package, ID1 + is the lake outlet number. Thus, outflows from a single lake can be + routed to different streams, for example. + * mname2 (string) name of model containing the package, PNAME2. + * pname2 (string) is the package name for the receiver. The package + PNAME2 must be designated to receive water from the MVR Package by + specifying the keyword "MOVER" in its OPTIONS block. + * id2 (integer) is the identifier for the receiver. The receiver + identifier is the reach number (SFR Package), Lake number (LAK + Package), well number (MAW Package), or UZF cell number. + * mvrtype (string) is the character string signifying the method for + determining how much water will be moved. Supported values are + "FACTOR" "EXCESS" "THRESHOLD" and "UPTO". These four options + determine how the receiver flow rate, :math:`Q_R`, is calculated. + These options are based the options available in the SFR2 Package for + diverting stream flow. + * value (double) is the value to be used in the equation for + calculating the amount of water to move. For the "FACTOR" option, + VALUE is the :math:`\\alpha` factor. For the remaining options, VALUE + is the specified flow rate, :math:`Q_S`. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + budget_filerecord = ListTemplateGenerator(('gwf6', 'mvr', 'options', + 'budget_filerecord')) + packages = ListTemplateGenerator(('gwf6', 'mvr', 'packages', + 'packages')) + perioddata = ListTemplateGenerator(('gwf6', 'mvr', 'period', + 'perioddata')) + package_abbr = "gwfmvr" + _package_type = "mvr" + dfn_file_name = "gwf-mvr.dfn" + + dfn = [["block options", "name print_input", "type keyword", + "reader urword", "optional true"], + ["block options", "name print_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name modelnames", "type keyword", + "reader urword", "optional true"], + ["block options", "name budget_filerecord", + "type record budget fileout budgetfile", "shape", "reader urword", + "tagged true", "optional true"], + ["block options", "name budget", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name fileout", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name budgetfile", "type string", + "preserve_case true", "shape", "in_record true", "reader urword", + "tagged false", "optional false"], + ["block dimensions", "name maxmvr", "type integer", + "reader urword", "optional false"], + ["block dimensions", "name maxpackages", "type integer", + "reader urword", "optional false"], + ["block packages", "name packages", "type recarray mname pname", + "reader urword", "shape (npackages)", "optional false"], + ["block packages", "name mname", "type string", "reader urword", + "shape", "tagged false", "in_record true", "optional true"], + ["block packages", "name pname", "type string", "reader urword", + "shape", "tagged false", "in_record true", "optional false"], + ["block period", "name iper", "type integer", + "block_variable True", "in_record true", "tagged false", "shape", + "valid", "reader urword", "optional false"], + ["block period", "name perioddata", + "type recarray mname1 pname1 id1 mname2 pname2 id2 mvrtype value", + "shape (maxbound)", "reader urword"], + ["block period", "name mname1", "type string", "reader urword", + "shape", "tagged false", "in_record true", "optional true"], + ["block period", "name pname1", "type string", "shape", + "tagged false", "in_record true", "reader urword"], + ["block period", "name id1", "type integer", "shape", + "tagged false", "in_record true", "reader urword", + "numeric_index true"], + ["block period", "name mname2", "type string", "reader urword", + "shape", "tagged false", "in_record true", "optional true"], + ["block period", "name pname2", "type string", "shape", + "tagged false", "in_record true", "reader urword"], + ["block period", "name id2", "type integer", "shape", + "tagged false", "in_record true", "reader urword", + "numeric_index true"], + ["block period", "name mvrtype", "type string", "shape", + "tagged false", "in_record true", "reader urword"], + ["block period", "name value", "type double precision", "shape", + "tagged false", "in_record true", "reader urword"]] + + def __init__(self, model, loading_package=False, print_input=None, + print_flows=None, modelnames=None, budget_filerecord=None, + maxmvr=None, maxpackages=None, packages=None, perioddata=None, + filename=None, pname=None, parent_file=None): + super(ModflowGwfmvr, self).__init__(model, "mvr", filename, pname, + loading_package, parent_file) + + # set up variables + self.print_input = self.build_mfdata("print_input", print_input) + self.print_flows = self.build_mfdata("print_flows", print_flows) + self.modelnames = self.build_mfdata("modelnames", modelnames) + self.budget_filerecord = self.build_mfdata("budget_filerecord", + budget_filerecord) + self.maxmvr = self.build_mfdata("maxmvr", maxmvr) + self.maxpackages = self.build_mfdata("maxpackages", maxpackages) + self.packages = self.build_mfdata("packages", packages) + self.perioddata = self.build_mfdata("perioddata", perioddata) + self._init_complete = True diff --git a/flopy/mf6/modflow/mfgwfnam.py b/flopy/mf6/modflow/mfgwfnam.py index ee1218cfe5..93fe13820f 100644 --- a/flopy/mf6/modflow/mfgwfnam.py +++ b/flopy/mf6/modflow/mfgwfnam.py @@ -1,116 +1,116 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ListTemplateGenerator - - -class ModflowGwfnam(mfpackage.MFPackage): - """ - ModflowGwfnam defines a nam package within a gwf6 model. - - Parameters - ---------- - model : MFModel - Model that this package is a part of. Package is automatically - added to model when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - list : string - * list (string) is name of the listing file to create for this GWF - model. If not specified, then the name of the list file will be the - basename of the GWF model name file and the '.lst' extension. For - example, if the GWF name file is called "my.model.nam" then the list - file will be called "my.model.lst". - print_input : boolean - * print_input (boolean) keyword to indicate that the list of all model - stress package information will be written to the listing file - immediately after it is read. - print_flows : boolean - * print_flows (boolean) keyword to indicate that the list of all model - package flow rates will be printed to the listing file for every - stress period time step in which "BUDGET PRINT" is specified in - Output Control. If there is no Output Control option and - "PRINT_FLOWS" is specified, then flow rates are printed for the last - time step of each stress period. - save_flows : boolean - * save_flows (boolean) keyword to indicate that all model package flow - terms will be written to the file specified with "BUDGET FILEOUT" in - Output Control. - newtonoptions : [under_relaxation] - * under_relaxation (string) keyword that indicates whether the - groundwater head in a cell will be under-relaxed when water levels - fall below the bottom of the model below any given cell. By default, - Newton-Raphson UNDER_RELAXATION is not applied. - packages : [ftype, fname, pname] - * ftype (string) is the file type, which must be one of the following - character values shown in table~ref{table:ftype}. Ftype may be - entered in any combination of uppercase and lowercase. - * fname (string) is the name of the file containing the package input. - The path to the file should be included if the file is not located in - the folder where the program was run. - * pname (string) is the user-defined name for the package. PNAME is - restricted to 16 characters. No spaces are allowed in PNAME. PNAME - character values are read and stored by the program for stress - packages only. These names may be useful for labeling purposes when - multiple stress packages of the same type are located within a single - GWF Model. If PNAME is specified for a stress package, then PNAME - will be used in the flow budget table in the listing file; it will - also be used for the text entry in the cell-by-cell budget file. - PNAME is case insensitive and is stored in all upper case letters. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - packages = ListTemplateGenerator(('gwf6', 'nam', 'packages', - 'packages')) - package_abbr = "gwfnam" - _package_type = "nam" - dfn_file_name = "gwf-nam.dfn" - - dfn = [["block options", "name list", "type string", "reader urword", - "optional true"], - ["block options", "name print_input", "type keyword", - "reader urword", "optional true"], - ["block options", "name print_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name save_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name newtonoptions", - "type record newton under_relaxation", "reader urword", - "optional true"], - ["block options", "name newton", "in_record true", - "type keyword", "reader urword"], - ["block options", "name under_relaxation", "in_record true", - "type keyword", "reader urword", "optional true"], - ["block packages", "name packages", - "type recarray ftype fname pname", "reader urword", - "optional false"], - ["block packages", "name ftype", "in_record true", "type string", - "tagged false", "reader urword"], - ["block packages", "name fname", "in_record true", "type string", - "preserve_case true", "tagged false", "reader urword"], - ["block packages", "name pname", "in_record true", "type string", - "tagged false", "reader urword", "optional true"]] - - def __init__(self, model, loading_package=False, list=None, - print_input=None, print_flows=None, save_flows=None, - newtonoptions=None, packages=None, filename=None, pname=None, - parent_file=None): - super(ModflowGwfnam, self).__init__(model, "nam", filename, pname, - loading_package, parent_file) - - # set up variables - self.list = self.build_mfdata("list", list) - self.print_input = self.build_mfdata("print_input", print_input) - self.print_flows = self.build_mfdata("print_flows", print_flows) - self.save_flows = self.build_mfdata("save_flows", save_flows) - self.newtonoptions = self.build_mfdata("newtonoptions", newtonoptions) - self.packages = self.build_mfdata("packages", packages) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ListTemplateGenerator + + +class ModflowGwfnam(mfpackage.MFPackage): + """ + ModflowGwfnam defines a nam package within a gwf6 model. + + Parameters + ---------- + model : MFModel + Model that this package is a part of. Package is automatically + added to model when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + list : string + * list (string) is name of the listing file to create for this GWF + model. If not specified, then the name of the list file will be the + basename of the GWF model name file and the '.lst' extension. For + example, if the GWF name file is called "my.model.nam" then the list + file will be called "my.model.lst". + print_input : boolean + * print_input (boolean) keyword to indicate that the list of all model + stress package information will be written to the listing file + immediately after it is read. + print_flows : boolean + * print_flows (boolean) keyword to indicate that the list of all model + package flow rates will be printed to the listing file for every + stress period time step in which "BUDGET PRINT" is specified in + Output Control. If there is no Output Control option and + "PRINT_FLOWS" is specified, then flow rates are printed for the last + time step of each stress period. + save_flows : boolean + * save_flows (boolean) keyword to indicate that all model package flow + terms will be written to the file specified with "BUDGET FILEOUT" in + Output Control. + newtonoptions : [under_relaxation] + * under_relaxation (string) keyword that indicates whether the + groundwater head in a cell will be under-relaxed when water levels + fall below the bottom of the model below any given cell. By default, + Newton-Raphson UNDER_RELAXATION is not applied. + packages : [ftype, fname, pname] + * ftype (string) is the file type, which must be one of the following + character values shown in table~ref{table:ftype}. Ftype may be + entered in any combination of uppercase and lowercase. + * fname (string) is the name of the file containing the package input. + The path to the file should be included if the file is not located in + the folder where the program was run. + * pname (string) is the user-defined name for the package. PNAME is + restricted to 16 characters. No spaces are allowed in PNAME. PNAME + character values are read and stored by the program for stress + packages only. These names may be useful for labeling purposes when + multiple stress packages of the same type are located within a single + GWF Model. If PNAME is specified for a stress package, then PNAME + will be used in the flow budget table in the listing file; it will + also be used for the text entry in the cell-by-cell budget file. + PNAME is case insensitive and is stored in all upper case letters. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + packages = ListTemplateGenerator(('gwf6', 'nam', 'packages', + 'packages')) + package_abbr = "gwfnam" + _package_type = "nam" + dfn_file_name = "gwf-nam.dfn" + + dfn = [["block options", "name list", "type string", "reader urword", + "optional true"], + ["block options", "name print_input", "type keyword", + "reader urword", "optional true"], + ["block options", "name print_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name save_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name newtonoptions", + "type record newton under_relaxation", "reader urword", + "optional true"], + ["block options", "name newton", "in_record true", + "type keyword", "reader urword"], + ["block options", "name under_relaxation", "in_record true", + "type keyword", "reader urword", "optional true"], + ["block packages", "name packages", + "type recarray ftype fname pname", "reader urword", + "optional false"], + ["block packages", "name ftype", "in_record true", "type string", + "tagged false", "reader urword"], + ["block packages", "name fname", "in_record true", "type string", + "preserve_case true", "tagged false", "reader urword"], + ["block packages", "name pname", "in_record true", "type string", + "tagged false", "reader urword", "optional true"]] + + def __init__(self, model, loading_package=False, list=None, + print_input=None, print_flows=None, save_flows=None, + newtonoptions=None, packages=None, filename=None, pname=None, + parent_file=None): + super(ModflowGwfnam, self).__init__(model, "nam", filename, pname, + loading_package, parent_file) + + # set up variables + self.list = self.build_mfdata("list", list) + self.print_input = self.build_mfdata("print_input", print_input) + self.print_flows = self.build_mfdata("print_flows", print_flows) + self.save_flows = self.build_mfdata("save_flows", save_flows) + self.newtonoptions = self.build_mfdata("newtonoptions", newtonoptions) + self.packages = self.build_mfdata("packages", packages) + self._init_complete = True diff --git a/flopy/mf6/modflow/mfgwfnpf.py b/flopy/mf6/modflow/mfgwfnpf.py index 2017f520bb..22caa29086 100644 --- a/flopy/mf6/modflow/mfgwfnpf.py +++ b/flopy/mf6/modflow/mfgwfnpf.py @@ -1,284 +1,284 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ListTemplateGenerator, ArrayTemplateGenerator - - -class ModflowGwfnpf(mfpackage.MFPackage): - """ - ModflowGwfnpf defines a npf package within a gwf6 model. - - Parameters - ---------- - model : MFModel - Model that this package is a part of. Package is automatically - added to model when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - save_flows : boolean - * save_flows (boolean) keyword to indicate that cell-by-cell flow terms - will be written to the file specified with "BUDGET SAVE FILE" in - Output Control. - alternative_cell_averaging : string - * alternative_cell_averaging (string) is a text keyword to indicate - that an alternative method will be used for calculating the - conductance for horizontal cell connections. The text value for - ALTERNATIVE_CELL_AVERAGING can be "LOGARITHMIC", "AMT-LMK", or "AMT- - HMK". "AMT-LMK" signifies that the conductance will be calculated - using arithmetic-mean thickness and logarithmic-mean hydraulic - conductivity. "AMT-HMK" signifies that the conductance will be - calculated using arithmetic-mean thickness and harmonic-mean - hydraulic conductivity. If the user does not specify a value for - ALTERNATIVE_CELL_AVERAGING, then the harmonic-mean method will be - used. This option cannot be used if the XT3D option is invoked. - thickstrt : boolean - * thickstrt (boolean) indicates that cells having a negative ICELLTYPE - are confined, and their cell thickness for conductance calculations - will be computed as STRT-BOT rather than TOP-BOT. - cvoptions : [dewatered] - * dewatered (string) If the DEWATERED keyword is specified, then the - vertical conductance is calculated using only the saturated thickness - and properties of the overlying cell if the head in the underlying - cell is below its top. - perched : boolean - * perched (boolean) keyword to indicate that when a cell is overlying a - dewatered convertible cell, the head difference used in Darcy's Law - is equal to the head in the overlying cell minus the bottom elevation - of the overlying cell. If not specified, then the default is to use - the head difference between the two cells. - rewet_record : [wetfct, iwetit, ihdwet] - * wetfct (double) is a keyword and factor that is included in the - calculation of the head that is initially established at a cell when - that cell is converted from dry to wet. - * iwetit (integer) is a keyword and iteration interval for attempting - to wet cells. Wetting is attempted every IWETIT iteration. This - applies to outer iterations and not inner iterations. If IWETIT is - specified as zero or less, then the value is changed to 1. - * ihdwet (integer) is a keyword and integer flag that determines which - equation is used to define the initial head at cells that become wet. - If IHDWET is 0, h = BOT + WETFCT (hm - BOT). If IHDWET is not 0, h = - BOT + WETFCT (THRESH). - xt3doptions : [rhs] - * rhs (string) If the RHS keyword is also included, then the XT3D - additional terms will be added to the right-hand side. If the RHS - keyword is excluded, then the XT3D terms will be put into the - coefficient matrix. - save_specific_discharge : boolean - * save_specific_discharge (boolean) keyword to indicate that x, y, and - z components of specific discharge will be calculated at cell centers - and written to the cell-by-cell flow file, which is specified with - "BUDGET SAVE FILE" in Output Control. If this option is activated, - then additional information may be required in the discretization - packages and the GWF Exchange package (if GWF models are coupled). - Specifically, ANGLDEGX must be specified in the CONNECTIONDATA block - of the DISU Package; ANGLDEGX must also be specified for the GWF - Exchange as an auxiliary variable. - icelltype : [integer] - * icelltype (integer) flag for each cell that specifies how saturated - thickness is treated. 0 means saturated thickness is held constant; - :math:`>`0 means saturated thickness varies with computed head when - head is below the cell top; :math:`<`0 means saturated thickness - varies with computed head unless the THICKSTRT option is in effect. - When THICKSTRT is in effect, a negative value of icelltype indicates - that saturated thickness will be computed as STRT-BOT and held - constant. - k : [double] - * k (double) is the hydraulic conductivity. For the common case in - which the user would like to specify the horizontal hydraulic - conductivity and the vertical hydraulic conductivity, then K should - be assigned as the horizontal hydraulic conductivity, K33 should be - assigned as the vertical hydraulic conductivity, and texttt{K22} and - the three rotation angles should not be specified. When more - sophisticated anisotropy is required, then K corresponds to the K11 - hydraulic conductivity axis. All included cells (IDOMAIN :math:`>` 0) - must have a K value greater than zero. - k22 : [double] - * k22 (double) is the hydraulic conductivity of the second ellipsoid - axis; for an unrotated case this is the hydraulic conductivity in the - y direction. If K22 is not included in the GRIDDATA block, then K22 - is set equal to K. For a regular MODFLOW grid (DIS Package is used) - in which no rotation angles are specified, K22 is the hydraulic - conductivity along columns in the y direction. For an unstructured - DISU grid, the user must assign principal x and y axes and provide - the angle for each cell face relative to the assigned x direction. - All included cells (IDOMAIN :math:`>` 0) must have a K22 value - greater than zero. - k33 : [double] - * k33 (double) is the hydraulic conductivity of the third ellipsoid - axis; for an unrotated case, this is the vertical hydraulic - conductivity. When anisotropy is applied, K33 corresponds to the K33 - tensor component. All included cells (IDOMAIN :math:`>` 0) must have - a K33 value greater than zero. - angle1 : [double] - * angle1 (double) is a rotation angle of the hydraulic conductivity - tensor in degrees. The angle represents the first of three sequential - rotations of the hydraulic conductivity ellipsoid. With the K11, K22, - and K33 axes of the ellipsoid initially aligned with the x, y, and z - coordinate axes, respectively, ANGLE1 rotates the ellipsoid about its - K33 axis (within the x - y plane). A positive value represents - counter-clockwise rotation when viewed from any point on the positive - K33 axis, looking toward the center of the ellipsoid. A value of zero - indicates that the K11 axis lies within the x - z plane. If ANGLE1 is - not specified, default values of zero are assigned to ANGLE1, ANGLE2, - and ANGLE3, in which case the K11, K22, and K33 axes are aligned with - the x, y, and z axes, respectively. - angle2 : [double] - * angle2 (double) is a rotation angle of the hydraulic conductivity - tensor in degrees. The angle represents the second of three - sequential rotations of the hydraulic conductivity ellipsoid. - Following the rotation by ANGLE1 described above, ANGLE2 rotates the - ellipsoid about its K22 axis (out of the x - y plane). An array can - be specified for ANGLE2 only if ANGLE1 is also specified. A positive - value of ANGLE2 represents clockwise rotation when viewed from any - point on the positive K22 axis, looking toward the center of the - ellipsoid. A value of zero indicates that the K11 axis lies within - the x - y plane. If ANGLE2 is not specified, default values of zero - are assigned to ANGLE2 and ANGLE3; connections that are not user- - designated as vertical are assumed to be strictly horizontal (that - is, to have no z component to their orientation); and connection - lengths are based on horizontal distances. - angle3 : [double] - * angle3 (double) is a rotation angle of the hydraulic conductivity - tensor in degrees. The angle represents the third of three sequential - rotations of the hydraulic conductivity ellipsoid. Following the - rotations by ANGLE1 and ANGLE2 described above, ANGLE3 rotates the - ellipsoid about its K11 axis. An array can be specified for ANGLE3 - only if ANGLE1 and ANGLE2 are also specified. An array must be - specified for ANGLE3 if ANGLE2 is specified. A positive value of - ANGLE3 represents clockwise rotation when viewed from any point on - the positive K11 axis, looking toward the center of the ellipsoid. A - value of zero indicates that the K22 axis lies within the x - y - plane. - wetdry : [double] - * wetdry (double) is a combination of the wetting threshold and a flag - to indicate which neighboring cells can cause a cell to become wet. - If WETDRY :math:`<` 0, only a cell below a dry cell can cause the - cell to become wet. If WETDRY :math:`>` 0, the cell below a dry cell - and horizontally adjacent cells can cause a cell to become wet. If - WETDRY is 0, the cell cannot be wetted. The absolute value of WETDRY - is the wetting threshold. When the sum of BOT and the absolute value - of WETDRY at a dry cell is equaled or exceeded by the head at an - adjacent cell, the cell is wetted. WETDRY must be specified if - "REWET" is specified in the OPTIONS block. If "REWET" is not - specified in the options block, then WETDRY can be entered, and - memory will be allocated for it, even though it is not used. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - rewet_record = ListTemplateGenerator(('gwf6', 'npf', 'options', - 'rewet_record')) - icelltype = ArrayTemplateGenerator(('gwf6', 'npf', 'griddata', - 'icelltype')) - k = ArrayTemplateGenerator(('gwf6', 'npf', 'griddata', 'k')) - k22 = ArrayTemplateGenerator(('gwf6', 'npf', 'griddata', 'k22')) - k33 = ArrayTemplateGenerator(('gwf6', 'npf', 'griddata', 'k33')) - angle1 = ArrayTemplateGenerator(('gwf6', 'npf', 'griddata', - 'angle1')) - angle2 = ArrayTemplateGenerator(('gwf6', 'npf', 'griddata', - 'angle2')) - angle3 = ArrayTemplateGenerator(('gwf6', 'npf', 'griddata', - 'angle3')) - wetdry = ArrayTemplateGenerator(('gwf6', 'npf', 'griddata', - 'wetdry')) - package_abbr = "gwfnpf" - _package_type = "npf" - dfn_file_name = "gwf-npf.dfn" - - dfn = [["block options", "name save_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name alternative_cell_averaging", - "type string", "valid logarithmic amt-lmk amt-hmk", - "reader urword", "optional true"], - ["block options", "name thickstrt", "type keyword", - "reader urword", "optional true"], - ["block options", "name cvoptions", - "type record variablecv dewatered", "reader urword", - "optional true"], - ["block options", "name variablecv", "in_record true", - "type keyword", "reader urword"], - ["block options", "name dewatered", "in_record true", - "type keyword", "reader urword", "optional true"], - ["block options", "name perched", "type keyword", - "reader urword", "optional true"], - ["block options", "name rewet_record", - "type record rewet wetfct iwetit ihdwet", "reader urword", - "optional true"], - ["block options", "name rewet", "type keyword", "in_record true", - "reader urword", "optional false"], - ["block options", "name wetfct", "type double precision", - "in_record true", "reader urword", "optional false"], - ["block options", "name iwetit", "type integer", - "in_record true", "reader urword", "optional false"], - ["block options", "name ihdwet", "type integer", - "in_record true", "reader urword", "optional false"], - ["block options", "name xt3doptions", "type record xt3d rhs", - "reader urword", "optional true"], - ["block options", "name xt3d", "in_record true", "type keyword", - "reader urword"], - ["block options", "name rhs", "in_record true", "type keyword", - "reader urword", "optional true"], - ["block options", "name save_specific_discharge", "type keyword", - "reader urword", "optional true"], - ["block griddata", "name icelltype", "type integer", - "shape (nodes)", "valid", "reader readarray", "layered true", - "optional", "default_value 0"], - ["block griddata", "name k", "type double precision", - "shape (nodes)", "valid", "reader readarray", "layered true", - "optional", "default_value 1.0"], - ["block griddata", "name k22", "type double precision", - "shape (nodes)", "valid", "reader readarray", "layered true", - "optional true"], - ["block griddata", "name k33", "type double precision", - "shape (nodes)", "valid", "reader readarray", "layered true", - "optional true"], - ["block griddata", "name angle1", "type double precision", - "shape (nodes)", "valid", "reader readarray", "layered true", - "optional true"], - ["block griddata", "name angle2", "type double precision", - "shape (nodes)", "valid", "reader readarray", "layered true", - "optional true"], - ["block griddata", "name angle3", "type double precision", - "shape (nodes)", "valid", "reader readarray", "layered true", - "optional true"], - ["block griddata", "name wetdry", "type double precision", - "shape (nodes)", "valid", "reader readarray", "layered true", - "optional true"]] - - def __init__(self, model, loading_package=False, save_flows=None, - alternative_cell_averaging=None, thickstrt=None, - cvoptions=None, perched=None, rewet_record=None, - xt3doptions=None, save_specific_discharge=None, icelltype=0, - k=1.0, k22=None, k33=None, angle1=None, angle2=None, - angle3=None, wetdry=None, filename=None, pname=None, - parent_file=None): - super(ModflowGwfnpf, self).__init__(model, "npf", filename, pname, - loading_package, parent_file) - - # set up variables - self.save_flows = self.build_mfdata("save_flows", save_flows) - self.alternative_cell_averaging = self.build_mfdata( - "alternative_cell_averaging", alternative_cell_averaging) - self.thickstrt = self.build_mfdata("thickstrt", thickstrt) - self.cvoptions = self.build_mfdata("cvoptions", cvoptions) - self.perched = self.build_mfdata("perched", perched) - self.rewet_record = self.build_mfdata("rewet_record", rewet_record) - self.xt3doptions = self.build_mfdata("xt3doptions", xt3doptions) - self.save_specific_discharge = self.build_mfdata( - "save_specific_discharge", save_specific_discharge) - self.icelltype = self.build_mfdata("icelltype", icelltype) - self.k = self.build_mfdata("k", k) - self.k22 = self.build_mfdata("k22", k22) - self.k33 = self.build_mfdata("k33", k33) - self.angle1 = self.build_mfdata("angle1", angle1) - self.angle2 = self.build_mfdata("angle2", angle2) - self.angle3 = self.build_mfdata("angle3", angle3) - self.wetdry = self.build_mfdata("wetdry", wetdry) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ListTemplateGenerator, ArrayTemplateGenerator + + +class ModflowGwfnpf(mfpackage.MFPackage): + """ + ModflowGwfnpf defines a npf package within a gwf6 model. + + Parameters + ---------- + model : MFModel + Model that this package is a part of. Package is automatically + added to model when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + save_flows : boolean + * save_flows (boolean) keyword to indicate that cell-by-cell flow terms + will be written to the file specified with "BUDGET SAVE FILE" in + Output Control. + alternative_cell_averaging : string + * alternative_cell_averaging (string) is a text keyword to indicate + that an alternative method will be used for calculating the + conductance for horizontal cell connections. The text value for + ALTERNATIVE_CELL_AVERAGING can be "LOGARITHMIC", "AMT-LMK", or "AMT- + HMK". "AMT-LMK" signifies that the conductance will be calculated + using arithmetic-mean thickness and logarithmic-mean hydraulic + conductivity. "AMT-HMK" signifies that the conductance will be + calculated using arithmetic-mean thickness and harmonic-mean + hydraulic conductivity. If the user does not specify a value for + ALTERNATIVE_CELL_AVERAGING, then the harmonic-mean method will be + used. This option cannot be used if the XT3D option is invoked. + thickstrt : boolean + * thickstrt (boolean) indicates that cells having a negative ICELLTYPE + are confined, and their cell thickness for conductance calculations + will be computed as STRT-BOT rather than TOP-BOT. + cvoptions : [dewatered] + * dewatered (string) If the DEWATERED keyword is specified, then the + vertical conductance is calculated using only the saturated thickness + and properties of the overlying cell if the head in the underlying + cell is below its top. + perched : boolean + * perched (boolean) keyword to indicate that when a cell is overlying a + dewatered convertible cell, the head difference used in Darcy's Law + is equal to the head in the overlying cell minus the bottom elevation + of the overlying cell. If not specified, then the default is to use + the head difference between the two cells. + rewet_record : [wetfct, iwetit, ihdwet] + * wetfct (double) is a keyword and factor that is included in the + calculation of the head that is initially established at a cell when + that cell is converted from dry to wet. + * iwetit (integer) is a keyword and iteration interval for attempting + to wet cells. Wetting is attempted every IWETIT iteration. This + applies to outer iterations and not inner iterations. If IWETIT is + specified as zero or less, then the value is changed to 1. + * ihdwet (integer) is a keyword and integer flag that determines which + equation is used to define the initial head at cells that become wet. + If IHDWET is 0, h = BOT + WETFCT (hm - BOT). If IHDWET is not 0, h = + BOT + WETFCT (THRESH). + xt3doptions : [rhs] + * rhs (string) If the RHS keyword is also included, then the XT3D + additional terms will be added to the right-hand side. If the RHS + keyword is excluded, then the XT3D terms will be put into the + coefficient matrix. + save_specific_discharge : boolean + * save_specific_discharge (boolean) keyword to indicate that x, y, and + z components of specific discharge will be calculated at cell centers + and written to the cell-by-cell flow file, which is specified with + "BUDGET SAVE FILE" in Output Control. If this option is activated, + then additional information may be required in the discretization + packages and the GWF Exchange package (if GWF models are coupled). + Specifically, ANGLDEGX must be specified in the CONNECTIONDATA block + of the DISU Package; ANGLDEGX must also be specified for the GWF + Exchange as an auxiliary variable. + icelltype : [integer] + * icelltype (integer) flag for each cell that specifies how saturated + thickness is treated. 0 means saturated thickness is held constant; + :math:`>`0 means saturated thickness varies with computed head when + head is below the cell top; :math:`<`0 means saturated thickness + varies with computed head unless the THICKSTRT option is in effect. + When THICKSTRT is in effect, a negative value of icelltype indicates + that saturated thickness will be computed as STRT-BOT and held + constant. + k : [double] + * k (double) is the hydraulic conductivity. For the common case in + which the user would like to specify the horizontal hydraulic + conductivity and the vertical hydraulic conductivity, then K should + be assigned as the horizontal hydraulic conductivity, K33 should be + assigned as the vertical hydraulic conductivity, and texttt{K22} and + the three rotation angles should not be specified. When more + sophisticated anisotropy is required, then K corresponds to the K11 + hydraulic conductivity axis. All included cells (IDOMAIN :math:`>` 0) + must have a K value greater than zero. + k22 : [double] + * k22 (double) is the hydraulic conductivity of the second ellipsoid + axis; for an unrotated case this is the hydraulic conductivity in the + y direction. If K22 is not included in the GRIDDATA block, then K22 + is set equal to K. For a regular MODFLOW grid (DIS Package is used) + in which no rotation angles are specified, K22 is the hydraulic + conductivity along columns in the y direction. For an unstructured + DISU grid, the user must assign principal x and y axes and provide + the angle for each cell face relative to the assigned x direction. + All included cells (IDOMAIN :math:`>` 0) must have a K22 value + greater than zero. + k33 : [double] + * k33 (double) is the hydraulic conductivity of the third ellipsoid + axis; for an unrotated case, this is the vertical hydraulic + conductivity. When anisotropy is applied, K33 corresponds to the K33 + tensor component. All included cells (IDOMAIN :math:`>` 0) must have + a K33 value greater than zero. + angle1 : [double] + * angle1 (double) is a rotation angle of the hydraulic conductivity + tensor in degrees. The angle represents the first of three sequential + rotations of the hydraulic conductivity ellipsoid. With the K11, K22, + and K33 axes of the ellipsoid initially aligned with the x, y, and z + coordinate axes, respectively, ANGLE1 rotates the ellipsoid about its + K33 axis (within the x - y plane). A positive value represents + counter-clockwise rotation when viewed from any point on the positive + K33 axis, looking toward the center of the ellipsoid. A value of zero + indicates that the K11 axis lies within the x - z plane. If ANGLE1 is + not specified, default values of zero are assigned to ANGLE1, ANGLE2, + and ANGLE3, in which case the K11, K22, and K33 axes are aligned with + the x, y, and z axes, respectively. + angle2 : [double] + * angle2 (double) is a rotation angle of the hydraulic conductivity + tensor in degrees. The angle represents the second of three + sequential rotations of the hydraulic conductivity ellipsoid. + Following the rotation by ANGLE1 described above, ANGLE2 rotates the + ellipsoid about its K22 axis (out of the x - y plane). An array can + be specified for ANGLE2 only if ANGLE1 is also specified. A positive + value of ANGLE2 represents clockwise rotation when viewed from any + point on the positive K22 axis, looking toward the center of the + ellipsoid. A value of zero indicates that the K11 axis lies within + the x - y plane. If ANGLE2 is not specified, default values of zero + are assigned to ANGLE2 and ANGLE3; connections that are not user- + designated as vertical are assumed to be strictly horizontal (that + is, to have no z component to their orientation); and connection + lengths are based on horizontal distances. + angle3 : [double] + * angle3 (double) is a rotation angle of the hydraulic conductivity + tensor in degrees. The angle represents the third of three sequential + rotations of the hydraulic conductivity ellipsoid. Following the + rotations by ANGLE1 and ANGLE2 described above, ANGLE3 rotates the + ellipsoid about its K11 axis. An array can be specified for ANGLE3 + only if ANGLE1 and ANGLE2 are also specified. An array must be + specified for ANGLE3 if ANGLE2 is specified. A positive value of + ANGLE3 represents clockwise rotation when viewed from any point on + the positive K11 axis, looking toward the center of the ellipsoid. A + value of zero indicates that the K22 axis lies within the x - y + plane. + wetdry : [double] + * wetdry (double) is a combination of the wetting threshold and a flag + to indicate which neighboring cells can cause a cell to become wet. + If WETDRY :math:`<` 0, only a cell below a dry cell can cause the + cell to become wet. If WETDRY :math:`>` 0, the cell below a dry cell + and horizontally adjacent cells can cause a cell to become wet. If + WETDRY is 0, the cell cannot be wetted. The absolute value of WETDRY + is the wetting threshold. When the sum of BOT and the absolute value + of WETDRY at a dry cell is equaled or exceeded by the head at an + adjacent cell, the cell is wetted. WETDRY must be specified if + "REWET" is specified in the OPTIONS block. If "REWET" is not + specified in the options block, then WETDRY can be entered, and + memory will be allocated for it, even though it is not used. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + rewet_record = ListTemplateGenerator(('gwf6', 'npf', 'options', + 'rewet_record')) + icelltype = ArrayTemplateGenerator(('gwf6', 'npf', 'griddata', + 'icelltype')) + k = ArrayTemplateGenerator(('gwf6', 'npf', 'griddata', 'k')) + k22 = ArrayTemplateGenerator(('gwf6', 'npf', 'griddata', 'k22')) + k33 = ArrayTemplateGenerator(('gwf6', 'npf', 'griddata', 'k33')) + angle1 = ArrayTemplateGenerator(('gwf6', 'npf', 'griddata', + 'angle1')) + angle2 = ArrayTemplateGenerator(('gwf6', 'npf', 'griddata', + 'angle2')) + angle3 = ArrayTemplateGenerator(('gwf6', 'npf', 'griddata', + 'angle3')) + wetdry = ArrayTemplateGenerator(('gwf6', 'npf', 'griddata', + 'wetdry')) + package_abbr = "gwfnpf" + _package_type = "npf" + dfn_file_name = "gwf-npf.dfn" + + dfn = [["block options", "name save_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name alternative_cell_averaging", + "type string", "valid logarithmic amt-lmk amt-hmk", + "reader urword", "optional true"], + ["block options", "name thickstrt", "type keyword", + "reader urword", "optional true"], + ["block options", "name cvoptions", + "type record variablecv dewatered", "reader urword", + "optional true"], + ["block options", "name variablecv", "in_record true", + "type keyword", "reader urword"], + ["block options", "name dewatered", "in_record true", + "type keyword", "reader urword", "optional true"], + ["block options", "name perched", "type keyword", + "reader urword", "optional true"], + ["block options", "name rewet_record", + "type record rewet wetfct iwetit ihdwet", "reader urword", + "optional true"], + ["block options", "name rewet", "type keyword", "in_record true", + "reader urword", "optional false"], + ["block options", "name wetfct", "type double precision", + "in_record true", "reader urword", "optional false"], + ["block options", "name iwetit", "type integer", + "in_record true", "reader urword", "optional false"], + ["block options", "name ihdwet", "type integer", + "in_record true", "reader urword", "optional false"], + ["block options", "name xt3doptions", "type record xt3d rhs", + "reader urword", "optional true"], + ["block options", "name xt3d", "in_record true", "type keyword", + "reader urword"], + ["block options", "name rhs", "in_record true", "type keyword", + "reader urword", "optional true"], + ["block options", "name save_specific_discharge", "type keyword", + "reader urword", "optional true"], + ["block griddata", "name icelltype", "type integer", + "shape (nodes)", "valid", "reader readarray", "layered true", + "optional", "default_value 0"], + ["block griddata", "name k", "type double precision", + "shape (nodes)", "valid", "reader readarray", "layered true", + "optional", "default_value 1.0"], + ["block griddata", "name k22", "type double precision", + "shape (nodes)", "valid", "reader readarray", "layered true", + "optional true"], + ["block griddata", "name k33", "type double precision", + "shape (nodes)", "valid", "reader readarray", "layered true", + "optional true"], + ["block griddata", "name angle1", "type double precision", + "shape (nodes)", "valid", "reader readarray", "layered true", + "optional true"], + ["block griddata", "name angle2", "type double precision", + "shape (nodes)", "valid", "reader readarray", "layered true", + "optional true"], + ["block griddata", "name angle3", "type double precision", + "shape (nodes)", "valid", "reader readarray", "layered true", + "optional true"], + ["block griddata", "name wetdry", "type double precision", + "shape (nodes)", "valid", "reader readarray", "layered true", + "optional true"]] + + def __init__(self, model, loading_package=False, save_flows=None, + alternative_cell_averaging=None, thickstrt=None, + cvoptions=None, perched=None, rewet_record=None, + xt3doptions=None, save_specific_discharge=None, icelltype=0, + k=1.0, k22=None, k33=None, angle1=None, angle2=None, + angle3=None, wetdry=None, filename=None, pname=None, + parent_file=None): + super(ModflowGwfnpf, self).__init__(model, "npf", filename, pname, + loading_package, parent_file) + + # set up variables + self.save_flows = self.build_mfdata("save_flows", save_flows) + self.alternative_cell_averaging = self.build_mfdata( + "alternative_cell_averaging", alternative_cell_averaging) + self.thickstrt = self.build_mfdata("thickstrt", thickstrt) + self.cvoptions = self.build_mfdata("cvoptions", cvoptions) + self.perched = self.build_mfdata("perched", perched) + self.rewet_record = self.build_mfdata("rewet_record", rewet_record) + self.xt3doptions = self.build_mfdata("xt3doptions", xt3doptions) + self.save_specific_discharge = self.build_mfdata( + "save_specific_discharge", save_specific_discharge) + self.icelltype = self.build_mfdata("icelltype", icelltype) + self.k = self.build_mfdata("k", k) + self.k22 = self.build_mfdata("k22", k22) + self.k33 = self.build_mfdata("k33", k33) + self.angle1 = self.build_mfdata("angle1", angle1) + self.angle2 = self.build_mfdata("angle2", angle2) + self.angle3 = self.build_mfdata("angle3", angle3) + self.wetdry = self.build_mfdata("wetdry", wetdry) + self._init_complete = True diff --git a/flopy/mf6/modflow/mfgwfoc.py b/flopy/mf6/modflow/mfgwfoc.py index 9b74c3b5fd..a6d03681f1 100644 --- a/flopy/mf6/modflow/mfgwfoc.py +++ b/flopy/mf6/modflow/mfgwfoc.py @@ -1,189 +1,189 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ListTemplateGenerator - - -class ModflowGwfoc(mfpackage.MFPackage): - """ - ModflowGwfoc defines a oc package within a gwf6 model. - - Parameters - ---------- - model : MFModel - Model that this package is a part of. Package is automatically - added to model when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - budget_filerecord : [budgetfile] - * budgetfile (string) name of the output file to write budget - information. - head_filerecord : [headfile] - * headfile (string) name of the output file to write head information. - headprintrecord : [columns, width, digits, format] - * columns (integer) number of columns for writing data. - * width (integer) width for writing each number. - * digits (integer) number of digits to use for writing a number. - * format (string) write format can be EXPONENTIAL, FIXED, GENERAL, or - SCIENTIFIC. - saverecord : [rtype, ocsetting] - * rtype (string) type of information to save or print. Can be BUDGET or - HEAD. - * ocsetting (keystring) specifies the steps for which the data will be - saved. - all : [keyword] - * all (keyword) keyword to indicate save for all time steps in - period. - first : [keyword] - * first (keyword) keyword to indicate save for first step in - period. This keyword may be used in conjunction with other - keywords to print or save results for multiple time steps. - last : [keyword] - * last (keyword) keyword to indicate save for last step in - period. This keyword may be used in conjunction with other - keywords to print or save results for multiple time steps. - frequency : [integer] - * frequency (integer) save at the specified time step - frequency. This keyword may be used in conjunction with other - keywords to print or save results for multiple time steps. - steps : [integer] - * steps (integer) save for each step specified in STEPS. This - keyword may be used in conjunction with other keywords to - print or save results for multiple time steps. - printrecord : [rtype, ocsetting] - * rtype (string) type of information to save or print. Can be BUDGET or - HEAD. - * ocsetting (keystring) specifies the steps for which the data will be - saved. - all : [keyword] - * all (keyword) keyword to indicate save for all time steps in - period. - first : [keyword] - * first (keyword) keyword to indicate save for first step in - period. This keyword may be used in conjunction with other - keywords to print or save results for multiple time steps. - last : [keyword] - * last (keyword) keyword to indicate save for last step in - period. This keyword may be used in conjunction with other - keywords to print or save results for multiple time steps. - frequency : [integer] - * frequency (integer) save at the specified time step - frequency. This keyword may be used in conjunction with other - keywords to print or save results for multiple time steps. - steps : [integer] - * steps (integer) save for each step specified in STEPS. This - keyword may be used in conjunction with other keywords to - print or save results for multiple time steps. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - budget_filerecord = ListTemplateGenerator(('gwf6', 'oc', 'options', - 'budget_filerecord')) - head_filerecord = ListTemplateGenerator(('gwf6', 'oc', 'options', - 'head_filerecord')) - headprintrecord = ListTemplateGenerator(('gwf6', 'oc', 'options', - 'headprintrecord')) - saverecord = ListTemplateGenerator(('gwf6', 'oc', 'period', - 'saverecord')) - printrecord = ListTemplateGenerator(('gwf6', 'oc', 'period', - 'printrecord')) - package_abbr = "gwfoc" - _package_type = "oc" - dfn_file_name = "gwf-oc.dfn" - - dfn = [["block options", "name budget_filerecord", - "type record budget fileout budgetfile", "shape", "reader urword", - "tagged true", "optional true"], - ["block options", "name budget", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name fileout", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name budgetfile", "type string", - "preserve_case true", "shape", "in_record true", "reader urword", - "tagged false", "optional false"], - ["block options", "name head_filerecord", - "type record head fileout headfile", "shape", "reader urword", - "tagged true", "optional true"], - ["block options", "name head", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name headfile", "type string", - "preserve_case true", "shape", "in_record true", "reader urword", - "tagged false", "optional false"], - ["block options", "name headprintrecord", - "type record head print_format formatrecord", "shape", - "reader urword", "optional true"], - ["block options", "name print_format", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name formatrecord", - "type record columns width digits format", "shape", - "in_record true", "reader urword", "tagged", "optional false"], - ["block options", "name columns", "type integer", "shape", - "in_record true", "reader urword", "tagged true", "optional"], - ["block options", "name width", "type integer", "shape", - "in_record true", "reader urword", "tagged true", "optional"], - ["block options", "name digits", "type integer", "shape", - "in_record true", "reader urword", "tagged true", "optional"], - ["block options", "name format", "type string", "shape", - "in_record true", "reader urword", "tagged false", - "optional false"], - ["block period", "name iper", "type integer", - "block_variable True", "in_record true", "tagged false", "shape", - "valid", "reader urword", "optional false"], - ["block period", "name saverecord", - "type record save rtype ocsetting", "shape", "reader urword", - "tagged false", "optional true"], - ["block period", "name save", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block period", "name printrecord", - "type record print rtype ocsetting", "shape", "reader urword", - "tagged false", "optional true"], - ["block period", "name print", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block period", "name rtype", "type string", "shape", - "in_record true", "reader urword", "tagged false", - "optional false"], - ["block period", "name ocsetting", - "type keystring all first last frequency steps", "shape", - "tagged false", "in_record true", "reader urword"], - ["block period", "name all", "type keyword", "shape", - "in_record true", "reader urword"], - ["block period", "name first", "type keyword", "shape", - "in_record true", "reader urword"], - ["block period", "name last", "type keyword", "shape", - "in_record true", "reader urword"], - ["block period", "name frequency", "type integer", "shape", - "tagged true", "in_record true", "reader urword"], - ["block period", "name steps", "type integer", "shape (`0 indicates confined storage is - used when head is above cell top and a mixed formulation of - unconfined and confined storage is used when head is below cell top. - ss : [double] - * ss (double) is specific storage (or the storage coefficient if - STORAGECOEFFICIENT is specified as an option). Specific storage - values must be greater than or equal to 0. - sy : [double] - * sy (double) is specific yield. Specific yield values must be greater - than or equal to 0. Specific yield does not have to be specified if - there are no convertible cells (ICONVERT=0 in every cell). - steady_state : boolean - * steady-state (boolean) keyword to indicate that stress period IPER is - steady-state. Steady-state conditions will apply until the TRANSIENT - keyword is specified in a subsequent BEGIN PERIOD block. - transient : boolean - * transient (boolean) keyword to indicate that stress period IPER is - transient. Transient conditions will apply until the STEADY-STATE - keyword is specified in a subsequent BEGIN PERIOD block. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - iconvert = ArrayTemplateGenerator(('gwf6', 'sto', 'griddata', - 'iconvert')) - ss = ArrayTemplateGenerator(('gwf6', 'sto', 'griddata', 'ss')) - sy = ArrayTemplateGenerator(('gwf6', 'sto', 'griddata', 'sy')) - package_abbr = "gwfsto" - _package_type = "sto" - dfn_file_name = "gwf-sto.dfn" - - dfn = [["block options", "name save_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name storagecoefficient", "type keyword", - "reader urword", "optional true"], - ["block griddata", "name iconvert", "type integer", - "shape (nodes)", "valid", "reader readarray", "layered true", - "optional false", "default_value 0"], - ["block griddata", "name ss", "type double precision", - "shape (nodes)", "valid", "reader readarray", "layered true", - "optional false", "default_value 1.e-5"], - ["block griddata", "name sy", "type double precision", - "shape (nodes)", "valid", "reader readarray", "layered true", - "optional false", "default_value 0.15"], - ["block period", "name iper", "type integer", - "block_variable True", "in_record true", "tagged false", "shape", - "valid", "reader urword", "optional false"], - ["block period", "name steady-state", "type keyword", "shape", - "valid", "reader urword", "optional true"], - ["block period", "name transient", "type keyword", "shape", - "valid", "reader urword", "optional true"]] - - def __init__(self, model, loading_package=False, save_flows=None, - storagecoefficient=None, iconvert=0, ss=1.e-5, sy=0.15, - steady_state=None, transient=None, filename=None, pname=None, - parent_file=None): - super(ModflowGwfsto, self).__init__(model, "sto", filename, pname, - loading_package, parent_file) - - # set up variables - self.save_flows = self.build_mfdata("save_flows", save_flows) - self.storagecoefficient = self.build_mfdata("storagecoefficient", - storagecoefficient) - self.iconvert = self.build_mfdata("iconvert", iconvert) - self.ss = self.build_mfdata("ss", ss) - self.sy = self.build_mfdata("sy", sy) - self.steady_state = self.build_mfdata("steady-state", steady_state) - self.transient = self.build_mfdata("transient", transient) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ArrayTemplateGenerator + + +class ModflowGwfsto(mfpackage.MFPackage): + """ + ModflowGwfsto defines a sto package within a gwf6 model. + + Parameters + ---------- + model : MFModel + Model that this package is a part of. Package is automatically + added to model when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + save_flows : boolean + * save_flows (boolean) keyword to indicate that cell-by-cell flow terms + will be written to the file specified with "BUDGET SAVE FILE" in + Output Control. + storagecoefficient : boolean + * storagecoefficient (boolean) keyword to indicate that the SS array is + read as storage coefficient rather than specific storage. + iconvert : [integer] + * iconvert (integer) is a flag for each cell that specifies whether or + not a cell is convertible for the storage calculation. 0 indicates + confined storage is used. :math:`>`0 indicates confined storage is + used when head is above cell top and a mixed formulation of + unconfined and confined storage is used when head is below cell top. + ss : [double] + * ss (double) is specific storage (or the storage coefficient if + STORAGECOEFFICIENT is specified as an option). Specific storage + values must be greater than or equal to 0. + sy : [double] + * sy (double) is specific yield. Specific yield values must be greater + than or equal to 0. Specific yield does not have to be specified if + there are no convertible cells (ICONVERT=0 in every cell). + steady_state : boolean + * steady-state (boolean) keyword to indicate that stress period IPER is + steady-state. Steady-state conditions will apply until the TRANSIENT + keyword is specified in a subsequent BEGIN PERIOD block. + transient : boolean + * transient (boolean) keyword to indicate that stress period IPER is + transient. Transient conditions will apply until the STEADY-STATE + keyword is specified in a subsequent BEGIN PERIOD block. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + iconvert = ArrayTemplateGenerator(('gwf6', 'sto', 'griddata', + 'iconvert')) + ss = ArrayTemplateGenerator(('gwf6', 'sto', 'griddata', 'ss')) + sy = ArrayTemplateGenerator(('gwf6', 'sto', 'griddata', 'sy')) + package_abbr = "gwfsto" + _package_type = "sto" + dfn_file_name = "gwf-sto.dfn" + + dfn = [["block options", "name save_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name storagecoefficient", "type keyword", + "reader urword", "optional true"], + ["block griddata", "name iconvert", "type integer", + "shape (nodes)", "valid", "reader readarray", "layered true", + "optional false", "default_value 0"], + ["block griddata", "name ss", "type double precision", + "shape (nodes)", "valid", "reader readarray", "layered true", + "optional false", "default_value 1.e-5"], + ["block griddata", "name sy", "type double precision", + "shape (nodes)", "valid", "reader readarray", "layered true", + "optional false", "default_value 0.15"], + ["block period", "name iper", "type integer", + "block_variable True", "in_record true", "tagged false", "shape", + "valid", "reader urword", "optional false"], + ["block period", "name steady-state", "type keyword", "shape", + "valid", "reader urword", "optional true"], + ["block period", "name transient", "type keyword", "shape", + "valid", "reader urword", "optional true"]] + + def __init__(self, model, loading_package=False, save_flows=None, + storagecoefficient=None, iconvert=0, ss=1.e-5, sy=0.15, + steady_state=None, transient=None, filename=None, pname=None, + parent_file=None): + super(ModflowGwfsto, self).__init__(model, "sto", filename, pname, + loading_package, parent_file) + + # set up variables + self.save_flows = self.build_mfdata("save_flows", save_flows) + self.storagecoefficient = self.build_mfdata("storagecoefficient", + storagecoefficient) + self.iconvert = self.build_mfdata("iconvert", iconvert) + self.ss = self.build_mfdata("ss", ss) + self.sy = self.build_mfdata("sy", sy) + self.steady_state = self.build_mfdata("steady-state", steady_state) + self.transient = self.build_mfdata("transient", transient) + self._init_complete = True diff --git a/flopy/mf6/modflow/mfgwfuzf.py b/flopy/mf6/modflow/mfgwfuzf.py index fd569779d8..41dc133bdc 100644 --- a/flopy/mf6/modflow/mfgwfuzf.py +++ b/flopy/mf6/modflow/mfgwfuzf.py @@ -1,415 +1,415 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ListTemplateGenerator - - -class ModflowGwfuzf(mfpackage.MFPackage): - """ - ModflowGwfuzf defines a uzf package within a gwf6 model. - - Parameters - ---------- - model : MFModel - Model that this package is a part of. Package is automatically - added to model when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - auxiliary : [string] - * auxiliary (string) defines an array of one or more auxiliary variable - names. There is no limit on the number of auxiliary variables that - can be provided on this line; however, lists of information provided - in subsequent blocks must have a column of data for each auxiliary - variable name defined here. The number of auxiliary variables - detected on this line determines the value for naux. Comments cannot - be provided anywhere on this line as they will be interpreted as - auxiliary variable names. Auxiliary variables may not be used by the - package, but they will be available for use by other parts of the - program. The program will terminate with an error if auxiliary - variables are specified on more than one line in the options block. - auxmultname : string - * auxmultname (string) name of auxiliary variable to be used as - multiplier of GWF cell area used by UZF cell. - boundnames : boolean - * boundnames (boolean) keyword to indicate that boundary names may be - provided with the list of UZF cells. - print_input : boolean - * print_input (boolean) keyword to indicate that the list of UZF - information will be written to the listing file immediately after it - is read. - print_flows : boolean - * print_flows (boolean) keyword to indicate that the list of UZF flow - rates will be printed to the listing file for every stress period - time step in which "BUDGET PRINT" is specified in Output Control. If - there is no Output Control option and "PRINT_FLOWS" is specified, - then flow rates are printed for the last time step of each stress - period. - save_flows : boolean - * save_flows (boolean) keyword to indicate that UZF flow terms will be - written to the file specified with "BUDGET FILEOUT" in Output - Control. - budget_filerecord : [budgetfile] - * budgetfile (string) name of the binary output file to write budget - information. - timeseries : {varname:data} or timeseries data - * Contains data for the ts package. Data can be stored in a dictionary - containing data for the ts package with variable names as keys and - package data as values. Data just for the timeseries variable is also - acceptable. See ts package documentation for more information. - observations : {varname:data} or continuous data - * Contains data for the obs package. Data can be stored in a dictionary - containing data for the obs package with variable names as keys and - package data as values. Data just for the observations variable is - also acceptable. See obs package documentation for more information. - mover : boolean - * mover (boolean) keyword to indicate that this instance of the UZF - Package can be used with the Water Mover (MVR) Package. When the - MOVER option is specified, additional memory is allocated within the - package to store the available, provided, and received water. - simulate_et : boolean - * simulate_et (boolean) keyword specifying that ET in the unsaturated - (UZF) and saturated zones (GWF) will be simulated. ET can be - simulated in the UZF cell and not the GWF cell by omitting keywords - LINEAR_GWET and SQUARE_GWET. - linear_gwet : boolean - * linear_gwet (boolean) keyword specifying that groundwater ET will be - simulated using the original ET formulation of MODFLOW-2005. - square_gwet : boolean - * square_gwet (boolean) keyword specifying that groundwater ET will be - simulated by assuming a constant ET rate for groundwater levels - between land surface (TOP) and land surface minus the ET extinction - depth (TOP-EXTDP). Groundwater ET is smoothly reduced from the PET - rate to zero over a nominal interval at TOP-EXTDP. - simulate_gwseep : boolean - * simulate_gwseep (boolean) keyword specifying that groundwater - discharge (GWSEEP) to land surface will be simulated. Groundwater - discharge is nonzero when groundwater head is greater than land - surface. - unsat_etwc : boolean - * unsat_etwc (boolean) keyword specifying that ET in the unsaturated - zone will be simulated as a function of the specified PET rate while - the water content (THETA) is greater than the ET extinction water - content (EXTWC). - unsat_etae : boolean - * unsat_etae (boolean) keyword specifying that ET in the unsaturated - zone will be simulated simulated using a capillary pressure based - formulation. Capillary pressure is calculated using the Brooks-Corey - retention function. - nuzfcells : integer - * nuzfcells (integer) is the number of UZF cells. More than one UZF - cell can be assigned to a GWF cell; however, only one GWF cell can be - assigned to a single UZF cell. If more than one UZF cell is assigned - to a GWF cell, then an auxiliary variable should be used to reduce - the surface area of the UZF cell with the AUXMULTNAME option. - ntrailwaves : integer - * ntrailwaves (integer) is the number of trailing waves. NTRAILWAVES - has a default value of 7 and can be increased to lower mass balance - error in the unsaturated zone. - nwavesets : integer - * nwavesets (integer) is the number of UZF cells specified. NWAVESETS - has a default value of 40 and can be increased if more waves are - required to resolve variations in water content within the - unsaturated zone. - packagedata : [iuzno, cellid, landflag, ivertcon, surfdep, vks, thtr, thts, - thti, eps, boundname] - * iuzno (integer) integer value that defines the UZF cell number - associated with the specified PACKAGEDATA data on the line. IUZNO - must be greater than zero and less than or equal to NUZFCELLS. UZF - information must be specified for every UZF cell or the program will - terminate with an error. The program will also terminate with an - error if information for a UZF cell is specified more than once. - * cellid ((integer, ...)) is the cell identifier, and depends on the - type of grid that is used for the simulation. For a structured grid - that uses the DIS input file, CELLID is the layer, row, and column. - For a grid that uses the DISV input file, CELLID is the layer and - CELL2D number. If the model uses the unstructured discretization - (DISU) input file, CELLID is the node number for the cell. - * landflag (integer) integer value set to one for land surface cells - indicating that boundary conditions can be applied and data can be - specified in the PERIOD block. A value of 0 specifies a non-land - surface cell. - * ivertcon (integer) integer value set to specify underlying UZF cell - that receives water flowing to bottom of cell. If unsaturated zone - flow reaches the water table before the cell bottom, then water is - added to the GWF cell instead of flowing to the underlying UZF cell. - A value of 0 indicates the UZF cell is not connected to an underlying - UZF cell. - * surfdep (double) is the surface depression depth of the UZF cell. - * vks (double) is the vertical saturated hydraulic conductivity of the - UZF cell. - * thtr (double) is the residual (irreducible) water content of the UZF - cell. - * thts (double) is the saturated water content of the UZF cell. - * thti (double) is the initial water content of the UZF cell. - * eps (double) is the epsilon exponent of the UZF cell. - * boundname (string) name of the UZF cell cell. BOUNDNAME is an ASCII - character variable that can contain as many as 40 characters. If - BOUNDNAME contains spaces in it, then the entire name must be - enclosed within single quotes. - perioddata : [iuzno, finf, pet, extdp, extwc, ha, hroot, rootact, aux] - * iuzno (integer) integer value that defines the UZF cell number - associated with the specified PERIOD data on the line. - * finf (string) real or character value that defines the applied - infiltration rate of the UZF cell (:math:`LT^{-1}`). If the Options - block includes a TIMESERIESFILE entry (see the "Time-Variable Input" - section), values can be obtained from a time series by entering the - time-series name in place of a numeric value. - * pet (string) real or character value that defines the potential - evapotranspiration rate of the UZF cell and specified GWF cell. - Evapotranspiration is first removed from the unsaturated zone and any - remaining potential evapotranspiration is applied to the saturated - zone. If IVERTCON is greater than zero then residual potential - evapotranspiration not satisfied in the UZF cell is applied to the - underlying UZF and GWF cells. PET is always specified, but is only - used if SIMULATE_ET is specified in the OPTIONS block. If the Options - block includes a TIMESERIESFILE entry (see the "Time-Variable Input" - section), values can be obtained from a time series by entering the - time-series name in place of a numeric value. - * extdp (string) real or character value that defines the - evapotranspiration extinction depth of the UZF cell. If IVERTCON is - greater than zero and EXTDP extends below the GWF cell bottom then - remaining potential evapotranspiration is applied to the underlying - UZF and GWF cells. EXTDP is always specified, but is only used if - SIMULATE_ET is specified in the OPTIONS block. If the Options block - includes a TIMESERIESFILE entry (see the "Time-Variable Input" - section), values can be obtained from a time series by entering the - time-series name in place of a numeric value. - * extwc (string) real or character value that defines the - evapotranspiration extinction water content of the UZF cell. EXTWC is - always specified, but is only used if SIMULATE_ET and UNSAT_ETWC are - specified in the OPTIONS block. If the Options block includes a - TIMESERIESFILE entry (see the "Time-Variable Input" section), values - can be obtained from a time series by entering the time-series name - in place of a numeric value. - * ha (string) real or character value that defines the air entry - potential (head) of the UZF cell. HA is always specified, but is only - used if SIMULATE_ET and UNSAT_ETAE are specified in the OPTIONS - block. If the Options block includes a TIMESERIESFILE entry (see the - "Time-Variable Input" section), values can be obtained from a time - series by entering the time-series name in place of a numeric value. - * hroot (string) real or character value that defines the root - potential (head) of the UZF cell. HROOT is always specified, but is - only used if SIMULATE_ET and UNSAT_ETAE are specified in the OPTIONS - block. If the Options block includes a TIMESERIESFILE entry (see the - "Time-Variable Input" section), values can be obtained from a time - series by entering the time-series name in place of a numeric value. - * rootact (string) real or character value that defines the root - activity function of the UZF cell. ROOTACT is the length of roots in - a given volume of soil divided by that volume. Values range from 0 to - about 3 :math:`cm^{-2}`, depending on the plant community and its - stage of development. ROOTACT is always specified, but is only used - if SIMULATE\_ET and UNSAT\_ETAE are specified in the OPTIONS block. - If the Options block includes a TIMESERIESFILE entry (see the "Time- - Variable Input" section), values can be obtained from a time series - by entering the time-series name in place of a numeric value. - * aux (double) represents the values of the auxiliary variables for - each UZF. The values of auxiliary variables must be present for each - UZF. The values must be specified in the order of the auxiliary - variables specified in the OPTIONS block. If the package supports - time series and the Options block includes a TIMESERIESFILE entry - (see the "Time-Variable Input" section), values can be obtained from - a time series by entering the time-series name in place of a numeric - value. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - auxiliary = ListTemplateGenerator(('gwf6', 'uzf', 'options', - 'auxiliary')) - budget_filerecord = ListTemplateGenerator(('gwf6', 'uzf', 'options', - 'budget_filerecord')) - ts_filerecord = ListTemplateGenerator(('gwf6', 'uzf', 'options', - 'ts_filerecord')) - obs_filerecord = ListTemplateGenerator(('gwf6', 'uzf', 'options', - 'obs_filerecord')) - packagedata = ListTemplateGenerator(('gwf6', 'uzf', 'packagedata', - 'packagedata')) - perioddata = ListTemplateGenerator(('gwf6', 'uzf', 'period', - 'perioddata')) - package_abbr = "gwfuzf" - _package_type = "uzf" - dfn_file_name = "gwf-uzf.dfn" - - dfn = [["block options", "name auxiliary", "type string", - "shape (naux)", "reader urword", "optional true"], - ["block options", "name auxmultname", "type string", "shape", - "reader urword", "optional true"], - ["block options", "name boundnames", "type keyword", "shape", - "reader urword", "optional true"], - ["block options", "name print_input", "type keyword", - "reader urword", "optional true"], - ["block options", "name print_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name save_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name budget_filerecord", - "type record budget fileout budgetfile", "shape", "reader urword", - "tagged true", "optional true"], - ["block options", "name budget", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name fileout", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name budgetfile", "preserve_case true", - "type string", "shape", "in_record true", "reader urword", - "tagged false", "optional false"], - ["block options", "name ts_filerecord", - "type record ts6 filein ts6_filename", "shape", "reader urword", - "tagged true", "optional true", "construct_package ts", - "construct_data timeseries", "parameter_name timeseries"], - ["block options", "name ts6", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name filein", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name ts6_filename", "type string", - "preserve_case true", "in_record true", "reader urword", - "optional false", "tagged false"], - ["block options", "name obs_filerecord", - "type record obs6 filein obs6_filename", "shape", "reader urword", - "tagged true", "optional true", "construct_package obs", - "construct_data continuous", "parameter_name observations"], - ["block options", "name obs6", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name obs6_filename", "type string", - "preserve_case true", "in_record true", "tagged false", - "reader urword", "optional false"], - ["block options", "name mover", "type keyword", "tagged true", - "reader urword", "optional true"], - ["block options", "name simulate_et", "type keyword", - "tagged true", "reader urword", "optional true"], - ["block options", "name linear_gwet", "type keyword", - "tagged true", "reader urword", "optional true"], - ["block options", "name square_gwet", "type keyword", - "tagged true", "reader urword", "optional true"], - ["block options", "name simulate_gwseep", "type keyword", - "tagged true", "reader urword", "optional true"], - ["block options", "name unsat_etwc", "type keyword", - "tagged true", "reader urword", "optional true"], - ["block options", "name unsat_etae", "type keyword", - "tagged true", "reader urword", "optional true"], - ["block dimensions", "name nuzfcells", "type integer", - "reader urword", "optional false"], - ["block dimensions", "name ntrailwaves", "type integer", - "reader urword", "optional false"], - ["block dimensions", "name nwavesets", "type integer", - "reader urword", "optional false"], - ["block packagedata", "name packagedata", - "type recarray iuzno cellid landflag ivertcon surfdep vks thtr " - "thts thti eps boundname", - "shape (nuzfcells)", "reader urword"], - ["block packagedata", "name iuzno", "type integer", "shape", - "tagged false", "in_record true", "reader urword", - "numeric_index true"], - ["block packagedata", "name cellid", "type integer", - "shape (ncelldim)", "tagged false", "in_record true", - "reader urword"], - ["block packagedata", "name landflag", "type integer", "shape", - "tagged false", "in_record true", "reader urword"], - ["block packagedata", "name ivertcon", "type integer", "shape", - "tagged false", "in_record true", "reader urword", - "numeric_index true"], - ["block packagedata", "name surfdep", "type double precision", - "shape", "tagged false", "in_record true", "reader urword"], - ["block packagedata", "name vks", "type double precision", - "shape", "tagged false", "in_record true", "reader urword"], - ["block packagedata", "name thtr", "type double precision", - "shape", "tagged false", "in_record true", "reader urword"], - ["block packagedata", "name thts", "type double precision", - "shape", "tagged false", "in_record true", "reader urword"], - ["block packagedata", "name thti", "type double precision", - "shape", "tagged false", "in_record true", "reader urword"], - ["block packagedata", "name eps", "type double precision", - "shape", "tagged false", "in_record true", "reader urword"], - ["block packagedata", "name boundname", "type string", "shape", - "tagged false", "in_record true", "reader urword", - "optional true"], - ["block period", "name iper", "type integer", - "block_variable True", "in_record true", "tagged false", "shape", - "valid", "reader urword", "optional false"], - ["block period", "name perioddata", - "type recarray iuzno finf pet extdp extwc ha hroot rootact aux", - "shape", "reader urword"], - ["block period", "name iuzno", "type integer", "shape", - "tagged false", "in_record true", "reader urword", - "numeric_index true"], - ["block period", "name finf", "type string", "shape", - "tagged false", "in_record true", "time_series true", - "reader urword"], - ["block period", "name pet", "type string", "shape", - "tagged false", "in_record true", "reader urword", - "time_series true"], - ["block period", "name extdp", "type string", "shape", - "tagged false", "in_record true", "reader urword", - "time_series true"], - ["block period", "name extwc", "type string", "shape", - "tagged false", "in_record true", "reader urword", - "time_series true"], - ["block period", "name ha", "type string", "shape", - "tagged false", "in_record true", "time_series true", - "reader urword"], - ["block period", "name hroot", "type string", "shape", - "tagged false", "in_record true", "reader urword", - "time_series true"], - ["block period", "name rootact", "type string", "shape", - "tagged false", "in_record true", "reader urword", - "time_series true"], - ["block period", "name aux", "type double precision", - "in_record true", "tagged false", "shape (naux)", "reader urword", - "time_series true", "optional true"]] - - def __init__(self, model, loading_package=False, auxiliary=None, - auxmultname=None, boundnames=None, print_input=None, - print_flows=None, save_flows=None, budget_filerecord=None, - timeseries=None, observations=None, mover=None, - simulate_et=None, linear_gwet=None, square_gwet=None, - simulate_gwseep=None, unsat_etwc=None, unsat_etae=None, - nuzfcells=None, ntrailwaves=None, nwavesets=None, - packagedata=None, perioddata=None, filename=None, pname=None, - parent_file=None): - super(ModflowGwfuzf, self).__init__(model, "uzf", filename, pname, - loading_package, parent_file) - - # set up variables - self.auxiliary = self.build_mfdata("auxiliary", auxiliary) - self.auxmultname = self.build_mfdata("auxmultname", auxmultname) - self.boundnames = self.build_mfdata("boundnames", boundnames) - self.print_input = self.build_mfdata("print_input", print_input) - self.print_flows = self.build_mfdata("print_flows", print_flows) - self.save_flows = self.build_mfdata("save_flows", save_flows) - self.budget_filerecord = self.build_mfdata("budget_filerecord", - budget_filerecord) - self._ts_filerecord = self.build_mfdata("ts_filerecord", - None) - self._ts_package = self.build_child_package("ts", timeseries, - "timeseries", - self._ts_filerecord) - self._obs_filerecord = self.build_mfdata("obs_filerecord", - None) - self._obs_package = self.build_child_package("obs", observations, - "continuous", - self._obs_filerecord) - self.mover = self.build_mfdata("mover", mover) - self.simulate_et = self.build_mfdata("simulate_et", simulate_et) - self.linear_gwet = self.build_mfdata("linear_gwet", linear_gwet) - self.square_gwet = self.build_mfdata("square_gwet", square_gwet) - self.simulate_gwseep = self.build_mfdata("simulate_gwseep", - simulate_gwseep) - self.unsat_etwc = self.build_mfdata("unsat_etwc", unsat_etwc) - self.unsat_etae = self.build_mfdata("unsat_etae", unsat_etae) - self.nuzfcells = self.build_mfdata("nuzfcells", nuzfcells) - self.ntrailwaves = self.build_mfdata("ntrailwaves", ntrailwaves) - self.nwavesets = self.build_mfdata("nwavesets", nwavesets) - self.packagedata = self.build_mfdata("packagedata", packagedata) - self.perioddata = self.build_mfdata("perioddata", perioddata) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ListTemplateGenerator + + +class ModflowGwfuzf(mfpackage.MFPackage): + """ + ModflowGwfuzf defines a uzf package within a gwf6 model. + + Parameters + ---------- + model : MFModel + Model that this package is a part of. Package is automatically + added to model when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + auxiliary : [string] + * auxiliary (string) defines an array of one or more auxiliary variable + names. There is no limit on the number of auxiliary variables that + can be provided on this line; however, lists of information provided + in subsequent blocks must have a column of data for each auxiliary + variable name defined here. The number of auxiliary variables + detected on this line determines the value for naux. Comments cannot + be provided anywhere on this line as they will be interpreted as + auxiliary variable names. Auxiliary variables may not be used by the + package, but they will be available for use by other parts of the + program. The program will terminate with an error if auxiliary + variables are specified on more than one line in the options block. + auxmultname : string + * auxmultname (string) name of auxiliary variable to be used as + multiplier of GWF cell area used by UZF cell. + boundnames : boolean + * boundnames (boolean) keyword to indicate that boundary names may be + provided with the list of UZF cells. + print_input : boolean + * print_input (boolean) keyword to indicate that the list of UZF + information will be written to the listing file immediately after it + is read. + print_flows : boolean + * print_flows (boolean) keyword to indicate that the list of UZF flow + rates will be printed to the listing file for every stress period + time step in which "BUDGET PRINT" is specified in Output Control. If + there is no Output Control option and "PRINT_FLOWS" is specified, + then flow rates are printed for the last time step of each stress + period. + save_flows : boolean + * save_flows (boolean) keyword to indicate that UZF flow terms will be + written to the file specified with "BUDGET FILEOUT" in Output + Control. + budget_filerecord : [budgetfile] + * budgetfile (string) name of the binary output file to write budget + information. + timeseries : {varname:data} or timeseries data + * Contains data for the ts package. Data can be stored in a dictionary + containing data for the ts package with variable names as keys and + package data as values. Data just for the timeseries variable is also + acceptable. See ts package documentation for more information. + observations : {varname:data} or continuous data + * Contains data for the obs package. Data can be stored in a dictionary + containing data for the obs package with variable names as keys and + package data as values. Data just for the observations variable is + also acceptable. See obs package documentation for more information. + mover : boolean + * mover (boolean) keyword to indicate that this instance of the UZF + Package can be used with the Water Mover (MVR) Package. When the + MOVER option is specified, additional memory is allocated within the + package to store the available, provided, and received water. + simulate_et : boolean + * simulate_et (boolean) keyword specifying that ET in the unsaturated + (UZF) and saturated zones (GWF) will be simulated. ET can be + simulated in the UZF cell and not the GWF cell by omitting keywords + LINEAR_GWET and SQUARE_GWET. + linear_gwet : boolean + * linear_gwet (boolean) keyword specifying that groundwater ET will be + simulated using the original ET formulation of MODFLOW-2005. + square_gwet : boolean + * square_gwet (boolean) keyword specifying that groundwater ET will be + simulated by assuming a constant ET rate for groundwater levels + between land surface (TOP) and land surface minus the ET extinction + depth (TOP-EXTDP). Groundwater ET is smoothly reduced from the PET + rate to zero over a nominal interval at TOP-EXTDP. + simulate_gwseep : boolean + * simulate_gwseep (boolean) keyword specifying that groundwater + discharge (GWSEEP) to land surface will be simulated. Groundwater + discharge is nonzero when groundwater head is greater than land + surface. + unsat_etwc : boolean + * unsat_etwc (boolean) keyword specifying that ET in the unsaturated + zone will be simulated as a function of the specified PET rate while + the water content (THETA) is greater than the ET extinction water + content (EXTWC). + unsat_etae : boolean + * unsat_etae (boolean) keyword specifying that ET in the unsaturated + zone will be simulated simulated using a capillary pressure based + formulation. Capillary pressure is calculated using the Brooks-Corey + retention function. + nuzfcells : integer + * nuzfcells (integer) is the number of UZF cells. More than one UZF + cell can be assigned to a GWF cell; however, only one GWF cell can be + assigned to a single UZF cell. If more than one UZF cell is assigned + to a GWF cell, then an auxiliary variable should be used to reduce + the surface area of the UZF cell with the AUXMULTNAME option. + ntrailwaves : integer + * ntrailwaves (integer) is the number of trailing waves. NTRAILWAVES + has a default value of 7 and can be increased to lower mass balance + error in the unsaturated zone. + nwavesets : integer + * nwavesets (integer) is the number of UZF cells specified. NWAVESETS + has a default value of 40 and can be increased if more waves are + required to resolve variations in water content within the + unsaturated zone. + packagedata : [iuzno, cellid, landflag, ivertcon, surfdep, vks, thtr, thts, + thti, eps, boundname] + * iuzno (integer) integer value that defines the UZF cell number + associated with the specified PACKAGEDATA data on the line. IUZNO + must be greater than zero and less than or equal to NUZFCELLS. UZF + information must be specified for every UZF cell or the program will + terminate with an error. The program will also terminate with an + error if information for a UZF cell is specified more than once. + * cellid ((integer, ...)) is the cell identifier, and depends on the + type of grid that is used for the simulation. For a structured grid + that uses the DIS input file, CELLID is the layer, row, and column. + For a grid that uses the DISV input file, CELLID is the layer and + CELL2D number. If the model uses the unstructured discretization + (DISU) input file, CELLID is the node number for the cell. + * landflag (integer) integer value set to one for land surface cells + indicating that boundary conditions can be applied and data can be + specified in the PERIOD block. A value of 0 specifies a non-land + surface cell. + * ivertcon (integer) integer value set to specify underlying UZF cell + that receives water flowing to bottom of cell. If unsaturated zone + flow reaches the water table before the cell bottom, then water is + added to the GWF cell instead of flowing to the underlying UZF cell. + A value of 0 indicates the UZF cell is not connected to an underlying + UZF cell. + * surfdep (double) is the surface depression depth of the UZF cell. + * vks (double) is the vertical saturated hydraulic conductivity of the + UZF cell. + * thtr (double) is the residual (irreducible) water content of the UZF + cell. + * thts (double) is the saturated water content of the UZF cell. + * thti (double) is the initial water content of the UZF cell. + * eps (double) is the epsilon exponent of the UZF cell. + * boundname (string) name of the UZF cell cell. BOUNDNAME is an ASCII + character variable that can contain as many as 40 characters. If + BOUNDNAME contains spaces in it, then the entire name must be + enclosed within single quotes. + perioddata : [iuzno, finf, pet, extdp, extwc, ha, hroot, rootact, aux] + * iuzno (integer) integer value that defines the UZF cell number + associated with the specified PERIOD data on the line. + * finf (string) real or character value that defines the applied + infiltration rate of the UZF cell (:math:`LT^{-1}`). If the Options + block includes a TIMESERIESFILE entry (see the "Time-Variable Input" + section), values can be obtained from a time series by entering the + time-series name in place of a numeric value. + * pet (string) real or character value that defines the potential + evapotranspiration rate of the UZF cell and specified GWF cell. + Evapotranspiration is first removed from the unsaturated zone and any + remaining potential evapotranspiration is applied to the saturated + zone. If IVERTCON is greater than zero then residual potential + evapotranspiration not satisfied in the UZF cell is applied to the + underlying UZF and GWF cells. PET is always specified, but is only + used if SIMULATE_ET is specified in the OPTIONS block. If the Options + block includes a TIMESERIESFILE entry (see the "Time-Variable Input" + section), values can be obtained from a time series by entering the + time-series name in place of a numeric value. + * extdp (string) real or character value that defines the + evapotranspiration extinction depth of the UZF cell. If IVERTCON is + greater than zero and EXTDP extends below the GWF cell bottom then + remaining potential evapotranspiration is applied to the underlying + UZF and GWF cells. EXTDP is always specified, but is only used if + SIMULATE_ET is specified in the OPTIONS block. If the Options block + includes a TIMESERIESFILE entry (see the "Time-Variable Input" + section), values can be obtained from a time series by entering the + time-series name in place of a numeric value. + * extwc (string) real or character value that defines the + evapotranspiration extinction water content of the UZF cell. EXTWC is + always specified, but is only used if SIMULATE_ET and UNSAT_ETWC are + specified in the OPTIONS block. If the Options block includes a + TIMESERIESFILE entry (see the "Time-Variable Input" section), values + can be obtained from a time series by entering the time-series name + in place of a numeric value. + * ha (string) real or character value that defines the air entry + potential (head) of the UZF cell. HA is always specified, but is only + used if SIMULATE_ET and UNSAT_ETAE are specified in the OPTIONS + block. If the Options block includes a TIMESERIESFILE entry (see the + "Time-Variable Input" section), values can be obtained from a time + series by entering the time-series name in place of a numeric value. + * hroot (string) real or character value that defines the root + potential (head) of the UZF cell. HROOT is always specified, but is + only used if SIMULATE_ET and UNSAT_ETAE are specified in the OPTIONS + block. If the Options block includes a TIMESERIESFILE entry (see the + "Time-Variable Input" section), values can be obtained from a time + series by entering the time-series name in place of a numeric value. + * rootact (string) real or character value that defines the root + activity function of the UZF cell. ROOTACT is the length of roots in + a given volume of soil divided by that volume. Values range from 0 to + about 3 :math:`cm^{-2}`, depending on the plant community and its + stage of development. ROOTACT is always specified, but is only used + if SIMULATE\_ET and UNSAT\_ETAE are specified in the OPTIONS block. + If the Options block includes a TIMESERIESFILE entry (see the "Time- + Variable Input" section), values can be obtained from a time series + by entering the time-series name in place of a numeric value. + * aux (double) represents the values of the auxiliary variables for + each UZF. The values of auxiliary variables must be present for each + UZF. The values must be specified in the order of the auxiliary + variables specified in the OPTIONS block. If the package supports + time series and the Options block includes a TIMESERIESFILE entry + (see the "Time-Variable Input" section), values can be obtained from + a time series by entering the time-series name in place of a numeric + value. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + auxiliary = ListTemplateGenerator(('gwf6', 'uzf', 'options', + 'auxiliary')) + budget_filerecord = ListTemplateGenerator(('gwf6', 'uzf', 'options', + 'budget_filerecord')) + ts_filerecord = ListTemplateGenerator(('gwf6', 'uzf', 'options', + 'ts_filerecord')) + obs_filerecord = ListTemplateGenerator(('gwf6', 'uzf', 'options', + 'obs_filerecord')) + packagedata = ListTemplateGenerator(('gwf6', 'uzf', 'packagedata', + 'packagedata')) + perioddata = ListTemplateGenerator(('gwf6', 'uzf', 'period', + 'perioddata')) + package_abbr = "gwfuzf" + _package_type = "uzf" + dfn_file_name = "gwf-uzf.dfn" + + dfn = [["block options", "name auxiliary", "type string", + "shape (naux)", "reader urword", "optional true"], + ["block options", "name auxmultname", "type string", "shape", + "reader urword", "optional true"], + ["block options", "name boundnames", "type keyword", "shape", + "reader urword", "optional true"], + ["block options", "name print_input", "type keyword", + "reader urword", "optional true"], + ["block options", "name print_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name save_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name budget_filerecord", + "type record budget fileout budgetfile", "shape", "reader urword", + "tagged true", "optional true"], + ["block options", "name budget", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name fileout", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name budgetfile", "preserve_case true", + "type string", "shape", "in_record true", "reader urword", + "tagged false", "optional false"], + ["block options", "name ts_filerecord", + "type record ts6 filein ts6_filename", "shape", "reader urword", + "tagged true", "optional true", "construct_package ts", + "construct_data timeseries", "parameter_name timeseries"], + ["block options", "name ts6", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name filein", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name ts6_filename", "type string", + "preserve_case true", "in_record true", "reader urword", + "optional false", "tagged false"], + ["block options", "name obs_filerecord", + "type record obs6 filein obs6_filename", "shape", "reader urword", + "tagged true", "optional true", "construct_package obs", + "construct_data continuous", "parameter_name observations"], + ["block options", "name obs6", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name obs6_filename", "type string", + "preserve_case true", "in_record true", "tagged false", + "reader urword", "optional false"], + ["block options", "name mover", "type keyword", "tagged true", + "reader urword", "optional true"], + ["block options", "name simulate_et", "type keyword", + "tagged true", "reader urword", "optional true"], + ["block options", "name linear_gwet", "type keyword", + "tagged true", "reader urword", "optional true"], + ["block options", "name square_gwet", "type keyword", + "tagged true", "reader urword", "optional true"], + ["block options", "name simulate_gwseep", "type keyword", + "tagged true", "reader urword", "optional true"], + ["block options", "name unsat_etwc", "type keyword", + "tagged true", "reader urword", "optional true"], + ["block options", "name unsat_etae", "type keyword", + "tagged true", "reader urword", "optional true"], + ["block dimensions", "name nuzfcells", "type integer", + "reader urword", "optional false"], + ["block dimensions", "name ntrailwaves", "type integer", + "reader urword", "optional false"], + ["block dimensions", "name nwavesets", "type integer", + "reader urword", "optional false"], + ["block packagedata", "name packagedata", + "type recarray iuzno cellid landflag ivertcon surfdep vks thtr " + "thts thti eps boundname", + "shape (nuzfcells)", "reader urword"], + ["block packagedata", "name iuzno", "type integer", "shape", + "tagged false", "in_record true", "reader urword", + "numeric_index true"], + ["block packagedata", "name cellid", "type integer", + "shape (ncelldim)", "tagged false", "in_record true", + "reader urword"], + ["block packagedata", "name landflag", "type integer", "shape", + "tagged false", "in_record true", "reader urword"], + ["block packagedata", "name ivertcon", "type integer", "shape", + "tagged false", "in_record true", "reader urword", + "numeric_index true"], + ["block packagedata", "name surfdep", "type double precision", + "shape", "tagged false", "in_record true", "reader urword"], + ["block packagedata", "name vks", "type double precision", + "shape", "tagged false", "in_record true", "reader urword"], + ["block packagedata", "name thtr", "type double precision", + "shape", "tagged false", "in_record true", "reader urword"], + ["block packagedata", "name thts", "type double precision", + "shape", "tagged false", "in_record true", "reader urword"], + ["block packagedata", "name thti", "type double precision", + "shape", "tagged false", "in_record true", "reader urword"], + ["block packagedata", "name eps", "type double precision", + "shape", "tagged false", "in_record true", "reader urword"], + ["block packagedata", "name boundname", "type string", "shape", + "tagged false", "in_record true", "reader urword", + "optional true"], + ["block period", "name iper", "type integer", + "block_variable True", "in_record true", "tagged false", "shape", + "valid", "reader urword", "optional false"], + ["block period", "name perioddata", + "type recarray iuzno finf pet extdp extwc ha hroot rootact aux", + "shape", "reader urword"], + ["block period", "name iuzno", "type integer", "shape", + "tagged false", "in_record true", "reader urword", + "numeric_index true"], + ["block period", "name finf", "type string", "shape", + "tagged false", "in_record true", "time_series true", + "reader urword"], + ["block period", "name pet", "type string", "shape", + "tagged false", "in_record true", "reader urword", + "time_series true"], + ["block period", "name extdp", "type string", "shape", + "tagged false", "in_record true", "reader urword", + "time_series true"], + ["block period", "name extwc", "type string", "shape", + "tagged false", "in_record true", "reader urword", + "time_series true"], + ["block period", "name ha", "type string", "shape", + "tagged false", "in_record true", "time_series true", + "reader urword"], + ["block period", "name hroot", "type string", "shape", + "tagged false", "in_record true", "reader urword", + "time_series true"], + ["block period", "name rootact", "type string", "shape", + "tagged false", "in_record true", "reader urword", + "time_series true"], + ["block period", "name aux", "type double precision", + "in_record true", "tagged false", "shape (naux)", "reader urword", + "time_series true", "optional true"]] + + def __init__(self, model, loading_package=False, auxiliary=None, + auxmultname=None, boundnames=None, print_input=None, + print_flows=None, save_flows=None, budget_filerecord=None, + timeseries=None, observations=None, mover=None, + simulate_et=None, linear_gwet=None, square_gwet=None, + simulate_gwseep=None, unsat_etwc=None, unsat_etae=None, + nuzfcells=None, ntrailwaves=None, nwavesets=None, + packagedata=None, perioddata=None, filename=None, pname=None, + parent_file=None): + super(ModflowGwfuzf, self).__init__(model, "uzf", filename, pname, + loading_package, parent_file) + + # set up variables + self.auxiliary = self.build_mfdata("auxiliary", auxiliary) + self.auxmultname = self.build_mfdata("auxmultname", auxmultname) + self.boundnames = self.build_mfdata("boundnames", boundnames) + self.print_input = self.build_mfdata("print_input", print_input) + self.print_flows = self.build_mfdata("print_flows", print_flows) + self.save_flows = self.build_mfdata("save_flows", save_flows) + self.budget_filerecord = self.build_mfdata("budget_filerecord", + budget_filerecord) + self._ts_filerecord = self.build_mfdata("ts_filerecord", + None) + self._ts_package = self.build_child_package("ts", timeseries, + "timeseries", + self._ts_filerecord) + self._obs_filerecord = self.build_mfdata("obs_filerecord", + None) + self._obs_package = self.build_child_package("obs", observations, + "continuous", + self._obs_filerecord) + self.mover = self.build_mfdata("mover", mover) + self.simulate_et = self.build_mfdata("simulate_et", simulate_et) + self.linear_gwet = self.build_mfdata("linear_gwet", linear_gwet) + self.square_gwet = self.build_mfdata("square_gwet", square_gwet) + self.simulate_gwseep = self.build_mfdata("simulate_gwseep", + simulate_gwseep) + self.unsat_etwc = self.build_mfdata("unsat_etwc", unsat_etwc) + self.unsat_etae = self.build_mfdata("unsat_etae", unsat_etae) + self.nuzfcells = self.build_mfdata("nuzfcells", nuzfcells) + self.ntrailwaves = self.build_mfdata("ntrailwaves", ntrailwaves) + self.nwavesets = self.build_mfdata("nwavesets", nwavesets) + self.packagedata = self.build_mfdata("packagedata", packagedata) + self.perioddata = self.build_mfdata("perioddata", perioddata) + self._init_complete = True diff --git a/flopy/mf6/modflow/mfgwfwel.py b/flopy/mf6/modflow/mfgwfwel.py index a3be0d3473..db5f2c7564 100644 --- a/flopy/mf6/modflow/mfgwfwel.py +++ b/flopy/mf6/modflow/mfgwfwel.py @@ -1,219 +1,219 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ListTemplateGenerator - - -class ModflowGwfwel(mfpackage.MFPackage): - """ - ModflowGwfwel defines a wel package within a gwf6 model. - - Parameters - ---------- - model : MFModel - Model that this package is a part of. Package is automatically - added to model when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - auxiliary : [string] - * auxiliary (string) defines an array of one or more auxiliary variable - names. There is no limit on the number of auxiliary variables that - can be provided on this line; however, lists of information provided - in subsequent blocks must have a column of data for each auxiliary - variable name defined here. The number of auxiliary variables - detected on this line determines the value for naux. Comments cannot - be provided anywhere on this line as they will be interpreted as - auxiliary variable names. Auxiliary variables may not be used by the - package, but they will be available for use by other parts of the - program. The program will terminate with an error if auxiliary - variables are specified on more than one line in the options block. - auxmultname : string - * auxmultname (string) name of auxiliary variable to be used as - multiplier of well flow rate. - boundnames : boolean - * boundnames (boolean) keyword to indicate that boundary names may be - provided with the list of well cells. - print_input : boolean - * print_input (boolean) keyword to indicate that the list of well - information will be written to the listing file immediately after it - is read. - print_flows : boolean - * print_flows (boolean) keyword to indicate that the list of well flow - rates will be printed to the listing file for every stress period - time step in which "BUDGET PRINT" is specified in Output Control. If - there is no Output Control option and "PRINT_FLOWS" is specified, - then flow rates are printed for the last time step of each stress - period. - save_flows : boolean - * save_flows (boolean) keyword to indicate that well flow terms will be - written to the file specified with "BUDGET FILEOUT" in Output - Control. - auto_flow_reduce : double - * auto_flow_reduce (double) keyword and real value that defines the - fraction of the cell thickness used as an interval for smoothly - adjusting negative pumping rates to 0 in cells with head values less - than or equal to the bottom of the cell. Negative pumping rates are - adjusted to 0 or a smaller negative value when the head in the cell - is equal to or less than the calculated interval above the cell - bottom. AUTO_FLOW_REDUCE is set to 0.1 if the specified value is less - than or equal to zero. By default, negative pumping rates are not - reduced during a simulation. - timeseries : {varname:data} or timeseries data - * Contains data for the ts package. Data can be stored in a dictionary - containing data for the ts package with variable names as keys and - package data as values. Data just for the timeseries variable is also - acceptable. See ts package documentation for more information. - observations : {varname:data} or continuous data - * Contains data for the obs package. Data can be stored in a dictionary - containing data for the obs package with variable names as keys and - package data as values. Data just for the observations variable is - also acceptable. See obs package documentation for more information. - mover : boolean - * mover (boolean) keyword to indicate that this instance of the Well - Package can be used with the Water Mover (MVR) Package. When the - MOVER option is specified, additional memory is allocated within the - package to store the available, provided, and received water. - maxbound : integer - * maxbound (integer) integer value specifying the maximum number of - wells cells that will be specified for use during any stress period. - stress_period_data : [cellid, q, aux, boundname] - * cellid ((integer, ...)) is the cell identifier, and depends on the - type of grid that is used for the simulation. For a structured grid - that uses the DIS input file, CELLID is the layer, row, and column. - For a grid that uses the DISV input file, CELLID is the layer and - CELL2D number. If the model uses the unstructured discretization - (DISU) input file, CELLID is the node number for the cell. - * q (double) is the volumetric well rate. A positive value indicates - recharge (injection) and a negative value indicates discharge - (extraction). If the Options block includes a TIMESERIESFILE entry - (see the "Time-Variable Input" section), values can be obtained from - a time series by entering the time-series name in place of a numeric - value. - * aux (double) represents the values of the auxiliary variables for - each well. The values of auxiliary variables must be present for each - well. The values must be specified in the order of the auxiliary - variables specified in the OPTIONS block. If the package supports - time series and the Options block includes a TIMESERIESFILE entry - (see the "Time-Variable Input" section), values can be obtained from - a time series by entering the time-series name in place of a numeric - value. - * boundname (string) name of the well cell. BOUNDNAME is an ASCII - character variable that can contain as many as 40 characters. If - BOUNDNAME contains spaces in it, then the entire name must be - enclosed within single quotes. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - auxiliary = ListTemplateGenerator(('gwf6', 'wel', 'options', - 'auxiliary')) - ts_filerecord = ListTemplateGenerator(('gwf6', 'wel', 'options', - 'ts_filerecord')) - obs_filerecord = ListTemplateGenerator(('gwf6', 'wel', 'options', - 'obs_filerecord')) - stress_period_data = ListTemplateGenerator(('gwf6', 'wel', 'period', - 'stress_period_data')) - package_abbr = "gwfwel" - _package_type = "wel" - dfn_file_name = "gwf-wel.dfn" - - dfn = [["block options", "name auxiliary", "type string", - "shape (naux)", "reader urword", "optional true"], - ["block options", "name auxmultname", "type string", "shape", - "reader urword", "optional true"], - ["block options", "name boundnames", "type keyword", "shape", - "reader urword", "optional true"], - ["block options", "name print_input", "type keyword", - "reader urword", "optional true"], - ["block options", "name print_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name save_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name auto_flow_reduce", - "type double precision", "reader urword", "optional true"], - ["block options", "name ts_filerecord", - "type record ts6 filein ts6_filename", "shape", "reader urword", - "tagged true", "optional true", "construct_package ts", - "construct_data timeseries", "parameter_name timeseries"], - ["block options", "name ts6", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name filein", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name ts6_filename", "type string", - "preserve_case true", "in_record true", "reader urword", - "optional false", "tagged false"], - ["block options", "name obs_filerecord", - "type record obs6 filein obs6_filename", "shape", "reader urword", - "tagged true", "optional true", "construct_package obs", - "construct_data continuous", "parameter_name observations"], - ["block options", "name obs6", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name obs6_filename", "type string", - "preserve_case true", "in_record true", "tagged false", - "reader urword", "optional false"], - ["block options", "name mover", "type keyword", "tagged true", - "reader urword", "optional true"], - ["block dimensions", "name maxbound", "type integer", - "reader urword", "optional false"], - ["block period", "name iper", "type integer", - "block_variable True", "in_record true", "tagged false", "shape", - "valid", "reader urword", "optional false"], - ["block period", "name stress_period_data", - "type recarray cellid q aux boundname", "shape (maxbound)", - "reader urword"], - ["block period", "name cellid", "type integer", - "shape (ncelldim)", "tagged false", "in_record true", - "reader urword"], - ["block period", "name q", "type double precision", "shape", - "tagged false", "in_record true", "reader urword", - "time_series true"], - ["block period", "name aux", "type double precision", - "in_record true", "tagged false", "shape (naux)", "reader urword", - "optional true", "time_series true"], - ["block period", "name boundname", "type string", "shape", - "tagged false", "in_record true", "reader urword", - "optional true"]] - - def __init__(self, model, loading_package=False, auxiliary=None, - auxmultname=None, boundnames=None, print_input=None, - print_flows=None, save_flows=None, auto_flow_reduce=None, - timeseries=None, observations=None, mover=None, maxbound=None, - stress_period_data=None, filename=None, pname=None, - parent_file=None): - super(ModflowGwfwel, self).__init__(model, "wel", filename, pname, - loading_package, parent_file) - - # set up variables - self.auxiliary = self.build_mfdata("auxiliary", auxiliary) - self.auxmultname = self.build_mfdata("auxmultname", auxmultname) - self.boundnames = self.build_mfdata("boundnames", boundnames) - self.print_input = self.build_mfdata("print_input", print_input) - self.print_flows = self.build_mfdata("print_flows", print_flows) - self.save_flows = self.build_mfdata("save_flows", save_flows) - self.auto_flow_reduce = self.build_mfdata("auto_flow_reduce", - auto_flow_reduce) - self._ts_filerecord = self.build_mfdata("ts_filerecord", - None) - self._ts_package = self.build_child_package("ts", timeseries, - "timeseries", - self._ts_filerecord) - self._obs_filerecord = self.build_mfdata("obs_filerecord", - None) - self._obs_package = self.build_child_package("obs", observations, - "continuous", - self._obs_filerecord) - self.mover = self.build_mfdata("mover", mover) - self.maxbound = self.build_mfdata("maxbound", maxbound) - self.stress_period_data = self.build_mfdata("stress_period_data", - stress_period_data) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ListTemplateGenerator + + +class ModflowGwfwel(mfpackage.MFPackage): + """ + ModflowGwfwel defines a wel package within a gwf6 model. + + Parameters + ---------- + model : MFModel + Model that this package is a part of. Package is automatically + added to model when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + auxiliary : [string] + * auxiliary (string) defines an array of one or more auxiliary variable + names. There is no limit on the number of auxiliary variables that + can be provided on this line; however, lists of information provided + in subsequent blocks must have a column of data for each auxiliary + variable name defined here. The number of auxiliary variables + detected on this line determines the value for naux. Comments cannot + be provided anywhere on this line as they will be interpreted as + auxiliary variable names. Auxiliary variables may not be used by the + package, but they will be available for use by other parts of the + program. The program will terminate with an error if auxiliary + variables are specified on more than one line in the options block. + auxmultname : string + * auxmultname (string) name of auxiliary variable to be used as + multiplier of well flow rate. + boundnames : boolean + * boundnames (boolean) keyword to indicate that boundary names may be + provided with the list of well cells. + print_input : boolean + * print_input (boolean) keyword to indicate that the list of well + information will be written to the listing file immediately after it + is read. + print_flows : boolean + * print_flows (boolean) keyword to indicate that the list of well flow + rates will be printed to the listing file for every stress period + time step in which "BUDGET PRINT" is specified in Output Control. If + there is no Output Control option and "PRINT_FLOWS" is specified, + then flow rates are printed for the last time step of each stress + period. + save_flows : boolean + * save_flows (boolean) keyword to indicate that well flow terms will be + written to the file specified with "BUDGET FILEOUT" in Output + Control. + auto_flow_reduce : double + * auto_flow_reduce (double) keyword and real value that defines the + fraction of the cell thickness used as an interval for smoothly + adjusting negative pumping rates to 0 in cells with head values less + than or equal to the bottom of the cell. Negative pumping rates are + adjusted to 0 or a smaller negative value when the head in the cell + is equal to or less than the calculated interval above the cell + bottom. AUTO_FLOW_REDUCE is set to 0.1 if the specified value is less + than or equal to zero. By default, negative pumping rates are not + reduced during a simulation. + timeseries : {varname:data} or timeseries data + * Contains data for the ts package. Data can be stored in a dictionary + containing data for the ts package with variable names as keys and + package data as values. Data just for the timeseries variable is also + acceptable. See ts package documentation for more information. + observations : {varname:data} or continuous data + * Contains data for the obs package. Data can be stored in a dictionary + containing data for the obs package with variable names as keys and + package data as values. Data just for the observations variable is + also acceptable. See obs package documentation for more information. + mover : boolean + * mover (boolean) keyword to indicate that this instance of the Well + Package can be used with the Water Mover (MVR) Package. When the + MOVER option is specified, additional memory is allocated within the + package to store the available, provided, and received water. + maxbound : integer + * maxbound (integer) integer value specifying the maximum number of + wells cells that will be specified for use during any stress period. + stress_period_data : [cellid, q, aux, boundname] + * cellid ((integer, ...)) is the cell identifier, and depends on the + type of grid that is used for the simulation. For a structured grid + that uses the DIS input file, CELLID is the layer, row, and column. + For a grid that uses the DISV input file, CELLID is the layer and + CELL2D number. If the model uses the unstructured discretization + (DISU) input file, CELLID is the node number for the cell. + * q (double) is the volumetric well rate. A positive value indicates + recharge (injection) and a negative value indicates discharge + (extraction). If the Options block includes a TIMESERIESFILE entry + (see the "Time-Variable Input" section), values can be obtained from + a time series by entering the time-series name in place of a numeric + value. + * aux (double) represents the values of the auxiliary variables for + each well. The values of auxiliary variables must be present for each + well. The values must be specified in the order of the auxiliary + variables specified in the OPTIONS block. If the package supports + time series and the Options block includes a TIMESERIESFILE entry + (see the "Time-Variable Input" section), values can be obtained from + a time series by entering the time-series name in place of a numeric + value. + * boundname (string) name of the well cell. BOUNDNAME is an ASCII + character variable that can contain as many as 40 characters. If + BOUNDNAME contains spaces in it, then the entire name must be + enclosed within single quotes. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + auxiliary = ListTemplateGenerator(('gwf6', 'wel', 'options', + 'auxiliary')) + ts_filerecord = ListTemplateGenerator(('gwf6', 'wel', 'options', + 'ts_filerecord')) + obs_filerecord = ListTemplateGenerator(('gwf6', 'wel', 'options', + 'obs_filerecord')) + stress_period_data = ListTemplateGenerator(('gwf6', 'wel', 'period', + 'stress_period_data')) + package_abbr = "gwfwel" + _package_type = "wel" + dfn_file_name = "gwf-wel.dfn" + + dfn = [["block options", "name auxiliary", "type string", + "shape (naux)", "reader urword", "optional true"], + ["block options", "name auxmultname", "type string", "shape", + "reader urword", "optional true"], + ["block options", "name boundnames", "type keyword", "shape", + "reader urword", "optional true"], + ["block options", "name print_input", "type keyword", + "reader urword", "optional true"], + ["block options", "name print_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name save_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name auto_flow_reduce", + "type double precision", "reader urword", "optional true"], + ["block options", "name ts_filerecord", + "type record ts6 filein ts6_filename", "shape", "reader urword", + "tagged true", "optional true", "construct_package ts", + "construct_data timeseries", "parameter_name timeseries"], + ["block options", "name ts6", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name filein", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name ts6_filename", "type string", + "preserve_case true", "in_record true", "reader urword", + "optional false", "tagged false"], + ["block options", "name obs_filerecord", + "type record obs6 filein obs6_filename", "shape", "reader urword", + "tagged true", "optional true", "construct_package obs", + "construct_data continuous", "parameter_name observations"], + ["block options", "name obs6", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name obs6_filename", "type string", + "preserve_case true", "in_record true", "tagged false", + "reader urword", "optional false"], + ["block options", "name mover", "type keyword", "tagged true", + "reader urword", "optional true"], + ["block dimensions", "name maxbound", "type integer", + "reader urword", "optional false"], + ["block period", "name iper", "type integer", + "block_variable True", "in_record true", "tagged false", "shape", + "valid", "reader urword", "optional false"], + ["block period", "name stress_period_data", + "type recarray cellid q aux boundname", "shape (maxbound)", + "reader urword"], + ["block period", "name cellid", "type integer", + "shape (ncelldim)", "tagged false", "in_record true", + "reader urword"], + ["block period", "name q", "type double precision", "shape", + "tagged false", "in_record true", "reader urword", + "time_series true"], + ["block period", "name aux", "type double precision", + "in_record true", "tagged false", "shape (naux)", "reader urword", + "optional true", "time_series true"], + ["block period", "name boundname", "type string", "shape", + "tagged false", "in_record true", "reader urword", + "optional true"]] + + def __init__(self, model, loading_package=False, auxiliary=None, + auxmultname=None, boundnames=None, print_input=None, + print_flows=None, save_flows=None, auto_flow_reduce=None, + timeseries=None, observations=None, mover=None, maxbound=None, + stress_period_data=None, filename=None, pname=None, + parent_file=None): + super(ModflowGwfwel, self).__init__(model, "wel", filename, pname, + loading_package, parent_file) + + # set up variables + self.auxiliary = self.build_mfdata("auxiliary", auxiliary) + self.auxmultname = self.build_mfdata("auxmultname", auxmultname) + self.boundnames = self.build_mfdata("boundnames", boundnames) + self.print_input = self.build_mfdata("print_input", print_input) + self.print_flows = self.build_mfdata("print_flows", print_flows) + self.save_flows = self.build_mfdata("save_flows", save_flows) + self.auto_flow_reduce = self.build_mfdata("auto_flow_reduce", + auto_flow_reduce) + self._ts_filerecord = self.build_mfdata("ts_filerecord", + None) + self._ts_package = self.build_child_package("ts", timeseries, + "timeseries", + self._ts_filerecord) + self._obs_filerecord = self.build_mfdata("obs_filerecord", + None) + self._obs_package = self.build_child_package("obs", observations, + "continuous", + self._obs_filerecord) + self.mover = self.build_mfdata("mover", mover) + self.maxbound = self.build_mfdata("maxbound", maxbound) + self.stress_period_data = self.build_mfdata("stress_period_data", + stress_period_data) + self._init_complete = True diff --git a/flopy/mf6/modflow/mfims.py b/flopy/mf6/modflow/mfims.py index 7d8d3ce314..19d7f9c4c3 100644 --- a/flopy/mf6/modflow/mfims.py +++ b/flopy/mf6/modflow/mfims.py @@ -1,429 +1,429 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ListTemplateGenerator - - -class ModflowIms(mfpackage.MFPackage): - """ - ModflowIms defines a ims package. - - Parameters - ---------- - simulation : MFSimulation - Simulation that this package is a part of. Package is automatically - added to simulation when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - print_option : string - * print_option (string) is a flag that controls printing of convergence - information from the solver. NONE means print nothing. SUMMARY means - print only the total number of iterations and nonlinear residual - reduction summaries. ALL means print linear matrix solver convergence - information to the solution listing file and model specific linear - matrix solver convergence information to each model listing file in - addition to SUMMARY information. NONE is default if PRINT_OPTION is - not specified. - complexity : string - * complexity (string) is an optional keyword that defines default non- - linear and linear solver parameters. SIMPLE - indicates that default - solver input values will be defined that work well for nearly linear - models. This would be used for models that do not include nonlinear - stress packages and models that are either confined or consist of a - single unconfined layer that is thick enough to contain the water - table within a single layer. MODERATE - indicates that default solver - input values will be defined that work well for moderately nonlinear - models. This would be used for models that include nonlinear stress - packages and models that consist of one or more unconfined layers. - The MODERATE option should be used when the SIMPLE option does not - result in successful convergence. COMPLEX - indicates that default - solver input values will be defined that work well for highly - nonlinear models. This would be used for models that include - nonlinear stress packages and models that consist of one or more - unconfined layers representing complex geology and surface- - water/groundwater interaction. The COMPLEX option should be used when - the MODERATE option does not result in successful convergence. Non- - linear and linear solver parameters assigned using a specified - complexity can be modified in the NONLINEAR and LINEAR blocks. If the - COMPLEXITY option is not specified, NONLINEAR and LINEAR variables - will be assigned the simple complexity values. - csv_output_filerecord : [csvfile] - * csvfile (string) name of the ascii comma separated values output file - to write solver convergence information. If PRINT_OPTION is NONE or - SUMMARY, comma separated values output includes maximum head change - convergence information at the end of each outer iteration for each - time step. If PRINT_OPTION is ALL, comma separated values output - includes maximum head change and maximum residual convergence - information for the solution and each model (if the solution includes - more than one model) and linear acceleration information for each - inner iteration. - no_ptc : boolean - * no_ptc (boolean) is a flag that is used to disable pseudo-transient - continuation (PTC). Option only applies to steady-state stress - periods for models using the Newton-Raphson formulation. For many - problems, PTC can significantly improve convergence behavior for - steady-state simulations, and for this reason it is active by - default. In some cases, however, PTC can worsen the convergence - behavior, especially when the initial conditions are similar to the - solution. When the initial conditions are similar to, or exactly the - same as, the solution and convergence is slow, then this NO_PTC - option should be used to deactivate PTC. This NO_PTC option should - also be used in order to compare convergence behavior with other - MODFLOW versions, as PTC is only available in MODFLOW 6. - outer_hclose : double - * outer_hclose (double) real value defining the head change criterion - for convergence of the outer (nonlinear) iterations, in units of - length. When the maximum absolute value of the head change at all - nodes during an iteration is less than or equal to OUTER_HCLOSE, - iteration stops. Commonly, OUTER_HCLOSE equals 0.01. - outer_rclosebnd : double - * outer_rclosebnd (double) real value defining the residual tolerance - for convergence of model packages that solve a separate equation not - solved by the IMS linear solver. This value represents the maximum - allowable residual between successive outer iterations at any single - model package element. An example of a model package that would use - OUTER_RCLOSEBND to evaluate convergence is the SFR package which - solves a continuity equation for each reach. - outer_maximum : integer - * outer_maximum (integer) integer value defining the maximum number of - outer (nonlinear) iterations -- that is, calls to the solution - routine. For a linear problem OUTER_MAXIMUM should be 1. - under_relaxation : string - * under_relaxation (string) is an optional keyword that defines the - nonlinear under-relaxation schemes used. By default under-relaxation - is not used. NONE - under-relaxation is not used. SIMPLE - Simple - under-relaxation scheme with a fixed relaxation factor is used. - COOLEY - Cooley under-relaxation scheme is used. DBD - delta-bar- - delta under-relaxation is used. Note that the under-relaxation - schemes are used in conjunction with problems that use the Newton- - Raphson formulation, however, experience has indicated that the - Cooley under-relaxation and damping work well also for the Picard - scheme with the wet/dry options of MODFLOW 6. - under_relaxation_theta : double - * under_relaxation_theta (double) real value defining the reduction - factor for the learning rate (under-relaxation term) of the delta- - bar-delta algorithm. The value of UNDER_RELAXATION_THETA is between - zero and one. If the change in the variable (head) is of opposite - sign to that of the previous iteration, the under-relaxation term is - reduced by a factor of UNDER_RELAXATION_THETA. The value usually - ranges from 0.3 to 0.9; a value of 0.7 works well for most problems. - UNDER_RELAXATION_THETA only needs to be specified if UNDER_RELAXATION - is DBD. - under_relaxation_kappa : double - * under_relaxation_kappa (double) real value defining the increment for - the learning rate (under-relaxation term) of the delta-bar-delta - algorithm. The value of UNDER_RELAXATION_kappa is between zero and - one. If the change in the variable (head) is of the same sign to that - of the previous iteration, the under-relaxation term is increased by - an increment of UNDER_RELAXATION_KAPPA. The value usually ranges from - 0.03 to 0.3; a value of 0.1 works well for most problems. - UNDER_RELAXATION_KAPPA only needs to be specified if UNDER_RELAXATION - is DBD. - under_relaxation_gamma : double - * under_relaxation_gamma (double) real value defining the history or - memory term factor of the delta-bar-delta algorithm. - UNDER_RELAXATION_GAMMA is between zero and 1 but cannot be equal to - one. When UNDER_RELAXATION_GAMMA is zero, only the most recent - history (previous iteration value) is maintained. As - UNDER_RELAXATION_GAMMA is increased, past history of iteration - changes has greater influence on the memory term. The memory term is - maintained as an exponential average of past changes. Retaining some - past history can overcome granular behavior in the calculated - function surface and therefore helps to overcome cyclic patterns of - non-convergence. The value usually ranges from 0.1 to 0.3; a value of - 0.2 works well for most problems. UNDER_RELAXATION_GAMMA only needs - to be specified if UNDER_RELAXATION is not NONE. - under_relaxation_momentum : double - * under_relaxation_momentum (double) real value defining the fraction - of past history changes that is added as a momentum term to the step - change for a nonlinear iteration. The value of - UNDER_RELAXATION_MOMENTUM is between zero and one. A large momentum - term should only be used when small learning rates are expected. - Small amounts of the momentum term help convergence. The value - usually ranges from 0.0001 to 0.1; a value of 0.001 works well for - most problems. UNDER_RELAXATION_MOMENTUM only needs to be specified - if UNDER_RELAXATION is DBD. - backtracking_number : integer - * backtracking_number (integer) integer value defining the maximum - number of backtracking iterations allowed for residual reduction - computations. If BACKTRACKING_NUMBER = 0 then the backtracking - iterations are omitted. The value usually ranges from 2 to 20; a - value of 10 works well for most problems. - backtracking_tolerance : double - * backtracking_tolerance (double) real value defining the tolerance for - residual change that is allowed for residual reduction computations. - BACKTRACKING_TOLERANCE should not be less than one to avoid getting - stuck in local minima. A large value serves to check for extreme - residual increases, while a low value serves to control step size - more severely. The value usually ranges from 1.0 to 10:math:`^6`; a - value of 10:math:`^4` works well for most problems but lower values - like 1.1 may be required for harder problems. BACKTRACKING\_TOLERANCE - only needs to be specified if BACKTRACKING\_NUMBER is greater than - zero. - backtracking_reduction_factor : double - * backtracking_reduction_factor (double) real value defining the - reduction in step size used for residual reduction computations. The - value of BACKTRACKING_REDUCTION_FACTOR is between zero and one. The - value usually ranges from 0.1 to 0.3; a value of 0.2 works well for - most problems. BACKTRACKING_REDUCTION_FACTOR only needs to be - specified if BACKTRACKING_NUMBER is greater than zero. - backtracking_residual_limit : double - * backtracking_residual_limit (double) real value defining the limit to - which the residual is reduced with backtracking. If the residual is - smaller than BACKTRACKING_RESIDUAL_LIMIT, then further backtracking - is not performed. A value of 100 is suitable for large problems and - residual reduction to smaller values may only slow down computations. - BACKTRACKING_RESIDUAL_LIMIT only needs to be specified if - BACKTRACKING_NUMBER is greater than zero. - inner_maximum : integer - * inner_maximum (integer) integer value defining the maximum number of - inner (linear) iterations. The number typically depends on the - characteristics of the matrix solution scheme being used. For - nonlinear problems, INNER_MAXIMUM usually ranges from 60 to 600; a - value of 100 will be sufficient for most linear problems. - inner_hclose : double - * inner_hclose (double) real value defining the head change criterion - for convergence of the inner (linear) iterations, in units of length. - When the maximum absolute value of the head change at all nodes - during an iteration is less than or equal to INNER_HCLOSE, the matrix - solver assumes convergence. Commonly, INNER_HCLOSE is set an order of - magnitude less than the OUTER_HCLOSE value specified for the - NONLINEAR block. - rcloserecord : [inner_rclose, rclose_option] - * inner_rclose (double) real value that defines the flow residual - tolerance for convergence of the IMS linear solver and specific flow - residual criteria used. This value represents the maximum allowable - residual at any single node. Value is in units of length cubed per - time, and must be consistent with mf length and time units. Usually a - value of :math:`1.0 \\times 10^{-1}` is sufficient for the flow- - residual criteria when meters and seconds are the defined \mf length - and time. - * rclose_option (string) an optional keyword that defines the specific - flow residual criterion used. STRICT--an optional keyword that is - used to specify that INNER_RCLOSE represents a infinity-Norm - (absolute convergence criteria) and that the head and flow - convergence criteria must be met on the first inner iteration (this - criteria is equivalent to the criteria used by the MODFLOW-2005 PCG - package~citep{hill1990preconditioned}). L2NORM_RCLOSE--an optional - keyword that is used to specify that INNER_RCLOSE represents a L-2 - Norm closure criteria instead of a infinity-Norm (absolute - convergence criteria). When L2NORM_RCLOSE is specified, a reasonable - initial INNER_RCLOSE value is 0.1 times the number of active cells - when meters and seconds are the defined mf length and time. - RELATIVE_RCLOSE--an optional keyword that is used to specify that - INNER_RCLOSE represents a relative L-2 Norm reduction closure - criteria instead of a infinity-Norm (absolute convergence criteria). - When RELATIVE_RCLOSE is specified, a reasonable initial INNER_RCLOSE - value is :math:`1.0 \\times 10^{-4}` and convergence is achieved for - a given inner (linear) iteration when :math:`\\Delta h \\le` - INNER_HCLOSE and the current L-2 Norm is :math:`\\le` the product of - the RELATIVE\_RCLOSE and the initial L-2 Norm for the current inner - (linear) iteration. If RCLOSE\_OPTION is not specified, an absolute - residual (infinity-norm) criterion is used. - linear_acceleration : string - * linear_acceleration (string) a keyword that defines the linear - acceleration method used by the default IMS linear solvers. CG - - preconditioned conjugate gradient method. BICGSTAB - preconditioned - bi-conjugate gradient stabilized method. - relaxation_factor : double - * relaxation_factor (double) optional real value that defines the - relaxation factor used by the incomplete LU factorization - preconditioners (MILU(0) and MILUT). RELAXATION_FACTOR is unitless - and should be greater than or equal to 0.0 and less than or equal to - 1.0. RELAXATION_FACTOR values of about 1.0 are commonly used, and - experience suggests that convergence can be optimized in some cases - with relax values of 0.97. A RELAXATION_FACTOR value of 0.0 will - result in either ILU(0) or ILUT preconditioning (depending on the - value specified for PRECONDITIONER_LEVELS and/or - PRECONDITIONER_DROP_TOLERANCE). By default, RELAXATION_FACTOR is - zero. - preconditioner_levels : integer - * preconditioner_levels (integer) optional integer value defining the - level of fill for ILU decomposition used in the ILUT and MILUT - preconditioners. Higher levels of fill provide more robustness but - also require more memory. For optimal performance, it is suggested - that a large level of fill be applied (7 or 8) with use of a drop - tolerance. Specification of a PRECONDITIONER_LEVELS value greater - than zero results in use of the ILUT preconditioner. By default, - PRECONDITIONER_LEVELS is zero and the zero-fill incomplete LU - factorization preconditioners (ILU(0) and MILU(0)) are used. - preconditioner_drop_tolerance : double - * preconditioner_drop_tolerance (double) optional real value that - defines the drop tolerance used to drop preconditioner terms based on - the magnitude of matrix entries in the ILUT and MILUT - preconditioners. A value of :math:`10^{-4}` works well for most - problems. By default, PRECONDITIONER\_DROP\_TOLERANCE is zero and the - zero-fill incomplete LU factorization preconditioners (ILU(0) and - MILU(0)) are used. - number_orthogonalizations : integer - * number_orthogonalizations (integer) optional integer value defining - the interval used to explicitly recalculate the residual of the flow - equation using the solver coefficient matrix, the latest head - estimates, and the right hand side. For problems that benefit from - explicit recalculation of the residual, a number between 4 and 10 is - appropriate. By default, NUMBER_ORTHOGONALIZATIONS is zero. - scaling_method : string - * scaling_method (string) an optional keyword that defines the matrix - scaling approach used. By default, matrix scaling is not applied. - NONE - no matrix scaling applied. DIAGONAL - symmetric matrix scaling - using the POLCG preconditioner scaling method in Hill (1992). L2NORM - - symmetric matrix scaling using the L2 norm. - reordering_method : string - * reordering_method (string) an optional keyword that defines the - matrix reordering approach used. By default, matrix reordering is not - applied. NONE - original ordering. RCM - reverse Cuthill McKee - ordering. MD - minimum degree ordering. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - csv_output_filerecord = ListTemplateGenerator(('ims', 'options', - 'csv_output_filerecord')) - rcloserecord = ListTemplateGenerator(('ims', 'linear', - 'rcloserecord')) - package_abbr = "ims" - _package_type = "ims" - dfn_file_name = "sln-ims.dfn" - - dfn = [["block options", "name print_option", "type string", - "reader urword", "optional true"], - ["block options", "name complexity", "type string", - "reader urword", "optional true"], - ["block options", "name csv_output_filerecord", - "type record csv_output fileout csvfile", "shape", - "reader urword", "tagged true", "optional true"], - ["block options", "name csv_output", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name fileout", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name csvfile", "type string", - "preserve_case true", "shape", "in_record true", "reader urword", - "tagged false", "optional false"], - ["block options", "name no_ptc", "type keyword", "reader urword", - "optional true"], - ["block nonlinear", "name outer_hclose", "type double precision", - "reader urword", "optional false"], - ["block nonlinear", "name outer_rclosebnd", - "type double precision", "reader urword", "optional true"], - ["block nonlinear", "name outer_maximum", "type integer", - "reader urword", "optional false"], - ["block nonlinear", "name under_relaxation", "type string", - "reader urword", "optional true"], - ["block nonlinear", "name under_relaxation_theta", - "type double precision", "reader urword", "optional true"], - ["block nonlinear", "name under_relaxation_kappa", - "type double precision", "reader urword", "optional true"], - ["block nonlinear", "name under_relaxation_gamma", - "type double precision", "reader urword", "optional true"], - ["block nonlinear", "name under_relaxation_momentum", - "type double precision", "reader urword", "optional true"], - ["block nonlinear", "name backtracking_number", "type integer", - "reader urword", "optional true"], - ["block nonlinear", "name backtracking_tolerance", - "type double precision", "reader urword", "optional true"], - ["block nonlinear", "name backtracking_reduction_factor", - "type double precision", "reader urword", "optional true"], - ["block nonlinear", "name backtracking_residual_limit", - "type double precision", "reader urword", "optional true"], - ["block linear", "name inner_maximum", "type integer", - "reader urword", "optional false"], - ["block linear", "name inner_hclose", "type double precision", - "reader urword", "optional false"], - ["block linear", "name rcloserecord", - "type record inner_rclose rclose_option", "reader urword", - "optional false"], - ["block linear", "name inner_rclose", "type double precision", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block linear", "name rclose_option", "type string", - "tagged false", "in_record true", "reader urword", - "optional true"], - ["block linear", "name linear_acceleration", "type string", - "reader urword", "optional false"], - ["block linear", "name relaxation_factor", - "type double precision", "reader urword", "optional true"], - ["block linear", "name preconditioner_levels", "type integer", - "reader urword", "optional true"], - ["block linear", "name preconditioner_drop_tolerance", - "type double precision", "reader urword", "optional true"], - ["block linear", "name number_orthogonalizations", - "type integer", "reader urword", "optional true"], - ["block linear", "name scaling_method", "type string", - "reader urword", "optional true"], - ["block linear", "name reordering_method", "type string", - "reader urword", "optional true"]] - - def __init__(self, simulation, loading_package=False, print_option=None, - complexity=None, csv_output_filerecord=None, no_ptc=None, - outer_hclose=None, outer_rclosebnd=None, outer_maximum=None, - under_relaxation=None, under_relaxation_theta=None, - under_relaxation_kappa=None, under_relaxation_gamma=None, - under_relaxation_momentum=None, backtracking_number=None, - backtracking_tolerance=None, - backtracking_reduction_factor=None, - backtracking_residual_limit=None, inner_maximum=None, - inner_hclose=None, rcloserecord=None, - linear_acceleration=None, relaxation_factor=None, - preconditioner_levels=None, - preconditioner_drop_tolerance=None, - number_orthogonalizations=None, scaling_method=None, - reordering_method=None, filename=None, pname=None, - parent_file=None): - super(ModflowIms, self).__init__(simulation, "ims", filename, pname, - loading_package, parent_file) - - # set up variables - self.print_option = self.build_mfdata("print_option", print_option) - self.complexity = self.build_mfdata("complexity", complexity) - self.csv_output_filerecord = self.build_mfdata("csv_output_filerecord", - csv_output_filerecord) - self.no_ptc = self.build_mfdata("no_ptc", no_ptc) - self.outer_hclose = self.build_mfdata("outer_hclose", outer_hclose) - self.outer_rclosebnd = self.build_mfdata("outer_rclosebnd", - outer_rclosebnd) - self.outer_maximum = self.build_mfdata("outer_maximum", outer_maximum) - self.under_relaxation = self.build_mfdata("under_relaxation", - under_relaxation) - self.under_relaxation_theta = self.build_mfdata( - "under_relaxation_theta", under_relaxation_theta) - self.under_relaxation_kappa = self.build_mfdata( - "under_relaxation_kappa", under_relaxation_kappa) - self.under_relaxation_gamma = self.build_mfdata( - "under_relaxation_gamma", under_relaxation_gamma) - self.under_relaxation_momentum = self.build_mfdata( - "under_relaxation_momentum", under_relaxation_momentum) - self.backtracking_number = self.build_mfdata("backtracking_number", - backtracking_number) - self.backtracking_tolerance = self.build_mfdata( - "backtracking_tolerance", backtracking_tolerance) - self.backtracking_reduction_factor = self.build_mfdata( - "backtracking_reduction_factor", backtracking_reduction_factor) - self.backtracking_residual_limit = self.build_mfdata( - "backtracking_residual_limit", backtracking_residual_limit) - self.inner_maximum = self.build_mfdata("inner_maximum", inner_maximum) - self.inner_hclose = self.build_mfdata("inner_hclose", inner_hclose) - self.rcloserecord = self.build_mfdata("rcloserecord", rcloserecord) - self.linear_acceleration = self.build_mfdata("linear_acceleration", - linear_acceleration) - self.relaxation_factor = self.build_mfdata("relaxation_factor", - relaxation_factor) - self.preconditioner_levels = self.build_mfdata("preconditioner_levels", - preconditioner_levels) - self.preconditioner_drop_tolerance = self.build_mfdata( - "preconditioner_drop_tolerance", preconditioner_drop_tolerance) - self.number_orthogonalizations = self.build_mfdata( - "number_orthogonalizations", number_orthogonalizations) - self.scaling_method = self.build_mfdata("scaling_method", - scaling_method) - self.reordering_method = self.build_mfdata("reordering_method", - reordering_method) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ListTemplateGenerator + + +class ModflowIms(mfpackage.MFPackage): + """ + ModflowIms defines a ims package. + + Parameters + ---------- + simulation : MFSimulation + Simulation that this package is a part of. Package is automatically + added to simulation when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + print_option : string + * print_option (string) is a flag that controls printing of convergence + information from the solver. NONE means print nothing. SUMMARY means + print only the total number of iterations and nonlinear residual + reduction summaries. ALL means print linear matrix solver convergence + information to the solution listing file and model specific linear + matrix solver convergence information to each model listing file in + addition to SUMMARY information. NONE is default if PRINT_OPTION is + not specified. + complexity : string + * complexity (string) is an optional keyword that defines default non- + linear and linear solver parameters. SIMPLE - indicates that default + solver input values will be defined that work well for nearly linear + models. This would be used for models that do not include nonlinear + stress packages and models that are either confined or consist of a + single unconfined layer that is thick enough to contain the water + table within a single layer. MODERATE - indicates that default solver + input values will be defined that work well for moderately nonlinear + models. This would be used for models that include nonlinear stress + packages and models that consist of one or more unconfined layers. + The MODERATE option should be used when the SIMPLE option does not + result in successful convergence. COMPLEX - indicates that default + solver input values will be defined that work well for highly + nonlinear models. This would be used for models that include + nonlinear stress packages and models that consist of one or more + unconfined layers representing complex geology and surface- + water/groundwater interaction. The COMPLEX option should be used when + the MODERATE option does not result in successful convergence. Non- + linear and linear solver parameters assigned using a specified + complexity can be modified in the NONLINEAR and LINEAR blocks. If the + COMPLEXITY option is not specified, NONLINEAR and LINEAR variables + will be assigned the simple complexity values. + csv_output_filerecord : [csvfile] + * csvfile (string) name of the ascii comma separated values output file + to write solver convergence information. If PRINT_OPTION is NONE or + SUMMARY, comma separated values output includes maximum head change + convergence information at the end of each outer iteration for each + time step. If PRINT_OPTION is ALL, comma separated values output + includes maximum head change and maximum residual convergence + information for the solution and each model (if the solution includes + more than one model) and linear acceleration information for each + inner iteration. + no_ptc : boolean + * no_ptc (boolean) is a flag that is used to disable pseudo-transient + continuation (PTC). Option only applies to steady-state stress + periods for models using the Newton-Raphson formulation. For many + problems, PTC can significantly improve convergence behavior for + steady-state simulations, and for this reason it is active by + default. In some cases, however, PTC can worsen the convergence + behavior, especially when the initial conditions are similar to the + solution. When the initial conditions are similar to, or exactly the + same as, the solution and convergence is slow, then this NO_PTC + option should be used to deactivate PTC. This NO_PTC option should + also be used in order to compare convergence behavior with other + MODFLOW versions, as PTC is only available in MODFLOW 6. + outer_hclose : double + * outer_hclose (double) real value defining the head change criterion + for convergence of the outer (nonlinear) iterations, in units of + length. When the maximum absolute value of the head change at all + nodes during an iteration is less than or equal to OUTER_HCLOSE, + iteration stops. Commonly, OUTER_HCLOSE equals 0.01. + outer_rclosebnd : double + * outer_rclosebnd (double) real value defining the residual tolerance + for convergence of model packages that solve a separate equation not + solved by the IMS linear solver. This value represents the maximum + allowable residual between successive outer iterations at any single + model package element. An example of a model package that would use + OUTER_RCLOSEBND to evaluate convergence is the SFR package which + solves a continuity equation for each reach. + outer_maximum : integer + * outer_maximum (integer) integer value defining the maximum number of + outer (nonlinear) iterations -- that is, calls to the solution + routine. For a linear problem OUTER_MAXIMUM should be 1. + under_relaxation : string + * under_relaxation (string) is an optional keyword that defines the + nonlinear under-relaxation schemes used. By default under-relaxation + is not used. NONE - under-relaxation is not used. SIMPLE - Simple + under-relaxation scheme with a fixed relaxation factor is used. + COOLEY - Cooley under-relaxation scheme is used. DBD - delta-bar- + delta under-relaxation is used. Note that the under-relaxation + schemes are used in conjunction with problems that use the Newton- + Raphson formulation, however, experience has indicated that the + Cooley under-relaxation and damping work well also for the Picard + scheme with the wet/dry options of MODFLOW 6. + under_relaxation_theta : double + * under_relaxation_theta (double) real value defining the reduction + factor for the learning rate (under-relaxation term) of the delta- + bar-delta algorithm. The value of UNDER_RELAXATION_THETA is between + zero and one. If the change in the variable (head) is of opposite + sign to that of the previous iteration, the under-relaxation term is + reduced by a factor of UNDER_RELAXATION_THETA. The value usually + ranges from 0.3 to 0.9; a value of 0.7 works well for most problems. + UNDER_RELAXATION_THETA only needs to be specified if UNDER_RELAXATION + is DBD. + under_relaxation_kappa : double + * under_relaxation_kappa (double) real value defining the increment for + the learning rate (under-relaxation term) of the delta-bar-delta + algorithm. The value of UNDER_RELAXATION_kappa is between zero and + one. If the change in the variable (head) is of the same sign to that + of the previous iteration, the under-relaxation term is increased by + an increment of UNDER_RELAXATION_KAPPA. The value usually ranges from + 0.03 to 0.3; a value of 0.1 works well for most problems. + UNDER_RELAXATION_KAPPA only needs to be specified if UNDER_RELAXATION + is DBD. + under_relaxation_gamma : double + * under_relaxation_gamma (double) real value defining the history or + memory term factor of the delta-bar-delta algorithm. + UNDER_RELAXATION_GAMMA is between zero and 1 but cannot be equal to + one. When UNDER_RELAXATION_GAMMA is zero, only the most recent + history (previous iteration value) is maintained. As + UNDER_RELAXATION_GAMMA is increased, past history of iteration + changes has greater influence on the memory term. The memory term is + maintained as an exponential average of past changes. Retaining some + past history can overcome granular behavior in the calculated + function surface and therefore helps to overcome cyclic patterns of + non-convergence. The value usually ranges from 0.1 to 0.3; a value of + 0.2 works well for most problems. UNDER_RELAXATION_GAMMA only needs + to be specified if UNDER_RELAXATION is not NONE. + under_relaxation_momentum : double + * under_relaxation_momentum (double) real value defining the fraction + of past history changes that is added as a momentum term to the step + change for a nonlinear iteration. The value of + UNDER_RELAXATION_MOMENTUM is between zero and one. A large momentum + term should only be used when small learning rates are expected. + Small amounts of the momentum term help convergence. The value + usually ranges from 0.0001 to 0.1; a value of 0.001 works well for + most problems. UNDER_RELAXATION_MOMENTUM only needs to be specified + if UNDER_RELAXATION is DBD. + backtracking_number : integer + * backtracking_number (integer) integer value defining the maximum + number of backtracking iterations allowed for residual reduction + computations. If BACKTRACKING_NUMBER = 0 then the backtracking + iterations are omitted. The value usually ranges from 2 to 20; a + value of 10 works well for most problems. + backtracking_tolerance : double + * backtracking_tolerance (double) real value defining the tolerance for + residual change that is allowed for residual reduction computations. + BACKTRACKING_TOLERANCE should not be less than one to avoid getting + stuck in local minima. A large value serves to check for extreme + residual increases, while a low value serves to control step size + more severely. The value usually ranges from 1.0 to 10:math:`^6`; a + value of 10:math:`^4` works well for most problems but lower values + like 1.1 may be required for harder problems. BACKTRACKING\_TOLERANCE + only needs to be specified if BACKTRACKING\_NUMBER is greater than + zero. + backtracking_reduction_factor : double + * backtracking_reduction_factor (double) real value defining the + reduction in step size used for residual reduction computations. The + value of BACKTRACKING_REDUCTION_FACTOR is between zero and one. The + value usually ranges from 0.1 to 0.3; a value of 0.2 works well for + most problems. BACKTRACKING_REDUCTION_FACTOR only needs to be + specified if BACKTRACKING_NUMBER is greater than zero. + backtracking_residual_limit : double + * backtracking_residual_limit (double) real value defining the limit to + which the residual is reduced with backtracking. If the residual is + smaller than BACKTRACKING_RESIDUAL_LIMIT, then further backtracking + is not performed. A value of 100 is suitable for large problems and + residual reduction to smaller values may only slow down computations. + BACKTRACKING_RESIDUAL_LIMIT only needs to be specified if + BACKTRACKING_NUMBER is greater than zero. + inner_maximum : integer + * inner_maximum (integer) integer value defining the maximum number of + inner (linear) iterations. The number typically depends on the + characteristics of the matrix solution scheme being used. For + nonlinear problems, INNER_MAXIMUM usually ranges from 60 to 600; a + value of 100 will be sufficient for most linear problems. + inner_hclose : double + * inner_hclose (double) real value defining the head change criterion + for convergence of the inner (linear) iterations, in units of length. + When the maximum absolute value of the head change at all nodes + during an iteration is less than or equal to INNER_HCLOSE, the matrix + solver assumes convergence. Commonly, INNER_HCLOSE is set an order of + magnitude less than the OUTER_HCLOSE value specified for the + NONLINEAR block. + rcloserecord : [inner_rclose, rclose_option] + * inner_rclose (double) real value that defines the flow residual + tolerance for convergence of the IMS linear solver and specific flow + residual criteria used. This value represents the maximum allowable + residual at any single node. Value is in units of length cubed per + time, and must be consistent with mf length and time units. Usually a + value of :math:`1.0 \\times 10^{-1}` is sufficient for the flow- + residual criteria when meters and seconds are the defined \mf length + and time. + * rclose_option (string) an optional keyword that defines the specific + flow residual criterion used. STRICT--an optional keyword that is + used to specify that INNER_RCLOSE represents a infinity-Norm + (absolute convergence criteria) and that the head and flow + convergence criteria must be met on the first inner iteration (this + criteria is equivalent to the criteria used by the MODFLOW-2005 PCG + package~citep{hill1990preconditioned}). L2NORM_RCLOSE--an optional + keyword that is used to specify that INNER_RCLOSE represents a L-2 + Norm closure criteria instead of a infinity-Norm (absolute + convergence criteria). When L2NORM_RCLOSE is specified, a reasonable + initial INNER_RCLOSE value is 0.1 times the number of active cells + when meters and seconds are the defined mf length and time. + RELATIVE_RCLOSE--an optional keyword that is used to specify that + INNER_RCLOSE represents a relative L-2 Norm reduction closure + criteria instead of a infinity-Norm (absolute convergence criteria). + When RELATIVE_RCLOSE is specified, a reasonable initial INNER_RCLOSE + value is :math:`1.0 \\times 10^{-4}` and convergence is achieved for + a given inner (linear) iteration when :math:`\\Delta h \\le` + INNER_HCLOSE and the current L-2 Norm is :math:`\\le` the product of + the RELATIVE\_RCLOSE and the initial L-2 Norm for the current inner + (linear) iteration. If RCLOSE\_OPTION is not specified, an absolute + residual (infinity-norm) criterion is used. + linear_acceleration : string + * linear_acceleration (string) a keyword that defines the linear + acceleration method used by the default IMS linear solvers. CG - + preconditioned conjugate gradient method. BICGSTAB - preconditioned + bi-conjugate gradient stabilized method. + relaxation_factor : double + * relaxation_factor (double) optional real value that defines the + relaxation factor used by the incomplete LU factorization + preconditioners (MILU(0) and MILUT). RELAXATION_FACTOR is unitless + and should be greater than or equal to 0.0 and less than or equal to + 1.0. RELAXATION_FACTOR values of about 1.0 are commonly used, and + experience suggests that convergence can be optimized in some cases + with relax values of 0.97. A RELAXATION_FACTOR value of 0.0 will + result in either ILU(0) or ILUT preconditioning (depending on the + value specified for PRECONDITIONER_LEVELS and/or + PRECONDITIONER_DROP_TOLERANCE). By default, RELAXATION_FACTOR is + zero. + preconditioner_levels : integer + * preconditioner_levels (integer) optional integer value defining the + level of fill for ILU decomposition used in the ILUT and MILUT + preconditioners. Higher levels of fill provide more robustness but + also require more memory. For optimal performance, it is suggested + that a large level of fill be applied (7 or 8) with use of a drop + tolerance. Specification of a PRECONDITIONER_LEVELS value greater + than zero results in use of the ILUT preconditioner. By default, + PRECONDITIONER_LEVELS is zero and the zero-fill incomplete LU + factorization preconditioners (ILU(0) and MILU(0)) are used. + preconditioner_drop_tolerance : double + * preconditioner_drop_tolerance (double) optional real value that + defines the drop tolerance used to drop preconditioner terms based on + the magnitude of matrix entries in the ILUT and MILUT + preconditioners. A value of :math:`10^{-4}` works well for most + problems. By default, PRECONDITIONER\_DROP\_TOLERANCE is zero and the + zero-fill incomplete LU factorization preconditioners (ILU(0) and + MILU(0)) are used. + number_orthogonalizations : integer + * number_orthogonalizations (integer) optional integer value defining + the interval used to explicitly recalculate the residual of the flow + equation using the solver coefficient matrix, the latest head + estimates, and the right hand side. For problems that benefit from + explicit recalculation of the residual, a number between 4 and 10 is + appropriate. By default, NUMBER_ORTHOGONALIZATIONS is zero. + scaling_method : string + * scaling_method (string) an optional keyword that defines the matrix + scaling approach used. By default, matrix scaling is not applied. + NONE - no matrix scaling applied. DIAGONAL - symmetric matrix scaling + using the POLCG preconditioner scaling method in Hill (1992). L2NORM + - symmetric matrix scaling using the L2 norm. + reordering_method : string + * reordering_method (string) an optional keyword that defines the + matrix reordering approach used. By default, matrix reordering is not + applied. NONE - original ordering. RCM - reverse Cuthill McKee + ordering. MD - minimum degree ordering. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + csv_output_filerecord = ListTemplateGenerator(('ims', 'options', + 'csv_output_filerecord')) + rcloserecord = ListTemplateGenerator(('ims', 'linear', + 'rcloserecord')) + package_abbr = "ims" + _package_type = "ims" + dfn_file_name = "sln-ims.dfn" + + dfn = [["block options", "name print_option", "type string", + "reader urword", "optional true"], + ["block options", "name complexity", "type string", + "reader urword", "optional true"], + ["block options", "name csv_output_filerecord", + "type record csv_output fileout csvfile", "shape", + "reader urword", "tagged true", "optional true"], + ["block options", "name csv_output", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name fileout", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name csvfile", "type string", + "preserve_case true", "shape", "in_record true", "reader urword", + "tagged false", "optional false"], + ["block options", "name no_ptc", "type keyword", "reader urword", + "optional true"], + ["block nonlinear", "name outer_hclose", "type double precision", + "reader urword", "optional false"], + ["block nonlinear", "name outer_rclosebnd", + "type double precision", "reader urword", "optional true"], + ["block nonlinear", "name outer_maximum", "type integer", + "reader urword", "optional false"], + ["block nonlinear", "name under_relaxation", "type string", + "reader urword", "optional true"], + ["block nonlinear", "name under_relaxation_theta", + "type double precision", "reader urword", "optional true"], + ["block nonlinear", "name under_relaxation_kappa", + "type double precision", "reader urword", "optional true"], + ["block nonlinear", "name under_relaxation_gamma", + "type double precision", "reader urword", "optional true"], + ["block nonlinear", "name under_relaxation_momentum", + "type double precision", "reader urword", "optional true"], + ["block nonlinear", "name backtracking_number", "type integer", + "reader urword", "optional true"], + ["block nonlinear", "name backtracking_tolerance", + "type double precision", "reader urword", "optional true"], + ["block nonlinear", "name backtracking_reduction_factor", + "type double precision", "reader urword", "optional true"], + ["block nonlinear", "name backtracking_residual_limit", + "type double precision", "reader urword", "optional true"], + ["block linear", "name inner_maximum", "type integer", + "reader urword", "optional false"], + ["block linear", "name inner_hclose", "type double precision", + "reader urword", "optional false"], + ["block linear", "name rcloserecord", + "type record inner_rclose rclose_option", "reader urword", + "optional false"], + ["block linear", "name inner_rclose", "type double precision", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block linear", "name rclose_option", "type string", + "tagged false", "in_record true", "reader urword", + "optional true"], + ["block linear", "name linear_acceleration", "type string", + "reader urword", "optional false"], + ["block linear", "name relaxation_factor", + "type double precision", "reader urword", "optional true"], + ["block linear", "name preconditioner_levels", "type integer", + "reader urword", "optional true"], + ["block linear", "name preconditioner_drop_tolerance", + "type double precision", "reader urword", "optional true"], + ["block linear", "name number_orthogonalizations", + "type integer", "reader urword", "optional true"], + ["block linear", "name scaling_method", "type string", + "reader urword", "optional true"], + ["block linear", "name reordering_method", "type string", + "reader urword", "optional true"]] + + def __init__(self, simulation, loading_package=False, print_option=None, + complexity=None, csv_output_filerecord=None, no_ptc=None, + outer_hclose=None, outer_rclosebnd=None, outer_maximum=None, + under_relaxation=None, under_relaxation_theta=None, + under_relaxation_kappa=None, under_relaxation_gamma=None, + under_relaxation_momentum=None, backtracking_number=None, + backtracking_tolerance=None, + backtracking_reduction_factor=None, + backtracking_residual_limit=None, inner_maximum=None, + inner_hclose=None, rcloserecord=None, + linear_acceleration=None, relaxation_factor=None, + preconditioner_levels=None, + preconditioner_drop_tolerance=None, + number_orthogonalizations=None, scaling_method=None, + reordering_method=None, filename=None, pname=None, + parent_file=None): + super(ModflowIms, self).__init__(simulation, "ims", filename, pname, + loading_package, parent_file) + + # set up variables + self.print_option = self.build_mfdata("print_option", print_option) + self.complexity = self.build_mfdata("complexity", complexity) + self.csv_output_filerecord = self.build_mfdata("csv_output_filerecord", + csv_output_filerecord) + self.no_ptc = self.build_mfdata("no_ptc", no_ptc) + self.outer_hclose = self.build_mfdata("outer_hclose", outer_hclose) + self.outer_rclosebnd = self.build_mfdata("outer_rclosebnd", + outer_rclosebnd) + self.outer_maximum = self.build_mfdata("outer_maximum", outer_maximum) + self.under_relaxation = self.build_mfdata("under_relaxation", + under_relaxation) + self.under_relaxation_theta = self.build_mfdata( + "under_relaxation_theta", under_relaxation_theta) + self.under_relaxation_kappa = self.build_mfdata( + "under_relaxation_kappa", under_relaxation_kappa) + self.under_relaxation_gamma = self.build_mfdata( + "under_relaxation_gamma", under_relaxation_gamma) + self.under_relaxation_momentum = self.build_mfdata( + "under_relaxation_momentum", under_relaxation_momentum) + self.backtracking_number = self.build_mfdata("backtracking_number", + backtracking_number) + self.backtracking_tolerance = self.build_mfdata( + "backtracking_tolerance", backtracking_tolerance) + self.backtracking_reduction_factor = self.build_mfdata( + "backtracking_reduction_factor", backtracking_reduction_factor) + self.backtracking_residual_limit = self.build_mfdata( + "backtracking_residual_limit", backtracking_residual_limit) + self.inner_maximum = self.build_mfdata("inner_maximum", inner_maximum) + self.inner_hclose = self.build_mfdata("inner_hclose", inner_hclose) + self.rcloserecord = self.build_mfdata("rcloserecord", rcloserecord) + self.linear_acceleration = self.build_mfdata("linear_acceleration", + linear_acceleration) + self.relaxation_factor = self.build_mfdata("relaxation_factor", + relaxation_factor) + self.preconditioner_levels = self.build_mfdata("preconditioner_levels", + preconditioner_levels) + self.preconditioner_drop_tolerance = self.build_mfdata( + "preconditioner_drop_tolerance", preconditioner_drop_tolerance) + self.number_orthogonalizations = self.build_mfdata( + "number_orthogonalizations", number_orthogonalizations) + self.scaling_method = self.build_mfdata("scaling_method", + scaling_method) + self.reordering_method = self.build_mfdata("reordering_method", + reordering_method) + self._init_complete = True diff --git a/flopy/mf6/modflow/mfmvr.py b/flopy/mf6/modflow/mfmvr.py index 2e77a5a812..f5f057325a 100644 --- a/flopy/mf6/modflow/mfmvr.py +++ b/flopy/mf6/modflow/mfmvr.py @@ -1,176 +1,176 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ListTemplateGenerator - - -class ModflowMvr(mfpackage.MFPackage): - """ - ModflowMvr defines a mvr package. - - Parameters - ---------- - simulation : MFSimulation - Simulation that this package is a part of. Package is automatically - added to simulation when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - print_input : boolean - * print_input (boolean) keyword to indicate that the list of MVR - information will be written to the listing file immediately after it - is read. - print_flows : boolean - * print_flows (boolean) keyword to indicate that the list of MVR flow - rates will be printed to the listing file for every stress period - time step in which "BUDGET PRINT" is specified in Output Control. If - there is no Output Control option and "PRINT_FLOWS" is specified, - then flow rates are printed for the last time step of each stress - period. - modelnames : boolean - * modelnames (boolean) keyword to indicate that all package names will - be preceded by the model name for the package. Model names are - required when the Mover Package is used with a GWF-GWF Exchange. The - MODELNAME keyword should not be used for a Mover Package that is for - a single GWF Model. - budget_filerecord : [budgetfile] - * budgetfile (string) name of the output file to write budget - information. - maxmvr : integer - * maxmvr (integer) integer value specifying the maximum number of water - mover entries that will specified for any stress period. - maxpackages : integer - * maxpackages (integer) integer value specifying the number of unique - packages that are included in this water mover input file. - packages : [mname, pname] - * mname (string) name of model containing the package. Model names are - assigned by the user in the simulation name file. - * pname (string) is the name of a package that may be included in a - subsequent stress period block. The package name is assigned in the - name file for the GWF Model. Package names are optionally provided in - the name file. If they are not provided by the user, then packages - are assigned a default value, which is the package acronym followed - by a hyphen and the package number. For example, the first Drain - Package is named DRN-1. The second Drain Package is named DRN-2, and - so forth. - perioddata : [mname1, pname1, id1, mname2, pname2, id2, mvrtype, value] - * mname1 (string) name of model containing the package, PNAME1. - * pname1 (string) is the package name for the provider. The package - PNAME1 must be designated to provide water through the MVR Package by - specifying the keyword "MOVER" in its OPTIONS block. - * id1 (integer) is the identifier for the provider. For the standard - boundary packages, the provider identifier is the number of the - boundary as it is listed in the package input file. (Note that the - order of these boundaries may change by stress period, which must be - accounted for in the Mover Package.) So the first well has an - identifier of one. The second is two, and so forth. For the advanced - packages, the identifier is the reach number (SFR Package), well - number (MAW Package), or UZF cell number. For the Lake Package, ID1 - is the lake outlet number. Thus, outflows from a single lake can be - routed to different streams, for example. - * mname2 (string) name of model containing the package, PNAME2. - * pname2 (string) is the package name for the receiver. The package - PNAME2 must be designated to receive water from the MVR Package by - specifying the keyword "MOVER" in its OPTIONS block. - * id2 (integer) is the identifier for the receiver. The receiver - identifier is the reach number (SFR Package), Lake number (LAK - Package), well number (MAW Package), or UZF cell number. - * mvrtype (string) is the character string signifying the method for - determining how much water will be moved. Supported values are - "FACTOR" "EXCESS" "THRESHOLD" and "UPTO". These four options - determine how the receiver flow rate, :math:`Q_R`, is calculated. - These options are based the options available in the SFR2 Package for - diverting stream flow. - * value (double) is the value to be used in the equation for - calculating the amount of water to move. For the "FACTOR" option, - VALUE is the :math:`\\alpha` factor. For the remaining options, VALUE - is the specified flow rate, :math:`Q_S`. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - budget_filerecord = ListTemplateGenerator(('mvr', 'options', - 'budget_filerecord')) - packages = ListTemplateGenerator(('mvr', 'packages', 'packages')) - perioddata = ListTemplateGenerator(('mvr', 'period', 'perioddata')) - package_abbr = "mvr" - _package_type = "mvr" - dfn_file_name = "gwf-mvr.dfn" - - dfn = [["block options", "name print_input", "type keyword", - "reader urword", "optional true"], - ["block options", "name print_flows", "type keyword", - "reader urword", "optional true"], - ["block options", "name modelnames", "type keyword", - "reader urword", "optional true"], - ["block options", "name budget_filerecord", - "type record budget fileout budgetfile", "shape", "reader urword", - "tagged true", "optional true"], - ["block options", "name budget", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name fileout", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block options", "name budgetfile", "type string", - "preserve_case true", "shape", "in_record true", "reader urword", - "tagged false", "optional false"], - ["block dimensions", "name maxmvr", "type integer", - "reader urword", "optional false"], - ["block dimensions", "name maxpackages", "type integer", - "reader urword", "optional false"], - ["block packages", "name packages", "type recarray mname pname", - "reader urword", "shape (npackages)", "optional false"], - ["block packages", "name mname", "type string", "reader urword", - "shape", "tagged false", "in_record true", "optional true"], - ["block packages", "name pname", "type string", "reader urword", - "shape", "tagged false", "in_record true", "optional false"], - ["block period", "name iper", "type integer", - "block_variable True", "in_record true", "tagged false", "shape", - "valid", "reader urword", "optional false"], - ["block period", "name perioddata", - "type recarray mname1 pname1 id1 mname2 pname2 id2 mvrtype value", - "shape (maxbound)", "reader urword"], - ["block period", "name mname1", "type string", "reader urword", - "shape", "tagged false", "in_record true", "optional true"], - ["block period", "name pname1", "type string", "shape", - "tagged false", "in_record true", "reader urword"], - ["block period", "name id1", "type integer", "shape", - "tagged false", "in_record true", "reader urword", - "numeric_index true"], - ["block period", "name mname2", "type string", "reader urword", - "shape", "tagged false", "in_record true", "optional true"], - ["block period", "name pname2", "type string", "shape", - "tagged false", "in_record true", "reader urword"], - ["block period", "name id2", "type integer", "shape", - "tagged false", "in_record true", "reader urword", - "numeric_index true"], - ["block period", "name mvrtype", "type string", "shape", - "tagged false", "in_record true", "reader urword"], - ["block period", "name value", "type double precision", "shape", - "tagged false", "in_record true", "reader urword"]] - - def __init__(self, simulation, loading_package=False, print_input=None, - print_flows=None, modelnames=None, budget_filerecord=None, - maxmvr=None, maxpackages=None, packages=None, perioddata=None, - filename=None, pname=None, parent_file=None): - super(ModflowMvr, self).__init__(simulation, "mvr", filename, pname, - loading_package, parent_file) - - # set up variables - self.print_input = self.build_mfdata("print_input", print_input) - self.print_flows = self.build_mfdata("print_flows", print_flows) - self.modelnames = self.build_mfdata("modelnames", modelnames) - self.budget_filerecord = self.build_mfdata("budget_filerecord", - budget_filerecord) - self.maxmvr = self.build_mfdata("maxmvr", maxmvr) - self.maxpackages = self.build_mfdata("maxpackages", maxpackages) - self.packages = self.build_mfdata("packages", packages) - self.perioddata = self.build_mfdata("perioddata", perioddata) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ListTemplateGenerator + + +class ModflowMvr(mfpackage.MFPackage): + """ + ModflowMvr defines a mvr package. + + Parameters + ---------- + simulation : MFSimulation + Simulation that this package is a part of. Package is automatically + added to simulation when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + print_input : boolean + * print_input (boolean) keyword to indicate that the list of MVR + information will be written to the listing file immediately after it + is read. + print_flows : boolean + * print_flows (boolean) keyword to indicate that the list of MVR flow + rates will be printed to the listing file for every stress period + time step in which "BUDGET PRINT" is specified in Output Control. If + there is no Output Control option and "PRINT_FLOWS" is specified, + then flow rates are printed for the last time step of each stress + period. + modelnames : boolean + * modelnames (boolean) keyword to indicate that all package names will + be preceded by the model name for the package. Model names are + required when the Mover Package is used with a GWF-GWF Exchange. The + MODELNAME keyword should not be used for a Mover Package that is for + a single GWF Model. + budget_filerecord : [budgetfile] + * budgetfile (string) name of the output file to write budget + information. + maxmvr : integer + * maxmvr (integer) integer value specifying the maximum number of water + mover entries that will specified for any stress period. + maxpackages : integer + * maxpackages (integer) integer value specifying the number of unique + packages that are included in this water mover input file. + packages : [mname, pname] + * mname (string) name of model containing the package. Model names are + assigned by the user in the simulation name file. + * pname (string) is the name of a package that may be included in a + subsequent stress period block. The package name is assigned in the + name file for the GWF Model. Package names are optionally provided in + the name file. If they are not provided by the user, then packages + are assigned a default value, which is the package acronym followed + by a hyphen and the package number. For example, the first Drain + Package is named DRN-1. The second Drain Package is named DRN-2, and + so forth. + perioddata : [mname1, pname1, id1, mname2, pname2, id2, mvrtype, value] + * mname1 (string) name of model containing the package, PNAME1. + * pname1 (string) is the package name for the provider. The package + PNAME1 must be designated to provide water through the MVR Package by + specifying the keyword "MOVER" in its OPTIONS block. + * id1 (integer) is the identifier for the provider. For the standard + boundary packages, the provider identifier is the number of the + boundary as it is listed in the package input file. (Note that the + order of these boundaries may change by stress period, which must be + accounted for in the Mover Package.) So the first well has an + identifier of one. The second is two, and so forth. For the advanced + packages, the identifier is the reach number (SFR Package), well + number (MAW Package), or UZF cell number. For the Lake Package, ID1 + is the lake outlet number. Thus, outflows from a single lake can be + routed to different streams, for example. + * mname2 (string) name of model containing the package, PNAME2. + * pname2 (string) is the package name for the receiver. The package + PNAME2 must be designated to receive water from the MVR Package by + specifying the keyword "MOVER" in its OPTIONS block. + * id2 (integer) is the identifier for the receiver. The receiver + identifier is the reach number (SFR Package), Lake number (LAK + Package), well number (MAW Package), or UZF cell number. + * mvrtype (string) is the character string signifying the method for + determining how much water will be moved. Supported values are + "FACTOR" "EXCESS" "THRESHOLD" and "UPTO". These four options + determine how the receiver flow rate, :math:`Q_R`, is calculated. + These options are based the options available in the SFR2 Package for + diverting stream flow. + * value (double) is the value to be used in the equation for + calculating the amount of water to move. For the "FACTOR" option, + VALUE is the :math:`\\alpha` factor. For the remaining options, VALUE + is the specified flow rate, :math:`Q_S`. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + budget_filerecord = ListTemplateGenerator(('mvr', 'options', + 'budget_filerecord')) + packages = ListTemplateGenerator(('mvr', 'packages', 'packages')) + perioddata = ListTemplateGenerator(('mvr', 'period', 'perioddata')) + package_abbr = "mvr" + _package_type = "mvr" + dfn_file_name = "gwf-mvr.dfn" + + dfn = [["block options", "name print_input", "type keyword", + "reader urword", "optional true"], + ["block options", "name print_flows", "type keyword", + "reader urword", "optional true"], + ["block options", "name modelnames", "type keyword", + "reader urword", "optional true"], + ["block options", "name budget_filerecord", + "type record budget fileout budgetfile", "shape", "reader urword", + "tagged true", "optional true"], + ["block options", "name budget", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name fileout", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name budgetfile", "type string", + "preserve_case true", "shape", "in_record true", "reader urword", + "tagged false", "optional false"], + ["block dimensions", "name maxmvr", "type integer", + "reader urword", "optional false"], + ["block dimensions", "name maxpackages", "type integer", + "reader urword", "optional false"], + ["block packages", "name packages", "type recarray mname pname", + "reader urword", "shape (npackages)", "optional false"], + ["block packages", "name mname", "type string", "reader urword", + "shape", "tagged false", "in_record true", "optional true"], + ["block packages", "name pname", "type string", "reader urword", + "shape", "tagged false", "in_record true", "optional false"], + ["block period", "name iper", "type integer", + "block_variable True", "in_record true", "tagged false", "shape", + "valid", "reader urword", "optional false"], + ["block period", "name perioddata", + "type recarray mname1 pname1 id1 mname2 pname2 id2 mvrtype value", + "shape (maxbound)", "reader urword"], + ["block period", "name mname1", "type string", "reader urword", + "shape", "tagged false", "in_record true", "optional true"], + ["block period", "name pname1", "type string", "shape", + "tagged false", "in_record true", "reader urword"], + ["block period", "name id1", "type integer", "shape", + "tagged false", "in_record true", "reader urword", + "numeric_index true"], + ["block period", "name mname2", "type string", "reader urword", + "shape", "tagged false", "in_record true", "optional true"], + ["block period", "name pname2", "type string", "shape", + "tagged false", "in_record true", "reader urword"], + ["block period", "name id2", "type integer", "shape", + "tagged false", "in_record true", "reader urword", + "numeric_index true"], + ["block period", "name mvrtype", "type string", "shape", + "tagged false", "in_record true", "reader urword"], + ["block period", "name value", "type double precision", "shape", + "tagged false", "in_record true", "reader urword"]] + + def __init__(self, simulation, loading_package=False, print_input=None, + print_flows=None, modelnames=None, budget_filerecord=None, + maxmvr=None, maxpackages=None, packages=None, perioddata=None, + filename=None, pname=None, parent_file=None): + super(ModflowMvr, self).__init__(simulation, "mvr", filename, pname, + loading_package, parent_file) + + # set up variables + self.print_input = self.build_mfdata("print_input", print_input) + self.print_flows = self.build_mfdata("print_flows", print_flows) + self.modelnames = self.build_mfdata("modelnames", modelnames) + self.budget_filerecord = self.build_mfdata("budget_filerecord", + budget_filerecord) + self.maxmvr = self.build_mfdata("maxmvr", maxmvr) + self.maxpackages = self.build_mfdata("maxpackages", maxpackages) + self.packages = self.build_mfdata("packages", packages) + self.perioddata = self.build_mfdata("perioddata", perioddata) + self._init_complete = True diff --git a/flopy/mf6/modflow/mfnam.py b/flopy/mf6/modflow/mfnam.py index d51a0568ae..1e6630cc8c 100644 --- a/flopy/mf6/modflow/mfnam.py +++ b/flopy/mf6/modflow/mfnam.py @@ -1,139 +1,139 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ListTemplateGenerator - - -class ModflowNam(mfpackage.MFPackage): - """ - ModflowNam defines a nam package. - - Parameters - ---------- - simulation : MFSimulation - Simulation that this package is a part of. Package is automatically - added to simulation when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - continue_ : boolean - * continue (boolean) keyword flag to indicate that the simulation - should continue even if one or more solutions do not converge. - nocheck : boolean - * nocheck (boolean) keyword flag to indicate that the model input check - routines should not be called prior to each time step. Checks are - performed by default. - memory_print_option : string - * memory_print_option (string) is a flag that controls printing of - detailed memory manager usage to the end of the simulation list file. - NONE means do not print detailed information. SUMMARY means print - only the total memory for each simulation component. ALL means print - information for each variable stored in the memory manager. NONE is - default if MEMORY_PRINT_OPTION is not specified. - tdis6 : string - * tdis6 (string) is the name of the Temporal Discretization (TDIS) - Input File. - models : [mtype, mfname, mname] - * mtype (string) is the type of model to add to simulation. - * mfname (string) is the file name of the model name file. - * mname (string) is the user-assigned name of the model. The model name - cannot exceed 16 characters and must not have blanks within the name. - The model name is case insensitive; any lowercase letters are - converted and stored as upper case letters. - exchanges : [exgtype, exgfile, exgmnamea, exgmnameb] - * exgtype (string) is the exchange type. - * exgfile (string) is the input file for the exchange. - * exgmnamea (string) is the name of the first model that is part of - this exchange. - * exgmnameb (string) is the name of the second model that is part of - this exchange. - mxiter : integer - * mxiter (integer) is the maximum number of outer iterations for this - solution group. The default value is 1. If there is only one solution - in the solution group, then MXITER must be 1. - solutiongroup : [slntype, slnfname, slnmnames] - * slntype (string) is the type of solution. The Integrated Model - Solution (IMS6) is the only supported option in this version. - * slnfname (string) name of file containing solution input. - * slnmnames (string) is the array of model names to add to this - solution. The number of model names is determined by the number of - model names the user provides on this line. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - models = ListTemplateGenerator(('nam', 'models', 'models')) - exchanges = ListTemplateGenerator(('nam', 'exchanges', 'exchanges')) - solutiongroup = ListTemplateGenerator(('nam', 'solutiongroup', - 'solutiongroup')) - package_abbr = "nam" - _package_type = "nam" - dfn_file_name = "sim-nam.dfn" - - dfn = [["block options", "name continue", "type keyword", - "reader urword", "optional true"], - ["block options", "name nocheck", "type keyword", - "reader urword", "optional true"], - ["block options", "name memory_print_option", "type string", - "reader urword", "optional true"], - ["block timing", "name tdis6", "preserve_case true", - "type string", "reader urword", "optional"], - ["block models", "name models", - "type recarray mtype mfname mname", "reader urword", "optional"], - ["block models", "name mtype", "in_record true", "type string", - "tagged false", "reader urword"], - ["block models", "name mfname", "in_record true", "type string", - "preserve_case true", "tagged false", "reader urword"], - ["block models", "name mname", "in_record true", "type string", - "tagged false", "reader urword"], - ["block exchanges", "name exchanges", - "type recarray exgtype exgfile exgmnamea exgmnameb", - "reader urword", "optional"], - ["block exchanges", "name exgtype", "in_record true", - "type string", "tagged false", "reader urword"], - ["block exchanges", "name exgfile", "in_record true", - "type string", "preserve_case true", "tagged false", - "reader urword"], - ["block exchanges", "name exgmnamea", "in_record true", - "type string", "tagged false", "reader urword"], - ["block exchanges", "name exgmnameb", "in_record true", - "type string", "tagged false", "reader urword"], - ["block solutiongroup", "name group_num", "type integer", - "block_variable True", "in_record true", "tagged false", "shape", - "reader urword"], - ["block solutiongroup", "name mxiter", "type integer", - "reader urword", "optional true"], - ["block solutiongroup", "name solutiongroup", - "type recarray slntype slnfname slnmnames", "reader urword"], - ["block solutiongroup", "name slntype", "type string", - "valid ims6", "in_record true", "tagged false", "reader urword"], - ["block solutiongroup", "name slnfname", "type string", - "preserve_case true", "in_record true", "tagged false", - "reader urword"], - ["block solutiongroup", "name slnmnames", "type string", - "in_record true", "shape (:)", "tagged false", "reader urword"]] - - def __init__(self, simulation, loading_package=False, continue_=None, - nocheck=None, memory_print_option=None, tdis6=None, - models=None, exchanges=None, mxiter=None, solutiongroup=None, - filename=None, pname=None, parent_file=None): - super(ModflowNam, self).__init__(simulation, "nam", filename, pname, - loading_package, parent_file) - - # set up variables - self.continue_ = self.build_mfdata("continue", continue_) - self.nocheck = self.build_mfdata("nocheck", nocheck) - self.memory_print_option = self.build_mfdata("memory_print_option", - memory_print_option) - self.tdis6 = self.build_mfdata("tdis6", tdis6) - self.models = self.build_mfdata("models", models) - self.exchanges = self.build_mfdata("exchanges", exchanges) - self.mxiter = self.build_mfdata("mxiter", mxiter) - self.solutiongroup = self.build_mfdata("solutiongroup", solutiongroup) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ListTemplateGenerator + + +class ModflowNam(mfpackage.MFPackage): + """ + ModflowNam defines a nam package. + + Parameters + ---------- + simulation : MFSimulation + Simulation that this package is a part of. Package is automatically + added to simulation when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + continue_ : boolean + * continue (boolean) keyword flag to indicate that the simulation + should continue even if one or more solutions do not converge. + nocheck : boolean + * nocheck (boolean) keyword flag to indicate that the model input check + routines should not be called prior to each time step. Checks are + performed by default. + memory_print_option : string + * memory_print_option (string) is a flag that controls printing of + detailed memory manager usage to the end of the simulation list file. + NONE means do not print detailed information. SUMMARY means print + only the total memory for each simulation component. ALL means print + information for each variable stored in the memory manager. NONE is + default if MEMORY_PRINT_OPTION is not specified. + tdis6 : string + * tdis6 (string) is the name of the Temporal Discretization (TDIS) + Input File. + models : [mtype, mfname, mname] + * mtype (string) is the type of model to add to simulation. + * mfname (string) is the file name of the model name file. + * mname (string) is the user-assigned name of the model. The model name + cannot exceed 16 characters and must not have blanks within the name. + The model name is case insensitive; any lowercase letters are + converted and stored as upper case letters. + exchanges : [exgtype, exgfile, exgmnamea, exgmnameb] + * exgtype (string) is the exchange type. + * exgfile (string) is the input file for the exchange. + * exgmnamea (string) is the name of the first model that is part of + this exchange. + * exgmnameb (string) is the name of the second model that is part of + this exchange. + mxiter : integer + * mxiter (integer) is the maximum number of outer iterations for this + solution group. The default value is 1. If there is only one solution + in the solution group, then MXITER must be 1. + solutiongroup : [slntype, slnfname, slnmnames] + * slntype (string) is the type of solution. The Integrated Model + Solution (IMS6) is the only supported option in this version. + * slnfname (string) name of file containing solution input. + * slnmnames (string) is the array of model names to add to this + solution. The number of model names is determined by the number of + model names the user provides on this line. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + models = ListTemplateGenerator(('nam', 'models', 'models')) + exchanges = ListTemplateGenerator(('nam', 'exchanges', 'exchanges')) + solutiongroup = ListTemplateGenerator(('nam', 'solutiongroup', + 'solutiongroup')) + package_abbr = "nam" + _package_type = "nam" + dfn_file_name = "sim-nam.dfn" + + dfn = [["block options", "name continue", "type keyword", + "reader urword", "optional true"], + ["block options", "name nocheck", "type keyword", + "reader urword", "optional true"], + ["block options", "name memory_print_option", "type string", + "reader urword", "optional true"], + ["block timing", "name tdis6", "preserve_case true", + "type string", "reader urword", "optional"], + ["block models", "name models", + "type recarray mtype mfname mname", "reader urword", "optional"], + ["block models", "name mtype", "in_record true", "type string", + "tagged false", "reader urword"], + ["block models", "name mfname", "in_record true", "type string", + "preserve_case true", "tagged false", "reader urword"], + ["block models", "name mname", "in_record true", "type string", + "tagged false", "reader urword"], + ["block exchanges", "name exchanges", + "type recarray exgtype exgfile exgmnamea exgmnameb", + "reader urword", "optional"], + ["block exchanges", "name exgtype", "in_record true", + "type string", "tagged false", "reader urword"], + ["block exchanges", "name exgfile", "in_record true", + "type string", "preserve_case true", "tagged false", + "reader urword"], + ["block exchanges", "name exgmnamea", "in_record true", + "type string", "tagged false", "reader urword"], + ["block exchanges", "name exgmnameb", "in_record true", + "type string", "tagged false", "reader urword"], + ["block solutiongroup", "name group_num", "type integer", + "block_variable True", "in_record true", "tagged false", "shape", + "reader urword"], + ["block solutiongroup", "name mxiter", "type integer", + "reader urword", "optional true"], + ["block solutiongroup", "name solutiongroup", + "type recarray slntype slnfname slnmnames", "reader urword"], + ["block solutiongroup", "name slntype", "type string", + "valid ims6", "in_record true", "tagged false", "reader urword"], + ["block solutiongroup", "name slnfname", "type string", + "preserve_case true", "in_record true", "tagged false", + "reader urword"], + ["block solutiongroup", "name slnmnames", "type string", + "in_record true", "shape (:)", "tagged false", "reader urword"]] + + def __init__(self, simulation, loading_package=False, continue_=None, + nocheck=None, memory_print_option=None, tdis6=None, + models=None, exchanges=None, mxiter=None, solutiongroup=None, + filename=None, pname=None, parent_file=None): + super(ModflowNam, self).__init__(simulation, "nam", filename, pname, + loading_package, parent_file) + + # set up variables + self.continue_ = self.build_mfdata("continue", continue_) + self.nocheck = self.build_mfdata("nocheck", nocheck) + self.memory_print_option = self.build_mfdata("memory_print_option", + memory_print_option) + self.tdis6 = self.build_mfdata("tdis6", tdis6) + self.models = self.build_mfdata("models", models) + self.exchanges = self.build_mfdata("exchanges", exchanges) + self.mxiter = self.build_mfdata("mxiter", mxiter) + self.solutiongroup = self.build_mfdata("solutiongroup", solutiongroup) + self._init_complete = True diff --git a/flopy/mf6/modflow/mfsimulation.py b/flopy/mf6/modflow/mfsimulation.py index 62ecaeb64c..aa7f75a9fb 100644 --- a/flopy/mf6/modflow/mfsimulation.py +++ b/flopy/mf6/modflow/mfsimulation.py @@ -1,1535 +1,1535 @@ -""" -mfsimulation module. contains the MFSimulation class - - -""" -import errno, sys, inspect -import collections -import os.path -from ...mbase import run_model -from ..mfbase import PackageContainer, MFFileMgmt, ExtFileAction, \ - PackageContainerType, MFDataException, FlopyException, \ - VerbosityLevel -from ..mfpackage import MFPackage -from ..data.mfstructure import DatumType -from ..data import mfstructure -from ..utils import binaryfile_utils -from ..utils import mfobservation -from ..modflow import mfnam, mfims, mftdis, mfgwfgnc, mfgwfmvr -from ..data.mfdatautil import MFComment - - -class SimulationDict(collections.OrderedDict): - """ - Class containing custom dictionary for MODFLOW simulations. Behaves as an - OrderedDict with some additional features described below. - - Parameters - ---------- - path : MFFileMgmt - object containing path information for the simulation - - Methods - ------- - output_keys : (print_keys: boolean) : list - returns a list of output data keys the dictionary supports for output - data, print_keys allows those keys to be printed to output. - input_keys : () - prints all input data keys - observation_keys : () - prints observation keys - keys : () - print all keys, input and output - plot : (key : string, **kwargs) - plots data with key 'key' using **kwargs for plot options - shapefile : (key : string, **kwargs) - create shapefile from data with key 'key' and with additional fields - in **kwargs - """ - def __init__(self, path, *args): - self._path = path - collections.OrderedDict.__init__(self) - - def __getitem__(self, key): - # check if the key refers to a binary output file, or an observation - # output file, if so override the dictionary request and call output - # requester classes - - # FIX: Transport - Include transport output files - if key[1] in ('CBC', 'HDS', 'DDN', 'UCN'): - val = binaryfile_utils.MFOutput(self, self._path, key) - return val.data - - elif key[-1] == 'Observations': - val = mfobservation.MFObservation(self, self._path, key) - return val.data - - val = collections.OrderedDict.__getitem__(self, key) - return val - - def __setitem__(self, key, val): - collections.OrderedDict.__setitem__(self, key, val) - - def find_in_path(self, key_path, key_leaf): - key_path_size = len(key_path) - for key, item in self.items(): - if key[:key_path_size] == key_path: - if key[-1] == key_leaf: - # found key_leaf as a key in the dictionary - return item, None - if not isinstance(item, MFComment): - data_item_index = 0 - data_item_structures = item.structure.data_item_structures - for data_item_struct in data_item_structures: - if data_item_struct.name == key_leaf: - # found key_leaf as a data item name in the data in - # the dictionary - return item, data_item_index - if data_item_struct.type != DatumType.keyword: - data_item_index += 1 - return None, None - - def output_keys(self, print_keys=True): - # get keys to request binary output - x = binaryfile_utils.MFOutputRequester.getkeys(self, self._path, - print_keys=print_keys) - return [key for key in x.dataDict] - - def input_keys(self): - # get keys to request input ie. package data - for key in self: - print(key) - - def observation_keys(self): - # get keys to request observation file output - mfobservation.MFObservationRequester.getkeys(self, self._path) - - def keys(self): - # overrides the built in keys to print all keys, input and output - self.input_keys() - try: - self.output_keys() - except OSError as e: - if e.errno == errno.EEXIST: - pass - try: - self.observation_keys() - except KeyError: - pass - - -class MFSimulationData(object): - """ - Class containing MODFLOW simulation data and file formatting data. - - Parameters - ---------- - path : string - path on disk to the simulation - - Attributes - ---------- - indent_string : string - string used to define how much indent to use (file formatting) - internal_formatting : list - list defining string to use for internal formatting - external_formatting : list - list defining string to use for external formatting - open_close_formatting : list - list defining string to use for open/close - max_columns_of_data : int - maximum columns of data before line wraps - wrap_multidim_arrays : bool - whether to wrap line for multi-dimensional arrays at the end of a - row/column/layer - float_precision : int - number of decimal points to write for a floating point number - float_characters : int - number of characters a floating point number takes up - sci_note_upper_thres : float - numbers greater than this threshold are written in scientific notation - sci_note_lower_thres : float - numbers less than this threshold are written in scientific notation - mfpath : MFFileMgmt - file path location information for the simulation - model_dimensions : OrderedDict - dictionary containing discretization information for each model - mfdata : SimulationDict - custom dictionary containing all model data for the simulation - """ - def __init__(self, path): - # --- formatting variables --- - self.indent_string = ' ' - self.constant_formatting = ['constant', ''] - self.max_columns_of_data = 20 - self.wrap_multidim_arrays = True - self.float_precision = 8 - self.float_characters = 15 - self._sci_note_upper_thres = 100000 - self._sci_note_lower_thres = 0.001 - self.fast_write = True - self.comments_on = False - self.auto_set_sizes = True - self.debug = False - self.verbose = True - self.verbosity_level = VerbosityLevel.normal - - self._update_str_format() - - # --- file path --- - self.mfpath = MFFileMgmt(path) - - # --- ease of use variables to make working with modflow input and - # output data easier --- model dimension class for each model - self.model_dimensions = collections.OrderedDict() - - # --- model data --- - self.mfdata = SimulationDict(self.mfpath) - - # --- temporary variables --- - # other external files referenced - self.referenced_files = collections.OrderedDict() - - def set_sci_note_upper_thres(self, value): - self._sci_note_upper_thres = value - self._update_str_format() - - def set_sci_note_lower_thres(self, value): - self._sci_note_lower_thres = value - self._update_str_format() - - def _update_str_format(self): - self.reg_format_str = '{:.%dE}' % \ - self.float_precision - self.sci_format_str = '{:%d.%df' \ - '}' % (self.float_characters, - self.float_precision) - - -class MFSimulation(PackageContainer): - """ - MODFLOW Simulation Class. Entry point into any MODFLOW simulation. - - Parameters - ---------- - sim_name : string - name of the simulation. - version : string - MODFLOW version - exe_name : string - relative path to MODFLOW executable from the simulation working folder - sim_ws : string - path to simulation working folder - verbosity_level : int - verbosity level of standard output - 0 : no standard output - 1 : standard error/warning messages with some informational messages - 2 : verbose mode with full error/warning/informational messages. - this is ideal for debugging - - Attributes - ---------- - sim_name : string - name of the simulation - models : OrderedDict - all models in the simulation - exchanges : list - all exchange packages in the simulation - imsfiles : list - all ims packages in the simulation - mfdata : OrderedDict - all variables defined in the simulation. the key for a variable is - defined as a tuple. for "simulation level" packages the tuple - starts with the package type, followed by the block name, followed - by the variable name ("TDIS", "DIMENSIONS", "nper"). for "model level" - packages the tuple starts with the model name, followed by the package - name, followed by the block name, followed by the variable name ( - "MyModelName", "DIS6", "OPTIONS", "length_units"). - name_file : MFPackage - simulation name file - tdis_file - simulation tdis file - - Methods - ------- - load : (sim_name : string, version : string, exe_name : string, - sim_ws : string, strict : boolean, - verbosity_level : VerbosityLevel) : - MFSimulation - a class method that loads a simulation from files - write_simulation - writes the simulation to files - set_sim_path : (path : string) - set the file path to the root simulation folder and updates all model - file paths - get_model : (model_name : string) - : [MFModel] - returns the models in the simulation with a given model name, name file - name, or model type - add_model : (model : MFModel, sln_group : integer) - add model to the simulation - remove_model : (model_name : string) - remove model from the simulation - get_package : (type : string) - returns a simulation package based on package type - add_package : (package : MFPackage) - adds a simulation package to the simulation - remove_package : (package_name : string) - removes package from the simulation. package_name can be the - package's name, type, or package object to be removed from - the model - is_valid : () : boolean - checks the validity of the solution and all of its models and packages - - See Also - -------- - - Notes - ----- - - Examples - -------- - - >>> s = flopy6.mfsimulation.load('my simulation', 'simulation.nam') - - """ - def __init__(self, sim_name='sim', version='mf6', - exe_name='mf6.exe', sim_ws='.', - verbosity_level=1): - super(MFSimulation, self).__init__(MFSimulationData(sim_ws), sim_name) - self.simulation_data.verbosity_level = self._resolve_verbosity_level( - verbosity_level) - # verify metadata - fpdata = mfstructure.MFStructure() - if not fpdata.valid: - excpt_str = 'Invalid package metadata. Unable to load MODFLOW ' \ - 'file structure metadata.' - raise FlopyException(excpt_str) - - # initialize - self.dimensions = None - self.type = 'Simulation' - - self.version = version - self.exe_name = exe_name - self._models = collections.OrderedDict() - self._tdis_file = None - self._exchange_files = collections.OrderedDict() - self._ims_files = collections.OrderedDict() - self._ghost_node_files = {} - self._mover_files = {} - self._other_files = collections.OrderedDict() - self.structure = fpdata.sim_struct - - self._exg_file_num = {} - self._gnc_file_num = 0 - self._mvr_file_num = 0 - - self.simulation_data.mfpath.set_last_accessed_path() - - # build simulation name file - self.name_file = mfnam.ModflowNam(self, filename='mfsim.nam') - - # try to build directory structure - sim_path = self.simulation_data.mfpath.get_sim_path() - if not os.path.isdir(sim_path): - try: - os.makedirs(sim_path) - except OSError as e: - if self.simulation_data.verbosity_level.value >= \ - VerbosityLevel.quiet.value: - print('An error occurred when trying to create the ' - 'directory {}: {}'.format(sim_path, e.strerror)) - - # set simulation validity initially to false since the user must first - # add at least one model to the simulation and fill out the name and - # tdis files - self.valid = False - - def __getattr__(self, item): - """ - __getattr__ - used to allow for getting models and packages as if - they are attributes - - Parameters - ---------- - item : str - model or package name - - - Returns - ------- - md : Model or package object - Model or package object of type :class:flopy6.mfmodel or - :class:flopy6.mfpackage - - """ - - models = [] - if item in self.structure.model_types: - # get all models of this type - for model in self._models.values(): - if model.model_type == item: - models.append(model) - - if len(models) > 0: - return models - elif item in self._models: - return self.get_model(item) - else: - return self.get_package(item) - - def __repr__(self): - return self._get_data_str(True) - - def __str__(self): - return self._get_data_str(False) - - def _get_data_str(self, formal): - file_mgt = self.simulation_data.mfpath - data_str = 'sim_name = {}\nsim_path = {}\nexe_name = ' \ - '{}\n\n'.format(self.name, file_mgt.get_sim_path(), - self.exe_name) - - for package in self._packagelist: - pk_str = package._get_data_str(formal, False) - if formal: - if len(pk_str.strip()) > 0: - data_str = '{}###################\nPackage {}\n' \ - '###################\n\n' \ - '{}\n'.format(data_str, package._get_pname(), - pk_str) - else: - if len(pk_str.strip()) > 0: - data_str = '{}###################\nPackage {}\n' \ - '###################\n\n' \ - '{}\n'.format(data_str, package._get_pname(), - pk_str) - for model in self._models.values(): - if formal: - mod_repr = repr(model) - if len(mod_repr.strip()) > 0: - data_str = '{}@@@@@@@@@@@@@@@@@@@@\nModel {}\n' \ - '@@@@@@@@@@@@@@@@@@@@\n\n' \ - '{}\n'.format(data_str, model.name, mod_repr) - else: - mod_str = str(model) - if len(mod_str.strip()) > 0: - data_str = '{}@@@@@@@@@@@@@@@@@@@@\nModel {}\n' \ - '@@@@@@@@@@@@@@@@@@@@\n\n' \ - '{}\n'.format(data_str, model.name, mod_str) - return data_str - - @property - def model_names(self): - """ - Returns a list of model names associated with this simulation - """ - return self._models.keys() - - @classmethod - def load(cls, sim_name='modflowsim', version='mf6', exe_name='mf6.exe', - sim_ws='.', strict=True, verbosity_level=1): - """ - Load an existing model. - - Parameters - ---------- - sim_name : string - name of the simulation. - version : string - MODFLOW version - exe_name : string - relative path to MODFLOW executable from the simulation working - folder - sim_ws : string - path to simulation working folder - strict : boolean - strict enforcement of file formatting - verbosity_level : int - verbosity level of standard output - 0 : no standard output - 1 : standard error/warning messages with some informational - messages - 2 : verbose mode with full error/warning/informational - messages. this is ideal for debugging - Returns - ------- - sim : MFSimulation object - - Examples - -------- - >>> s = flopy6.mfsimulation.load('my simulation') - """ - # initialize - instance = cls(sim_name, version, exe_name, sim_ws, verbosity_level) - verbosity_level = instance.simulation_data.verbosity_level - - if verbosity_level.value >= VerbosityLevel.normal.value: - print('loading simulation...') - - # load simulation name file - if verbosity_level.value >= VerbosityLevel.normal.value: - print(' loading simulation name file...') - instance.name_file.load(strict) - - # load TDIS file - tdis_pkg = 'tdis{}'.format(mfstructure.MFStructure(). - get_version_string()) - tdis_attr = getattr(instance.name_file, tdis_pkg) - instance._tdis_file = mftdis.ModflowTdis(instance, - filename=tdis_attr.get_data()) - - instance._tdis_file._filename = instance.simulation_data.mfdata[ - ('nam', 'timing', tdis_pkg)].get_data() - if verbosity_level.value >= VerbosityLevel.normal.value: - print(' loading tdis package...') - instance._tdis_file.load(strict) - - # load models - try: - model_recarray = instance.simulation_data.mfdata[('nam', 'models', - 'models')] - models = model_recarray.get_data() - except MFDataException as mfde: - message = 'Error occurred while loading model names from the ' \ - 'simulation name file.' - raise MFDataException(mfdata_except=mfde, - model=instance.name, - package='nam', - message=message) - for item in models: - # resolve model working folder and name file - path, name_file = os.path.split(item[1]) - model_obj = PackageContainer.model_factory(item[0][:-1].lower()) - # load model - if verbosity_level.value >= VerbosityLevel.normal.value: - print(' loading model {}...'.format(item[0].lower())) - instance._models[item[2]] = model_obj.load( - instance, - instance.structure.model_struct_objs[item[0].lower()], item[2], - name_file, version, exe_name, strict, path) - - # load exchange packages and dependent packages - try: - exchange_recarray = instance.name_file.exchanges - has_exch_data = exchange_recarray.has_data() - except MFDataException as mfde: - message = 'Error occurred while loading exchange names from the ' \ - 'simulation name file.' - raise MFDataException(mfdata_except=mfde, - model=instance.name, - package='nam', - message=message) - if has_exch_data: - try: - exch_data = exchange_recarray.get_data() - except MFDataException as mfde: - message = 'Error occurred while loading exchange names from the ' \ - 'simulation name file.' - raise MFDataException(mfdata_except=mfde, - model=instance.name, - package='nam', - message=message) - for exgfile in exch_data: - # get exchange type by removing numbers from exgtype - exchange_type = ''.join([char for char in exgfile[0] if - not char.isdigit()]).upper() - # get exchange number for this type - if not exchange_type in instance._exg_file_num: - exchange_file_num = 0 - instance._exg_file_num[exchange_type] = 1 - else: - exchange_file_num = instance._exg_file_num[exchange_type] - instance._exg_file_num[exchange_type] += 1 - - exchange_name = '{}_EXG_{}'.format(exchange_type, - exchange_file_num) - # find package class the corresponds to this exchange type - package_obj = instance.package_factory( - exchange_type.replace('-', '').lower(), '') - if not package_obj: - message = 'An error occurred while loading the ' \ - 'simulation name file. Invalid exchange type ' \ - '"{}" specified.'.format(exchange_type) - type_, value_, traceback_ = sys.exc_info() - raise MFDataException(instance.name, - 'nam', - 'nam', - 'loading simulation name file', - exchange_recarray.structure.name, - inspect.stack()[0][3], - type_, value_, traceback_, message, - instance._simulation_data.debug) - - # build and load exchange package object - exchange_file = package_obj(instance, exgtype=exgfile[0], - exgmnamea=exgfile[2], - exgmnameb=exgfile[3], - filename=exgfile[1], - pname=exchange_name, - loading_package=True) - if verbosity_level.value >= VerbosityLevel.normal.value: - print(' loading exchange package {}..' - '.'.format(exchange_file._get_pname())) - exchange_file.load(strict) - instance._exchange_files[exgfile[1]] = exchange_file - - # load simulation packages - solution_recarray = instance.simulation_data.mfdata[('nam', - 'solutiongroup', - 'solutiongroup' - )] - - try: - solution_group_dict = solution_recarray.get_data() - except MFDataException as mfde: - message = 'Error occurred while loading solution groups from ' \ - 'the simulation name file.' - raise MFDataException(mfdata_except=mfde, - model=instance.name, - package='nam', - message=message) - for solution_group in solution_group_dict.values(): - for solution_info in solution_group: - ims_file = mfims.ModflowIms(instance, filename=solution_info[1], - pname=solution_info[2]) - if verbosity_level.value >= VerbosityLevel.normal.value: - print(' loading ims package {}..' - '.'.format(ims_file._get_pname())) - ims_file.load(strict) - - instance.simulation_data.mfpath.set_last_accessed_path() - return instance - - def load_package(self, ftype, fname, pname, strict, ref_path, - dict_package_name=None, parent_package=None): - """ - loads a package from a file - - Parameters - ---------- - ftype : string - the file type - fname : string - the name of the file containing the package input - pname : string - the user-defined name for the package - strict : bool - strict mode when loading the file - ref_path : string - path to the file. uses local path if set to None - dict_package_name : string - package name for dictionary lookup - parent_package : MFPackage - parent package - - Examples - -------- - """ - if ftype == 'gnc': - if fname not in self._ghost_node_files: - # get package type from parent package - if parent_package: - package_abbr = parent_package.package_abbr[0:3] - else: - package_abbr = 'GWF' - # build package name and package - gnc_name = '{}-GNC_{}'.format(package_abbr, self._gnc_file_num) - ghost_node_file = mfgwfgnc.ModflowGwfgnc(self, filename=fname, - pname=gnc_name, - parent_file= - parent_package, - loading_package=True) - ghost_node_file.load(strict) - self._ghost_node_files[fname] = ghost_node_file - self._gnc_file_num += 1 - return ghost_node_file - elif ftype == 'mvr': - if fname not in self._mover_files: - # Get package type from parent package - if parent_package: - package_abbr = parent_package.package_abbr[0:3] - else: - package_abbr = 'GWF' - # build package name and package - mvr_name = '{}-MVR_{}'.format(package_abbr, self._mvr_file_num) - mover_file = mfgwfmvr.ModflowGwfmvr(self, filename=fname, - pname=mvr_name, - parent_file=parent_package, - loading_package=True) - mover_file.load(strict) - self._mover_files[fname] = mover_file - self._mvr_file_num += 1 - return mover_file - else: - # create package - package_obj = self.package_factory(ftype, '') - package = package_obj(self, filename=fname, pname=dict_package_name, - add_to_package_list=False, - parent_file=parent_package, - loading_package=True) - # verify that this is a utility package - utl_struct = mfstructure.MFStructure().sim_struct.utl_struct_objs - if package.package_type in utl_struct: - package.load(strict) - self._other_files[package.filename] = package - # register child package with the simulation - self._add_package(package, package.path) - if parent_package is not None: - # register child package with the parent package - parent_package._add_package(package, package.path) - else: - if self.simulation_data.verbosity_level.value >= \ - VerbosityLevel.normal.value: - print('WARNING: Unsupported file type {} for ' - 'simulation.'.format(package.package_type)) - return package - - def register_ims_package(self, ims_file, model_list): - """ - registers an ims package with the simulation - - Parameters - ---------- - ims_file : MFPackage - ims package to register - model_list : list of strings - list of models using the ims package to be registered - - Examples - -------- - """ - if isinstance(model_list, str): - model_list = [model_list] - - if not isinstance(ims_file, mfims.ModflowIms): - comment = 'Parameter "ims_file" is not a valid ims file. ' \ - 'Expected type ModflowIms, but type "{}" was given' \ - '.'.format(type(ims_file)) - type_, value_, traceback_ = sys.exc_info() - raise MFDataException(None, - 'ims', - '', - 'registering ims package', - '', - inspect.stack()[0][3], type_, - value_, - traceback_, comment, - self.simulation_data.debug) - - in_simulation = False - pkg_with_same_name = None - for file in self._ims_files.values(): - if file is ims_file: - in_simulation = True - if file.package_name == ims_file.package_name and \ - file != ims_file: - pkg_with_same_name = file - if self.simulation_data.verbosity_level.value >= \ - VerbosityLevel.normal.value: - print('WARNING: ims package with name {} already exists. ' - 'New ims package will replace old package' - '.'.format(file.package_name)) - self._remove_package(self._ims_files[file.filename]) - del self._ims_files[file.filename] - # register ims package - if not in_simulation: - self._add_package(ims_file, self._get_package_path(ims_file)) - # do not allow an ims package to be registered twice with the - # same simulation - if not in_simulation: - # create unique file/package name - if ims_file.package_name is None: - file_num = len(self._ims_files) - 1 - ims_file.package_name = 'ims_{}'.format(file_num) - if ims_file.filename in self._ims_files: - ims_file.filename = MFFileMgmt.unique_file_name( - ims_file.filename, self._ims_files) - # add ims package to simulation - self._ims_files[ims_file.filename] = ims_file - - # If ims file is being replaced, replace ims filename in solution group - if pkg_with_same_name is not None and \ - self._is_in_solution_group(pkg_with_same_name.filename, 1): - # change existing solution group to reflect new ims file - self._replace_ims_in_solution_group(pkg_with_same_name.filename, - 1, ims_file.filename) - # only allow an ims package to be registered to one solution group - elif model_list is not None: - ims_in_group = self._is_in_solution_group(ims_file.filename, 1) - # add solution group to the simulation name file - solution_recarray = self.name_file.solutiongroup - solution_group_list = solution_recarray.get_active_key_list() - if len(solution_group_list) == 0: - solution_group_num = 0 - else: - solution_group_num = solution_group_list[-1][0] - - if ims_in_group: - self._append_to_ims_solution_group(ims_file.filename, - model_list) - else: - if self.name_file.mxiter.get_data(solution_group_num) is None: - self.name_file.mxiter.add_transient_key(solution_group_num) - - # associate any models in the model list to this simulation file - version_string = mfstructure.MFStructure().get_version_string() - ims_pkg = 'ims{}'.format(version_string) - new_record = [ims_pkg, ims_file.filename] - for model in model_list: - new_record.append(model) - try: - solution_recarray.append_list_as_record(new_record, - solution_group_num) - except MFDataException as mfde: - message = 'Error occurred while updating the ' \ - 'simulation name file with the ims package ' \ - 'file "{}".'.format(ims_file.filename) - raise MFDataException(mfdata_except=mfde, - package='nam', - message=message) - - def write_simulation(self, - ext_file_action=ExtFileAction.copy_relative_paths, - silent=False): - """ - writes the simulation to files - - Parameters - ---------- - ext_file_action : ExtFileAction - defines what to do with external files when the simulation path - has changed. defaults to copy_relative_paths which copies only - files with relative paths, leaving files defined by absolute - paths fixed. - silent : bool - writes out the simulation in silent mode (verbosity_level = 0) - Examples - -------- - """ - saved_verb_lvl = self.simulation_data.verbosity_level - if silent: - self.simulation_data.verbosity_level = VerbosityLevel.quiet - - # write simulation name file - if self.simulation_data.verbosity_level.value >= \ - VerbosityLevel.normal.value: - print('writing simulation...') - print(' writing simulation name file...') - self.name_file.write(ext_file_action=ext_file_action) - - # write TDIS file - if self.simulation_data.verbosity_level.value >= \ - VerbosityLevel.normal.value: - print(' writing simulation tdis package...') - self._tdis_file.write(ext_file_action=ext_file_action) - - # write ims files - for ims_file in self._ims_files.values(): - if self.simulation_data.verbosity_level.value >= \ - VerbosityLevel.normal.value: - print(' writing ims package {}...'.format( - ims_file._get_pname())) - ims_file.write(ext_file_action=ext_file_action) - - # write exchange files - for exchange_file in self._exchange_files.values(): - exchange_file.write() - if hasattr(exchange_file, 'gnc_filerecord') and \ - exchange_file.gnc_filerecord.has_data(): - try: - gnc_file = exchange_file.gnc_filerecord.get_data()[0][0] - except MFDataException as mfde: - message = 'An error occurred while retrieving the ghost ' \ - 'node file record from exchange file ' \ - '"{}".'.format(exchange_file.filename) - raise MFDataException(mfdata_except=mfde, - package=exchange_file._get_pname(), - message=message) - if gnc_file in self._ghost_node_files: - if self.simulation_data.verbosity_level.value >= \ - VerbosityLevel.normal.value: - print(' writing gnc package {}...'.format( - self._ghost_node_files[gnc_file]._get_pname())) - self._ghost_node_files[gnc_file].write(ext_file_action= - ext_file_action) - else: - if self.simulation_data.verbosity_level.value >= \ - VerbosityLevel.normal.value: - print('WARNING: Ghost node file {} not loaded prior to' - ' writing. File will not be written' - '.'.format(gnc_file)) - if hasattr(exchange_file, 'mvr_filerecord') and \ - exchange_file.mvr_filerecord.has_data(): - try: - mvr_file = exchange_file.mvr_filerecord.get_data()[0][0] - except MFDataException as mfde: - message = 'An error occurred while retrieving the mover ' \ - 'file record from exchange file ' \ - '"{}".'.format(exchange_file.filename) - raise MFDataException(mfdata_except=mfde, - package=exchange_file._get_pname(), - message=message) - - if mvr_file in self._mover_files: - if self.simulation_data.verbosity_level.value >= \ - VerbosityLevel.normal.value: - print(' writing mvr package {}...'.format( - self._mover_files[mvr_file]._get_pname())) - self._mover_files[mvr_file].write(ext_file_action= - ext_file_action) - else: - if self.simulation_data.verbosity_level.value >= \ - VerbosityLevel.normal.value: - print('WARNING: Mover file {} not loaded prior to ' - 'writing. File will not be ' - 'written.'.format(mvr_file)) - - if ext_file_action == ExtFileAction.copy_relative_paths: - # move external files with relative paths - num_files_copied = self.simulation_data.mfpath.copy_files() - elif ext_file_action == ExtFileAction.copy_all: - # move all external files - num_files_copied = self.simulation_data.mfpath.copy_files( - copy_relative_only=False) - else: - num_files_copied = 0 - if self.simulation_data.verbosity_level.value >= \ - VerbosityLevel.verbose.value and num_files_copied > 0: - print('INFORMATION: {} external files copied'.format( - num_files_copied)) - - # write other packages - for pp in self._other_files.values(): - if self.simulation_data.verbosity_level.value >= \ - VerbosityLevel.normal.value: - print(' writing package {}...'.format(pp._get_pname())) - pp.write(ext_file_action=ext_file_action) - - # FIX: model working folder should be model name file folder - - # write models - for model in self._models.values(): - if self.simulation_data.verbosity_level.value >= \ - VerbosityLevel.normal.value: - print(' writing model {}...'.format(model.name)) - model.write(ext_file_action=ext_file_action) - - self.simulation_data.mfpath.set_last_accessed_path() - - if silent: - self.simulation_data.verbosity_level = saved_verb_lvl - - def set_sim_path(self, path): - self.simulation_data.mfpath.set_sim_path(path) - - def run_simulation(self, silent=None, pause=False, report=False, - normal_msg='normal termination', - use_async=False, cargs=None): - """ - Run the simulation. - """ - if silent is None: - if self.simulation_data.verbosity_level.value >= \ - VerbosityLevel.normal.value: - silent = False - else: - silent = True - return run_model(self.exe_name, None, - self.simulation_data.mfpath.get_sim_path(), - silent=silent, pause=pause, report=report, - normal_msg=normal_msg, use_async=use_async, cargs=cargs) - - def delete_output_files(self): - """ - Delete simulation output files. - """ - output_req = binaryfile_utils.MFOutputRequester - output_file_keys = output_req.getkeys(self.simulation_data.mfdata, - self.simulation_data.mfpath, - False) - for path in output_file_keys.binarypathdict.values(): - if os.path.isfile(path): - os.remove(path) - - def remove_package(self, package_name): - if isinstance(package_name, MFPackage): - packages = [package_name] - else: - packages = self.get_package(package_name) - if not isinstance(packages, list): - packages = [packages] - for package in packages: - if self._tdis_file is not None and \ - package.path == self._tdis_file.path: - self._tdis_file = None - if package.filename in self._exchange_files: - del self._exchange_files[package.filename] - if package.filename in self._ims_files: - del self._ims_files[package.filename] - if package.filename in self._ghost_node_files: - del self._ghost_node_files[package.filename] - if package.filename in self._mover_files: - del self._mover_files[package.filename] - if package.filename in self._other_files : - del self._other_files[package.filename] - - self._remove_package(package) - - @property - def model_dict(self): - return self._models.copy() - - def get_model(self, model_name=None): - """ - Load an existing model. - - Parameters - ---------- - model_name : string - name of model to get - - Returns - ------- - model : MFModel - - Examples - -------- - """ - if model_name is None: - for model in self._models.values(): - return model - return self._models[model_name] - - def get_exchange_file(self, filename): - """ - get a specified exchange file - - Parameters - ---------- - filename : string - name of exchange file to get - - Returns - ------- - exchange package : MFPackage - - Examples - -------- - """ - if filename in self._exchange_files: - return self._exchange_files[filename] - else: - excpt_str = 'Exchange file "{}" can not be found' \ - '.'.format(filename) - raise FlopyException(excpt_str) - - def get_mvr_file(self, filename): - """ - get a specified mover file - - Parameters - ---------- - filename : string - name of mover file to get - - Returns - ------- - mover package : MFPackage - - Examples - -------- - """ - if filename in self._mover_files: - return self._mover_files[filename] - else: - excpt_str = 'MVR file "{}" can not be ' \ - 'found.'.format(filename) - raise FlopyException(excpt_str) - - def get_gnc_file(self, filename): - """ - get a specified gnc file - - Parameters - ---------- - filename : string - name of gnc file to get - - Returns - ------- - gnc package : MFPackage - - Examples - -------- - """ - if filename in self._ghost_node_files: - return self._ghost_node_files[filename] - else: - excpt_str = 'GNC file "{}" can not be ' \ - 'found.'.format(filename) - raise FlopyException(excpt_str) - - def register_exchange_file(self, package): - """ - register an exchange package file with the simulation - - Parameters - ---------- - package : MFPackage - exchange package object to register - - Examples - -------- - """ - if package.filename not in self._exchange_files: - exgtype = package.exgtype - exgmnamea = package.exgmnamea - exgmnameb = package.exgmnameb - - if exgtype is None or exgmnamea is None or exgmnameb is None: - excpt_str = 'Exchange packages require that exgtype, ' \ - 'exgmnamea, and exgmnameb are specified.' - raise FlopyException(excpt_str) - - self._exchange_files[package.filename] = package - try: - exchange_recarray_data = self.name_file.exchanges.get_data() - except MFDataException as mfde: - message = 'An error occurred while retrieving exchange ' \ - 'data from the simulation name file. The error ' \ - 'occurred while registering exchange file ' \ - '"{}".'.format(package.filename) - raise MFDataException(mfdata_except=mfde, - package=package._get_pname(), - message=message) - if exchange_recarray_data is not None: - for index, exchange in zip(range(0, - len(exchange_recarray_data)), - exchange_recarray_data): - if exchange[1] == package.filename: - # update existing exchange - exchange_recarray_data[index][0] = exgtype - exchange_recarray_data[index][2] = exgmnamea - exchange_recarray_data[index][3] = exgmnameb - ex_recarray = self.name_file.exchanges - try: - ex_recarray.set_data(exchange_recarray_data) - except MFDataException as mfde: - message = 'An error occurred while setting ' \ - 'exchange data in the simulation name ' \ - 'file. The error occurred while ' \ - 'registering the following ' \ - 'values (exgtype, filename, ' \ - 'exgmnamea, exgmnameb): "{} {} {}' \ - '{}".'.format(exgtype, package.filename, - exgmnamea, exgmnameb) - raise MFDataException(mfdata_except=mfde, - package=package._get_pname(), - message=message) - return - try: - # add new exchange - self.name_file.exchanges.append_data([(exgtype, - package.filename, - exgmnamea, - exgmnameb)]) - except MFDataException as mfde: - message = 'An error occurred while setting exchange data ' \ - 'in the simulation name file. The error occurred ' \ - 'while registering the following values (exgtype, ' \ - 'filename, exgmnamea, exgmnameb): "{} {} {}' \ - '{}".'.format(exgtype, package.filename, exgmnamea, - exgmnameb) - raise MFDataException(mfdata_except=mfde, - package=package._get_pname(), - message=message) - if package.dimensions is None: - # resolve exchange package dimensions object - package.dimensions = package.create_package_dimensions() - - def register_package(self, package, add_to_package_list=True, - set_package_name=True, set_package_filename=True): - """ - register a package file with the simulation - - Parameters - ---------- - package : MFPackage - package to register - add_to_package_list : bool - add package to lookup list - set_package_name : bool - produce a package name for this package - set_package_filename : bool - produce a filename for this package - - Returns - ------- - (path : tuple, package structure : MFPackageStructure) - - Examples - -------- - """ - package.container_type = [PackageContainerType.simulation] - path = self._get_package_path(package) - if add_to_package_list and package.package_type.lower != 'nam': - pname = None - if package.package_name is not None: - pname = package.package_name.lower() - if package.package_type.lower() == 'tdis' and self._tdis_file is \ - not None and self._tdis_file in self._packagelist: - # tdis package already exists. there can be only one tdis - # package. remove existing tdis package - if self.simulation_data.verbosity_level.value >= \ - VerbosityLevel.normal.value: - print('WARNING: tdis package already exists. Replacing ' - 'existing tdis package.') - self._remove_package(self._tdis_file) - elif package.package_type.lower() == 'gnc' and \ - package.filename in self._ghost_node_files and \ - self._ghost_node_files[package.filename] in self._packagelist: - # gnc package with same file name already exists. remove old - # gnc package - if self.simulation_data.verbosity_level.value >= \ - VerbosityLevel.normal.value: - print('WARNING: gnc package with name {} already exists. ' - 'Replacing existing gnc package' - '.'.format(pname)) - self._remove_package(self._ghost_node_files[package.filename]) - del self._ghost_node_files[package.filename] - elif package.package_type.lower() == 'mvr' and \ - package.filename in self._mover_files and \ - self._mover_files[package.filename] in self._packagelist: - # mvr package with same file name already exists. remove old - # mvr package - if self.simulation_data.verbosity_level.value >= \ - VerbosityLevel.normal.value: - print('WARNING: mvr package with name {} already exists. ' - 'Replacing existing mvr package' - '.'.format(pname)) - self._remove_package(self._mover_files[package.filename]) - del self._mover_files[package.filename] - elif package.package_type.lower() != 'ims' and pname in \ - self.package_name_dict: - if self.simulation_data.verbosity_level.value >= \ - VerbosityLevel.normal.value: - print('WARNING: Package with name {} already exists. ' - 'Replacing existing package' - '.'.format(package.package_name.lower())) - self._remove_package(self.package_name_dict[pname]) - if package.package_type.lower() != 'ims': - # all but ims packages get added here. ims packages are - # added during ims package registration - self._add_package(package, path) - if package.package_type.lower() == 'nam': - return path, self.structure.name_file_struct_obj - elif package.package_type.lower() == 'tdis': - self._tdis_file = package - struct_root = mfstructure.MFStructure() - tdis_pkg = 'tdis{}'.format(struct_root.get_version_string()) - tdis_attr = getattr(self.name_file, tdis_pkg) - try: - tdis_attr.set_data(package.filename) - except MFDataException as mfde: - message = 'An error occurred while setting the tdis package ' \ - 'file name "{}". The error occurred while ' \ - 'registering the tdis package with the ' \ - 'simulation'.format(package.filename) - raise MFDataException(mfdata_except=mfde, - package=package._get_pname(), - message=message) - return path, self.structure.package_struct_objs[ - package.package_type.lower()] - elif package.package_type.lower() == 'gnc': - if package.filename not in self._ghost_node_files: - self._ghost_node_files[package.filename] = package - self._gnc_file_num += 1 - elif self._ghost_node_files[package.filename] != package: - # auto generate a unique file name and register it - file_name = MFFileMgmt.unique_file_name(package.filename, - self._ghost_node_files) - package.filename = file_name - self._ghost_node_files[file_name] = package - elif package.package_type.lower() == 'mvr': - if package.filename not in self._mover_files: - self._mover_files[package.filename] = package - else: - # auto generate a unique file name and register it - file_name = MFFileMgmt.unique_file_name(package.filename, - self._mover_files) - package.filename = file_name - self._mover_files[file_name] = package - elif package.package_type.lower() == 'ims': - # default behavior is to register the ims package with the first - # unregistered model - unregistered_models = [] - for model in self._models: - model_registered = self._is_in_solution_group(model, 2) - if not model_registered: - unregistered_models.append(model) - if unregistered_models: - self.register_ims_package(package, unregistered_models) - else: - self.register_ims_package(package, None) - return path, self.structure.package_struct_objs[ - package.package_type.lower()] - else: - self._other_files[package.filename] = package - - if package.package_type.lower() in self.structure.package_struct_objs: - return path, self.structure.package_struct_objs[ - package.package_type.lower()] - elif package.package_type.lower() in self.structure.utl_struct_objs: - return path, self.structure.utl_struct_objs[ - package.package_type.lower()] - else: - excpt_str = 'Invalid package type "{}". Unable to register ' \ - 'package.'.format(package.package_type) - print(excpt_str) - raise FlopyException(excpt_str) - - def register_model(self, model, model_type, model_name, model_namefile): - """ - add a model to the simulation. - - Parameters - ---------- - model : MFModel - model object to add to simulation - sln_group : string - solution group of model - - Returns - ------- - model_structure_object : MFModelStructure - - Examples - -------- - """ - - # get model structure from model type - if model_type not in self.structure.model_struct_objs: - message = 'Invalid model type: "{}".'.format(model_type) - type_, value_, traceback_ = sys.exc_info() - raise MFDataException(model.name, - '', model.name, - 'registering model', 'sim', - inspect.stack()[0][3], - type_, value_, traceback_, message, - self.simulation_data.debug) - - # add model - self._models[model_name] = model - - # update simulation name file - self.name_file.models.append_list_as_record([model_type, - model_namefile, - model_name]) - - if len(self._ims_files) > 0: - # register model with first ims file found - first_ims_key = next(iter(self._ims_files)) - self.register_ims_package(self._ims_files[first_ims_key], - model_name) - - return self.structure.model_struct_objs[model_type] - - def get_ims_package(self, key): - if key in self._ims_files: - return self._ims_files[key] - return None - - def remove_model(self, model_name): - """ - remove a model from the simulation. - - Parameters - ---------- - model_name : string - model name to remove from simulation - - Examples - -------- - """ - - # Remove model - del self._models[model_name] - - # TODO: Fully implement this - # Update simulation name file - - def is_valid(self): - """ - check all packages and models in the simulation to verify validity - - Returns - ---------- - valid : boolean - simulation validity - - Examples - -------- - """ - - # name file valid - if not self.name_file.is_valid(): - return False - - # tdis file valid - if not self._tdis_file.is_valid(): - return False - - # exchanges valid - for exchange in self._exchange_files: - if not exchange.is_valid(): - return False - - # ims files valid - for imsfile in self._ims_files.values(): - if not imsfile.is_valid(): - return False - - # a model exists - if not self._models: - return False - - # models valid - for key in self._models: - if not self._models[key].is_valid(): - return False - - # each model has an imsfile - - return True - - @staticmethod - def _resolve_verbosity_level(verbosity_level): - if verbosity_level == 0: - return VerbosityLevel.quiet - elif verbosity_level == 1: - return VerbosityLevel.normal - elif verbosity_level == 2: - return VerbosityLevel.verbose - else: - return verbosity_level - - @staticmethod - def _get_package_path(package): - if package.parent_file is not None: - return (package.parent_file.path) + (package.package_type,) - else: - return (package.package_type,) - - def _append_to_ims_solution_group(self, ims_file, new_models): - solution_recarray = self.name_file.solutiongroup - for solution_group_num in solution_recarray.get_active_key_list(): - try: - rec_array = solution_recarray.get_data(solution_group_num[0]) - except MFDataException as mfde: - message = 'An error occurred while getting solution group' \ - '"{}" from the simulation name file' \ - '.'.format(solution_group_num[0]) - raise MFDataException(mfdata_except=mfde, - package='nam', - message=message) - new_array = [] - for index, record in enumerate(rec_array): - new_record = [] - rec_model_dict = {} - for index, item in enumerate(record): - if record[1] == ims_file or item not in new_models: - new_record.append(item) - if index > 1: - rec_model_dict[item] = 1 - - if record[1] == ims_file: - for model in new_models: - if model not in rec_model_dict: - new_record.append(model) - - new_array.append(tuple(new_record)) - solution_recarray.set_data(new_array, - solution_group_num[0]) - - def _replace_ims_in_solution_group(self, item, index, new_item): - solution_recarray = self.name_file.solutiongroup - for solution_group_num in solution_recarray.get_active_key_list(): - try: - rec_array = solution_recarray.get_data(solution_group_num[0]) - except MFDataException as mfde: - message = 'An error occurred while getting solution group' \ - '"{}" from the simulation name file. The error ' \ - 'occurred while replacing IMS file "{}" with "{}"' \ - 'at index "{}"'.format(solution_group_num[0], - item, new_item, index) - raise MFDataException(mfdata_except=mfde, - package='nam', - message=message) - if rec_array is not None: - for rec_item in rec_array: - if rec_item[index] == item: - rec_item[index] = new_item - - def _is_in_solution_group(self, item, index): - solution_recarray = self.name_file.solutiongroup - for solution_group_num in solution_recarray.get_active_key_list(): - try: - rec_array = solution_recarray.get_data(solution_group_num[0]) - except MFDataException as mfde: - message = 'An error occurred while getting solution group' \ - '"{}" from the simulation name file. The error ' \ - 'occurred while verifying file "{}" at index "{}" ' \ - 'is in the simulation name file' \ - '.'.format(solution_group_num[0], item, index) - raise MFDataException(mfdata_except=mfde, - package='nam', - message=message) - - if rec_array is not None: - for rec_item in rec_array: - if rec_item[index] == item: - return True - return False - - - def plot(self, model_list=None, SelPackList=None, **kwargs): - """ - Method to plot a whole simulation or a series of models - that are part of a simualtion - - Parameters: - model_list: (list) list of model names to plot, if none - all models will be plotted - SelPackList: (list) list of package names to plot, if none - all packages will be plotted - - kwargs: - filename_base : str - Base file name that will be used to automatically generate file - names for output image files. Plots will be exported as image - files if file_name_base is not None. (default is None) - file_extension : str - Valid matplotlib.pyplot file extension for savefig(). Only used - if filename_base is not None. (default is 'png') - mflay : int - MODFLOW zero-based layer number to return. If None, then all - all layers will be included. (default is None) - kper : int - MODFLOW zero-based stress period number to return. - (default is zero) - key : str - MfList dictionary key. (default is None) - - - Returns: - axes: (list) matplotlib.pyplot.axes objects - """ - from flopy.plot.plotutil import PlotUtilities - - axes = PlotUtilities._plot_simulation_helper(self, - model_list=model_list, - SelPackList=SelPackList, - **kwargs) +""" +mfsimulation module. contains the MFSimulation class + + +""" +import errno, sys, inspect +import collections +import os.path +from ...mbase import run_model +from ..mfbase import PackageContainer, MFFileMgmt, ExtFileAction, \ + PackageContainerType, MFDataException, FlopyException, \ + VerbosityLevel +from ..mfpackage import MFPackage +from ..data.mfstructure import DatumType +from ..data import mfstructure +from ..utils import binaryfile_utils +from ..utils import mfobservation +from ..modflow import mfnam, mfims, mftdis, mfgwfgnc, mfgwfmvr +from ..data.mfdatautil import MFComment + + +class SimulationDict(collections.OrderedDict): + """ + Class containing custom dictionary for MODFLOW simulations. Behaves as an + OrderedDict with some additional features described below. + + Parameters + ---------- + path : MFFileMgmt + object containing path information for the simulation + + Methods + ------- + output_keys : (print_keys: boolean) : list + returns a list of output data keys the dictionary supports for output + data, print_keys allows those keys to be printed to output. + input_keys : () + prints all input data keys + observation_keys : () + prints observation keys + keys : () + print all keys, input and output + plot : (key : string, **kwargs) + plots data with key 'key' using **kwargs for plot options + shapefile : (key : string, **kwargs) + create shapefile from data with key 'key' and with additional fields + in **kwargs + """ + def __init__(self, path, *args): + self._path = path + collections.OrderedDict.__init__(self) + + def __getitem__(self, key): + # check if the key refers to a binary output file, or an observation + # output file, if so override the dictionary request and call output + # requester classes + + # FIX: Transport - Include transport output files + if key[1] in ('CBC', 'HDS', 'DDN', 'UCN'): + val = binaryfile_utils.MFOutput(self, self._path, key) + return val.data + + elif key[-1] == 'Observations': + val = mfobservation.MFObservation(self, self._path, key) + return val.data + + val = collections.OrderedDict.__getitem__(self, key) + return val + + def __setitem__(self, key, val): + collections.OrderedDict.__setitem__(self, key, val) + + def find_in_path(self, key_path, key_leaf): + key_path_size = len(key_path) + for key, item in self.items(): + if key[:key_path_size] == key_path: + if key[-1] == key_leaf: + # found key_leaf as a key in the dictionary + return item, None + if not isinstance(item, MFComment): + data_item_index = 0 + data_item_structures = item.structure.data_item_structures + for data_item_struct in data_item_structures: + if data_item_struct.name == key_leaf: + # found key_leaf as a data item name in the data in + # the dictionary + return item, data_item_index + if data_item_struct.type != DatumType.keyword: + data_item_index += 1 + return None, None + + def output_keys(self, print_keys=True): + # get keys to request binary output + x = binaryfile_utils.MFOutputRequester.getkeys(self, self._path, + print_keys=print_keys) + return [key for key in x.dataDict] + + def input_keys(self): + # get keys to request input ie. package data + for key in self: + print(key) + + def observation_keys(self): + # get keys to request observation file output + mfobservation.MFObservationRequester.getkeys(self, self._path) + + def keys(self): + # overrides the built in keys to print all keys, input and output + self.input_keys() + try: + self.output_keys() + except OSError as e: + if e.errno == errno.EEXIST: + pass + try: + self.observation_keys() + except KeyError: + pass + + +class MFSimulationData(object): + """ + Class containing MODFLOW simulation data and file formatting data. + + Parameters + ---------- + path : string + path on disk to the simulation + + Attributes + ---------- + indent_string : string + string used to define how much indent to use (file formatting) + internal_formatting : list + list defining string to use for internal formatting + external_formatting : list + list defining string to use for external formatting + open_close_formatting : list + list defining string to use for open/close + max_columns_of_data : int + maximum columns of data before line wraps + wrap_multidim_arrays : bool + whether to wrap line for multi-dimensional arrays at the end of a + row/column/layer + float_precision : int + number of decimal points to write for a floating point number + float_characters : int + number of characters a floating point number takes up + sci_note_upper_thres : float + numbers greater than this threshold are written in scientific notation + sci_note_lower_thres : float + numbers less than this threshold are written in scientific notation + mfpath : MFFileMgmt + file path location information for the simulation + model_dimensions : OrderedDict + dictionary containing discretization information for each model + mfdata : SimulationDict + custom dictionary containing all model data for the simulation + """ + def __init__(self, path): + # --- formatting variables --- + self.indent_string = ' ' + self.constant_formatting = ['constant', ''] + self.max_columns_of_data = 20 + self.wrap_multidim_arrays = True + self.float_precision = 8 + self.float_characters = 15 + self._sci_note_upper_thres = 100000 + self._sci_note_lower_thres = 0.001 + self.fast_write = True + self.comments_on = False + self.auto_set_sizes = True + self.debug = False + self.verbose = True + self.verbosity_level = VerbosityLevel.normal + + self._update_str_format() + + # --- file path --- + self.mfpath = MFFileMgmt(path) + + # --- ease of use variables to make working with modflow input and + # output data easier --- model dimension class for each model + self.model_dimensions = collections.OrderedDict() + + # --- model data --- + self.mfdata = SimulationDict(self.mfpath) + + # --- temporary variables --- + # other external files referenced + self.referenced_files = collections.OrderedDict() + + def set_sci_note_upper_thres(self, value): + self._sci_note_upper_thres = value + self._update_str_format() + + def set_sci_note_lower_thres(self, value): + self._sci_note_lower_thres = value + self._update_str_format() + + def _update_str_format(self): + self.reg_format_str = '{:.%dE}' % \ + self.float_precision + self.sci_format_str = '{:%d.%df' \ + '}' % (self.float_characters, + self.float_precision) + + +class MFSimulation(PackageContainer): + """ + MODFLOW Simulation Class. Entry point into any MODFLOW simulation. + + Parameters + ---------- + sim_name : string + name of the simulation. + version : string + MODFLOW version + exe_name : string + relative path to MODFLOW executable from the simulation working folder + sim_ws : string + path to simulation working folder + verbosity_level : int + verbosity level of standard output + 0 : no standard output + 1 : standard error/warning messages with some informational messages + 2 : verbose mode with full error/warning/informational messages. + this is ideal for debugging + + Attributes + ---------- + sim_name : string + name of the simulation + models : OrderedDict + all models in the simulation + exchanges : list + all exchange packages in the simulation + imsfiles : list + all ims packages in the simulation + mfdata : OrderedDict + all variables defined in the simulation. the key for a variable is + defined as a tuple. for "simulation level" packages the tuple + starts with the package type, followed by the block name, followed + by the variable name ("TDIS", "DIMENSIONS", "nper"). for "model level" + packages the tuple starts with the model name, followed by the package + name, followed by the block name, followed by the variable name ( + "MyModelName", "DIS6", "OPTIONS", "length_units"). + name_file : MFPackage + simulation name file + tdis_file + simulation tdis file + + Methods + ------- + load : (sim_name : string, version : string, exe_name : string, + sim_ws : string, strict : boolean, + verbosity_level : VerbosityLevel) : + MFSimulation + a class method that loads a simulation from files + write_simulation + writes the simulation to files + set_sim_path : (path : string) + set the file path to the root simulation folder and updates all model + file paths + get_model : (model_name : string) + : [MFModel] + returns the models in the simulation with a given model name, name file + name, or model type + add_model : (model : MFModel, sln_group : integer) + add model to the simulation + remove_model : (model_name : string) + remove model from the simulation + get_package : (type : string) + returns a simulation package based on package type + add_package : (package : MFPackage) + adds a simulation package to the simulation + remove_package : (package_name : string) + removes package from the simulation. package_name can be the + package's name, type, or package object to be removed from + the model + is_valid : () : boolean + checks the validity of the solution and all of its models and packages + + See Also + -------- + + Notes + ----- + + Examples + -------- + + >>> s = flopy6.mfsimulation.load('my simulation', 'simulation.nam') + + """ + def __init__(self, sim_name='sim', version='mf6', + exe_name='mf6.exe', sim_ws='.', + verbosity_level=1): + super(MFSimulation, self).__init__(MFSimulationData(sim_ws), sim_name) + self.simulation_data.verbosity_level = self._resolve_verbosity_level( + verbosity_level) + # verify metadata + fpdata = mfstructure.MFStructure() + if not fpdata.valid: + excpt_str = 'Invalid package metadata. Unable to load MODFLOW ' \ + 'file structure metadata.' + raise FlopyException(excpt_str) + + # initialize + self.dimensions = None + self.type = 'Simulation' + + self.version = version + self.exe_name = exe_name + self._models = collections.OrderedDict() + self._tdis_file = None + self._exchange_files = collections.OrderedDict() + self._ims_files = collections.OrderedDict() + self._ghost_node_files = {} + self._mover_files = {} + self._other_files = collections.OrderedDict() + self.structure = fpdata.sim_struct + + self._exg_file_num = {} + self._gnc_file_num = 0 + self._mvr_file_num = 0 + + self.simulation_data.mfpath.set_last_accessed_path() + + # build simulation name file + self.name_file = mfnam.ModflowNam(self, filename='mfsim.nam') + + # try to build directory structure + sim_path = self.simulation_data.mfpath.get_sim_path() + if not os.path.isdir(sim_path): + try: + os.makedirs(sim_path) + except OSError as e: + if self.simulation_data.verbosity_level.value >= \ + VerbosityLevel.quiet.value: + print('An error occurred when trying to create the ' + 'directory {}: {}'.format(sim_path, e.strerror)) + + # set simulation validity initially to false since the user must first + # add at least one model to the simulation and fill out the name and + # tdis files + self.valid = False + + def __getattr__(self, item): + """ + __getattr__ - used to allow for getting models and packages as if + they are attributes + + Parameters + ---------- + item : str + model or package name + + + Returns + ------- + md : Model or package object + Model or package object of type :class:flopy6.mfmodel or + :class:flopy6.mfpackage + + """ + + models = [] + if item in self.structure.model_types: + # get all models of this type + for model in self._models.values(): + if model.model_type == item: + models.append(model) + + if len(models) > 0: + return models + elif item in self._models: + return self.get_model(item) + else: + return self.get_package(item) + + def __repr__(self): + return self._get_data_str(True) + + def __str__(self): + return self._get_data_str(False) + + def _get_data_str(self, formal): + file_mgt = self.simulation_data.mfpath + data_str = 'sim_name = {}\nsim_path = {}\nexe_name = ' \ + '{}\n\n'.format(self.name, file_mgt.get_sim_path(), + self.exe_name) + + for package in self._packagelist: + pk_str = package._get_data_str(formal, False) + if formal: + if len(pk_str.strip()) > 0: + data_str = '{}###################\nPackage {}\n' \ + '###################\n\n' \ + '{}\n'.format(data_str, package._get_pname(), + pk_str) + else: + if len(pk_str.strip()) > 0: + data_str = '{}###################\nPackage {}\n' \ + '###################\n\n' \ + '{}\n'.format(data_str, package._get_pname(), + pk_str) + for model in self._models.values(): + if formal: + mod_repr = repr(model) + if len(mod_repr.strip()) > 0: + data_str = '{}@@@@@@@@@@@@@@@@@@@@\nModel {}\n' \ + '@@@@@@@@@@@@@@@@@@@@\n\n' \ + '{}\n'.format(data_str, model.name, mod_repr) + else: + mod_str = str(model) + if len(mod_str.strip()) > 0: + data_str = '{}@@@@@@@@@@@@@@@@@@@@\nModel {}\n' \ + '@@@@@@@@@@@@@@@@@@@@\n\n' \ + '{}\n'.format(data_str, model.name, mod_str) + return data_str + + @property + def model_names(self): + """ + Returns a list of model names associated with this simulation + """ + return self._models.keys() + + @classmethod + def load(cls, sim_name='modflowsim', version='mf6', exe_name='mf6.exe', + sim_ws='.', strict=True, verbosity_level=1): + """ + Load an existing model. + + Parameters + ---------- + sim_name : string + name of the simulation. + version : string + MODFLOW version + exe_name : string + relative path to MODFLOW executable from the simulation working + folder + sim_ws : string + path to simulation working folder + strict : boolean + strict enforcement of file formatting + verbosity_level : int + verbosity level of standard output + 0 : no standard output + 1 : standard error/warning messages with some informational + messages + 2 : verbose mode with full error/warning/informational + messages. this is ideal for debugging + Returns + ------- + sim : MFSimulation object + + Examples + -------- + >>> s = flopy6.mfsimulation.load('my simulation') + """ + # initialize + instance = cls(sim_name, version, exe_name, sim_ws, verbosity_level) + verbosity_level = instance.simulation_data.verbosity_level + + if verbosity_level.value >= VerbosityLevel.normal.value: + print('loading simulation...') + + # load simulation name file + if verbosity_level.value >= VerbosityLevel.normal.value: + print(' loading simulation name file...') + instance.name_file.load(strict) + + # load TDIS file + tdis_pkg = 'tdis{}'.format(mfstructure.MFStructure(). + get_version_string()) + tdis_attr = getattr(instance.name_file, tdis_pkg) + instance._tdis_file = mftdis.ModflowTdis(instance, + filename=tdis_attr.get_data()) + + instance._tdis_file._filename = instance.simulation_data.mfdata[ + ('nam', 'timing', tdis_pkg)].get_data() + if verbosity_level.value >= VerbosityLevel.normal.value: + print(' loading tdis package...') + instance._tdis_file.load(strict) + + # load models + try: + model_recarray = instance.simulation_data.mfdata[('nam', 'models', + 'models')] + models = model_recarray.get_data() + except MFDataException as mfde: + message = 'Error occurred while loading model names from the ' \ + 'simulation name file.' + raise MFDataException(mfdata_except=mfde, + model=instance.name, + package='nam', + message=message) + for item in models: + # resolve model working folder and name file + path, name_file = os.path.split(item[1]) + model_obj = PackageContainer.model_factory(item[0][:-1].lower()) + # load model + if verbosity_level.value >= VerbosityLevel.normal.value: + print(' loading model {}...'.format(item[0].lower())) + instance._models[item[2]] = model_obj.load( + instance, + instance.structure.model_struct_objs[item[0].lower()], item[2], + name_file, version, exe_name, strict, path) + + # load exchange packages and dependent packages + try: + exchange_recarray = instance.name_file.exchanges + has_exch_data = exchange_recarray.has_data() + except MFDataException as mfde: + message = 'Error occurred while loading exchange names from the ' \ + 'simulation name file.' + raise MFDataException(mfdata_except=mfde, + model=instance.name, + package='nam', + message=message) + if has_exch_data: + try: + exch_data = exchange_recarray.get_data() + except MFDataException as mfde: + message = 'Error occurred while loading exchange names from the ' \ + 'simulation name file.' + raise MFDataException(mfdata_except=mfde, + model=instance.name, + package='nam', + message=message) + for exgfile in exch_data: + # get exchange type by removing numbers from exgtype + exchange_type = ''.join([char for char in exgfile[0] if + not char.isdigit()]).upper() + # get exchange number for this type + if not exchange_type in instance._exg_file_num: + exchange_file_num = 0 + instance._exg_file_num[exchange_type] = 1 + else: + exchange_file_num = instance._exg_file_num[exchange_type] + instance._exg_file_num[exchange_type] += 1 + + exchange_name = '{}_EXG_{}'.format(exchange_type, + exchange_file_num) + # find package class the corresponds to this exchange type + package_obj = instance.package_factory( + exchange_type.replace('-', '').lower(), '') + if not package_obj: + message = 'An error occurred while loading the ' \ + 'simulation name file. Invalid exchange type ' \ + '"{}" specified.'.format(exchange_type) + type_, value_, traceback_ = sys.exc_info() + raise MFDataException(instance.name, + 'nam', + 'nam', + 'loading simulation name file', + exchange_recarray.structure.name, + inspect.stack()[0][3], + type_, value_, traceback_, message, + instance._simulation_data.debug) + + # build and load exchange package object + exchange_file = package_obj(instance, exgtype=exgfile[0], + exgmnamea=exgfile[2], + exgmnameb=exgfile[3], + filename=exgfile[1], + pname=exchange_name, + loading_package=True) + if verbosity_level.value >= VerbosityLevel.normal.value: + print(' loading exchange package {}..' + '.'.format(exchange_file._get_pname())) + exchange_file.load(strict) + instance._exchange_files[exgfile[1]] = exchange_file + + # load simulation packages + solution_recarray = instance.simulation_data.mfdata[('nam', + 'solutiongroup', + 'solutiongroup' + )] + + try: + solution_group_dict = solution_recarray.get_data() + except MFDataException as mfde: + message = 'Error occurred while loading solution groups from ' \ + 'the simulation name file.' + raise MFDataException(mfdata_except=mfde, + model=instance.name, + package='nam', + message=message) + for solution_group in solution_group_dict.values(): + for solution_info in solution_group: + ims_file = mfims.ModflowIms(instance, filename=solution_info[1], + pname=solution_info[2]) + if verbosity_level.value >= VerbosityLevel.normal.value: + print(' loading ims package {}..' + '.'.format(ims_file._get_pname())) + ims_file.load(strict) + + instance.simulation_data.mfpath.set_last_accessed_path() + return instance + + def load_package(self, ftype, fname, pname, strict, ref_path, + dict_package_name=None, parent_package=None): + """ + loads a package from a file + + Parameters + ---------- + ftype : string + the file type + fname : string + the name of the file containing the package input + pname : string + the user-defined name for the package + strict : bool + strict mode when loading the file + ref_path : string + path to the file. uses local path if set to None + dict_package_name : string + package name for dictionary lookup + parent_package : MFPackage + parent package + + Examples + -------- + """ + if ftype == 'gnc': + if fname not in self._ghost_node_files: + # get package type from parent package + if parent_package: + package_abbr = parent_package.package_abbr[0:3] + else: + package_abbr = 'GWF' + # build package name and package + gnc_name = '{}-GNC_{}'.format(package_abbr, self._gnc_file_num) + ghost_node_file = mfgwfgnc.ModflowGwfgnc(self, filename=fname, + pname=gnc_name, + parent_file= + parent_package, + loading_package=True) + ghost_node_file.load(strict) + self._ghost_node_files[fname] = ghost_node_file + self._gnc_file_num += 1 + return ghost_node_file + elif ftype == 'mvr': + if fname not in self._mover_files: + # Get package type from parent package + if parent_package: + package_abbr = parent_package.package_abbr[0:3] + else: + package_abbr = 'GWF' + # build package name and package + mvr_name = '{}-MVR_{}'.format(package_abbr, self._mvr_file_num) + mover_file = mfgwfmvr.ModflowGwfmvr(self, filename=fname, + pname=mvr_name, + parent_file=parent_package, + loading_package=True) + mover_file.load(strict) + self._mover_files[fname] = mover_file + self._mvr_file_num += 1 + return mover_file + else: + # create package + package_obj = self.package_factory(ftype, '') + package = package_obj(self, filename=fname, pname=dict_package_name, + add_to_package_list=False, + parent_file=parent_package, + loading_package=True) + # verify that this is a utility package + utl_struct = mfstructure.MFStructure().sim_struct.utl_struct_objs + if package.package_type in utl_struct: + package.load(strict) + self._other_files[package.filename] = package + # register child package with the simulation + self._add_package(package, package.path) + if parent_package is not None: + # register child package with the parent package + parent_package._add_package(package, package.path) + else: + if self.simulation_data.verbosity_level.value >= \ + VerbosityLevel.normal.value: + print('WARNING: Unsupported file type {} for ' + 'simulation.'.format(package.package_type)) + return package + + def register_ims_package(self, ims_file, model_list): + """ + registers an ims package with the simulation + + Parameters + ---------- + ims_file : MFPackage + ims package to register + model_list : list of strings + list of models using the ims package to be registered + + Examples + -------- + """ + if isinstance(model_list, str): + model_list = [model_list] + + if not isinstance(ims_file, mfims.ModflowIms): + comment = 'Parameter "ims_file" is not a valid ims file. ' \ + 'Expected type ModflowIms, but type "{}" was given' \ + '.'.format(type(ims_file)) + type_, value_, traceback_ = sys.exc_info() + raise MFDataException(None, + 'ims', + '', + 'registering ims package', + '', + inspect.stack()[0][3], type_, + value_, + traceback_, comment, + self.simulation_data.debug) + + in_simulation = False + pkg_with_same_name = None + for file in self._ims_files.values(): + if file is ims_file: + in_simulation = True + if file.package_name == ims_file.package_name and \ + file != ims_file: + pkg_with_same_name = file + if self.simulation_data.verbosity_level.value >= \ + VerbosityLevel.normal.value: + print('WARNING: ims package with name {} already exists. ' + 'New ims package will replace old package' + '.'.format(file.package_name)) + self._remove_package(self._ims_files[file.filename]) + del self._ims_files[file.filename] + # register ims package + if not in_simulation: + self._add_package(ims_file, self._get_package_path(ims_file)) + # do not allow an ims package to be registered twice with the + # same simulation + if not in_simulation: + # create unique file/package name + if ims_file.package_name is None: + file_num = len(self._ims_files) - 1 + ims_file.package_name = 'ims_{}'.format(file_num) + if ims_file.filename in self._ims_files: + ims_file.filename = MFFileMgmt.unique_file_name( + ims_file.filename, self._ims_files) + # add ims package to simulation + self._ims_files[ims_file.filename] = ims_file + + # If ims file is being replaced, replace ims filename in solution group + if pkg_with_same_name is not None and \ + self._is_in_solution_group(pkg_with_same_name.filename, 1): + # change existing solution group to reflect new ims file + self._replace_ims_in_solution_group(pkg_with_same_name.filename, + 1, ims_file.filename) + # only allow an ims package to be registered to one solution group + elif model_list is not None: + ims_in_group = self._is_in_solution_group(ims_file.filename, 1) + # add solution group to the simulation name file + solution_recarray = self.name_file.solutiongroup + solution_group_list = solution_recarray.get_active_key_list() + if len(solution_group_list) == 0: + solution_group_num = 0 + else: + solution_group_num = solution_group_list[-1][0] + + if ims_in_group: + self._append_to_ims_solution_group(ims_file.filename, + model_list) + else: + if self.name_file.mxiter.get_data(solution_group_num) is None: + self.name_file.mxiter.add_transient_key(solution_group_num) + + # associate any models in the model list to this simulation file + version_string = mfstructure.MFStructure().get_version_string() + ims_pkg = 'ims{}'.format(version_string) + new_record = [ims_pkg, ims_file.filename] + for model in model_list: + new_record.append(model) + try: + solution_recarray.append_list_as_record(new_record, + solution_group_num) + except MFDataException as mfde: + message = 'Error occurred while updating the ' \ + 'simulation name file with the ims package ' \ + 'file "{}".'.format(ims_file.filename) + raise MFDataException(mfdata_except=mfde, + package='nam', + message=message) + + def write_simulation(self, + ext_file_action=ExtFileAction.copy_relative_paths, + silent=False): + """ + writes the simulation to files + + Parameters + ---------- + ext_file_action : ExtFileAction + defines what to do with external files when the simulation path + has changed. defaults to copy_relative_paths which copies only + files with relative paths, leaving files defined by absolute + paths fixed. + silent : bool + writes out the simulation in silent mode (verbosity_level = 0) + Examples + -------- + """ + saved_verb_lvl = self.simulation_data.verbosity_level + if silent: + self.simulation_data.verbosity_level = VerbosityLevel.quiet + + # write simulation name file + if self.simulation_data.verbosity_level.value >= \ + VerbosityLevel.normal.value: + print('writing simulation...') + print(' writing simulation name file...') + self.name_file.write(ext_file_action=ext_file_action) + + # write TDIS file + if self.simulation_data.verbosity_level.value >= \ + VerbosityLevel.normal.value: + print(' writing simulation tdis package...') + self._tdis_file.write(ext_file_action=ext_file_action) + + # write ims files + for ims_file in self._ims_files.values(): + if self.simulation_data.verbosity_level.value >= \ + VerbosityLevel.normal.value: + print(' writing ims package {}...'.format( + ims_file._get_pname())) + ims_file.write(ext_file_action=ext_file_action) + + # write exchange files + for exchange_file in self._exchange_files.values(): + exchange_file.write() + if hasattr(exchange_file, 'gnc_filerecord') and \ + exchange_file.gnc_filerecord.has_data(): + try: + gnc_file = exchange_file.gnc_filerecord.get_data()[0][0] + except MFDataException as mfde: + message = 'An error occurred while retrieving the ghost ' \ + 'node file record from exchange file ' \ + '"{}".'.format(exchange_file.filename) + raise MFDataException(mfdata_except=mfde, + package=exchange_file._get_pname(), + message=message) + if gnc_file in self._ghost_node_files: + if self.simulation_data.verbosity_level.value >= \ + VerbosityLevel.normal.value: + print(' writing gnc package {}...'.format( + self._ghost_node_files[gnc_file]._get_pname())) + self._ghost_node_files[gnc_file].write(ext_file_action= + ext_file_action) + else: + if self.simulation_data.verbosity_level.value >= \ + VerbosityLevel.normal.value: + print('WARNING: Ghost node file {} not loaded prior to' + ' writing. File will not be written' + '.'.format(gnc_file)) + if hasattr(exchange_file, 'mvr_filerecord') and \ + exchange_file.mvr_filerecord.has_data(): + try: + mvr_file = exchange_file.mvr_filerecord.get_data()[0][0] + except MFDataException as mfde: + message = 'An error occurred while retrieving the mover ' \ + 'file record from exchange file ' \ + '"{}".'.format(exchange_file.filename) + raise MFDataException(mfdata_except=mfde, + package=exchange_file._get_pname(), + message=message) + + if mvr_file in self._mover_files: + if self.simulation_data.verbosity_level.value >= \ + VerbosityLevel.normal.value: + print(' writing mvr package {}...'.format( + self._mover_files[mvr_file]._get_pname())) + self._mover_files[mvr_file].write(ext_file_action= + ext_file_action) + else: + if self.simulation_data.verbosity_level.value >= \ + VerbosityLevel.normal.value: + print('WARNING: Mover file {} not loaded prior to ' + 'writing. File will not be ' + 'written.'.format(mvr_file)) + + if ext_file_action == ExtFileAction.copy_relative_paths: + # move external files with relative paths + num_files_copied = self.simulation_data.mfpath.copy_files() + elif ext_file_action == ExtFileAction.copy_all: + # move all external files + num_files_copied = self.simulation_data.mfpath.copy_files( + copy_relative_only=False) + else: + num_files_copied = 0 + if self.simulation_data.verbosity_level.value >= \ + VerbosityLevel.verbose.value and num_files_copied > 0: + print('INFORMATION: {} external files copied'.format( + num_files_copied)) + + # write other packages + for pp in self._other_files.values(): + if self.simulation_data.verbosity_level.value >= \ + VerbosityLevel.normal.value: + print(' writing package {}...'.format(pp._get_pname())) + pp.write(ext_file_action=ext_file_action) + + # FIX: model working folder should be model name file folder + + # write models + for model in self._models.values(): + if self.simulation_data.verbosity_level.value >= \ + VerbosityLevel.normal.value: + print(' writing model {}...'.format(model.name)) + model.write(ext_file_action=ext_file_action) + + self.simulation_data.mfpath.set_last_accessed_path() + + if silent: + self.simulation_data.verbosity_level = saved_verb_lvl + + def set_sim_path(self, path): + self.simulation_data.mfpath.set_sim_path(path) + + def run_simulation(self, silent=None, pause=False, report=False, + normal_msg='normal termination', + use_async=False, cargs=None): + """ + Run the simulation. + """ + if silent is None: + if self.simulation_data.verbosity_level.value >= \ + VerbosityLevel.normal.value: + silent = False + else: + silent = True + return run_model(self.exe_name, None, + self.simulation_data.mfpath.get_sim_path(), + silent=silent, pause=pause, report=report, + normal_msg=normal_msg, use_async=use_async, cargs=cargs) + + def delete_output_files(self): + """ + Delete simulation output files. + """ + output_req = binaryfile_utils.MFOutputRequester + output_file_keys = output_req.getkeys(self.simulation_data.mfdata, + self.simulation_data.mfpath, + False) + for path in output_file_keys.binarypathdict.values(): + if os.path.isfile(path): + os.remove(path) + + def remove_package(self, package_name): + if isinstance(package_name, MFPackage): + packages = [package_name] + else: + packages = self.get_package(package_name) + if not isinstance(packages, list): + packages = [packages] + for package in packages: + if self._tdis_file is not None and \ + package.path == self._tdis_file.path: + self._tdis_file = None + if package.filename in self._exchange_files: + del self._exchange_files[package.filename] + if package.filename in self._ims_files: + del self._ims_files[package.filename] + if package.filename in self._ghost_node_files: + del self._ghost_node_files[package.filename] + if package.filename in self._mover_files: + del self._mover_files[package.filename] + if package.filename in self._other_files : + del self._other_files[package.filename] + + self._remove_package(package) + + @property + def model_dict(self): + return self._models.copy() + + def get_model(self, model_name=None): + """ + Load an existing model. + + Parameters + ---------- + model_name : string + name of model to get + + Returns + ------- + model : MFModel + + Examples + -------- + """ + if model_name is None: + for model in self._models.values(): + return model + return self._models[model_name] + + def get_exchange_file(self, filename): + """ + get a specified exchange file + + Parameters + ---------- + filename : string + name of exchange file to get + + Returns + ------- + exchange package : MFPackage + + Examples + -------- + """ + if filename in self._exchange_files: + return self._exchange_files[filename] + else: + excpt_str = 'Exchange file "{}" can not be found' \ + '.'.format(filename) + raise FlopyException(excpt_str) + + def get_mvr_file(self, filename): + """ + get a specified mover file + + Parameters + ---------- + filename : string + name of mover file to get + + Returns + ------- + mover package : MFPackage + + Examples + -------- + """ + if filename in self._mover_files: + return self._mover_files[filename] + else: + excpt_str = 'MVR file "{}" can not be ' \ + 'found.'.format(filename) + raise FlopyException(excpt_str) + + def get_gnc_file(self, filename): + """ + get a specified gnc file + + Parameters + ---------- + filename : string + name of gnc file to get + + Returns + ------- + gnc package : MFPackage + + Examples + -------- + """ + if filename in self._ghost_node_files: + return self._ghost_node_files[filename] + else: + excpt_str = 'GNC file "{}" can not be ' \ + 'found.'.format(filename) + raise FlopyException(excpt_str) + + def register_exchange_file(self, package): + """ + register an exchange package file with the simulation + + Parameters + ---------- + package : MFPackage + exchange package object to register + + Examples + -------- + """ + if package.filename not in self._exchange_files: + exgtype = package.exgtype + exgmnamea = package.exgmnamea + exgmnameb = package.exgmnameb + + if exgtype is None or exgmnamea is None or exgmnameb is None: + excpt_str = 'Exchange packages require that exgtype, ' \ + 'exgmnamea, and exgmnameb are specified.' + raise FlopyException(excpt_str) + + self._exchange_files[package.filename] = package + try: + exchange_recarray_data = self.name_file.exchanges.get_data() + except MFDataException as mfde: + message = 'An error occurred while retrieving exchange ' \ + 'data from the simulation name file. The error ' \ + 'occurred while registering exchange file ' \ + '"{}".'.format(package.filename) + raise MFDataException(mfdata_except=mfde, + package=package._get_pname(), + message=message) + if exchange_recarray_data is not None: + for index, exchange in zip(range(0, + len(exchange_recarray_data)), + exchange_recarray_data): + if exchange[1] == package.filename: + # update existing exchange + exchange_recarray_data[index][0] = exgtype + exchange_recarray_data[index][2] = exgmnamea + exchange_recarray_data[index][3] = exgmnameb + ex_recarray = self.name_file.exchanges + try: + ex_recarray.set_data(exchange_recarray_data) + except MFDataException as mfde: + message = 'An error occurred while setting ' \ + 'exchange data in the simulation name ' \ + 'file. The error occurred while ' \ + 'registering the following ' \ + 'values (exgtype, filename, ' \ + 'exgmnamea, exgmnameb): "{} {} {}' \ + '{}".'.format(exgtype, package.filename, + exgmnamea, exgmnameb) + raise MFDataException(mfdata_except=mfde, + package=package._get_pname(), + message=message) + return + try: + # add new exchange + self.name_file.exchanges.append_data([(exgtype, + package.filename, + exgmnamea, + exgmnameb)]) + except MFDataException as mfde: + message = 'An error occurred while setting exchange data ' \ + 'in the simulation name file. The error occurred ' \ + 'while registering the following values (exgtype, ' \ + 'filename, exgmnamea, exgmnameb): "{} {} {}' \ + '{}".'.format(exgtype, package.filename, exgmnamea, + exgmnameb) + raise MFDataException(mfdata_except=mfde, + package=package._get_pname(), + message=message) + if package.dimensions is None: + # resolve exchange package dimensions object + package.dimensions = package.create_package_dimensions() + + def register_package(self, package, add_to_package_list=True, + set_package_name=True, set_package_filename=True): + """ + register a package file with the simulation + + Parameters + ---------- + package : MFPackage + package to register + add_to_package_list : bool + add package to lookup list + set_package_name : bool + produce a package name for this package + set_package_filename : bool + produce a filename for this package + + Returns + ------- + (path : tuple, package structure : MFPackageStructure) + + Examples + -------- + """ + package.container_type = [PackageContainerType.simulation] + path = self._get_package_path(package) + if add_to_package_list and package.package_type.lower != 'nam': + pname = None + if package.package_name is not None: + pname = package.package_name.lower() + if package.package_type.lower() == 'tdis' and self._tdis_file is \ + not None and self._tdis_file in self._packagelist: + # tdis package already exists. there can be only one tdis + # package. remove existing tdis package + if self.simulation_data.verbosity_level.value >= \ + VerbosityLevel.normal.value: + print('WARNING: tdis package already exists. Replacing ' + 'existing tdis package.') + self._remove_package(self._tdis_file) + elif package.package_type.lower() == 'gnc' and \ + package.filename in self._ghost_node_files and \ + self._ghost_node_files[package.filename] in self._packagelist: + # gnc package with same file name already exists. remove old + # gnc package + if self.simulation_data.verbosity_level.value >= \ + VerbosityLevel.normal.value: + print('WARNING: gnc package with name {} already exists. ' + 'Replacing existing gnc package' + '.'.format(pname)) + self._remove_package(self._ghost_node_files[package.filename]) + del self._ghost_node_files[package.filename] + elif package.package_type.lower() == 'mvr' and \ + package.filename in self._mover_files and \ + self._mover_files[package.filename] in self._packagelist: + # mvr package with same file name already exists. remove old + # mvr package + if self.simulation_data.verbosity_level.value >= \ + VerbosityLevel.normal.value: + print('WARNING: mvr package with name {} already exists. ' + 'Replacing existing mvr package' + '.'.format(pname)) + self._remove_package(self._mover_files[package.filename]) + del self._mover_files[package.filename] + elif package.package_type.lower() != 'ims' and pname in \ + self.package_name_dict: + if self.simulation_data.verbosity_level.value >= \ + VerbosityLevel.normal.value: + print('WARNING: Package with name {} already exists. ' + 'Replacing existing package' + '.'.format(package.package_name.lower())) + self._remove_package(self.package_name_dict[pname]) + if package.package_type.lower() != 'ims': + # all but ims packages get added here. ims packages are + # added during ims package registration + self._add_package(package, path) + if package.package_type.lower() == 'nam': + return path, self.structure.name_file_struct_obj + elif package.package_type.lower() == 'tdis': + self._tdis_file = package + struct_root = mfstructure.MFStructure() + tdis_pkg = 'tdis{}'.format(struct_root.get_version_string()) + tdis_attr = getattr(self.name_file, tdis_pkg) + try: + tdis_attr.set_data(package.filename) + except MFDataException as mfde: + message = 'An error occurred while setting the tdis package ' \ + 'file name "{}". The error occurred while ' \ + 'registering the tdis package with the ' \ + 'simulation'.format(package.filename) + raise MFDataException(mfdata_except=mfde, + package=package._get_pname(), + message=message) + return path, self.structure.package_struct_objs[ + package.package_type.lower()] + elif package.package_type.lower() == 'gnc': + if package.filename not in self._ghost_node_files: + self._ghost_node_files[package.filename] = package + self._gnc_file_num += 1 + elif self._ghost_node_files[package.filename] != package: + # auto generate a unique file name and register it + file_name = MFFileMgmt.unique_file_name(package.filename, + self._ghost_node_files) + package.filename = file_name + self._ghost_node_files[file_name] = package + elif package.package_type.lower() == 'mvr': + if package.filename not in self._mover_files: + self._mover_files[package.filename] = package + else: + # auto generate a unique file name and register it + file_name = MFFileMgmt.unique_file_name(package.filename, + self._mover_files) + package.filename = file_name + self._mover_files[file_name] = package + elif package.package_type.lower() == 'ims': + # default behavior is to register the ims package with the first + # unregistered model + unregistered_models = [] + for model in self._models: + model_registered = self._is_in_solution_group(model, 2) + if not model_registered: + unregistered_models.append(model) + if unregistered_models: + self.register_ims_package(package, unregistered_models) + else: + self.register_ims_package(package, None) + return path, self.structure.package_struct_objs[ + package.package_type.lower()] + else: + self._other_files[package.filename] = package + + if package.package_type.lower() in self.structure.package_struct_objs: + return path, self.structure.package_struct_objs[ + package.package_type.lower()] + elif package.package_type.lower() in self.structure.utl_struct_objs: + return path, self.structure.utl_struct_objs[ + package.package_type.lower()] + else: + excpt_str = 'Invalid package type "{}". Unable to register ' \ + 'package.'.format(package.package_type) + print(excpt_str) + raise FlopyException(excpt_str) + + def register_model(self, model, model_type, model_name, model_namefile): + """ + add a model to the simulation. + + Parameters + ---------- + model : MFModel + model object to add to simulation + sln_group : string + solution group of model + + Returns + ------- + model_structure_object : MFModelStructure + + Examples + -------- + """ + + # get model structure from model type + if model_type not in self.structure.model_struct_objs: + message = 'Invalid model type: "{}".'.format(model_type) + type_, value_, traceback_ = sys.exc_info() + raise MFDataException(model.name, + '', model.name, + 'registering model', 'sim', + inspect.stack()[0][3], + type_, value_, traceback_, message, + self.simulation_data.debug) + + # add model + self._models[model_name] = model + + # update simulation name file + self.name_file.models.append_list_as_record([model_type, + model_namefile, + model_name]) + + if len(self._ims_files) > 0: + # register model with first ims file found + first_ims_key = next(iter(self._ims_files)) + self.register_ims_package(self._ims_files[first_ims_key], + model_name) + + return self.structure.model_struct_objs[model_type] + + def get_ims_package(self, key): + if key in self._ims_files: + return self._ims_files[key] + return None + + def remove_model(self, model_name): + """ + remove a model from the simulation. + + Parameters + ---------- + model_name : string + model name to remove from simulation + + Examples + -------- + """ + + # Remove model + del self._models[model_name] + + # TODO: Fully implement this + # Update simulation name file + + def is_valid(self): + """ + check all packages and models in the simulation to verify validity + + Returns + ---------- + valid : boolean + simulation validity + + Examples + -------- + """ + + # name file valid + if not self.name_file.is_valid(): + return False + + # tdis file valid + if not self._tdis_file.is_valid(): + return False + + # exchanges valid + for exchange in self._exchange_files: + if not exchange.is_valid(): + return False + + # ims files valid + for imsfile in self._ims_files.values(): + if not imsfile.is_valid(): + return False + + # a model exists + if not self._models: + return False + + # models valid + for key in self._models: + if not self._models[key].is_valid(): + return False + + # each model has an imsfile + + return True + + @staticmethod + def _resolve_verbosity_level(verbosity_level): + if verbosity_level == 0: + return VerbosityLevel.quiet + elif verbosity_level == 1: + return VerbosityLevel.normal + elif verbosity_level == 2: + return VerbosityLevel.verbose + else: + return verbosity_level + + @staticmethod + def _get_package_path(package): + if package.parent_file is not None: + return (package.parent_file.path) + (package.package_type,) + else: + return (package.package_type,) + + def _append_to_ims_solution_group(self, ims_file, new_models): + solution_recarray = self.name_file.solutiongroup + for solution_group_num in solution_recarray.get_active_key_list(): + try: + rec_array = solution_recarray.get_data(solution_group_num[0]) + except MFDataException as mfde: + message = 'An error occurred while getting solution group' \ + '"{}" from the simulation name file' \ + '.'.format(solution_group_num[0]) + raise MFDataException(mfdata_except=mfde, + package='nam', + message=message) + new_array = [] + for index, record in enumerate(rec_array): + new_record = [] + rec_model_dict = {} + for index, item in enumerate(record): + if record[1] == ims_file or item not in new_models: + new_record.append(item) + if index > 1: + rec_model_dict[item] = 1 + + if record[1] == ims_file: + for model in new_models: + if model not in rec_model_dict: + new_record.append(model) + + new_array.append(tuple(new_record)) + solution_recarray.set_data(new_array, + solution_group_num[0]) + + def _replace_ims_in_solution_group(self, item, index, new_item): + solution_recarray = self.name_file.solutiongroup + for solution_group_num in solution_recarray.get_active_key_list(): + try: + rec_array = solution_recarray.get_data(solution_group_num[0]) + except MFDataException as mfde: + message = 'An error occurred while getting solution group' \ + '"{}" from the simulation name file. The error ' \ + 'occurred while replacing IMS file "{}" with "{}"' \ + 'at index "{}"'.format(solution_group_num[0], + item, new_item, index) + raise MFDataException(mfdata_except=mfde, + package='nam', + message=message) + if rec_array is not None: + for rec_item in rec_array: + if rec_item[index] == item: + rec_item[index] = new_item + + def _is_in_solution_group(self, item, index): + solution_recarray = self.name_file.solutiongroup + for solution_group_num in solution_recarray.get_active_key_list(): + try: + rec_array = solution_recarray.get_data(solution_group_num[0]) + except MFDataException as mfde: + message = 'An error occurred while getting solution group' \ + '"{}" from the simulation name file. The error ' \ + 'occurred while verifying file "{}" at index "{}" ' \ + 'is in the simulation name file' \ + '.'.format(solution_group_num[0], item, index) + raise MFDataException(mfdata_except=mfde, + package='nam', + message=message) + + if rec_array is not None: + for rec_item in rec_array: + if rec_item[index] == item: + return True + return False + + + def plot(self, model_list=None, SelPackList=None, **kwargs): + """ + Method to plot a whole simulation or a series of models + that are part of a simualtion + + Parameters: + model_list: (list) list of model names to plot, if none + all models will be plotted + SelPackList: (list) list of package names to plot, if none + all packages will be plotted + + kwargs: + filename_base : str + Base file name that will be used to automatically generate file + names for output image files. Plots will be exported as image + files if file_name_base is not None. (default is None) + file_extension : str + Valid matplotlib.pyplot file extension for savefig(). Only used + if filename_base is not None. (default is 'png') + mflay : int + MODFLOW zero-based layer number to return. If None, then all + all layers will be included. (default is None) + kper : int + MODFLOW zero-based stress period number to return. + (default is zero) + key : str + MfList dictionary key. (default is None) + + + Returns: + axes: (list) matplotlib.pyplot.axes objects + """ + from flopy.plot.plotutil import PlotUtilities + + axes = PlotUtilities._plot_simulation_helper(self, + model_list=model_list, + SelPackList=SelPackList, + **kwargs) return axes \ No newline at end of file diff --git a/flopy/mf6/modflow/mftdis.py b/flopy/mf6/modflow/mftdis.py index 7f50fc304b..df5e4ef103 100644 --- a/flopy/mf6/modflow/mftdis.py +++ b/flopy/mf6/modflow/mftdis.py @@ -1,88 +1,88 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ListTemplateGenerator - - -class ModflowTdis(mfpackage.MFPackage): - """ - ModflowTdis defines a tdis package. - - Parameters - ---------- - simulation : MFSimulation - Simulation that this package is a part of. Package is automatically - added to simulation when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - time_units : string - * time_units (string) is the time units of the simulation. This is a - text string that is used as a label within model output files. Values - for time_units may be "unknown", "seconds", "minutes", "hours", - "days", or "years". The default time unit is "unknown". - start_date_time : string - * start_date_time (string) is the starting date and time of the - simulation. This is a text string that is used as a label within the - simulation list file. The value has no affect on the simulation. The - recommended format for the starting date and time is described at - https://www.w3.org/TR/NOTE-datetime. - nper : integer - * nper (integer) is the number of stress periods for the simulation. - perioddata : [perlen, nstp, tsmult] - * perlen (double) is the length of a stress period. - * nstp (integer) is the number of time steps in a stress period. - * tsmult (double) is the multiplier for the length of successive time - steps. The length of a time step is calculated by multiplying the - length of the previous time step by TSMULT. The length of the first - time step, :math:`\\Delta t_1`, is related to PERLEN, NSTP, and - TSMULT by the relation :math:`\\Delta t_1= perlen \\frac{tsmult - - 1}{tsmult^{nstp}-1}`. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - perioddata = ListTemplateGenerator(('tdis', 'perioddata', - 'perioddata')) - package_abbr = "tdis" - _package_type = "tdis" - dfn_file_name = "sim-tdis.dfn" - - dfn = [["block options", "name time_units", "type string", - "reader urword", "optional true"], - ["block options", "name start_date_time", "type string", - "reader urword", "optional true"], - ["block dimensions", "name nper", "type integer", - "reader urword", "optional false", "default_value 1"], - ["block perioddata", "name perioddata", - "type recarray perlen nstp tsmult", "reader urword", - "optional false", "default_value ((1.0, 1, 1.0),)"], - ["block perioddata", "name perlen", "type double precision", - "in_record true", "tagged false", "reader urword", - "optional false"], - ["block perioddata", "name nstp", "type integer", - "in_record true", "tagged false", "reader urword", - "optional false"], - ["block perioddata", "name tsmult", "type double precision", - "in_record true", "tagged false", "reader urword", - "optional false"]] - - def __init__(self, simulation, loading_package=False, time_units=None, - start_date_time=None, nper=1, perioddata=((1.0, 1, 1.0),), - filename=None, pname=None, parent_file=None): - super(ModflowTdis, self).__init__(simulation, "tdis", filename, pname, - loading_package, parent_file) - - # set up variables - self.time_units = self.build_mfdata("time_units", time_units) - self.start_date_time = self.build_mfdata("start_date_time", - start_date_time) - self.nper = self.build_mfdata("nper", nper) - self.perioddata = self.build_mfdata("perioddata", perioddata) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ListTemplateGenerator + + +class ModflowTdis(mfpackage.MFPackage): + """ + ModflowTdis defines a tdis package. + + Parameters + ---------- + simulation : MFSimulation + Simulation that this package is a part of. Package is automatically + added to simulation when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + time_units : string + * time_units (string) is the time units of the simulation. This is a + text string that is used as a label within model output files. Values + for time_units may be "unknown", "seconds", "minutes", "hours", + "days", or "years". The default time unit is "unknown". + start_date_time : string + * start_date_time (string) is the starting date and time of the + simulation. This is a text string that is used as a label within the + simulation list file. The value has no affect on the simulation. The + recommended format for the starting date and time is described at + https://www.w3.org/TR/NOTE-datetime. + nper : integer + * nper (integer) is the number of stress periods for the simulation. + perioddata : [perlen, nstp, tsmult] + * perlen (double) is the length of a stress period. + * nstp (integer) is the number of time steps in a stress period. + * tsmult (double) is the multiplier for the length of successive time + steps. The length of a time step is calculated by multiplying the + length of the previous time step by TSMULT. The length of the first + time step, :math:`\\Delta t_1`, is related to PERLEN, NSTP, and + TSMULT by the relation :math:`\\Delta t_1= perlen \\frac{tsmult - + 1}{tsmult^{nstp}-1}`. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + perioddata = ListTemplateGenerator(('tdis', 'perioddata', + 'perioddata')) + package_abbr = "tdis" + _package_type = "tdis" + dfn_file_name = "sim-tdis.dfn" + + dfn = [["block options", "name time_units", "type string", + "reader urword", "optional true"], + ["block options", "name start_date_time", "type string", + "reader urword", "optional true"], + ["block dimensions", "name nper", "type integer", + "reader urword", "optional false", "default_value 1"], + ["block perioddata", "name perioddata", + "type recarray perlen nstp tsmult", "reader urword", + "optional false", "default_value ((1.0, 1, 1.0),)"], + ["block perioddata", "name perlen", "type double precision", + "in_record true", "tagged false", "reader urword", + "optional false"], + ["block perioddata", "name nstp", "type integer", + "in_record true", "tagged false", "reader urword", + "optional false"], + ["block perioddata", "name tsmult", "type double precision", + "in_record true", "tagged false", "reader urword", + "optional false"]] + + def __init__(self, simulation, loading_package=False, time_units=None, + start_date_time=None, nper=1, perioddata=((1.0, 1, 1.0),), + filename=None, pname=None, parent_file=None): + super(ModflowTdis, self).__init__(simulation, "tdis", filename, pname, + loading_package, parent_file) + + # set up variables + self.time_units = self.build_mfdata("time_units", time_units) + self.start_date_time = self.build_mfdata("start_date_time", + start_date_time) + self.nper = self.build_mfdata("nper", nper) + self.perioddata = self.build_mfdata("perioddata", perioddata) + self._init_complete = True diff --git a/flopy/mf6/modflow/mfutllaktab.py b/flopy/mf6/modflow/mfutllaktab.py index 3643d398c1..9d16690b0e 100644 --- a/flopy/mf6/modflow/mfutllaktab.py +++ b/flopy/mf6/modflow/mfutllaktab.py @@ -1,79 +1,79 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ListTemplateGenerator - - -class ModflowUtllaktab(mfpackage.MFPackage): - """ - ModflowUtllaktab defines a tab package within a utl model. - - Parameters - ---------- - model : MFModel - Model that this package is a part of. Package is automatically - added to model when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - nrow : integer - * nrow (integer) integer value specifying the number of rows in the - lake table. There must be NROW rows of data in the TABLE block. - ncol : integer - * ncol (integer) integer value specifying the number of columns in the - lake table. There must be NCOL columns of data in the TABLE block. - For lakes with HORIZONTAL and/or VERTICAL CTYPE connections, NCOL - must be equal to 3. For lakes with EMBEDDEDH or EMBEDDEDV CTYPE - connections, NCOL must be equal to 4. - table : [stage, volume, sarea, barea] - * stage (double) real value that defines the stage corresponding to the - remaining data on the line. - * volume (double) real value that defines the lake volume corresponding - to the stage specified on the line. - * sarea (double) real value that defines the lake surface area - corresponding to the stage specified on the line. - * barea (double) real value that defines the lake-GWF exchange area - corresponding to the stage specified on the line. BAREA is only - specified if the CLAKTYPE for the lake is EMBEDDEDH or EMBEDDEDV. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - table = ListTemplateGenerator(('tab', 'table', 'table')) - package_abbr = "utltab" - _package_type = "tab" - dfn_file_name = "utl-lak-tab.dfn" - - dfn = [["block dimensions", "name nrow", "type integer", - "reader urword", "optional false"], - ["block dimensions", "name ncol", "type integer", - "reader urword", "optional false"], - ["block table", "name table", - "type recarray stage volume sarea barea", "shape (nrow)", - "reader urword"], - ["block table", "name stage", "type double precision", "shape", - "tagged false", "in_record true", "reader urword"], - ["block table", "name volume", "type double precision", "shape", - "tagged false", "in_record true", "reader urword"], - ["block table", "name sarea", "type double precision", "shape", - "tagged false", "in_record true", "reader urword"], - ["block table", "name barea", "type double precision", "shape", - "tagged false", "in_record true", "reader urword", - "optional true"]] - - def __init__(self, model, loading_package=False, nrow=None, ncol=None, - table=None, filename=None, pname=None, parent_file=None): - super(ModflowUtllaktab, self).__init__(model, "tab", filename, pname, - loading_package, parent_file) - - # set up variables - self.nrow = self.build_mfdata("nrow", nrow) - self.ncol = self.build_mfdata("ncol", ncol) - self.table = self.build_mfdata("table", table) - self._init_complete = True +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ListTemplateGenerator + + +class ModflowUtllaktab(mfpackage.MFPackage): + """ + ModflowUtllaktab defines a tab package within a utl model. + + Parameters + ---------- + model : MFModel + Model that this package is a part of. Package is automatically + added to model when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + nrow : integer + * nrow (integer) integer value specifying the number of rows in the + lake table. There must be NROW rows of data in the TABLE block. + ncol : integer + * ncol (integer) integer value specifying the number of columns in the + lake table. There must be NCOL columns of data in the TABLE block. + For lakes with HORIZONTAL and/or VERTICAL CTYPE connections, NCOL + must be equal to 3. For lakes with EMBEDDEDH or EMBEDDEDV CTYPE + connections, NCOL must be equal to 4. + table : [stage, volume, sarea, barea] + * stage (double) real value that defines the stage corresponding to the + remaining data on the line. + * volume (double) real value that defines the lake volume corresponding + to the stage specified on the line. + * sarea (double) real value that defines the lake surface area + corresponding to the stage specified on the line. + * barea (double) real value that defines the lake-GWF exchange area + corresponding to the stage specified on the line. BAREA is only + specified if the CLAKTYPE for the lake is EMBEDDEDH or EMBEDDEDV. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + table = ListTemplateGenerator(('tab', 'table', 'table')) + package_abbr = "utltab" + _package_type = "tab" + dfn_file_name = "utl-lak-tab.dfn" + + dfn = [["block dimensions", "name nrow", "type integer", + "reader urword", "optional false"], + ["block dimensions", "name ncol", "type integer", + "reader urword", "optional false"], + ["block table", "name table", + "type recarray stage volume sarea barea", "shape (nrow)", + "reader urword"], + ["block table", "name stage", "type double precision", "shape", + "tagged false", "in_record true", "reader urword"], + ["block table", "name volume", "type double precision", "shape", + "tagged false", "in_record true", "reader urword"], + ["block table", "name sarea", "type double precision", "shape", + "tagged false", "in_record true", "reader urword"], + ["block table", "name barea", "type double precision", "shape", + "tagged false", "in_record true", "reader urword", + "optional true"]] + + def __init__(self, model, loading_package=False, nrow=None, ncol=None, + table=None, filename=None, pname=None, parent_file=None): + super(ModflowUtllaktab, self).__init__(model, "tab", filename, pname, + loading_package, parent_file) + + # set up variables + self.nrow = self.build_mfdata("nrow", nrow) + self.ncol = self.build_mfdata("ncol", ncol) + self.table = self.build_mfdata("table", table) + self._init_complete = True diff --git a/flopy/mf6/modflow/mfutlobs.py b/flopy/mf6/modflow/mfutlobs.py index b98a8134e0..5471d1280a 100644 --- a/flopy/mf6/modflow/mfutlobs.py +++ b/flopy/mf6/modflow/mfutlobs.py @@ -1,129 +1,129 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ListTemplateGenerator - - -class ModflowUtlobs(mfpackage.MFPackage): - """ - ModflowUtlobs defines a obs package within a utl model. - - Parameters - ---------- - model : MFModel - Model that this package is a part of. Package is automatically - added to model when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - digits : integer - * digits (integer) Keyword and an integer digits specifier used for - conversion of simulated values to text on output. The default is 5 - digits. When simulated values are written to a file specified as file - type DATA in the Name File, the digits specifier controls the number - of significant digits with which simulated values are written to the - output file. The digits specifier has no effect on the number of - significant digits with which the simulation time is written for - continuous observations. - print_input : boolean - * print_input (boolean) keyword to indicate that the list of - observation information will be written to the listing file - immediately after it is read. - continuous : [obsname, obstype, id, id2] - * obsname (string) string of 1 to 40 nonblank characters used to - identify the observation. The identifier need not be unique; however, - identification and post-processing of observations in the output - files are facilitated if each observation is given a unique name. - * obstype (string) a string of characters used to identify the - observation type. - * id (string) Text identifying cell where observation is located. For - packages other than NPF, if boundary names are defined in the - corresponding package input file, ID can be a boundary name. - Otherwise ID is a cellid. If the model discretization is type DIS, - cellid is three integers (layer, row, column). If the discretization - is DISV, cellid is two integers (layer, cell number). If the - discretization is DISU, cellid is one integer (node number). - * id2 (string) Text identifying cell adjacent to cell identified by ID. - The form of ID2 is as described for ID. ID2 is used for intercell- - flow observations of a GWF model, for three observation types of the - LAK Package, for two observation types of the MAW Package, and one - observation type of the UZF Package. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - continuous = ListTemplateGenerator(('obs', 'continuous', - 'continuous')) - package_abbr = "utlobs" - _package_type = "obs" - dfn_file_name = "utl-obs.dfn" - - dfn = [["block options", "name digits", "type integer", "shape", - "reader urword", "optional true"], - ["block options", "name print_input", "type keyword", - "reader urword", "optional true"], - ["block continuous", "name output", - "type record fileout obs_output_file_name binary", "shape", - "block_variable true", "in_record false", "reader urword", - "optional false"], - ["block continuous", "name fileout", "type keyword", "shape", - "in_record true", "reader urword", "tagged true", - "optional false"], - ["block continuous", "name obs_output_file_name", "type string", - "preserve_case true", "in_record true", "shape", "tagged false", - "reader urword"], - ["block continuous", "name binary", "type keyword", - "in_record true", "shape", "reader urword", "optional true"], - ["block continuous", "name continuous", - "type recarray obsname obstype id id2", "shape", "reader urword", - "optional false"], - ["block continuous", "name obsname", "type string", "shape", - "tagged false", "in_record true", "reader urword"], - ["block continuous", "name obstype", "type string", "shape", - "tagged false", "in_record true", "reader urword"], - ["block continuous", "name id", "type string", "shape", - "tagged false", "in_record true", "reader urword", - "numeric_index true"], - ["block continuous", "name id2", "type string", "shape", - "tagged false", "in_record true", "reader urword", - "optional true", "numeric_index true"]] - - def __init__(self, model, loading_package=False, digits=None, - print_input=None, continuous=None, filename=None, pname=None, - parent_file=None): - super(ModflowUtlobs, self).__init__(model, "obs", filename, pname, - loading_package, parent_file) - - # set up variables - self.digits = self.build_mfdata("digits", digits) - self.print_input = self.build_mfdata("print_input", print_input) - self.continuous = self.build_mfdata("continuous", continuous) - self._init_complete = True - - -class UtlobsPackages(mfpackage.MFChildPackages): - """ - UtlobsPackages is a container class for the ModflowUtlobs class. - - Methods - ---------- - initialize - Initializes a new ModflowUtlobs package removing any sibling child - packages attached to the same parent package. See ModflowUtlobs init - documentation for definition of parameters. - """ - package_abbr = "utlobspackages" - - def initialize(self, digits=None, print_input=None, continuous=None, - filename=None, pname=None): - new_package = ModflowUtlobs(self._model, digits=digits, - print_input=print_input, - continuous=continuous, filename=filename, - pname=pname, parent_file=self._cpparent) - self._init_package(new_package, filename) +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ListTemplateGenerator + + +class ModflowUtlobs(mfpackage.MFPackage): + """ + ModflowUtlobs defines a obs package within a utl model. + + Parameters + ---------- + model : MFModel + Model that this package is a part of. Package is automatically + added to model when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + digits : integer + * digits (integer) Keyword and an integer digits specifier used for + conversion of simulated values to text on output. The default is 5 + digits. When simulated values are written to a file specified as file + type DATA in the Name File, the digits specifier controls the number + of significant digits with which simulated values are written to the + output file. The digits specifier has no effect on the number of + significant digits with which the simulation time is written for + continuous observations. + print_input : boolean + * print_input (boolean) keyword to indicate that the list of + observation information will be written to the listing file + immediately after it is read. + continuous : [obsname, obstype, id, id2] + * obsname (string) string of 1 to 40 nonblank characters used to + identify the observation. The identifier need not be unique; however, + identification and post-processing of observations in the output + files are facilitated if each observation is given a unique name. + * obstype (string) a string of characters used to identify the + observation type. + * id (string) Text identifying cell where observation is located. For + packages other than NPF, if boundary names are defined in the + corresponding package input file, ID can be a boundary name. + Otherwise ID is a cellid. If the model discretization is type DIS, + cellid is three integers (layer, row, column). If the discretization + is DISV, cellid is two integers (layer, cell number). If the + discretization is DISU, cellid is one integer (node number). + * id2 (string) Text identifying cell adjacent to cell identified by ID. + The form of ID2 is as described for ID. ID2 is used for intercell- + flow observations of a GWF model, for three observation types of the + LAK Package, for two observation types of the MAW Package, and one + observation type of the UZF Package. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + continuous = ListTemplateGenerator(('obs', 'continuous', + 'continuous')) + package_abbr = "utlobs" + _package_type = "obs" + dfn_file_name = "utl-obs.dfn" + + dfn = [["block options", "name digits", "type integer", "shape", + "reader urword", "optional true"], + ["block options", "name print_input", "type keyword", + "reader urword", "optional true"], + ["block continuous", "name output", + "type record fileout obs_output_file_name binary", "shape", + "block_variable true", "in_record false", "reader urword", + "optional false"], + ["block continuous", "name fileout", "type keyword", "shape", + "in_record true", "reader urword", "tagged true", + "optional false"], + ["block continuous", "name obs_output_file_name", "type string", + "preserve_case true", "in_record true", "shape", "tagged false", + "reader urword"], + ["block continuous", "name binary", "type keyword", + "in_record true", "shape", "reader urword", "optional true"], + ["block continuous", "name continuous", + "type recarray obsname obstype id id2", "shape", "reader urword", + "optional false"], + ["block continuous", "name obsname", "type string", "shape", + "tagged false", "in_record true", "reader urword"], + ["block continuous", "name obstype", "type string", "shape", + "tagged false", "in_record true", "reader urword"], + ["block continuous", "name id", "type string", "shape", + "tagged false", "in_record true", "reader urword", + "numeric_index true"], + ["block continuous", "name id2", "type string", "shape", + "tagged false", "in_record true", "reader urword", + "optional true", "numeric_index true"]] + + def __init__(self, model, loading_package=False, digits=None, + print_input=None, continuous=None, filename=None, pname=None, + parent_file=None): + super(ModflowUtlobs, self).__init__(model, "obs", filename, pname, + loading_package, parent_file) + + # set up variables + self.digits = self.build_mfdata("digits", digits) + self.print_input = self.build_mfdata("print_input", print_input) + self.continuous = self.build_mfdata("continuous", continuous) + self._init_complete = True + + +class UtlobsPackages(mfpackage.MFChildPackages): + """ + UtlobsPackages is a container class for the ModflowUtlobs class. + + Methods + ---------- + initialize + Initializes a new ModflowUtlobs package removing any sibling child + packages attached to the same parent package. See ModflowUtlobs init + documentation for definition of parameters. + """ + package_abbr = "utlobspackages" + + def initialize(self, digits=None, print_input=None, continuous=None, + filename=None, pname=None): + new_package = ModflowUtlobs(self._model, digits=digits, + print_input=print_input, + continuous=continuous, filename=filename, + pname=pname, parent_file=self._cpparent) + self._init_package(new_package, filename) diff --git a/flopy/mf6/modflow/mfutltas.py b/flopy/mf6/modflow/mfutltas.py index eb93deb1fa..91d1c6084c 100644 --- a/flopy/mf6/modflow/mfutltas.py +++ b/flopy/mf6/modflow/mfutltas.py @@ -1,142 +1,142 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ListTemplateGenerator, ArrayTemplateGenerator - - -class ModflowUtltas(mfpackage.MFPackage): - """ - ModflowUtltas defines a tas package within a utl model. - - Parameters - ---------- - model : MFModel - Model that this package is a part of. Package is automatically - added to model when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - time_series_namerecord : [time_series_name] - * time_series_name (string) Name by which a package references a - particular time-array series. The name must be unique among all time- - array series used in a package. - interpolation_methodrecord : [interpolation_method] - * interpolation_method (string) Interpolation method, which is either - STEPWISE or LINEAR. - sfacrecord : [sfacval] - * sfacval (double) Scale factor, which will multiply all array values - in time series. SFAC is an optional attribute; if omitted, SFAC = - 1.0. - tas_array : [double] - * tas_array (double) An array of numeric, floating-point values, or a - constant value, readable by the U2DREL array-reading utility. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - time_series_namerecord = ListTemplateGenerator(('tas', 'attributes', - 'time_series_namerecord')) - interpolation_methodrecord = ListTemplateGenerator(( - 'tas', 'attributes', 'interpolation_methodrecord')) - sfacrecord = ListTemplateGenerator(('tas', 'attributes', - 'sfacrecord')) - tas_array = ArrayTemplateGenerator(('tas', 'time', 'tas_array')) - package_abbr = "utltas" - _package_type = "tas" - dfn_file_name = "utl-tas.dfn" - - dfn = [["block attributes", "name time_series_namerecord", - "type record name time_series_name", "shape", "reader urword", - "tagged false", "optional false"], - ["block attributes", "name name", "type keyword", "shape", - "reader urword", "optional false"], - ["block attributes", "name time_series_name", "type string", - "shape any1d", "tagged false", "reader urword", "optional false"], - ["block attributes", "name interpolation_methodrecord", - "type record method interpolation_method", "shape", - "reader urword", "tagged false", "optional true"], - ["block attributes", "name method", "type keyword", "shape", - "reader urword", "optional false"], - ["block attributes", "name interpolation_method", "type string", - "valid stepwise linear linearend", "shape", "tagged false", - "reader urword", "optional false"], - ["block attributes", "name sfacrecord", - "type record sfac sfacval", "shape", "reader urword", - "tagged true", "optional true"], - ["block attributes", "name sfac", "type keyword", "shape", - "reader urword", "optional false"], - ["block attributes", "name sfacval", "type double precision", - "shape time_series_name", "tagged false", "reader urword", - "optional false"], - ["block time", "name time_from_model_start", - "type double precision", "block_variable True", "in_record true", - "shape", "tagged false", "valid", "reader urword", - "optional false"], - ["block time", "name tas_array", "type double precision", - "tagged false", "just_data true", "shape (unknown)", - "reader readarray", "optional false", "repeating true"]] - - def __init__(self, model, loading_package=False, - time_series_namerecord=None, interpolation_methodrecord=None, - sfacrecord=None, tas_array=None, filename=None, pname=None, - parent_file=None): - super(ModflowUtltas, self).__init__(model, "tas", filename, pname, - loading_package, parent_file) - - # set up variables - self.time_series_namerecord = self.build_mfdata( - "time_series_namerecord", time_series_namerecord) - self.interpolation_methodrecord = self.build_mfdata( - "interpolation_methodrecord", interpolation_methodrecord) - self.sfacrecord = self.build_mfdata("sfacrecord", sfacrecord) - self.tas_array = self.build_mfdata("tas_array", tas_array) - self._init_complete = True - - -class UtltasPackages(mfpackage.MFChildPackages): - """ - UtltasPackages is a container class for the ModflowUtltas class. - - Methods - ---------- - initialize - Initializes a new ModflowUtltas package removing any sibling child - packages attached to the same parent package. See ModflowUtltas init - documentation for definition of parameters. - append_package - Adds a new ModflowUtltas package to the container. See ModflowUtltas - init documentation for definition of parameters. - """ - package_abbr = "utltaspackages" - - def initialize(self, time_series_namerecord=None, - interpolation_methodrecord=None, sfacrecord=None, - tas_array=None, filename=None, pname=None): - new_package = ModflowUtltas(self._model, - time_series_namerecord= - time_series_namerecord, - interpolation_methodrecord= - interpolation_methodrecord, - sfacrecord=sfacrecord, tas_array=tas_array, - filename=filename, pname=pname, - parent_file=self._cpparent) - self._init_package(new_package, filename) - - def append_package(self, time_series_namerecord=None, - interpolation_methodrecord=None, sfacrecord=None, - tas_array=None, filename=None, pname=None): - new_package = ModflowUtltas(self._model, - time_series_namerecord= - time_series_namerecord, - interpolation_methodrecord= - interpolation_methodrecord, - sfacrecord=sfacrecord, tas_array=tas_array, - filename=filename, pname=pname, - parent_file=self._cpparent) - self._append_package(new_package, filename) +# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY +# mf6/utils/createpackages.py +from .. import mfpackage +from ..data.mfdatautil import ListTemplateGenerator, ArrayTemplateGenerator + + +class ModflowUtltas(mfpackage.MFPackage): + """ + ModflowUtltas defines a tas package within a utl model. + + Parameters + ---------- + model : MFModel + Model that this package is a part of. Package is automatically + added to model when it is initialized. + loading_package : bool + Do not set this parameter. It is intended for debugging and internal + processing purposes only. + time_series_namerecord : [time_series_name] + * time_series_name (string) Name by which a package references a + particular time-array series. The name must be unique among all time- + array series used in a package. + interpolation_methodrecord : [interpolation_method] + * interpolation_method (string) Interpolation method, which is either + STEPWISE or LINEAR. + sfacrecord : [sfacval] + * sfacval (double) Scale factor, which will multiply all array values + in time series. SFAC is an optional attribute; if omitted, SFAC = + 1.0. + tas_array : [double] + * tas_array (double) An array of numeric, floating-point values, or a + constant value, readable by the U2DREL array-reading utility. + filename : String + File name for this package. + pname : String + Package name for this package. + parent_file : MFPackage + Parent package file that references this package. Only needed for + utility packages (mfutl*). For example, mfutllaktab package must have + a mfgwflak package parent_file. + + """ + time_series_namerecord = ListTemplateGenerator(('tas', 'attributes', + 'time_series_namerecord')) + interpolation_methodrecord = ListTemplateGenerator(( + 'tas', 'attributes', 'interpolation_methodrecord')) + sfacrecord = ListTemplateGenerator(('tas', 'attributes', + 'sfacrecord')) + tas_array = ArrayTemplateGenerator(('tas', 'time', 'tas_array')) + package_abbr = "utltas" + _package_type = "tas" + dfn_file_name = "utl-tas.dfn" + + dfn = [["block attributes", "name time_series_namerecord", + "type record name time_series_name", "shape", "reader urword", + "tagged false", "optional false"], + ["block attributes", "name name", "type keyword", "shape", + "reader urword", "optional false"], + ["block attributes", "name time_series_name", "type string", + "shape any1d", "tagged false", "reader urword", "optional false"], + ["block attributes", "name interpolation_methodrecord", + "type record method interpolation_method", "shape", + "reader urword", "tagged false", "optional true"], + ["block attributes", "name method", "type keyword", "shape", + "reader urword", "optional false"], + ["block attributes", "name interpolation_method", "type string", + "valid stepwise linear linearend", "shape", "tagged false", + "reader urword", "optional false"], + ["block attributes", "name sfacrecord", + "type record sfac sfacval", "shape", "reader urword", + "tagged true", "optional true"], + ["block attributes", "name sfac", "type keyword", "shape", + "reader urword", "optional false"], + ["block attributes", "name sfacval", "type double precision", + "shape time_series_name", "tagged false", "reader urword", + "optional false"], + ["block time", "name time_from_model_start", + "type double precision", "block_variable True", "in_record true", + "shape", "tagged false", "valid", "reader urword", + "optional false"], + ["block time", "name tas_array", "type double precision", + "tagged false", "just_data true", "shape (unknown)", + "reader readarray", "optional false", "repeating true"]] + + def __init__(self, model, loading_package=False, + time_series_namerecord=None, interpolation_methodrecord=None, + sfacrecord=None, tas_array=None, filename=None, pname=None, + parent_file=None): + super(ModflowUtltas, self).__init__(model, "tas", filename, pname, + loading_package, parent_file) + + # set up variables + self.time_series_namerecord = self.build_mfdata( + "time_series_namerecord", time_series_namerecord) + self.interpolation_methodrecord = self.build_mfdata( + "interpolation_methodrecord", interpolation_methodrecord) + self.sfacrecord = self.build_mfdata("sfacrecord", sfacrecord) + self.tas_array = self.build_mfdata("tas_array", tas_array) + self._init_complete = True + + +class UtltasPackages(mfpackage.MFChildPackages): + """ + UtltasPackages is a container class for the ModflowUtltas class. + + Methods + ---------- + initialize + Initializes a new ModflowUtltas package removing any sibling child + packages attached to the same parent package. See ModflowUtltas init + documentation for definition of parameters. + append_package + Adds a new ModflowUtltas package to the container. See ModflowUtltas + init documentation for definition of parameters. + """ + package_abbr = "utltaspackages" + + def initialize(self, time_series_namerecord=None, + interpolation_methodrecord=None, sfacrecord=None, + tas_array=None, filename=None, pname=None): + new_package = ModflowUtltas(self._model, + time_series_namerecord= + time_series_namerecord, + interpolation_methodrecord= + interpolation_methodrecord, + sfacrecord=sfacrecord, tas_array=tas_array, + filename=filename, pname=pname, + parent_file=self._cpparent) + self._init_package(new_package, filename) + + def append_package(self, time_series_namerecord=None, + interpolation_methodrecord=None, sfacrecord=None, + tas_array=None, filename=None, pname=None): + new_package = ModflowUtltas(self._model, + time_series_namerecord= + time_series_namerecord, + interpolation_methodrecord= + interpolation_methodrecord, + sfacrecord=sfacrecord, tas_array=tas_array, + filename=filename, pname=pname, + parent_file=self._cpparent) + self._append_package(new_package, filename) diff --git a/flopy/mf6/modflow/mfutlts.py b/flopy/mf6/modflow/mfutlts.py index f4658db3a9..484ae6bd4d 100644 --- a/flopy/mf6/modflow/mfutlts.py +++ b/flopy/mf6/modflow/mfutlts.py @@ -1,186 +1,186 @@ -# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY -# mf6/utils/createpackages.py -from .. import mfpackage -from ..data.mfdatautil import ListTemplateGenerator - - -class ModflowUtlts(mfpackage.MFPackage): - """ - ModflowUtlts defines a ts package within a utl model. - - Parameters - ---------- - model : MFModel - Model that this package is a part of. Package is automatically - added to model when it is initialized. - loading_package : bool - Do not set this parameter. It is intended for debugging and internal - processing purposes only. - time_series_namerecord : [time_series_names] - * time_series_names (string) Name by which a package references a - particular time-array series. The name must be unique among all time- - array series used in a package. - interpolation_methodrecord : [interpolation_method] - * interpolation_method (string) Interpolation method, which is either - STEPWISE or LINEAR. - interpolation_methodrecord_single : [interpolation_method_single] - * interpolation_method_single (string) Interpolation method, which is - either STEPWISE or LINEAR. - sfacrecord : [sfacval] - * sfacval (double) Scale factor, which will multiply all array values - in time series. SFAC is an optional attribute; if omitted, SFAC = - 1.0. - sfacrecord_single : [sfacval] - * sfacval (double) Scale factor, which will multiply all array values - in time series. SFAC is an optional attribute; if omitted, SFAC = - 1.0. - timeseries : [ts_time, ts_array] - * ts_time (double) A numeric time relative to the start of the - simulation, in the time unit used in the simulation. Times must be - strictly increasing. - * ts_array (double) A 2-D array of numeric, floating-point values, or a - constant value, readable by the U2DREL array-reading utility. - filename : String - File name for this package. - pname : String - Package name for this package. - parent_file : MFPackage - Parent package file that references this package. Only needed for - utility packages (mfutl*). For example, mfutllaktab package must have - a mfgwflak package parent_file. - - """ - time_series_namerecord = ListTemplateGenerator(('ts', 'attributes', - 'time_series_namerecord')) - interpolation_methodrecord = ListTemplateGenerator(( - 'ts', 'attributes', 'interpolation_methodrecord')) - interpolation_methodrecord_single = ListTemplateGenerator(( - 'ts', 'attributes', 'interpolation_methodrecord_single')) - sfacrecord = ListTemplateGenerator(('ts', 'attributes', 'sfacrecord')) - sfacrecord_single = ListTemplateGenerator(('ts', 'attributes', - 'sfacrecord_single')) - timeseries = ListTemplateGenerator(('ts', 'timeseries', 'timeseries')) - package_abbr = "utlts" - _package_type = "ts" - dfn_file_name = "utl-ts.dfn" - - dfn = [["block attributes", "name time_series_namerecord", - "type record names time_series_names", "shape", "reader urword", - "tagged false", "optional false"], - ["block attributes", "name names", "other_names name", - "type keyword", "shape", "reader urword", "optional false"], - ["block attributes", "name time_series_names", "type string", - "shape any1d", "tagged false", "reader urword", "optional false"], - ["block attributes", "name interpolation_methodrecord", - "type record methods interpolation_method", "shape", - "reader urword", "tagged false", "optional true"], - ["block attributes", "name methods", "type keyword", "shape", - "reader urword", "optional false"], - ["block attributes", "name interpolation_method", "type string", - "valid stepwise linear linearend", "shape time_series_names", - "tagged false", "reader urword", "optional false"], - ["block attributes", "name interpolation_methodrecord_single", - "type record method interpolation_method_single", "shape", - "reader urword", "tagged false", "optional true"], - ["block attributes", "name method", "type keyword", "shape", - "reader urword", "optional false"], - ["block attributes", "name interpolation_method_single", - "type string", "valid stepwise linear linearend", "shape", - "tagged false", "reader urword", "optional false"], - ["block attributes", "name sfacrecord", - "type record sfacs sfacval", "shape", "reader urword", - "tagged true", "optional true"], - ["block attributes", "name sfacs", "type keyword", "shape", - "reader urword", "optional false"], - ["block attributes", "name sfacval", "type double precision", - "shape