From de874b02661f59ef4e99f18272883a13a4d55f16 Mon Sep 17 00:00:00 2001 From: jdhughes-usgs Date: Thu, 11 Jun 2020 11:26:15 -0400 Subject: [PATCH 1/8] refactor(make-release): Software citation developed from version.py Closes #727 --- README.md | 4 ++-- flopy/version.py | 4 ++-- release/make-release.py | 39 ++++++++++++++++++++++++++------------- 3 files changed, 30 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index f1069fcc8a..a303bf9921 100644 --- a/README.md +++ b/README.md @@ -216,11 +216,11 @@ How to Cite ##### ***Citation for FloPy:*** -[Bakker, M., Post, V., Langevin, C. D., Hughes, J. D., White, J. T., Starn, J. J. and Fienen, M. N., 2016, Scripting MODFLOW Model Development Using Python and FloPy: Groundwater, v. 54, p. 733–739, doi:10.1111/gwat.12413.](http://dx.doi.org/10.1111/gwat.12413) +[Bakker, Mark, Post, Vincent, Langevin, C. D., Hughes, J. D., White, J. T., Starn, J. J. and Fienen, M. N., 2016, Scripting MODFLOW Model Development Using Python and FloPy: Groundwater, v. 54, p. 733–739, doi:10.1111/gwat.12413.](http://dx.doi.org/10.1111/gwat.12413) ##### ***Software/Code citation for FloPy:*** -[Bakker, M., Post, V., Langevin, C. D., Hughes, J. D., White, J. T., Leaf, A. T., Paulinski, S. R., Larsen, J. D., Toews, M. W., Morway, E. D., Bellino, J. C., Starn, J. J., and Fienen, M. N., 2019, FloPy v3.3.1 — release candidate: U.S. Geological Survey Software Release, 15 December 2019, http://dx.doi.org/10.5066/F7BK19FH](http://dx.doi.org/10.5066/F7BK19FH) +[Bakker, Mark, Post, Vincent, Langevin, C. D., Hughes, J. D., White, J. T., Leaf, A. T., Paulinski, S. R., Larsen, J. D., Toews, M. W., Morway, E. D., Bellino, J. C., Starn, J. J., and Fienen, M. N., 2020, FloPy v3.3.1 — release candidate: U.S. Geological Survey Software Release, 11 June 2020, http://dx.doi.org/10.5066/F7BK19FH](http://dx.doi.org/10.5066/F7BK19FH) MODFLOW Resources diff --git a/flopy/version.py b/flopy/version.py index 151c5c2efa..6ab4b5b62f 100644 --- a/flopy/version.py +++ b/flopy/version.py @@ -1,5 +1,5 @@ # flopy version file automatically created using...make-release.py -# created on...May 26, 2020 17:16:58 +# created on...June 11, 2020 11:16:17 major = 3 minor = 3 @@ -21,7 +21,7 @@ 'Michael W. Toews': 'M.Toews@gns.cri.nz', 'Eric D. Morway': 'emorway@usgs.gov', 'Jason C. Bellino': 'jbellino@usgs.gov', - 'Jeffrey Starn': 'jjstarn@usgs.gov', + 'Jon Jeffrey Starn': 'jjstarn@usgs.gov', 'Michael N. Fienen': 'mnfienen@usgs.gov', } __author__ = ', '.join(author_dict.keys()) diff --git a/release/make-release.py b/release/make-release.py index 3fe3a99e52..c357a676ba 100644 --- a/release/make-release.py +++ b/release/make-release.py @@ -1,6 +1,5 @@ #!/usr/bin/python -from __future__ import print_function import subprocess import os import sys @@ -27,15 +26,18 @@ pak = 'flopy' -# authors list for Software/Code citation for FloPy -# author should be defined LastName FirstName MiddleInitial -# MiddleInitial can be absent. Use spaces instead of commas to separate -# LastName, FirstName, and MiddleInitial. -authors = ['Bakker Mark', 'Post Vincent', 'Langevin Christian D', - 'Hughes Joseph D', 'White Jeremy T', 'Leaf Andrew T', - 'Paulinski Scott R', 'Larsen Joshua D', 'Toews Michael W', - 'Morway Eric D', 'Bellino Jason C', 'Starn Jeffrey J', - 'Fienen Michael N'] +# local import of package variables in flopy/version.py +# imports author_dict +exec(open(os.path.join("..", "flopy", "version.py")).read()) + +# build authors list for Software/Code citation for FloPy +authors = [] +for key in author_dict.keys(): + t = key.split() + author = '{}'.format(t[-1]) + for str in t[0:-1]: + author += ' {}'.format(str) + authors.append(author) approved = '''Disclaimer ---------- @@ -130,6 +132,7 @@ def get_software_citation(version, is_approved): sb = '' if not is_approved: sb = ' — release candidate' + # format author names line = '[' for ipos, author in enumerate(authors): if ipos > 0: @@ -137,10 +140,19 @@ def get_software_citation(version, is_approved): if ipos == len(authors) - 1: line += 'and ' sv = author.split() - tauthor = '{}, {}.'.format(sv[0], sv[1][0]) - if len(sv) > 2: - tauthor += ' {}.'.format(sv[2][0]) + tauthor = '{}'.format(sv[0]) + if len(sv) < 3: + gname = sv[1] + if len(gname) > 1: + tauthor += ', {}'.format(gname) + else: + tauthor += ', {}.'.format(gname[0]) + else: + tauthor += ', {}. {}.'.format(sv[1][0], sv[2][0]) + # add formatted author name to line line += tauthor + + # add the rest of the citation line += ', {}, '.format(now.year) + \ 'FloPy v{}{}: '.format(version, sb) + \ 'U.S. Geological Survey Software Release, ' + \ @@ -443,3 +455,4 @@ def update_USGSmarkdown(vmajor, vminor, vmicro): if __name__ == "__main__": update_version() + get_software_citation('3.1.1', True) \ No newline at end of file From 10def415222062acaff81af96a6ac91f8e7f7ac9 Mon Sep 17 00:00:00 2001 From: "Hughes, J.D" Date: Fri, 12 Jun 2020 18:23:57 -0400 Subject: [PATCH 2/8] release: update mf6 v6.1.1 dfn and flopy mf6 classes (#1) --- README.md | 4 +- autotest/get_exes.py | 12 ++- flopy/mf6/data/dfn/gwf-chd.dfn | 2 +- flopy/mf6/data/dfn/gwf-csub.dfn | 42 +++++++- flopy/mf6/data/dfn/gwf-disu.dfn | 2 +- flopy/mf6/data/dfn/gwf-drn.dfn | 9 ++ flopy/mf6/data/dfn/gwf-evt.dfn | 12 +-- flopy/mf6/data/dfn/gwf-lak.dfn | 34 ++++++- flopy/mf6/data/dfn/gwf-maw.dfn | 12 ++- flopy/mf6/data/dfn/gwf-mvr.dfn | 2 +- flopy/mf6/data/dfn/gwf-npf.dfn | 12 ++- flopy/mf6/data/dfn/gwf-rch.dfn | 2 +- flopy/mf6/data/dfn/gwf-sfr.dfn | 55 ++++++++-- flopy/mf6/data/dfn/gwf-sto.dfn | 4 +- flopy/mf6/data/dfn/gwf-uzf.dfn | 37 ++++++- flopy/mf6/data/dfn/sln-ims.dfn | 114 ++++++++++++++++++--- flopy/mf6/modflow/mfgwfchd.py | 5 +- flopy/mf6/modflow/mfgwfcsub.py | 29 +++++- flopy/mf6/modflow/mfgwfdisu.py | 2 +- flopy/mf6/modflow/mfgwfdrn.py | 22 +++- flopy/mf6/modflow/mfgwfevt.py | 36 ++++--- flopy/mf6/modflow/mfgwflak.py | 38 +++++-- flopy/mf6/modflow/mfgwfmaw.py | 41 ++++++-- flopy/mf6/modflow/mfgwfmvr.py | 5 +- flopy/mf6/modflow/mfgwfnpf.py | 42 +++++--- flopy/mf6/modflow/mfgwfrch.py | 6 +- flopy/mf6/modflow/mfgwfsfr.py | 66 +++++++++--- flopy/mf6/modflow/mfgwfsto.py | 8 +- flopy/mf6/modflow/mfgwfuzf.py | 39 +++++-- flopy/mf6/modflow/mfims.py | 173 ++++++++++++++++++++++++-------- flopy/mf6/modflow/mfmvr.py | 5 +- 31 files changed, 696 insertions(+), 176 deletions(-) diff --git a/README.md b/README.md index a303bf9921..67f0dd328a 100644 --- a/README.md +++ b/README.md @@ -3,11 +3,11 @@ ### Version 3.3.1 — release candidate [![Build Status](https://travis-ci.org/modflowpy/flopy.svg?branch=develop)](https://travis-ci.org/modflowpy/flopy) +[![Codacy Badge](https://app.codacy.com/project/badge/Grade/3424dc693f9042ffadc93086cd554e47)](https://www.codacy.com/gh/modflowpy/flopy?utm_source=github.com&utm_medium=referral&utm_content=modflowpy/flopy&utm_campaign=Badge_Grade) +[![Coverage Status](https://coveralls.io/repos/github/modflowpy/flopy/badge.svg?branch=develop)](https://coveralls.io/github/modflowpy/flopy?branch=develop) [![Anaconda-Server Badge](https://anaconda.org/conda-forge/flopy/badges/installer/conda.svg)](https://conda.anaconda.org/conda-forge) [![Anaconda-Server Badge](https://anaconda.org/conda-forge/flopy/badges/version.svg)](https://anaconda.org/conda-forge/flopy) [![PyPI Version](https://img.shields.io/pypi/v/flopy.png)](https://pypi.python.org/pypi/flopy) -[![Coverage Status](https://coveralls.io/repos/github/modflowpy/flopy/badge.svg?branch=develop)](https://coveralls.io/github/modflowpy/flopy?branch=develop) -[![Codacy Badge](https://api.codacy.com/project/badge/Grade/b23a5edd021b4aa19e947545ab49e577)](https://www.codacy.com/app/jdhughes-usgs/flopy?utm_source=github.com&utm_medium=referral&utm_content=modflowpy/flopy&utm_campaign=Badge_Grade) [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/modflowpy/flopy.git/develop) Introduction diff --git a/autotest/get_exes.py b/autotest/get_exes.py index a5fb6de444..91980d9e5f 100644 --- a/autotest/get_exes.py +++ b/autotest/get_exes.py @@ -55,6 +55,16 @@ def list_exes(): def test_download_and_unzip(): pymake.getmfexes(exe_pth) + # move the exes from exe_pth to bindir + files = os.listdir(exe_pth) + for file in files: + if file.startswith('__'): + continue + src = os.path.join(exe_pth, file) + dst = os.path.join(bindir, file) + print('moving {} -> {}'.format(src, dst)) + os.replace(src, dst) + def test_cleanup(): cleanup() @@ -65,7 +75,7 @@ def test_list_download(): def main(): - pymake.getmfexes(exe_pth) + test_download_and_unzip() # clean up the download directory cleanup() diff --git a/flopy/mf6/data/dfn/gwf-chd.dfn b/flopy/mf6/data/dfn/gwf-chd.dfn index d0a4b55f95..1a432ee399 100644 --- a/flopy/mf6/data/dfn/gwf-chd.dfn +++ b/flopy/mf6/data/dfn/gwf-chd.dfn @@ -180,7 +180,7 @@ in_record true reader urword time_series true longname head value assigned to constant head -description is the head at the boundary. +description is the head at 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. block period name aux diff --git a/flopy/mf6/data/dfn/gwf-csub.dfn b/flopy/mf6/data/dfn/gwf-csub.dfn index d61a8c7e33..d4f126410f 100644 --- a/flopy/mf6/data/dfn/gwf-csub.dfn +++ b/flopy/mf6/data/dfn/gwf-csub.dfn @@ -405,6 +405,38 @@ optional false longname file keyword description name of the binary output file to write z-displacement information. +block options +name package_convergence_filerecord +type record package_convergence fileout package_convergence_filename +shape +reader urword +tagged true +optional true +longname +description + +block options +name package_convergence +type keyword +shape +in_record true +reader urword +tagged true +optional false +longname package_convergence keyword +description keyword to specify that record corresponds to the package convergence comma spaced values file. + +block options +name package_convergence_filename +type string +shape +in_record true +reader urword +tagged false +optional false +longname file keyword +description name of the comma spaced values output file to write package convergence information. + block options name ts_filerecord type record ts6 filein ts6_filename @@ -544,7 +576,7 @@ description is the specific gravity of saturated sediments. If not specified, th block packagedata name packagedata type recarray icsubno cellid cdelay pcs0 thick_frac rnb ssv_cc sse_cr theta kv h0 boundname -shape (ncsubcells) +shape (ninterbeds) reader urword longname description @@ -557,7 +589,7 @@ tagged false in_record true reader urword longname CSUB id number for this entry -description integer value that defines the CSUB interbed number associated with the specified PACKAGEDATA data on the line. CSUBNO must be greater than zero and less than or equal to NCSUBCELLS. CSUB information must be specified for every CSUB cell or the program will terminate with an error. The program will also terminate with an error if information for a CSUB interbed number is specified more than once. +description integer value that defines the CSUB interbed number associated with the specified PACKAGEDATA data on the line. CSUBNO must be greater than zero and less than or equal to NINTERBEDS. CSUB information must be specified for every CSUB cell or the program will terminate with an error. The program will also terminate with an error if information for a CSUB interbed number is specified more than once. numeric_index true block packagedata @@ -577,7 +609,7 @@ shape tagged false in_record true reader urword -longname initial water content +longname delay type description character string that defines the subsidence delay type for the interbed. Possible subsidence package CDELAY strings include: NODELAY--character keyword to indicate that delay will not be simulated in the interbed. DELAY--character keyword to indicate that delay will be simulated in the interbed. block packagedata @@ -627,7 +659,7 @@ shape tagged false in_record true reader urword -longname initial elastic interbed specific storage +longname initial interbed elastic specific storage description is the initial elastic coarse-grained material specific storage or recompression index of the interbed. The recompression index is specified if COMPRESSION\_INDICES is specified in the OPTIONS block. Specified or calculated interbed elastic specific storage values are not adjusted from initial values if HEAD\_BASED is specified in the OPTIONS block. block packagedata @@ -714,4 +746,4 @@ in_record true reader urword time_series true longname well stress offset -description is the stress offset for the cell. SIG0 is added to the calculated geostatic stress for the cell. SIG0 is specified only if MAXSIG0 is specified to be greater than 0 in the DIMENSIONS block. +description is the stress offset for the cell. SIG0 is added to the calculated geostatic stress for the cell. SIG0 is specified only if MAXSIG0 is specified to be greater than 0 in the DIMENSIONS 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. diff --git a/flopy/mf6/data/dfn/gwf-disu.dfn b/flopy/mf6/data/dfn/gwf-disu.dfn index 8fdfc12fcc..a4e45ceb8a 100644 --- a/flopy/mf6/data/dfn/gwf-disu.dfn +++ b/flopy/mf6/data/dfn/gwf-disu.dfn @@ -97,7 +97,7 @@ name idomain type integer shape (nodes) reader readarray -layered true +layered false optional true longname idomain existence array description 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. IDOMAIN values of -1 cannot be specified for the DISU Package. diff --git a/flopy/mf6/data/dfn/gwf-drn.dfn b/flopy/mf6/data/dfn/gwf-drn.dfn index 14e98c367b..481dea86e9 100644 --- a/flopy/mf6/data/dfn/gwf-drn.dfn +++ b/flopy/mf6/data/dfn/gwf-drn.dfn @@ -18,6 +18,15 @@ optional true longname name of auxiliary variable for multiplier description REPLACE auxmultname {'{#1}': 'drain conductance'} +block options +name auxdepthname +type string +shape +reader urword +optional true +longname name of auxiliary variable for drainage depth +description name of a variable listed in AUXILIARY that defines the depth at which drainage discharge will be scaled. If a positive value is specified for the AUXDEPTHNAME AUXILIARY variable, then ELEV is the elevation at which the drain starts to discharge and ELEV + DDRN (assuming DDRN is the AUXDEPTHNAME variable) is the elevation when the drain conductance (COND) scaling factor is 1. If a negative drainage depth value is specified for DDRN, then ELEV + DDRN is the elevation at which the drain starts to discharge and ELEV is the elevation when the conductance (COND) scaling factor is 1. A linear- or cubic-scaling is used to scale the drain conductance (COND) when the Standard or Newton-Raphson Formulation is used, respectively. + block options name boundnames type keyword diff --git a/flopy/mf6/data/dfn/gwf-evt.dfn b/flopy/mf6/data/dfn/gwf-evt.dfn index 8bd1852847..720dd8ed0a 100644 --- a/flopy/mf6/data/dfn/gwf-evt.dfn +++ b/flopy/mf6/data/dfn/gwf-evt.dfn @@ -203,7 +203,7 @@ in_record true reader urword time_series true longname ET surface -description is the elevation of the ET surface ($L$). A time-series name may be specified. +description is the elevation of the ET surface ($L$). 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. block period name rate @@ -214,7 +214,7 @@ in_record true reader urword time_series true longname maximum ET rate -description is the maximum ET flux rate ($LT^{-1}$). A time-series name may be specified. +description is the maximum ET flux rate ($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. block period name depth @@ -225,7 +225,7 @@ in_record true reader urword time_series true longname ET extinction depth -description is the ET extinction depth ($L$). A time-series name may be specified. +description is the ET extinction depth ($L$). 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. block period name pxdp @@ -236,7 +236,7 @@ in_record true reader urword time_series true longname proportion of ET extinction depth -description is the proportion of the ET extinction depth at the bottom of a segment (dimensionless). A time-series name may be specified. +description is the proportion of the ET extinction depth at the bottom of a segment (dimensionless). 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. block period name petm @@ -247,7 +247,7 @@ in_record true reader urword time_series true longname proportion of maximum ET rate -description is the proportion of the maximum ET flux rate at the bottom of a segment (dimensionless). A time-series name may be specified. +description is the proportion of the maximum ET flux rate at the bottom of a segment (dimensionless). 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. block period name petm0 @@ -259,7 +259,7 @@ reader urword optional true time_series true longname proportion of maximum ET rate at ET surface -description 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. +description 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. 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. block period name aux diff --git a/flopy/mf6/data/dfn/gwf-lak.dfn b/flopy/mf6/data/dfn/gwf-lak.dfn index 4f773bb3cf..6a30607838 100644 --- a/flopy/mf6/data/dfn/gwf-lak.dfn +++ b/flopy/mf6/data/dfn/gwf-lak.dfn @@ -127,6 +127,38 @@ optional false longname file keyword description name of the binary output file to write budget information. +block options +name package_convergence_filerecord +type record package_convergence fileout package_convergence_filename +shape +reader urword +tagged true +optional true +longname +description + +block options +name package_convergence +type keyword +shape +in_record true +reader urword +tagged true +optional false +longname package_convergence keyword +description keyword to specify that record corresponds to the package convergence comma spaced values file. + +block options +name package_convergence_filename +type string +shape +in_record true +reader urword +tagged false +optional false +longname file keyword +description name of the comma spaced values output file to write package convergence information. + block options name ts_filerecord type record ts6 filein ts6_filename @@ -483,7 +515,7 @@ reader urword optional false tagged false longname table file name -description 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. +description character string that defines the path and filename for the file containing lake table data for the lake connection. The TAB6\_FILENAME file includes the number of entries in the file and the relation between stage, volume, and surface area 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. Instructions for creating the TAB6\_FILENAME input file are provided in Lake Table Input File section. diff --git a/flopy/mf6/data/dfn/gwf-maw.dfn b/flopy/mf6/data/dfn/gwf-maw.dfn index 8db8f29846..b09e445593 100644 --- a/flopy/mf6/data/dfn/gwf-maw.dfn +++ b/flopy/mf6/data/dfn/gwf-maw.dfn @@ -135,6 +135,14 @@ optional true longname deactivate well storage description keyword that deactivates inclusion of well storage contributions to the multi-aquifer well package continuity equation. +block options +name flow_correction +type keyword +reader urword +optional true +longname activate flow correction +description keyword that activates flow corrections in cases where the head in a multi-aquifer well is below the bottom of the screen for a connection or the head in a convertible cell connected to a multi-aquifer well is below the cell bottom. When flow corrections are activated, unit head gradients are used to calculate the flow between a multi-aquifer well and a connected GWF cell. By default, flow corrections are not made. + block options name flowing_wells type keyword @@ -314,7 +322,7 @@ tagged false in_record true reader urword longname conductance equation -description 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. +description 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. The CUMULATIVE conductance equation is identical to the SKIN LOSSTYPE in the Multi-Node Well (MNW2) package for MODFLOW-2005. The program will terminate with an error condition if CONDEQN is SKIN or CUMULATIVE and the calculated saturated conductance is less than zero; if an error condition occurs, it is suggested that the THEIM or MEAN conductance equations be used for these multi-aquifer wells. block packagedata name ngwfnodes @@ -419,7 +427,7 @@ tagged false in_record true reader urword longname skin data -description 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. +description 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). If CONDEQN is SPECIFIED, HK\_SKIN must be greater than or equal to zero. HK\_SKIN can be any value if CONDEQN is THIEM. Otherwise, HK\_SKIN must be greater than zero. If CONDEQN is SKIN, the contrast between the cell transmissivity (the product of geometric mean horizontal hydraulic conductivity and the cell thickness) and the well transmissivity (the product of HK\_SKIN and the screen thicknesses) must be greater than one in node CELLID or the program will terminate with an error condition; if an error condition occurs, it is suggested that the HK\_SKIN be reduced to a value less than K11 and K22 in node CELLID or the THEIM or MEAN conductance equations be used for these multi-aquifer wells. block connectiondata name radius_skin diff --git a/flopy/mf6/data/dfn/gwf-mvr.dfn b/flopy/mf6/data/dfn/gwf-mvr.dfn index da9b90cc18..fa055645b0 100644 --- a/flopy/mf6/data/dfn/gwf-mvr.dfn +++ b/flopy/mf6/data/dfn/gwf-mvr.dfn @@ -216,7 +216,7 @@ tagged false in_record true reader urword longname mover type -description 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, $Q_R$, is calculated. These options are based the options available in the SFR2 Package for diverting stream flow. +description 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, $Q_R$, is calculated. These options mirror the options defined for the cprior variable in the SFR package, with the term ``FACTOR'' being functionally equivalent to the ``FRACTION'' option for cprior. block period name value diff --git a/flopy/mf6/data/dfn/gwf-npf.dfn b/flopy/mf6/data/dfn/gwf-npf.dfn index d27600bda7..28390af3a9 100644 --- a/flopy/mf6/data/dfn/gwf-npf.dfn +++ b/flopy/mf6/data/dfn/gwf-npf.dfn @@ -6,7 +6,7 @@ type keyword reader urword optional true longname keyword to save NPF flows -description keyword to indicate that cell-by-cell flow terms will be written to the file specified with ``BUDGET SAVE FILE'' in Output Control. +description keyword to indicate that budget flow terms will be written to the file specified with ``BUDGET SAVE FILE'' in Output Control. block options name alternative_cell_averaging @@ -133,7 +133,15 @@ type keyword reader urword optional true longname keyword to save specific discharge -description 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. +description keyword to indicate that x, y, and z components of specific discharge will be calculated at cell centers and written to the budget 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. + +block options +name save_saturation +type keyword +reader urword +optional true +longname keyword to save saturation +description keyword to indicate that cell saturation will be written to the budget file, which is specified with ``BUDGET SAVE FILE'' in Output Control. Saturation will be saved to the budget file as an auxiliary variable saved with the DATA-SAT text label. Saturation is a cell variable that ranges from zero to one and can be used by post processing programs to determine how much of a cell volume is saturated. If ICELLTYPE is 0, then saturation is always one. block options name k22overk diff --git a/flopy/mf6/data/dfn/gwf-rch.dfn b/flopy/mf6/data/dfn/gwf-rch.dfn index 957041bb1a..19fd93e2a5 100644 --- a/flopy/mf6/data/dfn/gwf-rch.dfn +++ b/flopy/mf6/data/dfn/gwf-rch.dfn @@ -188,7 +188,7 @@ in_record true reader urword time_series true longname recharge rate -description is the recharge flux rate ($LT^{-1}$). This rate is multiplied inside the program by the surface area of the cell to calculate the volumetric recharge rate. A time-series name may be specified. +description is the recharge flux rate ($LT^{-1}$). This rate is multiplied inside the program by the surface area of the cell to calculate the volumetric recharge rate. 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. block period name aux diff --git a/flopy/mf6/data/dfn/gwf-sfr.dfn b/flopy/mf6/data/dfn/gwf-sfr.dfn index c30f884686..f84f711d72 100644 --- a/flopy/mf6/data/dfn/gwf-sfr.dfn +++ b/flopy/mf6/data/dfn/gwf-sfr.dfn @@ -127,6 +127,38 @@ optional false longname file keyword description name of the binary output file to write budget information. +block options +name package_convergence_filerecord +type record package_convergence fileout package_convergence_filename +shape +reader urword +tagged true +optional true +longname +description + +block options +name package_convergence +type keyword +shape +in_record true +reader urword +tagged true +optional false +longname package_convergence keyword +description keyword to specify that record corresponds to the package convergence comma spaced values file. + +block options +name package_convergence_filename +type string +shape +in_record true +reader urword +tagged false +optional false +longname file keyword +description name of the comma spaced values output file to write package convergence information. + block options name ts_filerecord type record ts6 filein ts6_filename @@ -211,13 +243,21 @@ optional true longname description REPLACE mover {'{#1}': 'SFR'} +block options +name maximum_picard_iterations +type integer +reader urword +optional true +longname SFR picard iterations +description value that defines the maximum number of Streamflow Routing picard iterations allowed when solving for reach stages and flows as part of the GWF formulate step. Picard iterations are used to minimize differences in SFR package results between subsequent GWF picard (non-linear) iterations as a result of non-optimal reach numbering. If reaches are numbered in order, from upstream to downstream, MAXIMUM\_PICARD\_ITERATIONS can be set to 1 to reduce model run time. By default, MAXIMUM\_PICARD\_ITERATIONS is equal to 100. + block options name maximum_iterations type integer reader urword optional true longname SFR Newton-Raphson iterations -description value that defines the maximum number of Streamflow Routing Newton-Raphson iterations allowed for a reach. By default, MAXSFRIT is equal to 100. +description value that defines the maximum number of Streamflow Routing Newton-Raphson iterations allowed for a reach. By default, MAXIMUM\_ITERATIONS is equal to 100. block options name maximum_depth_change @@ -366,8 +406,9 @@ shape tagged false in_record true reader urword +time_series true longname fraction of upstream flow -description real value that defines the fraction of upstream flow from each upstream reach that is applied as upstream inflow to the reach. The sum of all USTRF values for all reaches connected to the same upstream reach must be equal to one and USTRF must be greater than or equal to zero. +description real value that defines the fraction of upstream flow from each upstream reach that is applied as upstream inflow to the reach. The sum of all USTRF values for all reaches connected to the same upstream reach must be equal to one and USTRF 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. block packagedata name ndv @@ -487,7 +528,7 @@ tagged false in_record true reader urword longname iprior code -description character string value that defines the the prioritization system for the diversion, such as when insufficient water is available to meet all diversion stipulations, and is used in conjunction with the value of FLOW value specified in the STRESS\_PERIOD\_DATA section. Available diversion options include: (1) CPRIOR = `FRACTION', then the amount of the diversion is computed as a fraction of the streamflow leaving reach RNO ($Q_{DS}$); in this case, 0.0 $\le$ DIVFLOW $\le$ 1.0. (2) CPRIOR = `EXCESS', a diversion is made only if $Q_{DS}$ for reach RNO exceeds the value of DIVFLOW. If this occurs, then the quantity of water diverted is the excess flow ($Q_{DS} -$ DIVFLOW) and $Q_{DS}$ from reach RNO is set equal to DIVFLOW. This represents a flood-control type of diversion, as described by Danskin and Hanson (2002). (3) CPRIOR = `THRESHOLD', then if $Q_{DS}$ in reach RNO is less than the specified diversion flow (DIVFLOW), no water is diverted from reach RNO. If $Q_{DS}$ in reach RNO is greater than or equal to (DIVFLOW), (DIVFLOW) is diverted and $Q_{DS}$ is set to the remainder ($Q_{DS} -$ DIVFLOW)). This approach assumes that once flow in the stream is sufficiently low, diversions from the stream cease, and is the `priority' algorithm that originally was programmed into the STR1 Package (Prudic, 1989). (4) CPRIOR = `UPTO' -- if $Q_{DS}$ in reach RNO is greater than or equal to the specified diversion flow (DIVFLOW), $Q_{DS}$ is reduced by DIVFLOW. If $Q_{DS}$ in reach RNO is less than (DIVFLOW), DIVFLOW is set to $Q_{DS}$ and there will be no flow available for reaches connected to downstream end of reach RNO. +description character string value that defines the the prioritization system for the diversion, such as when insufficient water is available to meet all diversion stipulations, and is used in conjunction with the value of FLOW value specified in the STRESS\_PERIOD\_DATA section. Available diversion options include: (1) CPRIOR = `FRACTION', then the amount of the diversion is computed as a fraction of the streamflow leaving reach RNO ($Q_{DS}$); in this case, 0.0 $\le$ DIVFLOW $\le$ 1.0. (2) CPRIOR = `EXCESS', a diversion is made only if $Q_{DS}$ for reach RNO exceeds the value of DIVFLOW. If this occurs, then the quantity of water diverted is the excess flow ($Q_{DS} -$ DIVFLOW) and $Q_{DS}$ from reach RNO is set equal to DIVFLOW. This represents a flood-control type of diversion, as described by Danskin and Hanson (2002). (3) CPRIOR = `THRESHOLD', then if $Q_{DS}$ in reach RNO is less than the specified diversion flow (DIVFLOW), no water is diverted from reach RNO. If $Q_{DS}$ in reach RNO is greater than or equal to (DIVFLOW), (DIVFLOW) is diverted and $Q_{DS}$ is set to the remainder ($Q_{DS} -$ DIVFLOW)). This approach assumes that once flow in the stream is sufficiently low, diversions from the stream cease, and is the `priority' algorithm that originally was programmed into the STR1 Package (Prudic, 1989). (4) CPRIOR = `UPTO' -- if $Q_{DS}$ in reach RNO is greater than or equal to the specified diversion flow (DIVFLOW), $Q_{DS}$ is reduced by DIVFLOW. If $Q_{DS}$ in reach RNO is less than (DIVFLOW), DIVFLOW is set to $Q_{DS}$ and there will be no flow available for reaches connected to downstream end of reach RNO. # --------------------- gwf sfr period --------------------- @@ -612,7 +653,7 @@ description real or character value that defines the volumetric rate of diffuse block period name diversionrecord -type record diversion idv divrate +type record diversion idv divflow shape tagged in_record true @@ -637,18 +678,18 @@ tagged false in_record true reader urword longname diversion number -description diversion number. +description an integer value specifying which diversion of reach RNO that DIVFLOW is being specified for. Must be less or equal to ndv for the current reach (RNO). numeric_index true block period -name divrate +name divflow type double precision shape tagged false in_record true reader urword time_series true -longname volumetric diversion rate +longname volumetric diversion flow rate description real or character value that defines the volumetric diversion (DIVFLOW) rate for the streamflow routing reach. 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. block period diff --git a/flopy/mf6/data/dfn/gwf-sto.dfn b/flopy/mf6/data/dfn/gwf-sto.dfn index a4534f4401..6239b02d73 100644 --- a/flopy/mf6/data/dfn/gwf-sto.dfn +++ b/flopy/mf6/data/dfn/gwf-sto.dfn @@ -39,7 +39,7 @@ reader readarray layered true optional false longname specific storage -description 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. +description 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. If the CSUB Package is included in the GWF model, specific storage must be zero for every cell. default_value 1.e-5 block griddata @@ -78,7 +78,7 @@ valid reader urword optional true longname steady state indicator -description 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. +description 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. If the CSUB Package is included in the GWF model, only the first and last stress period can be steady-state. block period name transient diff --git a/flopy/mf6/data/dfn/gwf-uzf.dfn b/flopy/mf6/data/dfn/gwf-uzf.dfn index faf51e07dc..0d228358b1 100644 --- a/flopy/mf6/data/dfn/gwf-uzf.dfn +++ b/flopy/mf6/data/dfn/gwf-uzf.dfn @@ -95,6 +95,38 @@ optional false longname file keyword description name of the binary output file to write budget information. +block options +name package_convergence_filerecord +type record package_convergence fileout package_convergence_filename +shape +reader urword +tagged true +optional true +longname +description + +block options +name package_convergence +type keyword +shape +in_record true +reader urword +tagged true +optional false +longname package_convergence keyword +description keyword to specify that record corresponds to the package convergence comma spaced values file. + +block options +name package_convergence_filename +type string +shape +in_record true +reader urword +tagged false +optional false +longname file keyword +description name of the comma spaced values output file to write package convergence information. + block options name ts_filerecord type record ts6 filein ts6_filename @@ -231,7 +263,7 @@ tagged true reader urword optional true longname use root potential -description 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. +description keyword specifying that ET in the unsaturated zone will be simulated using a capillary pressure based formulation. Capillary pressure is calculated using the Brooks-Corey retention function. # --------------------- gwf uzf dimensions --------------------- @@ -251,6 +283,7 @@ reader urword optional false longname number of trailing waves description is the number of trailing waves. A recommended value of 7 can be used for NTRAILWAVES. This value can be increased to lower mass balance error in the unsaturated zone. +default_value 7 block dimensions name nwavesets @@ -259,7 +292,7 @@ reader urword optional false longname number of wave sets description is the number of wave sets. A recommended value of 40 can be used for NWAVESETS. This value can be increased if more waves are required to resolve variations in water content within the unsaturated zone. - +default_value 40 # --------------------- gwf uzf packagedata --------------------- diff --git a/flopy/mf6/data/dfn/sln-ims.dfn b/flopy/mf6/data/dfn/sln-ims.dfn index b5091e8bed..98f6dbacb1 100644 --- a/flopy/mf6/data/dfn/sln-ims.dfn +++ b/flopy/mf6/data/dfn/sln-ims.dfn @@ -23,6 +23,7 @@ shape reader urword tagged true optional true +deprecated 6.1.1 longname description @@ -34,8 +35,43 @@ in_record true reader urword tagged true optional false +deprecated 6.1.1 longname budget keyword -description keyword to specify that the record corresponds to the comma separated values solver convergence output. +description keyword to specify that the record corresponds to the comma separated values solver convergence output. The CSV\_OUTPUT option has been deprecated and split into the CSV_OUTER_OUTPUT and CSV_INNER_OUTPUT options. Starting with MODFLOW 6 version 6.1.1 if the CSV_OUTPUT option is specified, then it is treated as the CSV_OUTER_OUTPUT option. + +block options +name csvfile +type string +preserve_case true +shape +in_record true +reader urword +tagged false +optional false +deprecated 6.1.1 +longname file keyword +description 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. + +block options +name csv_outer_output_filerecord +type record csv_outer_output fileout outer_csvfile +shape +reader urword +tagged true +optional true +longname +description + +block options +name csv_outer_output +type keyword +shape +in_record true +reader urword +tagged true +optional false +longname budget keyword +description keyword to specify that the record corresponds to the comma separated values outer iteration convergence output. block options name fileout @@ -49,7 +85,7 @@ longname file keyword description keyword to specify that an output filename is expected next. block options -name csvfile +name outer_csvfile type string preserve_case true shape @@ -58,7 +94,40 @@ reader urword tagged false optional false longname file keyword -description 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. +description name of the ascii comma separated values output file to write maximum dependent-variable (for example, head) change convergence information at the end of each outer iteration for each time step. + +block options +name csv_inner_output_filerecord +type record csv_inner_output fileout inner_csvfile +shape +reader urword +tagged true +optional true +longname +description + +block options +name csv_inner_output +type keyword +shape +in_record true +reader urword +tagged true +optional false +longname budget keyword +description keyword to specify that the record corresponds to the comma separated values solver convergence output. + +block options +name inner_csvfile +type string +preserve_case true +shape +in_record true +reader urword +tagged false +optional false +longname file keyword +description name of the ascii comma separated values output file to write solver convergence information. Comma separated values output includes maximum dependent-variable (for example, 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. block options name no_ptcrecord @@ -95,17 +164,27 @@ block nonlinear name outer_hclose type double precision reader urword -optional false +optional true +deprecated 6.1.1 longname head change criterion -description 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. +description 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. The OUTER\_HCLOSE option has been deprecated in favor of the more general OUTER\_DVCLOSE (for dependent variable), however either one can be specified in order to maintain backward compatibility. + +block nonlinear +name outer_dvclose +type double precision +reader urword +optional false +longname dependent-variable change criterion +description real value defining the dependent-variable (for example, head) change criterion for convergence of the outer (nonlinear) iterations, in units of the dependent-variable (for example, length for head). When the maximum absolute value of the dependent-variable change at all nodes during an iteration is less than or equal to OUTER\_DVCLOSE, iteration stops. Commonly, OUTER\_DVCLOSE equals 0.01. The keyword, OUTER\_HCLOSE can be still be specified instead of OUTER\_DVCLOSE for backward compatibility with previous versions of MODFLOW 6 but eventually OUTER\_HCLOSE will be deprecated and specification of OUTER\_HCLOSE will cause MODFLOW 6 to terminate with an error. block nonlinear name outer_rclosebnd type double precision reader urword optional true +deprecated 6.1.1 +description 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. The OUTER\_RCLOSEBND option is deprecated and has no effect on simulation results as of version 6.1.1. The keyword, OUTER\_RCLOSEBND can be still be specified for backward compatibility with previous versions of MODFLOW 6 but eventually specificiation of OUTER\_RCLOSEBND will cause MODFLOW 6 to terminate with an error. longname boundary package flow residual tolerance -description 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. block nonlinear name outer_maximum @@ -129,7 +208,7 @@ type double precision reader urword optional true longname under relaxation reduction factor -description 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. +description 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 dependent-variable (for example, 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. block nonlinear name under_relaxation_kappa @@ -137,7 +216,7 @@ type double precision reader urword optional true longname under relaxation increment for the learning rate -description 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. +description 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 dependent-variable (for example, 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. block nonlinear name under_relaxation_gamma @@ -202,9 +281,18 @@ block linear name inner_hclose type double precision reader urword -optional false +optional true +deprecated 6.1.1 longname head change tolerance -description 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. +description 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. The INNER\_HCLOSE keyword has been deprecated in favor of the more general INNER\_DVCLOSE (for dependent variable), however either one can be specified in order to maintain backward compatibility. + +block linear +name inner_dvclose +type double precision +reader urword +optional false +longname dependent-variable change tolerance +description real value defining the dependent-variable (for example, head) change criterion for convergence of the inner (linear) iterations, in units of the dependent-variable (for example, length for head). When the maximum absolute value of the dependent-variable change at all nodes during an iteration is less than or equal to INNER\_DVCLOSE, the matrix solver assumes convergence. Commonly, INNER\_DVCLOSE is set an order of magnitude less than the OUTER\_DVCLOSE value specified for the NONLINEAR block. The keyword, INNER\_HCLOSE can be still be specified instead of INNER\_DVCLOSE for backward compatibility with previous versions of MODFLOW 6 but eventually INNER\_HCLOSE will be deprecated and specification of INNER\_HCLOSE will cause MODFLOW 6 to terminate with an error. block linear name rcloserecord @@ -226,13 +314,13 @@ description real value that defines the flow residual tolerance for convergence block linear name rclose_option -type string +type string tagged false in_record true reader urword optional true longname flow residual tolerance -description 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 $1.0 \times 10^{-4}$ and convergence is achieved for a given inner (linear) iteration when $\Delta h \le$ INNER\_HCLOSE and the current L-2 Norm is $\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. +description 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 dependent-variable (for example, 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 $1.0 \times 10^{-4}$ and convergence is achieved for a given inner (linear) iteration when $\Delta h \le$ INNER\_DVCLOSE and the current L-2 Norm is $\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. block linear name linear_acceleration @@ -272,7 +360,7 @@ type integer reader urword optional true longname drop tolerance used to drop preconditioner terms -description 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. +description optional integer value defining the interval used to explicitly recalculate the residual of the flow equation using the solver coefficient matrix, the latest dependent-variable (for example, 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. block linear name scaling_method diff --git a/flopy/mf6/modflow/mfgwfchd.py b/flopy/mf6/modflow/mfgwfchd.py index f978a7eb08..ff86c47b48 100644 --- a/flopy/mf6/modflow/mfgwfchd.py +++ b/flopy/mf6/modflow/mfgwfchd.py @@ -74,7 +74,10 @@ class ModflowGwfchd(mfpackage.MFPackage): as zero-based when working with FloPy and Python. Flopy will automatically subtract one when loading index variables and add one when writing index variables. - * head (double) is the head at the boundary. + * head (double) is the head at 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 constant head. The values of auxiliary variables must be present for each constant head. The values must be specified in the order of diff --git a/flopy/mf6/modflow/mfgwfcsub.py b/flopy/mf6/modflow/mfgwfcsub.py index 0831727562..6d7953b781 100644 --- a/flopy/mf6/modflow/mfgwfcsub.py +++ b/flopy/mf6/modflow/mfgwfcsub.py @@ -136,6 +136,9 @@ class ModflowGwfcsub(mfpackage.MFPackage): zdisplacement_filerecord : [zdisplacement_filename] * zdisplacement_filename (string) name of the binary output file to write z-displacement information. + package_convergence_filerecord : [package_convergence_filename] + * package_convergence_filename (string) name of the comma spaced values + output file to write package convergence 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 @@ -174,7 +177,7 @@ class ModflowGwfcsub(mfpackage.MFPackage): sse_cr, theta, kv, h0, boundname] * icsubno (integer) integer value that defines the CSUB interbed number associated with the specified PACKAGEDATA data on the line. CSUBNO - must be greater than zero and less than or equal to NCSUBCELLS. CSUB + must be greater than zero and less than or equal to NINTERBEDS. CSUB information must be specified for every CSUB cell or the program will terminate with an error. The program will also terminate with an error if information for a CSUB interbed number is specified more @@ -253,7 +256,10 @@ class ModflowGwfcsub(mfpackage.MFPackage): when writing index variables. * sig0 (double) is the stress offset for the cell. SIG0 is added to the calculated geostatic stress for the cell. SIG0 is specified only if - MAXSIG0 is specified to be greater than 0 in the DIMENSIONS block. + MAXSIG0 is specified to be greater than 0 in the DIMENSIONS 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. filename : String File name for this package. pname : String @@ -283,6 +289,8 @@ class ModflowGwfcsub(mfpackage.MFPackage): 'gwf6', 'csub', 'options', 'compaction_coarse_filerecord')) zdisplacement_filerecord = ListTemplateGenerator(( 'gwf6', 'csub', 'options', 'zdisplacement_filerecord')) + package_convergence_filerecord = ListTemplateGenerator(( + 'gwf6', 'csub', 'options', 'package_convergence_filerecord')) ts_filerecord = ListTemplateGenerator(('gwf6', 'csub', 'options', 'ts_filerecord')) obs_filerecord = ListTemplateGenerator(('gwf6', 'csub', 'options', @@ -412,6 +420,16 @@ class ModflowGwfcsub(mfpackage.MFPackage): ["block options", "name zdisplacement_filename", "type string", "shape", "in_record true", "reader urword", "tagged false", "optional false"], + ["block options", "name package_convergence_filerecord", + "type record package_convergence fileout " + "package_convergence_filename", + "shape", "reader urword", "tagged true", "optional true"], + ["block options", "name package_convergence", "type keyword", + "shape", "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name package_convergence_filename", + "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", @@ -451,7 +469,7 @@ class ModflowGwfcsub(mfpackage.MFPackage): ["block packagedata", "name packagedata", "type recarray icsubno cellid cdelay pcs0 thick_frac rnb ssv_cc " "sse_cr theta kv h0 boundname", - "shape (ncsubcells)", "reader urword"], + "shape (ninterbeds)", "reader urword"], ["block packagedata", "name icsubno", "type integer", "shape", "tagged false", "in_record true", "reader urword", "numeric_index true"], @@ -506,7 +524,8 @@ def __init__(self, model, loading_package=False, boundnames=None, compaction_inelastic_filerecord=None, compaction_interbed_filerecord=None, compaction_coarse_filerecord=None, - zdisplacement_filerecord=None, timeseries=None, + zdisplacement_filerecord=None, + package_convergence_filerecord=None, timeseries=None, observations=None, ninterbeds=None, maxsig0=None, cg_ske_cr=1e-5, cg_theta=0.2, sgm=None, sgs=None, packagedata=None, stress_period_data=None, filename=None, @@ -557,6 +576,8 @@ def __init__(self, model, loading_package=False, boundnames=None, "compaction_coarse_filerecord", compaction_coarse_filerecord) self.zdisplacement_filerecord = self.build_mfdata( "zdisplacement_filerecord", zdisplacement_filerecord) + self.package_convergence_filerecord = self.build_mfdata( + "package_convergence_filerecord", package_convergence_filerecord) self._ts_filerecord = self.build_mfdata("ts_filerecord", None) self._ts_package = self.build_child_package("ts", timeseries, diff --git a/flopy/mf6/modflow/mfgwfdisu.py b/flopy/mf6/modflow/mfgwfdisu.py index 5e009f57e1..8e29fedc7b 100644 --- a/flopy/mf6/modflow/mfgwfdisu.py +++ b/flopy/mf6/modflow/mfgwfdisu.py @@ -219,7 +219,7 @@ class ModflowGwfdisu(mfpackage.MFPackage): ["block griddata", "name area", "type double precision", "shape (nodes)", "reader readarray"], ["block griddata", "name idomain", "type integer", - "shape (nodes)", "reader readarray", "layered true", + "shape (nodes)", "reader readarray", "layered false", "optional true"], ["block connectiondata", "name iac", "type integer", "shape (nodes)", "reader readarray"], diff --git a/flopy/mf6/modflow/mfgwfdrn.py b/flopy/mf6/modflow/mfgwfdrn.py index 8b9c899dd6..ea29cc948c 100644 --- a/flopy/mf6/modflow/mfgwfdrn.py +++ b/flopy/mf6/modflow/mfgwfdrn.py @@ -31,6 +31,19 @@ class ModflowGwfdrn(mfpackage.MFPackage): auxmultname : string * auxmultname (string) name of auxiliary variable to be used as multiplier of drain conductance. + auxdepthname : string + * auxdepthname (string) name of a variable listed in AUXILIARY that + defines the depth at which drainage discharge will be scaled. If a + positive value is specified for the AUXDEPTHNAME AUXILIARY variable, + then ELEV is the elevation at which the drain starts to discharge and + ELEV + DDRN (assuming DDRN is the AUXDEPTHNAME variable) is the + elevation when the drain conductance (COND) scaling factor is 1. If a + negative drainage depth value is specified for DDRN, then ELEV + DDRN + is the elevation at which the drain starts to discharge and ELEV is + the elevation when the conductance (COND) scaling factor is 1. A + linear- or cubic-scaling is used to scale the drain conductance + (COND) when the Standard or Newton-Raphson Formulation is used, + respectively. boundnames : boolean * boundnames (boolean) keyword to indicate that boundary names may be provided with the list of drain cells. @@ -125,6 +138,8 @@ class ModflowGwfdrn(mfpackage.MFPackage): "shape (naux)", "reader urword", "optional true"], ["block options", "name auxmultname", "type string", "shape", "reader urword", "optional true"], + ["block options", "name auxdepthname", "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", @@ -183,9 +198,9 @@ class ModflowGwfdrn(mfpackage.MFPackage): "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, + auxmultname=None, auxdepthname=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, @@ -194,6 +209,7 @@ def __init__(self, model, loading_package=False, auxiliary=None, # set up variables self.auxiliary = self.build_mfdata("auxiliary", auxiliary) self.auxmultname = self.build_mfdata("auxmultname", auxmultname) + self.auxdepthname = self.build_mfdata("auxdepthname", auxdepthname) 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) diff --git a/flopy/mf6/modflow/mfgwfevt.py b/flopy/mf6/modflow/mfgwfevt.py index 179bd85b8b..ea16c8e788 100644 --- a/flopy/mf6/modflow/mfgwfevt.py +++ b/flopy/mf6/modflow/mfgwfevt.py @@ -90,22 +90,34 @@ class ModflowGwfevt(mfpackage.MFPackage): as zero-based when working with FloPy and Python. Flopy will automatically subtract one when loading index variables and add one when writing index variables. - * 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. + * surface (double) is the elevation of the ET surface (:math:`L`). 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. + * rate (double) is the maximum ET flux rate (: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. + * depth (double) is the ET extinction depth (:math:`L`). 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. * pxdp (double) is the proportion of the ET extinction depth at the - bottom of a segment (dimensionless). A time-series name may be - specified. + bottom of a segment (dimensionless). 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. * 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. + bottom of a segment (dimensionless). 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. * 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. + PETM0 is read only when the SURF_RATE_SPECIFIED option is used. 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 evapotranspiration. The values of auxiliary variables must be present for each evapotranspiration. The values must be specified in diff --git a/flopy/mf6/modflow/mfgwflak.py b/flopy/mf6/modflow/mfgwflak.py index 1619f5c3a1..e5eaf3e91e 100644 --- a/flopy/mf6/modflow/mfgwflak.py +++ b/flopy/mf6/modflow/mfgwflak.py @@ -58,6 +58,9 @@ class ModflowGwflak(mfpackage.MFPackage): budget_filerecord : [budgetfile] * budgetfile (string) name of the binary output file to write budget information. + package_convergence_filerecord : [package_convergence_filename] + * package_convergence_filename (string) name of the comma spaced values + output file to write package convergence 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 @@ -223,13 +226,12 @@ class ModflowGwflak(mfpackage.MFPackage): and add one when writing index variables. * 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 + connection. The TAB6_FILENAME file includes the number of entries in + the file and the relation between stage, volume, and surface area 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. + each entry in the file. Instructions for creating the TAB6_FILENAME + input file are provided in Lake Table Input File section. outlets : [outletno, lakein, lakeout, couttype, invert, width, rough, slope] * outletno (integer) integer value that defines the outlet number @@ -416,6 +418,8 @@ class ModflowGwflak(mfpackage.MFPackage): 'stage_filerecord')) budget_filerecord = ListTemplateGenerator(('gwf6', 'lak', 'options', 'budget_filerecord')) + package_convergence_filerecord = ListTemplateGenerator(( + 'gwf6', 'lak', 'options', 'package_convergence_filerecord')) ts_filerecord = ListTemplateGenerator(('gwf6', 'lak', 'options', 'ts_filerecord')) obs_filerecord = ListTemplateGenerator(('gwf6', 'lak', 'options', @@ -467,6 +471,16 @@ class ModflowGwflak(mfpackage.MFPackage): ["block options", "name budgetfile", "type string", "preserve_case true", "shape", "in_record true", "reader urword", "tagged false", "optional false"], + ["block options", "name package_convergence_filerecord", + "type record package_convergence fileout " + "package_convergence_filename", + "shape", "reader urword", "tagged true", "optional true"], + ["block options", "name package_convergence", "type keyword", + "shape", "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name package_convergence_filename", + "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", @@ -649,12 +663,12 @@ class ModflowGwflak(mfpackage.MFPackage): 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, perioddata=None, filename=None, - pname=None, parent_file=None): + budget_filerecord=None, package_convergence_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, + perioddata=None, filename=None, pname=None, parent_file=None): super(ModflowGwflak, self).__init__(model, "lak", filename, pname, loading_package, parent_file) @@ -669,6 +683,8 @@ def __init__(self, model, loading_package=False, auxiliary=None, stage_filerecord) self.budget_filerecord = self.build_mfdata("budget_filerecord", budget_filerecord) + self.package_convergence_filerecord = self.build_mfdata( + "package_convergence_filerecord", package_convergence_filerecord) self._ts_filerecord = self.build_mfdata("ts_filerecord", None) self._ts_package = self.build_child_package("ts", timeseries, diff --git a/flopy/mf6/modflow/mfgwfmaw.py b/flopy/mf6/modflow/mfgwfmaw.py index b4155629d5..ec60119ffe 100644 --- a/flopy/mf6/modflow/mfgwfmaw.py +++ b/flopy/mf6/modflow/mfgwfmaw.py @@ -62,6 +62,14 @@ class ModflowGwfmaw(mfpackage.MFPackage): * no_well_storage (boolean) keyword that deactivates inclusion of well storage contributions to the multi-aquifer well package continuity equation. + flow_correction : boolean + * flow_correction (boolean) keyword that activates flow corrections in + cases where the head in a multi-aquifer well is below the bottom of + the screen for a connection or the head in a convertible cell + connected to a multi-aquifer well is below the cell bottom. When flow + corrections are activated, unit head gradients are used to calculate + the flow between a multi-aquifer well and a connected GWF cell. By + default, flow corrections are not made. flowing_wells : boolean * flowing_wells (boolean) keyword that activates the flowing wells option for the multi-aquifer well package. @@ -141,7 +149,13 @@ class ModflowGwfmaw(mfpackage.MFPackage): 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. + screen hydraulic conductivity, and well and skin radius. The + CUMULATIVE conductance equation is identical to the SKIN LOSSTYPE in + the Multi-Node Well (MNW2) package for MODFLOW-2005. The program will + terminate with an error condition if CONDEQN is SKIN or CUMULATIVE + and the calculated saturated conductance is less than zero; if an + error condition occurs, it is suggested that the THEIM or MEAN + conductance equations be used for these multi-aquifer wells. * ngwfnodes (integer) integer value that defines the number of GWF nodes connected to this (WELLNO) multi-aquifer well. NGWFNODES must be greater than zero. @@ -207,7 +221,17 @@ class ModflowGwfmaw(mfpackage.MFPackage): 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. + well (NGWFNODES). If CONDEQN is SPECIFIED, HK_SKIN must be greater + than or equal to zero. HK_SKIN can be any value if CONDEQN is THIEM. + Otherwise, HK_SKIN must be greater than zero. If CONDEQN is SKIN, the + contrast between the cell transmissivity (the product of geometric + mean horizontal hydraulic conductivity and the cell thickness) and + the well transmissivity (the product of HK_SKIN and the screen + thicknesses) must be greater than one in node CELLID or the program + will terminate with an error condition; if an error condition occurs, + it is suggested that the HK_SKIN be reduced to a value less than K11 + and K22 in node CELLID or the THEIM or MEAN conductance equations be + used for these multi-aquifer wells. * 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 @@ -371,6 +395,8 @@ class ModflowGwfmaw(mfpackage.MFPackage): "tagged false", "optional false"], ["block options", "name no_well_storage", "type keyword", "reader urword", "optional true"], + ["block options", "name flow_correction", "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", @@ -517,10 +543,11 @@ 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): + flow_correction=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) @@ -537,6 +564,8 @@ def __init__(self, model, loading_package=False, auxiliary=None, budget_filerecord) self.no_well_storage = self.build_mfdata("no_well_storage", no_well_storage) + self.flow_correction = self.build_mfdata("flow_correction", + flow_correction) self.flowing_wells = self.build_mfdata("flowing_wells", flowing_wells) self.shutdown_theta = self.build_mfdata("shutdown_theta", shutdown_theta) diff --git a/flopy/mf6/modflow/mfgwfmvr.py b/flopy/mf6/modflow/mfgwfmvr.py index c657635dd5..da3325e23d 100644 --- a/flopy/mf6/modflow/mfgwfmvr.py +++ b/flopy/mf6/modflow/mfgwfmvr.py @@ -87,8 +87,9 @@ class ModflowGwfmvr(mfpackage.MFPackage): 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. + These options mirror the options defined for the cprior variable in + the SFR package, with the term "FACTOR" being functionally equivalent + to the "FRACTION" option for cprior. * 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 diff --git a/flopy/mf6/modflow/mfgwfnpf.py b/flopy/mf6/modflow/mfgwfnpf.py index 0b17dda049..b024c8b15d 100644 --- a/flopy/mf6/modflow/mfgwfnpf.py +++ b/flopy/mf6/modflow/mfgwfnpf.py @@ -17,9 +17,9 @@ class ModflowGwfnpf(mfpackage.MFPackage): 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. + * save_flows (boolean) keyword to indicate that budget 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 @@ -67,13 +67,22 @@ class ModflowGwfnpf(mfpackage.MFPackage): 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. + and written to the budget 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. + save_saturation : boolean + * save_saturation (boolean) keyword to indicate that cell saturation + will be written to the budget file, which is specified with "BUDGET + SAVE FILE" in Output Control. Saturation will be saved to the budget + file as an auxiliary variable saved with the DATA-SAT text label. + Saturation is a cell variable that ranges from zero to one and can be + used by post processing programs to determine how much of a cell + volume is saturated. If ICELLTYPE is 0, then saturation is always + one. k22overk : boolean * k22overk (boolean) keyword to indicate that specified K22 is a ratio of K22 divided by K. If this option is specified, then the K22 array @@ -237,6 +246,8 @@ class ModflowGwfnpf(mfpackage.MFPackage): "reader urword", "optional true"], ["block options", "name save_specific_discharge", "type keyword", "reader urword", "optional true"], + ["block options", "name save_saturation", "type keyword", + "reader urword", "optional true"], ["block options", "name k22overk", "type keyword", "reader urword", "optional true"], ["block options", "name k33overk", "type keyword", @@ -269,10 +280,11 @@ class ModflowGwfnpf(mfpackage.MFPackage): 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, k22overk=None, - k33overk=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): + xt3doptions=None, save_specific_discharge=None, + save_saturation=None, k22overk=None, k33overk=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) @@ -287,6 +299,8 @@ def __init__(self, model, loading_package=False, save_flows=None, self.xt3doptions = self.build_mfdata("xt3doptions", xt3doptions) self.save_specific_discharge = self.build_mfdata( "save_specific_discharge", save_specific_discharge) + self.save_saturation = self.build_mfdata("save_saturation", + save_saturation) self.k22overk = self.build_mfdata("k22overk", k22overk) self.k33overk = self.build_mfdata("k33overk", k33overk) self.icelltype = self.build_mfdata("icelltype", icelltype) diff --git a/flopy/mf6/modflow/mfgwfrch.py b/flopy/mf6/modflow/mfgwfrch.py index b5cfeb2633..c78758cf30 100644 --- a/flopy/mf6/modflow/mfgwfrch.py +++ b/flopy/mf6/modflow/mfgwfrch.py @@ -80,8 +80,10 @@ class ModflowGwfrch(mfpackage.MFPackage): when writing index variables. * recharge (double) is the recharge flux rate (:math:`LT^{-1}`). This rate is multiplied inside the program by the surface area of the cell - to calculate the volumetric recharge rate. A time-series name may be - specified. + to calculate the volumetric recharge rate. 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 recharge. The values of auxiliary variables must be present for each recharge. The values must be specified in the order of the diff --git a/flopy/mf6/modflow/mfgwfsfr.py b/flopy/mf6/modflow/mfgwfsfr.py index 8088060c18..fb1917a88a 100644 --- a/flopy/mf6/modflow/mfgwfsfr.py +++ b/flopy/mf6/modflow/mfgwfsfr.py @@ -58,6 +58,9 @@ class ModflowGwfsfr(mfpackage.MFPackage): budget_filerecord : [budgetfile] * budgetfile (string) name of the binary output file to write budget information. + package_convergence_filerecord : [package_convergence_filename] + * package_convergence_filename (string) name of the comma spaced values + output file to write package convergence 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 @@ -73,10 +76,20 @@ class ModflowGwfsfr(mfpackage.MFPackage): 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. + maximum_picard_iterations : integer + * maximum_picard_iterations (integer) value that defines the maximum + number of Streamflow Routing picard iterations allowed when solving + for reach stages and flows as part of the GWF formulate step. Picard + iterations are used to minimize differences in SFR package results + between subsequent GWF picard (non-linear) iterations as a result of + non-optimal reach numbering. If reaches are numbered in order, from + upstream to downstream, MAXIMUM_PICARD_ITERATIONS can be set to 1 to + reduce model run time. By default, MAXIMUM_PICARD_ITERATIONS is equal + to 100. maximum_iterations : integer * maximum_iterations (integer) value that defines the maximum number of Streamflow Routing Newton-Raphson iterations allowed for a reach. By - default, MAXSFRIT is equal to 100. + default, MAXIMUM_ITERATIONS is equal to 100. maximum_depth_change : double * maximum_depth_change (double) value that defines the depth closure tolerance. By default, DMAXCHG is equal to :math:`1 \\times 10^{-5}`. @@ -135,7 +148,10 @@ class ModflowGwfsfr(mfpackage.MFPackage): from each upstream reach that is applied as upstream inflow to the reach. The sum of all USTRF values for all reaches connected to the same upstream reach must be equal to one and USTRF must be greater - than or equal to zero. + 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. * ndv (integer) integer value that defines the number of downstream diversions for the reach. * aux (double) represents the values of the auxiliary variables for @@ -315,13 +331,15 @@ class ModflowGwfsfr(mfpackage.MFPackage): the volumetric runoff rate is limited to inflows to the reach and the volumetric evaporation rate for the reach is set to zero. By default, runoff rates are zero for each reach. - diversionrecord : [idv, divrate] - * idv (integer) diversion number. This argument is an index - variable, which means that it should be treated as zero-based - when working with FloPy and Python. Flopy will automatically - subtract one when loading index variables and add one when - writing index variables. - * divrate (double) real or character value that defines the + diversionrecord : [idv, divflow] + * idv (integer) an integer value specifying which diversion of + reach RNO that DIVFLOW is being specified for. Must be less + or equal to ndv for the current reach (RNO). This argument is + an index variable, which means that it should be treated as + zero-based when working with FloPy and Python. Flopy will + automatically subtract one when loading index variables and + add one when writing index variables. + * divflow (double) real or character value that defines the volumetric diversion (DIVFLOW) rate for the streamflow routing reach. If the Options block includes a TIMESERIESFILE entry (see the "Time-Variable Input" section), values can be @@ -360,6 +378,8 @@ class ModflowGwfsfr(mfpackage.MFPackage): 'stage_filerecord')) budget_filerecord = ListTemplateGenerator(('gwf6', 'sfr', 'options', 'budget_filerecord')) + package_convergence_filerecord = ListTemplateGenerator(( + 'gwf6', 'sfr', 'options', 'package_convergence_filerecord')) ts_filerecord = ListTemplateGenerator(('gwf6', 'sfr', 'options', 'ts_filerecord')) obs_filerecord = ListTemplateGenerator(('gwf6', 'sfr', 'options', @@ -410,6 +430,16 @@ class ModflowGwfsfr(mfpackage.MFPackage): ["block options", "name budgetfile", "type string", "preserve_case true", "shape", "in_record true", "reader urword", "tagged false", "optional false"], + ["block options", "name package_convergence_filerecord", + "type record package_convergence fileout " + "package_convergence_filename", + "shape", "reader urword", "tagged true", "optional true"], + ["block options", "name package_convergence", "type keyword", + "shape", "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name package_convergence_filename", + "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", @@ -435,6 +465,8 @@ class ModflowGwfsfr(mfpackage.MFPackage): "reader urword", "optional false"], ["block options", "name mover", "type keyword", "tagged true", "reader urword", "optional true"], + ["block options", "name maximum_picard_iterations", + "type integer", "reader urword", "optional true"], ["block options", "name maximum_iterations", "type integer", "reader urword", "optional true"], ["block options", "name maximum_depth_change", @@ -471,7 +503,8 @@ class ModflowGwfsfr(mfpackage.MFPackage): ["block packagedata", "name ncon", "type integer", "shape", "tagged false", "in_record true", "reader urword"], ["block packagedata", "name ustrf", "type double precision", - "shape", "tagged false", "in_record true", "reader urword"], + "shape", "tagged false", "in_record true", "reader urword", + "time_series true"], ["block packagedata", "name ndv", "type integer", "shape", "tagged false", "in_record true", "reader urword"], ["block packagedata", "name aux", "type double precision", @@ -536,14 +569,14 @@ class ModflowGwfsfr(mfpackage.MFPackage): "tagged true", "in_record true", "reader urword", "time_series true"], ["block period", "name diversionrecord", - "type record diversion idv divrate", "shape", "tagged", + "type record diversion idv divflow", "shape", "tagged", "in_record true", "reader urword"], ["block period", "name diversion", "type keyword", "shape", "in_record true", "reader urword"], ["block period", "name idv", "type integer", "shape", "tagged false", "in_record true", "reader urword", "numeric_index true"], - ["block period", "name divrate", "type double precision", + ["block period", "name divflow", "type double precision", "shape", "tagged false", "in_record true", "reader urword", "time_series true"], ["block period", "name upstream_fraction", @@ -563,8 +596,9 @@ class ModflowGwfsfr(mfpackage.MFPackage): 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, maximum_iterations=None, + budget_filerecord=None, package_convergence_filerecord=None, + timeseries=None, observations=None, mover=None, + maximum_picard_iterations=None, maximum_iterations=None, maximum_depth_change=None, unit_conversion=None, nreaches=None, packagedata=None, connectiondata=None, diversions=None, perioddata=None, filename=None, pname=None, @@ -583,6 +617,8 @@ def __init__(self, model, loading_package=False, auxiliary=None, stage_filerecord) self.budget_filerecord = self.build_mfdata("budget_filerecord", budget_filerecord) + self.package_convergence_filerecord = self.build_mfdata( + "package_convergence_filerecord", package_convergence_filerecord) self._ts_filerecord = self.build_mfdata("ts_filerecord", None) self._ts_package = self.build_child_package("ts", timeseries, @@ -594,6 +630,8 @@ def __init__(self, model, loading_package=False, auxiliary=None, "continuous", self._obs_filerecord) self.mover = self.build_mfdata("mover", mover) + self.maximum_picard_iterations = self.build_mfdata( + "maximum_picard_iterations", maximum_picard_iterations) self.maximum_iterations = self.build_mfdata("maximum_iterations", maximum_iterations) self.maximum_depth_change = self.build_mfdata("maximum_depth_change", diff --git a/flopy/mf6/modflow/mfgwfsto.py b/flopy/mf6/modflow/mfgwfsto.py index d98584ded0..bf02ebb035 100644 --- a/flopy/mf6/modflow/mfgwfsto.py +++ b/flopy/mf6/modflow/mfgwfsto.py @@ -32,7 +32,9 @@ class ModflowGwfsto(mfpackage.MFPackage): 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. + values must be greater than or equal to 0. If the CSUB Package is + included in the GWF model, specific storage must be zero for every + cell. 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 @@ -40,7 +42,9 @@ class ModflowGwfsto(mfpackage.MFPackage): 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. + keyword is specified in a subsequent BEGIN PERIOD block. If the CSUB + Package is included in the GWF model, only the first and last stress + period can be steady-state. transient : boolean * transient (boolean) keyword to indicate that stress period IPER is transient. Transient conditions will apply until the STEADY-STATE diff --git a/flopy/mf6/modflow/mfgwfuzf.py b/flopy/mf6/modflow/mfgwfuzf.py index 7cc2eaa3a8..b5c1d60c93 100644 --- a/flopy/mf6/modflow/mfgwfuzf.py +++ b/flopy/mf6/modflow/mfgwfuzf.py @@ -52,6 +52,9 @@ class ModflowGwfuzf(mfpackage.MFPackage): budget_filerecord : [budgetfile] * budgetfile (string) name of the binary output file to write budget information. + package_convergence_filerecord : [package_convergence_filename] + * package_convergence_filename (string) name of the comma spaced values + output file to write package convergence 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 @@ -93,9 +96,9 @@ class ModflowGwfuzf(mfpackage.MFPackage): 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. + zone will be 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 @@ -240,6 +243,8 @@ class ModflowGwfuzf(mfpackage.MFPackage): 'auxiliary')) budget_filerecord = ListTemplateGenerator(('gwf6', 'uzf', 'options', 'budget_filerecord')) + package_convergence_filerecord = ListTemplateGenerator(( + 'gwf6', 'uzf', 'options', 'package_convergence_filerecord')) ts_filerecord = ListTemplateGenerator(('gwf6', 'uzf', 'options', 'ts_filerecord')) obs_filerecord = ListTemplateGenerator(('gwf6', 'uzf', 'options', @@ -276,6 +281,16 @@ class ModflowGwfuzf(mfpackage.MFPackage): ["block options", "name budgetfile", "preserve_case true", "type string", "shape", "in_record true", "reader urword", "tagged false", "optional false"], + ["block options", "name package_convergence_filerecord", + "type record package_convergence fileout " + "package_convergence_filename", + "shape", "reader urword", "tagged true", "optional true"], + ["block options", "name package_convergence", "type keyword", + "shape", "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name package_convergence_filename", + "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", @@ -316,9 +331,9 @@ class ModflowGwfuzf(mfpackage.MFPackage): ["block dimensions", "name nuzfcells", "type integer", "reader urword", "optional false"], ["block dimensions", "name ntrailwaves", "type integer", - "reader urword", "optional false"], + "reader urword", "optional false", "default_value 7"], ["block dimensions", "name nwavesets", "type integer", - "reader urword", "optional false"], + "reader urword", "optional false", "default_value 40"], ["block packagedata", "name packagedata", "type recarray iuzno cellid landflag ivertcon surfdep vks thtr " "thts thti eps boundname", @@ -386,12 +401,12 @@ class ModflowGwfuzf(mfpackage.MFPackage): 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): + package_convergence_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=7, nwavesets=40, packagedata=None, + perioddata=None, filename=None, pname=None, parent_file=None): super(ModflowGwfuzf, self).__init__(model, "uzf", filename, pname, loading_package, parent_file) @@ -404,6 +419,8 @@ def __init__(self, model, loading_package=False, auxiliary=None, self.save_flows = self.build_mfdata("save_flows", save_flows) self.budget_filerecord = self.build_mfdata("budget_filerecord", budget_filerecord) + self.package_convergence_filerecord = self.build_mfdata( + "package_convergence_filerecord", package_convergence_filerecord) self._ts_filerecord = self.build_mfdata("ts_filerecord", None) self._ts_package = self.build_child_package("ts", timeseries, diff --git a/flopy/mf6/modflow/mfims.py b/flopy/mf6/modflow/mfims.py index 1672286633..f5bf284575 100644 --- a/flopy/mf6/modflow/mfims.py +++ b/flopy/mf6/modflow/mfims.py @@ -58,6 +58,18 @@ class ModflowIms(mfpackage.MFPackage): information for the solution and each model (if the solution includes more than one model) and linear acceleration information for each inner iteration. + csv_outer_output_filerecord : [outer_csvfile] + * outer_csvfile (string) name of the ascii comma separated values + output file to write maximum dependent-variable (for example, head) + change convergence information at the end of each outer iteration for + each time step. + csv_inner_output_filerecord : [inner_csvfile] + * inner_csvfile (string) name of the ascii comma separated values + output file to write solver convergence information. Comma separated + values output includes maximum dependent-variable (for example, 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_ptcrecord : [no_ptc_option] * no_ptc_option (string) is an optional keyword that is used to define options for disabling pseudo-transient continuation (PTC). FIRST is @@ -72,7 +84,22 @@ class ModflowIms(mfpackage.MFPackage): 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. + iteration stops. Commonly, OUTER_HCLOSE equals 0.01. The OUTER_HCLOSE + option has been deprecated in favor of the more general OUTER_DVCLOSE + (for dependent variable), however either one can be specified in + order to maintain backward compatibility. + outer_dvclose : double + * outer_dvclose (double) real value defining the dependent-variable + (for example, head) change criterion for convergence of the outer + (nonlinear) iterations, in units of the dependent-variable (for + example, length for head). When the maximum absolute value of the + dependent-variable change at all nodes during an iteration is less + than or equal to OUTER_DVCLOSE, iteration stops. Commonly, + OUTER_DVCLOSE equals 0.01. The keyword, OUTER_HCLOSE can be still be + specified instead of OUTER_DVCLOSE for backward compatibility with + previous versions of MODFLOW 6 but eventually OUTER_HCLOSE will be + deprecated and specification of OUTER_HCLOSE will cause MODFLOW 6 to + terminate with an error. outer_rclosebnd : double * outer_rclosebnd (double) real value defining the residual tolerance for convergence of model packages that solve a separate equation not @@ -80,7 +107,12 @@ class ModflowIms(mfpackage.MFPackage): 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. + solves a continuity equation for each reach. The OUTER_RCLOSEBND + option is deprecated and has no effect on simulation results as of + version 6.1.1. The keyword, OUTER_RCLOSEBND can be still be specified + for backward compatibility with previous versions of MODFLOW 6 but + eventually specificiation of OUTER_RCLOSEBND will cause MODFLOW 6 to + terminate with an error. outer_maximum : integer * outer_maximum (integer) integer value defining the maximum number of outer (nonlinear) iterations -- that is, calls to the solution @@ -100,22 +132,22 @@ class ModflowIms(mfpackage.MFPackage): * 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. + zero and one. If the change in the dependent-variable (for example, + 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. + one. If the change in the dependent-variable (for example, 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. @@ -185,7 +217,23 @@ class ModflowIms(mfpackage.MFPackage): 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. + NONLINEAR block. The INNER_HCLOSE keyword has been deprecated in + favor of the more general INNER_DVCLOSE (for dependent variable), + however either one can be specified in order to maintain backward + compatibility. + inner_dvclose : double + * inner_dvclose (double) real value defining the dependent-variable + (for example, head) change criterion for convergence of the inner + (linear) iterations, in units of the dependent-variable (for example, + length for head). When the maximum absolute value of the dependent- + variable change at all nodes during an iteration is less than or + equal to INNER_DVCLOSE, the matrix solver assumes convergence. + Commonly, INNER_DVCLOSE is set an order of magnitude less than the + OUTER_DVCLOSE value specified for the NONLINEAR block. The keyword, + INNER_HCLOSE can be still be specified instead of INNER_DVCLOSE for + backward compatibility with previous versions of MODFLOW 6 but + eventually INNER_HCLOSE will be deprecated and specification of + INNER_HCLOSE will cause MODFLOW 6 to terminate with an error. 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 @@ -198,25 +246,25 @@ class ModflowIms(mfpackage.MFPackage): * 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. + (absolute convergence criteria) and that the dependent-variable (for + example, 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_DVCLOSE 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 - @@ -255,10 +303,11 @@ class ModflowIms(mfpackage.MFPackage): 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. + equation using the solver coefficient matrix, the latest dependent- + variable (for example, 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. @@ -282,6 +331,10 @@ class ModflowIms(mfpackage.MFPackage): """ csv_output_filerecord = ListTemplateGenerator(('ims', 'options', 'csv_output_filerecord')) + csv_outer_output_filerecord = ListTemplateGenerator(( + 'ims', 'options', 'csv_outer_output_filerecord')) + csv_inner_output_filerecord = ListTemplateGenerator(( + 'ims', 'options', 'csv_inner_output_filerecord')) no_ptcrecord = ListTemplateGenerator(('ims', 'options', 'no_ptcrecord')) rcloserecord = ListTemplateGenerator(('ims', 'linear', @@ -296,14 +349,33 @@ class ModflowIms(mfpackage.MFPackage): "reader urword", "optional true"], ["block options", "name csv_output_filerecord", "type record csv_output fileout csvfile", "shape", - "reader urword", "tagged true", "optional true"], + "reader urword", "tagged true", "optional true", + "deprecated 6.1.1"], ["block options", "name csv_output", "type keyword", "shape", "in_record true", "reader urword", "tagged true", + "optional false", "deprecated 6.1.1"], + ["block options", "name csvfile", "type string", + "preserve_case true", "shape", "in_record true", "reader urword", + "tagged false", "optional false", "deprecated 6.1.1"], + ["block options", "name csv_outer_output_filerecord", + "type record csv_outer_output fileout outer_csvfile", "shape", + "reader urword", "tagged true", "optional true"], + ["block options", "name csv_outer_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", + ["block options", "name outer_csvfile", "type string", + "preserve_case true", "shape", "in_record true", "reader urword", + "tagged false", "optional false"], + ["block options", "name csv_inner_output_filerecord", + "type record csv_inner_output fileout inner_csvfile", "shape", + "reader urword", "tagged true", "optional true"], + ["block options", "name csv_inner_output", "type keyword", + "shape", "in_record true", "reader urword", "tagged true", + "optional false"], + ["block options", "name inner_csvfile", "type string", "preserve_case true", "shape", "in_record true", "reader urword", "tagged false", "optional false"], ["block options", "name no_ptcrecord", @@ -316,9 +388,12 @@ class ModflowIms(mfpackage.MFPackage): "in_record true", "reader urword", "optional true", "tagged false"], ["block nonlinear", "name outer_hclose", "type double precision", - "reader urword", "optional false"], + "reader urword", "optional true", "deprecated 6.1.1"], + ["block nonlinear", "name outer_dvclose", + "type double precision", "reader urword", "optional false"], ["block nonlinear", "name outer_rclosebnd", - "type double precision", "reader urword", "optional true"], + "type double precision", "reader urword", "optional true", + "deprecated 6.1.1"], ["block nonlinear", "name outer_maximum", "type integer", "reader urword", "optional false"], ["block nonlinear", "name under_relaxation", "type string", @@ -342,6 +417,8 @@ class ModflowIms(mfpackage.MFPackage): ["block linear", "name inner_maximum", "type integer", "reader urword", "optional false"], ["block linear", "name inner_hclose", "type double precision", + "reader urword", "optional true", "deprecated 6.1.1"], + ["block linear", "name inner_dvclose", "type double precision", "reader urword", "optional false"], ["block linear", "name rcloserecord", "type record inner_rclose rclose_option", "reader urword", @@ -369,14 +446,16 @@ class ModflowIms(mfpackage.MFPackage): def __init__(self, simulation, loading_package=False, print_option=None, complexity=None, csv_output_filerecord=None, - no_ptcrecord=None, outer_hclose=None, outer_rclosebnd=None, + csv_outer_output_filerecord=None, + csv_inner_output_filerecord=None, no_ptcrecord=None, + outer_hclose=None, outer_dvclose=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, + inner_hclose=None, inner_dvclose=None, rcloserecord=None, linear_acceleration=None, relaxation_factor=None, preconditioner_levels=None, preconditioner_drop_tolerance=None, @@ -391,8 +470,13 @@ def __init__(self, simulation, loading_package=False, print_option=None, self.complexity = self.build_mfdata("complexity", complexity) self.csv_output_filerecord = self.build_mfdata("csv_output_filerecord", csv_output_filerecord) + self.csv_outer_output_filerecord = self.build_mfdata( + "csv_outer_output_filerecord", csv_outer_output_filerecord) + self.csv_inner_output_filerecord = self.build_mfdata( + "csv_inner_output_filerecord", csv_inner_output_filerecord) self.no_ptcrecord = self.build_mfdata("no_ptcrecord", no_ptcrecord) self.outer_hclose = self.build_mfdata("outer_hclose", outer_hclose) + self.outer_dvclose = self.build_mfdata("outer_dvclose", outer_dvclose) self.outer_rclosebnd = self.build_mfdata("outer_rclosebnd", outer_rclosebnd) self.outer_maximum = self.build_mfdata("outer_maximum", outer_maximum) @@ -416,6 +500,7 @@ def __init__(self, simulation, loading_package=False, print_option=None, "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.inner_dvclose = self.build_mfdata("inner_dvclose", inner_dvclose) self.rcloserecord = self.build_mfdata("rcloserecord", rcloserecord) self.linear_acceleration = self.build_mfdata("linear_acceleration", linear_acceleration) diff --git a/flopy/mf6/modflow/mfmvr.py b/flopy/mf6/modflow/mfmvr.py index 1be6078749..205e655e90 100644 --- a/flopy/mf6/modflow/mfmvr.py +++ b/flopy/mf6/modflow/mfmvr.py @@ -87,8 +87,9 @@ class ModflowMvr(mfpackage.MFPackage): 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. + These options mirror the options defined for the cprior variable in + the SFR package, with the term "FACTOR" being functionally equivalent + to the "FRACTION" option for cprior. * 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 From 145081dbef72f64f3db74300780b198ebda7e8f8 Mon Sep 17 00:00:00 2001 From: Christian Langevin Date: Wed, 17 Jun 2020 13:54:32 -0500 Subject: [PATCH 3/8] docs(misc): clean up docstrings --- flopy/discretization/grid.py | 2 +- flopy/mf6/modflow/mfsimulation.py | 186 ++++++++++++++---------------- 2 files changed, 88 insertions(+), 100 deletions(-) diff --git a/flopy/discretization/grid.py b/flopy/discretization/grid.py index 6e981885f7..41b386f497 100644 --- a/flopy/discretization/grid.py +++ b/flopy/discretization/grid.py @@ -51,7 +51,7 @@ class Grid(object): rotation : float rotation angle of model grid, as it is rotated around the origin point - Properties + Attributes ---------- grid_type : enumeration type of model grid ('structured', 'vertex_layered', diff --git a/flopy/mf6/modflow/mfsimulation.py b/flopy/mf6/modflow/mfsimulation.py index 7595f7c278..421532272a 100644 --- a/flopy/mf6/modflow/mfsimulation.py +++ b/flopy/mf6/modflow/mfsimulation.py @@ -1,4 +1,7 @@ -"""mfsimulation module. contains the MFSimulation class.""" +""" +mfsimulation module. contains the MFSimulation class. + +""" import errno import sys @@ -19,7 +22,8 @@ class SimulationDict(collections.OrderedDict): - """Class containing custom dictionary for MODFLOW simulations. + """ + Class containing custom dictionary for MODFLOW simulations. Behaves as an OrderedDict with some additional features described below. @@ -52,20 +56,15 @@ class SimulationDict(collections.OrderedDict): """ def __init__(self, path=None): - """Define the __init__ method. - - Parameters: - path (string): File-like path used as dictionary key - - """ collections.OrderedDict.__init__(self) self._path = path def __getitem__(self, key): """Define the __getitem__ magic method. - Parameters: - key (string): Part or all of a dictionary key + Parameters + ---------- + key (string): Part or all of a dictionary key Returns: MFData or numpy.ndarray @@ -91,9 +90,10 @@ def __getitem__(self, key): def __setitem__(self, key, val): """Define the __setitem__ magic method. - Parameters: - key (string): Dictionary key - val (MFData): MFData to store in dictionary + Parameters + ---------- + key (string): Dictionary key + val (MFData): MFData to store in dictionary """ collections.OrderedDict.__setitem__(self, key, val) @@ -101,9 +101,10 @@ def __setitem__(self, key, val): def find_in_path(self, key_path, key_leaf): """Attempt to find key_leaf in a partial key path key_path. - Parameters: - key_path (string): partial path to the data - key_leaf (string): name of the data + Parameters + ---------- + key_path (string): partial path to the data + key_leaf (string): name of the data Returns: MFData: Data found at the path. @@ -131,8 +132,9 @@ def find_in_path(self, key_path, key_leaf): def output_keys(self, print_keys=True): """Return a list of output data keys. - Parameters: - print_keys (bool): print keys to console + Parameters + ---------- + print_keys (bool): print keys to console Returns: list: keys for requesting binary output @@ -185,7 +187,8 @@ def keys(self): class MFSimulationData(object): - """Class containing MODFLOW simulation data and file formatting data. + """ + Class containing MODFLOW simulation data and file formatting data. Parameters ---------- @@ -225,12 +228,6 @@ class MFSimulationData(object): """ def __init__(self, path): - """Define the __init__ method. - - Parameters: - path (string): File-like path to simulation - - """ # --- formatting variables --- self.indent_string = ' ' self.constant_formatting = ['constant', ''] @@ -270,7 +267,8 @@ def set_sci_note_upper_thres(self, value): Sets threshold number where any number larger than threshold is represented in scientific notation. - Parameters: + Parameters + ---------- value (float): threshold value """ @@ -283,7 +281,8 @@ def set_sci_note_lower_thres(self, value): Sets threshold number where any number smaller than threshold is represented in scientific notation. - Parameters: + Parameters + ---------- value (float): threshold value """ @@ -300,7 +299,8 @@ def _update_str_format(self): class MFSimulation(PackageContainer): - """Entry point into any MODFLOW simulation. + """ + Entry point into any MODFLOW simulation. MFSimulation is used to load, build, and/or save a MODFLOW6 simulation. @@ -398,48 +398,6 @@ class MFSimulation(PackageContainer): def __init__(self, sim_name='sim', version='mf6', exe_name='mf6.exe', sim_ws='.', verbosity_level=1, continue_=None, nocheck=None, memory_print_option=None): - """Initialization. - - __init__ is used to initialize a simulation object - - 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 - continue_ : bool - sets the continue option in the simulation name file. the - continue option is a keyword flag to indicate that the - simulation should continue even if one or more solutions do - not converge. - nocheck : bool - sets the nocheck option in the simulation name file. the - nocheckoption is a 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 : str - sets memory_print_option in the simulation name file. - memory_print_option 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. - - """ super(MFSimulation, self).__init__(MFSimulationData(sim_ws), sim_name) self.simulation_data.verbosity_level = self._resolve_verbosity_level( verbosity_level) @@ -538,7 +496,8 @@ def __getattr__(self, item): def __repr__(self): """Override __repr__ to print custom string. - Returns: + Returns + -------- repr string : str string describing object @@ -548,7 +507,8 @@ def __repr__(self): def __str__(self): """Override __str__ to print custom string. - Returns: + Returns + -------- str string : str string describing object @@ -594,7 +554,8 @@ def _get_data_str(self, formal): def model_names(self): """Return a list of model names associated with this simulation. - Returns: + Returns + -------- list: list of model names """ @@ -1070,7 +1031,8 @@ def _rename_package_group(group_dict, name): def rename_all_packages(self, name): """Rename all packages with name as prefix. - Parameters: + Parameters + ---------- name (str): prefix of name """ @@ -1233,10 +1195,12 @@ def write_simulation(self, def set_sim_path(self, path): """Return a list of output data keys. - Parameters: + Parameters + ---------- print_keys (bool): print keys to console - Returns: + Returns + -------- list: keys for requesting binary output """ @@ -1247,7 +1211,8 @@ def run_simulation(self, silent=None, pause=False, report=False, use_async=False, cargs=None): """Run the simulation. - Parameters: + Parameters + ---------- silent (bool): run in silent mode pause (bool): @@ -1265,7 +1230,9 @@ def run_simulation(self, silent=None, pause=False, report=False, cargs : (str or list of strings) additional command line arguments to pass to the executable. default is None - Returns: + + Returns + -------- (success, buff) success : boolean buff : list of lines of stdout @@ -1295,7 +1262,8 @@ def delete_output_files(self): def remove_package(self, package_name): """Remove a package. - Parameters: + Parameters + ---------- package_name (str): name of package to be removed """ @@ -1327,7 +1295,8 @@ def remove_package(self, package_name): def model_dict(self): """Return a dictionary of models. - Returns: + Returns + -------- model dict : dict dictionary of models @@ -1337,11 +1306,13 @@ def model_dict(self): def get_model(self, model_name=None): """Load an existing model. - Parameters: + Parameters + ---------- model_name : string name of model to get - Returns: + Returns + -------- model : MFModel """ @@ -1362,11 +1333,13 @@ def get_model(self, model_name=None): def get_exchange_file(self, filename): """Get a specified exchange file. - Parameters: + Parameters + ---------- filename : string name of exchange file to get - Returns: + Returns + -------- exchange package : MFPackage """ @@ -1380,11 +1353,13 @@ def get_exchange_file(self, filename): def get_mvr_file(self, filename): """Get a specified mover file. - Parameters: + Parameters + ---------- filename : string name of mover file to get - Returns: + Returns + -------- mover package : MFPackage """ @@ -1398,11 +1373,13 @@ def get_mvr_file(self, filename): def get_gnc_file(self, filename): """Get a specified gnc file. - Parameters: + Parameters + ---------- filename : string name of gnc file to get - Returns: + Returns + -------- gnc package : MFPackage """ @@ -1416,7 +1393,8 @@ def get_gnc_file(self, filename): def register_exchange_file(self, package): """Register an exchange package file with the simulation. - Parameters: + Parameters + ---------- package : MFPackage exchange package object to register @@ -1491,7 +1469,8 @@ 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: + Parameters + ---------- package : MFPackage package to register add_to_package_list : bool @@ -1501,7 +1480,8 @@ def register_package(self, package, add_to_package_list=True, set_package_filename : bool produce a filename for this package - Returns: + Returns + -------- (path : tuple, package structure : MFPackageStructure) """ @@ -1626,13 +1606,15 @@ def register_package(self, package, add_to_package_list=True, def register_model(self, model, model_type, model_name, model_namefile): """Add a model to the simulation. - Parameters: + Parameters + ---------- model : MFModel model object to add to simulation sln_group : string solution group of model - Returns: + Returns + -------- model_structure_object : MFModelStructure """ @@ -1666,11 +1648,13 @@ def register_model(self, model, model_type, model_name, model_namefile): def get_ims_package(self, key): """Add a model to the simulation. - Parameters: + Parameters + ---------- key : str ims package key - Returns: + Returns + -------- ims_package : ModflowIms """ @@ -1681,7 +1665,8 @@ def get_ims_package(self, key): def remove_model(self, model_name): """Remove a model from the simulation. - Parameters: + Parameters + ---------- model_name : string model name to remove from simulation @@ -1695,7 +1680,8 @@ def remove_model(self, model_name): def is_valid(self): """Check all packages and models in the simulation to verify validity. - Returns: + Returns + -------- valid : boolean simulation validity @@ -1851,7 +1837,8 @@ 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 simulation. - Parameters: + 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 @@ -1873,7 +1860,8 @@ def plot(self, model_list=None, SelPackList=None, **kwargs): key : str MfList dictionary key. (default is None) - Returns: + Returns + -------- axes: (list) matplotlib.pyplot.axes objects """ From b5da38bb7ffc2dabbdddb19a145a444336d9936a Mon Sep 17 00:00:00 2001 From: dbrakenhoff Date: Thu, 18 Jun 2020 10:58:07 +0200 Subject: [PATCH 4/8] refactor(GridIntersect): fix error message for unsupported methods --- flopy/utils/gridintersect.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/flopy/utils/gridintersect.py b/flopy/utils/gridintersect.py index a280b33443..9a7a7a29bf 100644 --- a/flopy/utils/gridintersect.py +++ b/flopy/utils/gridintersect.py @@ -137,8 +137,11 @@ def __init__(self, mfgrid, method=None, rtree=True): self.intersect_polygon = self._intersect_polygon_structured else: - raise NotImplementedError( - "Method '{0}' not recognized!".format) + raise ValueError( + "Method '{0}' not recognized or " + "not supported " + "for grid_type '{1}'!".format(self.method, + self.mfgrid.grid_type)) def _set_method_get_gridshapes(self): """internal method, set self._get_gridshapes to the certain method for From 9a29cbbb9a0d29836e2f4c499e2489fb175ebed3 Mon Sep 17 00:00:00 2001 From: dbrakenhoff Date: Thu, 18 Jun 2020 16:11:53 +0200 Subject: [PATCH 5/8] bug(GridIntersect): fix #10 ensure one entry per grid cell in polygon intersection result add test for this case --- autotest/t065_test_gridintersect.py | 16 ++++++++++++++++ flopy/utils/gridintersect.py | 4 +++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/autotest/t065_test_gridintersect.py b/autotest/t065_test_gridintersect.py index 7e648a0b7c..085e52ddf1 100644 --- a/autotest/t065_test_gridintersect.py +++ b/autotest/t065_test_gridintersect.py @@ -841,6 +841,22 @@ def test_rect_grid_polygon_with_hole_shapely(rtree=True): return result +def test_rect_grid_polygon_in_edge_in_cell(rtree=True): + # avoid test fail when shapely not available + try: + import shapely + except: + return + gr = get_rect_grid() + ix = GridIntersect(gr, method='vertex', rtree=rtree) + p = Polygon([(0., 5.), (3., 0.), (7., 0.), + (10., 5.), (10., -1.), (0., -1.)]) + result = ix.intersect_polygon(p) + assert len(result) == 1 + assert result.areas.sum() == 15. + return result + + def test_tri_grid_polygon_outside(rtree=True): # avoid test fail when shapely not available try: diff --git a/flopy/utils/gridintersect.py b/flopy/utils/gridintersect.py index 9a7a7a29bf..e12aa2634a 100644 --- a/flopy/utils/gridintersect.py +++ b/flopy/utils/gridintersect.py @@ -8,7 +8,7 @@ try: from shapely.geometry import (MultiPoint, Point, Polygon, box, - GeometryCollection) + GeometryCollection, MultiPolygon) from shapely.strtree import STRtree from shapely.affinity import translate, rotate from shapely.prepared import prep @@ -493,6 +493,8 @@ def _intersect_polygon_shapely(self, shp, sort_by_cellid=True): # parse result collection = parse_shapely_ix_result( [], intersect, shptyps=["Polygon", "MultiPolygon"]) + if len(collection) > 1: + collection = [MultiPolygon(collection)] # loop over intersection result and store information for c in collection: # don't store intersections with 0 area From 97ddc53d927aeb413fccfe8c303c3b969f5901c3 Mon Sep 17 00:00:00 2001 From: dbrakenhoff Date: Tue, 23 Jun 2020 00:16:59 +0200 Subject: [PATCH 6/8] bug(gridintersect): fixes #917 bug in structured mode where linestrings were not handled correctly if they pass in and out of grid cell --- flopy/utils/gridintersect.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/flopy/utils/gridintersect.py b/flopy/utils/gridintersect.py index e12aa2634a..8895916ddd 100644 --- a/flopy/utils/gridintersect.py +++ b/flopy/utils/gridintersect.py @@ -894,8 +894,7 @@ def _check_adjacent_cells_intersecting_line(self, linestring, i_j, else: x = intersect.xy[0] y = intersect.xy[1] - verts.append([(ixy[0], ixy[1]) - for ixy in zip(*intersect.xy)]) + verts.append([(ixy[0], ixy[1]) for ixy in zip(x, y)]) node.append((ii, jj)) # check to right @@ -922,8 +921,7 @@ def _check_adjacent_cells_intersecting_line(self, linestring, i_j, else: x = intersect.xy[0] y = intersect.xy[1] - verts.append([(ixy[0], ixy[1]) - for ixy in zip(*intersect.xy)]) + verts.append([(ixy[0], ixy[1]) for ixy in zip(x, y)]) node.append((ii, jj)) # check to back @@ -950,8 +948,7 @@ def _check_adjacent_cells_intersecting_line(self, linestring, i_j, else: x = intersect.xy[0] y = intersect.xy[1] - verts.append([(ixy[0], ixy[1]) for ixy in - zip(*intersect.xy)]) + verts.append([(ixy[0], ixy[1]) for ixy in zip(x, y)]) node.append((ii, jj)) # check to front From 0d5953303694e023da8ee9e9453862bbdb7ffb66 Mon Sep 17 00:00:00 2001 From: dbrakenhoff Date: Wed, 13 Jan 2021 10:59:38 +0100 Subject: [PATCH 7/8] fix(GridIntersect): #1035 - fix vertices when intersecting linestring with offset grids --- flopy/utils/gridintersect.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flopy/utils/gridintersect.py b/flopy/utils/gridintersect.py index b29a19ef5c..481e464298 100644 --- a/flopy/utils/gridintersect.py +++ b/flopy/utils/gridintersect.py @@ -786,7 +786,7 @@ def _intersect_linestring_structured(self, shp, keepzerolengths=False): self.mfgrid.angrot_radians, inverse=False, ) - v_realworld.append([rx, ry]) + v_realworld.append(list(zip(rx, ry))) ixs_realworld = [] for ix in ixs: ix_realworld = rotate( @@ -828,7 +828,7 @@ def _intersect_linestring_structured(self, shp, keepzerolengths=False): self.mfgrid.angrot_radians, inverse=False, ) - v_realworld.append([rx, ry]) + v_realworld.append(list(zip(rx, ry))) vertices = v_realworld ix_shapes_realworld = [] From aa1c8b8a9e5a5fe305e474248dfd8842b443cb91 Mon Sep 17 00:00:00 2001 From: dbrakenhoff Date: Fri, 19 Nov 2021 15:42:15 +0100 Subject: [PATCH 8/8] feat(GridIntersect): add shapetype kwarg allow intersection shape to be passed as list of vertices (modify test to test this) specify keyword arguments explicitly in intersect calls formatting --- autotest/t065_test_gridintersect.py | 12 ++++------- flopy/utils/gridintersect.py | 33 +++++++++++++++++------------ 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/autotest/t065_test_gridintersect.py b/autotest/t065_test_gridintersect.py index 1ec78ed685..c1bc084e4c 100644 --- a/autotest/t065_test_gridintersect.py +++ b/autotest/t065_test_gridintersect.py @@ -205,7 +205,8 @@ def test_rect_grid_point_outside(): return gr = get_rect_grid() ix = GridIntersect(gr, method="structured") - result = ix.intersect(Point(25.0, 25.0)) + # use GeoSpatialUtil to convert to shapely geometry + result = ix.intersect((25.0, 25.0), shapetype="point") assert len(result) == 0 return result @@ -1289,9 +1290,9 @@ def test_all_intersections_shapely_no_strtree(): # offset and rotated grids test_point_offset_rot_structured_grid_shapely(rtree=False) test_linestring_offset_rot_structured_grid_shapely(rtree=False) - ix = test_polygon_offset_rot_structured_grid_shapely(rtree=False) + test_polygon_offset_rot_structured_grid_shapely(rtree=False) - return ix + return # %% test rasters @@ -1416,8 +1417,3 @@ def test_raster_sampling_methods(): raise AssertionError( f"{method} resampling returning incorrect values" ) - - -if __name__ == "__main__": - test_rasters() - test_raster_sampling_methods() \ No newline at end of file diff --git a/flopy/utils/gridintersect.py b/flopy/utils/gridintersect.py index 6e3d9141ab..18d4183142 100644 --- a/flopy/utils/gridintersect.py +++ b/flopy/utils/gridintersect.py @@ -186,29 +186,34 @@ def __init__(self, mfgrid, method=None, rtree=True): ) ) - def intersect(self, shp, **kwargs): - """ - Method to intersect a shape with a model grid + def intersect( + self, shp, shapetype=None, sort_by_cellid=True, keepzerolengths=False + ): + """Method to intersect a shape with a model grid. Parameters ---------- shp : shapely.geometry, geojson object, shapefile.Shape, - or flopy geomerty object + or flopy geometry object + shapetype : str, optional + type of shape (i.e. "point", "linestring", "polygon" or + their multi-variants), used by GeoSpatialUtil if shp is + passed as a list of vertices, default is None sort_by_cellid : bool - Sort results by cellid + sort results by cellid, ensures cell with lowest cellid is + returned for boundary cases when using vertex methods, default + is True keepzerolengths : bool boolean method to keep zero length intersections for - linestring intersection + linestring intersection, used when shp is of type "linestring" Returns ------- numpy.recarray a record array containing information about the intersection """ - gu = GeoSpatialUtil(shp) + gu = GeoSpatialUtil(shp, shapetype=shapetype) shp = gu.shapely - sort_by_cellid = kwargs.pop("sort_by_cellid", True) - keepzerolengths = kwargs.pop("keepzerolengths", False) if gu.shapetype in ("Point", "MultiPoint"): if ( @@ -654,7 +659,7 @@ def _intersect_polygon_shapely(self, shp, sort_by_cellid=True): return rec - def intersects(self, shp): + def intersects(self, shp, shapetype=None): """Return cellIDs for shapes that intersect with shape. Parameters @@ -662,7 +667,10 @@ def intersects(self, shp): shp : shapely.geometry, geojson geometry, shapefile.shape, or flopy geometry object shape to intersect with the grid - + shapetype : str, optional + type of shape (i.e. "point", "linestring", "polygon" or + their multi-variants), used by GeoSpatialUtil if shp is + passed as a list of vertices, default is None Returns ------- rec : numpy.recarray @@ -670,7 +678,7 @@ def intersects(self, shp): the shape intersects with """ # query grid - shp = GeoSpatialUtil(shp).shapely + shp = GeoSpatialUtil(shp, shapetype=shapetype).shapely qresult = self.query_grid(shp) # filter result further if possible (only strtree and filter methods) @@ -754,7 +762,6 @@ def _intersect_point_structured(self, shp): tempnodes.append(node) tempshapes.append(ixs) else: - # TODO: not sure if this is correct tempshapes[-1] = shapely_geo.MultiPoint([tempshapes[-1], ixs]) ixshapes = tempshapes