diff --git a/autotest/simulation.py b/autotest/simulation.py index 73516fbfdee..9ee16586398 100644 --- a/autotest/simulation.py +++ b/autotest/simulation.py @@ -17,6 +17,7 @@ from flopy.utils.compare import compare_heads from modflow_devtools.misc import is_in_ci +DNODATA = 3.e+30 sfmt = "{:25s} - {}" extdict = { "hds": "head", diff --git a/autotest/test_gwf_auxvars.py b/autotest/test_gwf_auxvars.py index 412b53a8385..95cd656527b 100644 --- a/autotest/test_gwf_auxvars.py +++ b/autotest/test_gwf_auxvars.py @@ -5,7 +5,7 @@ import numpy as np import pytest from framework import TestFramework -from simulation import TestSimulation +from simulation import TestSimulation, DNODATA ex = ["aux01"] auxvar1 = 101.0 @@ -183,8 +183,8 @@ def build_model(idx, dir): ] # connectiondata = [ - [0, 0, (0, 1, 1), "vertical", "none", 0.0, 0.0, 0.0, 0.0], - [1, 0, (0, 2, 2), "vertical", "none", 0.0, 0.0, 0.0, 0.0], + [0, 0, (0, 1, 1), "vertical", DNODATA, 0.0, 0.0, 0.0, 0.0], + [1, 0, (0, 2, 2), "vertical", DNODATA, 0.0, 0.0, 0.0, 0.0], ] lak = flopy.mf6.ModflowGwflak( gwf, diff --git a/autotest/test_gwf_lak_bedleak.py b/autotest/test_gwf_lak_bedleak.py new file mode 100644 index 00000000000..0787ff3cac1 --- /dev/null +++ b/autotest/test_gwf_lak_bedleak.py @@ -0,0 +1,193 @@ +import os +import sys + +import flopy +import numpy as np +import pytest +from framework import TestFramework +from simulation import TestSimulation, DNODATA + +ex = ["bedleak", "bedleak_fail", "bedleak_none"] + + +def build_model(idx, dir): + nlay, nrow, ncol = 1, 10, 10 + nper = 1 + perlen = [ + 1.0, + ] + nstp = [ + 1, + ] + tsmult = [ + 1.0, + ] + + lenx = 300.0 + delr = delc = lenx / float(nrow) + strt = 100.0 + + nouter, ninner = 100, 300 + hclose, rclose, relax = 1e-9, 1e-3, 0.97 + + tdis_rc = [] + for i in range(nper): + tdis_rc.append((perlen[i], nstp[i], tsmult[i])) + + name = ex[idx] + + # build MODFLOW 6 files + ws = dir + sim = flopy.mf6.MFSimulation( + sim_name=name, version="mf6", exe_name="mf6", sim_ws=ws + ) + # create tdis package + tdis = flopy.mf6.ModflowTdis( + sim, + time_units="DAYS", + nper=nper, + perioddata=tdis_rc, + ) + + # create iterative model solution and register the gwf model with it + ims = flopy.mf6.ModflowIms( + sim, + print_option="SUMMARY", + outer_dvclose=hclose, + outer_maximum=nouter, + under_relaxation="DBD", + inner_maximum=ninner, + inner_dvclose=hclose, + rcloserecord=rclose, + linear_acceleration="BICGSTAB", + scaling_method="NONE", + reordering_method="NONE", + relaxation_factor=relax, + ) + + # create gwf model + gwf = flopy.mf6.ModflowGwf(sim, modelname=name) + + dis = flopy.mf6.ModflowGwfdis( + gwf, + nlay=nlay, + nrow=nrow, + ncol=ncol, + delr=delr, + delc=delc, + top=90.0, + botm=0.0, + ) + + # initial conditions + ic = flopy.mf6.ModflowGwfic(gwf, strt=strt) + + # node property flow + npf = flopy.mf6.ModflowGwfnpf( + gwf, save_flows=True, icelltype=1, k=1.0, k33=0.01 + ) + # storage + sto = flopy.mf6.ModflowGwfsto( + gwf, + save_flows=True, + iconvert=1, + ss=0.0, + sy=0.1, + steady_state={0: True}, + ) + + # chd files + chdlist0 = [] + chdlist0.append([(0, 0, 0), 100.0]) + chdlist0.append([(0, nrow - 1, ncol - 1), 95.0]) + + chdspdict = {0: chdlist0} + chd = flopy.mf6.ModflowGwfchd( + gwf, + stress_period_data=chdspdict, + save_flows=False, + ) + + # lak package + if "fail" in name: + bedleak = -100.0 + elif "none" in name: + bedleak = "none" + else: + bedleak = DNODATA + + # [] [] + packagedata = [ + [0, 100.0, 1, "lake1"], + [1, 100.0, 1, "lake2"], + ] + # + connectiondata = [ + [0, 0, (0, 1, 1), "vertical", bedleak, 0.0, 0.0, 0.0, 0.0], + [1, 0, (0, 2, 2), "vertical", bedleak, 0.0, 0.0, 0.0, 0.0], + ] + lak = flopy.mf6.ModflowGwflak( + gwf, + boundnames=True, + surfdep=1.0, + print_input=True, + print_stage=True, + print_flows=True, + save_flows=True, + budget_filerecord=f"{name}.lak.bud", + nlakes=len(packagedata), + packagedata=packagedata, + connectiondata=connectiondata, + ) + # lak.remove() + + # output control + oc = flopy.mf6.ModflowGwfoc( + gwf, + budget_filerecord=f"{name}.cbc", + headprintrecord=[("COLUMNS", 10, "WIDTH", 15, "DIGITS", 6, "GENERAL")], + saverecord=[("BUDGET", "ALL")], + printrecord=[("HEAD", "ALL"), ("BUDGET", "ALL")], + ) + + return sim, None + + +def eval_model(sim): + print("evaluating model...") + + name = ex[sim.idxsim] + + # lak budget + if "fail" not in name: + fpth = os.path.join(sim.simpath, f"{name}.lak.bud") + bobj = flopy.utils.CellBudgetFile(fpth, precision="double") + bobj.list_unique_records() + records = bobj.get_data(text="GWF") + for r in records: + assert np.allclose(r["q"][0], -4.79616347e-12) + assert np.allclose(r["q"][1], -6.19237994e-12) + + +@pytest.mark.parametrize( + "idx, name", + list(enumerate(ex)), +) +def test_mf6model(idx, name, function_tmpdir, targets): + ws = str(function_tmpdir) + if "fail" in ws: + require_fail = True + else: + require_fail = False + test = TestFramework() + test.build(build_model, idx, ws) + test.run( + TestSimulation( + name=name, + exe_dict=targets, + exfunc=eval_model, + idxsim=idx, + require_failure=require_fail, + ), + str(function_tmpdir), + ) diff --git a/autotest/test_gwt_lkt01.py b/autotest/test_gwt_lkt01.py index 4971e5c9412..44ef5eb63c5 100644 --- a/autotest/test_gwt_lkt01.py +++ b/autotest/test_gwt_lkt01.py @@ -9,7 +9,7 @@ import numpy as np import pytest from framework import TestFramework -from simulation import TestSimulation +from simulation import TestSimulation, DNODATA ex = ["lkt_01"] @@ -134,13 +134,13 @@ def build_model(idx, dir): con_data = [] # con_data=(lakeno,iconn,(cellid),claktype,bedleak,belev,telev,connlen,connwidth ) con_data.append( - (0, 0, (0, 0, 1), "HORIZONTAL", "None", 10, 10, connlen, connwidth) + (0, 0, (0, 0, 1), "HORIZONTAL", DNODATA, 10, 10, connlen, connwidth) ) con_data.append( - (0, 1, (0, 0, 3), "HORIZONTAL", "None", 10, 10, connlen, connwidth) + (0, 1, (0, 0, 3), "HORIZONTAL", DNODATA, 10, 10, connlen, connwidth) ) con_data.append( - (0, 2, (0, 0, 2), "VERTICAL", "None", 10, 10, connlen, connwidth) + (0, 2, (0, 0, 2), "VERTICAL", DNODATA, 10, 10, connlen, connwidth) ) p_data = [ (0, "STATUS", "CONSTANT"), diff --git a/autotest/test_gwt_lkt02.py b/autotest/test_gwt_lkt02.py index 616fb514397..73b4daf6796 100644 --- a/autotest/test_gwt_lkt02.py +++ b/autotest/test_gwt_lkt02.py @@ -7,7 +7,7 @@ import numpy as np import pytest from framework import TestFramework -from simulation import TestSimulation +from simulation import TestSimulation, DNODATA ex = ["lkt_02"] @@ -136,21 +136,21 @@ def build_model(idx, dir): # con_data=(lakeno,iconn,(cellid),claktype,bedleak,belev,telev,connlen,connwidth ) # lake 1 con_data.append( - (0, 0, (0, 0, 1), "HORIZONTAL", "None", 10, 10, connlen, connwidth) + (0, 0, (0, 0, 1), "HORIZONTAL", DNODATA, 10, 10, connlen, connwidth) ) con_data.append( - (0, 1, (0, 0, 2), "VERTICAL", "None", 10, 10, connlen, connwidth) + (0, 1, (0, 0, 2), "VERTICAL", DNODATA, 10, 10, connlen, connwidth) ) # lake 2 con_data.append( - (1, 0, (0, 0, 3), "VERTICAL", "None", 10, 10, connlen, connwidth) + (1, 0, (0, 0, 3), "VERTICAL", DNODATA, 10, 10, connlen, connwidth) ) # lake 3 con_data.append( - (2, 0, (0, 0, 4), "VERTICAL", "None", 10, 10, connlen, connwidth) + (2, 0, (0, 0, 4), "VERTICAL", DNODATA, 10, 10, connlen, connwidth) ) con_data.append( - (2, 1, (0, 0, 5), "HORIZONTAL", "None", 10, 10, connlen, connwidth) + (2, 1, (0, 0, 5), "HORIZONTAL", DNODATA, 10, 10, connlen, connwidth) ) p_data = [ diff --git a/autotest/test_gwt_lkt03.py b/autotest/test_gwt_lkt03.py index efd98105085..0d3c55e99ae 100644 --- a/autotest/test_gwt_lkt03.py +++ b/autotest/test_gwt_lkt03.py @@ -7,7 +7,7 @@ import numpy as np import pytest from framework import TestFramework -from simulation import TestSimulation +from simulation import TestSimulation, DNODATA ex = ["lkt_03"] @@ -134,15 +134,15 @@ def build_model(idx, dir): # con_data=(lakeno,iconn,(cellid),claktype,bedleak,belev,telev,connlen,connwidth ) # lake 1 con_data.append( - (0, 0, (0, 0, 2), "VERTICAL", "None", 10, 10, connlen, connwidth) + (0, 0, (0, 0, 2), "VERTICAL", DNODATA, 10, 10, connlen, connwidth) ) # lake 2 con_data.append( - (1, 0, (0, 0, 3), "VERTICAL", "None", 10, 10, connlen, connwidth) + (1, 0, (0, 0, 3), "VERTICAL", DNODATA, 10, 10, connlen, connwidth) ) # lake 3 con_data.append( - (2, 0, (0, 0, 4), "VERTICAL", "None", 10, 10, connlen, connwidth) + (2, 0, (0, 0, 4), "VERTICAL", DNODATA, 10, 10, connlen, connwidth) ) p_data = [ diff --git a/autotest/test_gwt_lkt04.py b/autotest/test_gwt_lkt04.py index f8bb2cf2c65..888c3388042 100644 --- a/autotest/test_gwt_lkt04.py +++ b/autotest/test_gwt_lkt04.py @@ -10,7 +10,7 @@ import numpy as np import pytest from framework import TestFramework -from simulation import TestSimulation +from simulation import TestSimulation, DNODATA ex = ["lkt_04"] @@ -134,13 +134,13 @@ def build_model(idx, dir, exe): con_data = [] # con_data=(lakeno,iconn,(cellid),claktype,bedleak,belev,telev,connlen,connwidth ) con_data.append( - (0, 0, (0, 0, 1), "HORIZONTAL", "None", 10, 10, connlen, connwidth) + (0, 0, (0, 0, 1), "HORIZONTAL", DNODATA, 10, 10, connlen, connwidth) ) con_data.append( - (0, 1, (0, 0, 3), "HORIZONTAL", "None", 10, 10, connlen, connwidth) + (0, 1, (0, 0, 3), "HORIZONTAL", DNODATA, 10, 10, connlen, connwidth) ) con_data.append( - (0, 2, (0, 0, 2), "VERTICAL", "None", 10, 10, connlen, connwidth) + (0, 2, (0, 0, 2), "VERTICAL", DNODATA, 10, 10, connlen, connwidth) ) p_data = [ (0, "STATUS", "ACTIVE"), diff --git a/doc/ReleaseNotes/develop.tex b/doc/ReleaseNotes/develop.tex index b1fcec5c8c8..a7c72979d49 100644 --- a/doc/ReleaseNotes/develop.tex +++ b/doc/ReleaseNotes/develop.tex @@ -41,8 +41,8 @@ \underline{ADVANCED STRESS PACKAGES} \begin{itemize} - \item Added functionality to support zero values for each grid dimension when specifying the CELLID for SFR reaches that are not connected to an underlying groundwater grid cell. For example, for a DIS grid a CELLID of 0 0 0 should be specified for unconnected reaches. Warning messages will be issued if NONE is specified for unconnected reaches. Specifying a CELLID of NONE will eventually be deprecated and will cause MODFLOW 6 to terminate with an error. - % \item xxx + \item Added functionality to support zero values for each grid dimension when specifying the CELLID for SFR reaches that are not connected to an underlying groundwater grid cell. For example, for a DIS grid a CELLID of 0 0 0 should be specified for unconnected reaches. Warning messages will be issued if NONE is specified for unconnected reaches. Specifying a CELLID of NONE will eventually be deprecated and will cause MODFLOW 6 to terminate with an error. + \item Added functionality to support specification of a DNODATA (3.0E+30) BEDLEAK value for LAK package connections to identify lake-GWF connections where conductance is solely a function of aquifer properties in the connected GWF cell and lakebed sediments are assumed to be absent. Warning messages will be issued if NONE is specified for LAK package connections. Specifying a BEDLEAK value equal to NONE will eventually be deprecated and will cause MODFLOW 6 to terminate with an error. % \item xxx \end{itemize} diff --git a/doc/mf6io/mf6ivar/dfn/gwf-lak.dfn b/doc/mf6io/mf6ivar/dfn/gwf-lak.dfn index 36a67c16dca..d229382bbc7 100644 --- a/doc/mf6io/mf6ivar/dfn/gwf-lak.dfn +++ b/doc/mf6io/mf6ivar/dfn/gwf-lak.dfn @@ -470,7 +470,7 @@ tagged false in_record true reader urword longname bed leakance -description character string or real value that defines the bed leakance for the lake-GWF connection. BEDLEAK must be greater than or equal to zero or specified to be NONE. If BEDLEAK is specified to be NONE, the lake-GWF connection conductance is solely a function of aquifer properties in the connected GWF cell and lakebed sediments are assumed to be absent. +description real value or character string that defines the bed leakance for the lake-GWF connection. BEDLEAK must be greater than or equal to zero, equal to the DNODATA value (3.0E+30), or specified to be NONE. If DNODATA or NONE is specified for BEDLEAK, the lake-GWF connection conductance is solely a function of aquifer properties in the connected GWF cell and lakebed sediments are assumed to be absent. Warning messages will be issued if NONE is specified. Eventually the ability to specify NONE will be deprecated and cause MODFLOW 6 to terminate with an error. block connectiondata name belev diff --git a/doc/mf6io/mf6ivar/md/mf6ivar.md b/doc/mf6io/mf6ivar/md/mf6ivar.md index 0bce538bf7a..9b45f871c9c 100644 --- a/doc/mf6io/mf6ivar/md/mf6ivar.md +++ b/doc/mf6io/mf6ivar/md/mf6ivar.md @@ -658,7 +658,7 @@ | GWF | LAK | CONNECTIONDATA | ICONN | INTEGER | integer value that defines the GWF connection number for this lake connection entry. ICONN must be greater than zero and less than or equal to NLAKECONN for lake LAKENO. | | GWF | LAK | CONNECTIONDATA | CELLID | INTEGER (NCELLDIM) | is the cell identifier, and depends on the type of grid that is used for the simulation. For a structured grid that uses the DIS input file, CELLID is the layer, row, and column. For a grid that uses the DISV input file, CELLID is the layer and CELL2D number. If the model uses the unstructured discretization (DISU) input file, CELLID is the node number for the cell. | | GWF | LAK | CONNECTIONDATA | CLAKTYPE | STRING | character string that defines the lake-GWF connection type for the lake connection. Possible lake-GWF connection type strings include: VERTICAL--character keyword to indicate the lake-GWF connection is vertical and connection conductance calculations use the hydraulic conductivity corresponding to the $K_{33}$ tensor component defined for CELLID in the NPF package. HORIZONTAL--character keyword to indicate the lake-GWF connection is horizontal and connection conductance calculations use the hydraulic conductivity corresponding to the $K_{11}$ tensor component defined for CELLID in the NPF package. EMBEDDEDH--character keyword to indicate the lake-GWF connection is embedded in a single cell and connection conductance calculations use the hydraulic conductivity corresponding to the $K_{11}$ tensor component defined for CELLID in the NPF package. EMBEDDEDV--character keyword to indicate the lake-GWF connection is embedded in a single cell and connection conductance calculations use the hydraulic conductivity corresponding to the $K_{33}$ tensor component defined for CELLID in the NPF package. Embedded lakes can only be connected to a single cell (NLAKECONN = 1) and there must be a lake table associated with each embedded lake. | -| GWF | LAK | CONNECTIONDATA | BEDLEAK | STRING | character string or real value that defines the bed leakance for the lake-GWF connection. BEDLEAK must be greater than or equal to zero or specified to be NONE. If BEDLEAK is specified to be NONE, the lake-GWF connection conductance is solely a function of aquifer properties in the connected GWF cell and lakebed sediments are assumed to be absent. | +| GWF | LAK | CONNECTIONDATA | BEDLEAK | STRING | real value or character string that defines the bed leakance for the lake-GWF connection. BEDLEAK must be greater than or equal to zero, equal to the DNODATA value (3.0E+30), or specified to be NONE. If DNODATA or NONE is specified for BEDLEAK, the lake-GWF connection conductance is solely a function of aquifer properties in the connected GWF cell and lakebed sediments are assumed to be absent. Warning messages will be issued if NONE is specified. Eventually the ability to specify NONE will be deprecated and cause MODFLOW 6 to terminate with an error. | | GWF | LAK | CONNECTIONDATA | BELEV | DOUBLE PRECISION | real value that defines the bottom elevation for a HORIZONTAL lake-GWF connection. Any value can be specified if CLAKTYPE is VERTICAL, EMBEDDEDH, or EMBEDDEDV. If CLAKTYPE is HORIZONTAL and BELEV is not equal to TELEV, BELEV must be greater than or equal to the bottom of the GWF cell CELLID. If BELEV is equal to TELEV, BELEV is reset to the bottom of the GWF cell CELLID. | | GWF | LAK | CONNECTIONDATA | TELEV | DOUBLE PRECISION | real value that defines the top elevation for a HORIZONTAL lake-GWF connection. Any value can be specified if CLAKTYPE is VERTICAL, EMBEDDEDH, or EMBEDDEDV. If CLAKTYPE is HORIZONTAL and TELEV is not equal to BELEV, TELEV must be less than or equal to the top of the GWF cell CELLID. If TELEV is equal to BELEV, TELEV is reset to the top of the GWF cell CELLID. | | GWF | LAK | CONNECTIONDATA | CONNLEN | DOUBLE PRECISION | real value that defines the distance between the connected GWF CELLID node and the lake for a HORIZONTAL, EMBEDDEDH, or EMBEDDEDV lake-GWF connection. CONLENN must be greater than zero for a HORIZONTAL, EMBEDDEDH, or EMBEDDEDV lake-GWF connection. Any value can be specified if CLAKTYPE is VERTICAL. | diff --git a/doc/mf6io/mf6ivar/tex/gwf-lak-desc.tex b/doc/mf6io/mf6ivar/tex/gwf-lak-desc.tex index ad5ac4b7d71..c3886f5c8cb 100644 --- a/doc/mf6io/mf6ivar/tex/gwf-lak-desc.tex +++ b/doc/mf6io/mf6ivar/tex/gwf-lak-desc.tex @@ -91,7 +91,7 @@ \item \texttt{claktype}---character string that defines the lake-GWF connection type for the lake connection. Possible lake-GWF connection type strings include: VERTICAL--character keyword to indicate the lake-GWF connection is vertical and connection conductance calculations use the hydraulic conductivity corresponding to the $K_{33}$ tensor component defined for CELLID in the NPF package. HORIZONTAL--character keyword to indicate the lake-GWF connection is horizontal and connection conductance calculations use the hydraulic conductivity corresponding to the $K_{11}$ tensor component defined for CELLID in the NPF package. EMBEDDEDH--character keyword to indicate the lake-GWF connection is embedded in a single cell and connection conductance calculations use the hydraulic conductivity corresponding to the $K_{11}$ tensor component defined for CELLID in the NPF package. EMBEDDEDV--character keyword to indicate the lake-GWF connection is embedded in a single cell and connection conductance calculations use the hydraulic conductivity corresponding to the $K_{33}$ tensor component defined for CELLID in the NPF package. Embedded lakes can only be connected to a single cell (NLAKECONN = 1) and there must be a lake table associated with each embedded lake. -\item \texttt{bedleak}---character string or real value that defines the bed leakance for the lake-GWF connection. BEDLEAK must be greater than or equal to zero or specified to be NONE. If BEDLEAK is specified to be NONE, the lake-GWF connection conductance is solely a function of aquifer properties in the connected GWF cell and lakebed sediments are assumed to be absent. +\item \texttt{bedleak}---real value or character string that defines the bed leakance for the lake-GWF connection. BEDLEAK must be greater than or equal to zero, equal to the DNODATA value (3.0E+30), or specified to be NONE. If DNODATA or NONE is specified for BEDLEAK, the lake-GWF connection conductance is solely a function of aquifer properties in the connected GWF cell and lakebed sediments are assumed to be absent. Warning messages will be issued if NONE is specified. Eventually the ability to specify NONE will be deprecated and cause MODFLOW 6 to terminate with an error. \item \texttt{belev}---real value that defines the bottom elevation for a HORIZONTAL lake-GWF connection. Any value can be specified if CLAKTYPE is VERTICAL, EMBEDDEDH, or EMBEDDEDV. If CLAKTYPE is HORIZONTAL and BELEV is not equal to TELEV, BELEV must be greater than or equal to the bottom of the GWF cell CELLID. If BELEV is equal to TELEV, BELEV is reset to the bottom of the GWF cell CELLID. diff --git a/doc/mf6io/mf6ivar/tex/gwt-mwt-desc.tex b/doc/mf6io/mf6ivar/tex/gwt-mwt-desc.tex index b3bbbc87356..7c2c57c4e27 100644 --- a/doc/mf6io/mf6ivar/tex/gwt-mwt-desc.tex +++ b/doc/mf6io/mf6ivar/tex/gwt-mwt-desc.tex @@ -63,7 +63,7 @@ \item \texttt{mawno}---integer value that defines the well number associated with the specified PERIOD data on the line. MAWNO must be greater than zero and less than or equal to NMAWWELLS. -\item \texttt{mwtsetting}---line of information that is parsed into a keyword and values. Keyword values that can be used to start the MWTSETTING string include: STATUS, CONCENTRATION, RAINFALL, EVAPORATION, RUNOFF, and AUXILIARY. These settings are used to assign the concentration of associated with the corresponding flow terms. Concentrations cannot be specified for all flow terms. For example, the Multi-Aquifer Well Package supports a ``WITHDRAWAL'' flow term. If this withdrawal term is active, then water will be withdrawn from the well at the calculated concentration of the well. +\item \texttt{mwtsetting}---line of information that is parsed into a keyword and values. Keyword values that can be used to start the MWTSETTING string include: STATUS, CONCENTRATION, RAINFALL, EVAPORATION, RUNOFF, and AUXILIARY. These settings are used to assign the concentration associated with the corresponding flow terms. Concentrations cannot be specified for all flow terms. For example, the Multi-Aquifer Well Package supports a ``WITHDRAWAL'' flow term. If this withdrawal term is active, then water will be withdrawn from the well at the calculated concentration of the well. \begin{lstlisting}[style=blockdefinition] STATUS diff --git a/doc/mf6io/mf6ivar/tex/gwt-ssm-desc.tex b/doc/mf6io/mf6ivar/tex/gwt-ssm-desc.tex index 0d450f542f4..d75c8508def 100644 --- a/doc/mf6io/mf6ivar/tex/gwt-ssm-desc.tex +++ b/doc/mf6io/mf6ivar/tex/gwt-ssm-desc.tex @@ -13,7 +13,7 @@ \begin{description} \item \texttt{pname}---name of the flow package for which an auxiliary variable contains a source concentration. If this flow package is represented using an advanced transport package (SFT, LKT, MWT, or UZT), then the advanced transport package will override SSM terms specified here. -\item \texttt{srctype}---keyword indicating how concentration will be assigned for sources and sinks. Keyword must be specified as either AUX or AUXMIXED. For both options the user must provide an auxiliary variable in the corresponding flow package. The auxiliary variable must have the same name as the AUXNAME value that follows. If the AUX keyword is specified, then the auxiliary variable specified by the user will be assigned as the concenration value for groundwater sources (flows with a positive sign). For negative flow rates (sinks), groundwater will be withdrawn from the cell at the simulated concentration of the cell. The AUXMIXED option provides an alternative method for how to determine the concentration of sinks. If the cell concentration is larger than the user-specified auxiliary concentration, then the concentration of groundwater withdrawn from the cell will be assigned as the user-specified concentration. Alternatively, if the user-specified auxiliary concentration is larger than the cell concentration, then groundwater will be withdrawn at the cell concentration. Thus, the AUXMIXED option is designed to work with the Evapotranspiration (EVT) and Recharge (RCH) Packages where water may be withdrawn at a concentration that is less than the cell concentration. +\item \texttt{srctype}---keyword indicating how concentration will be assigned for sources and sinks. Keyword must be specified as either AUX or AUXMIXED. For both options the user must provide an auxiliary variable in the corresponding flow package. The auxiliary variable must have the same name as the AUXNAME value that follows. If the AUX keyword is specified, then the auxiliary variable specified by the user will be assigned as the concentration value for groundwater sources (flows with a positive sign). For negative flow rates (sinks), groundwater will be withdrawn from the cell at the simulated concentration of the cell. The AUXMIXED option provides an alternative method for how to determine the concentration of sinks. If the cell concentration is larger than the user-specified auxiliary concentration, then the concentration of groundwater withdrawn from the cell will be assigned as the user-specified concentration. Alternatively, if the user-specified auxiliary concentration is larger than the cell concentration, then groundwater will be withdrawn at the cell concentration. Thus, the AUXMIXED option is designed to work with the Evapotranspiration (EVT) and Recharge (RCH) Packages where water may be withdrawn at a concentration that is less than the cell concentration. \item \texttt{auxname}---name of the auxiliary variable in the package PNAME. This auxiliary variable must exist and be specified by the user in that package. The values in this auxiliary variable will be used to set the concentration associated with the flows for that boundary package. diff --git a/src/Model/GroundWaterFlow/gwf3lak8.f90 b/src/Model/GroundWaterFlow/gwf3lak8.f90 index 366ebc54e23..3c839ad81b0 100644 --- a/src/Model/GroundWaterFlow/gwf3lak8.f90 +++ b/src/Model/GroundWaterFlow/gwf3lak8.f90 @@ -1,6 +1,6 @@ module LakModule ! - use KindModule, only: DP, I4B + use KindModule, only: DP, I4B, LGP use ConstantsModule, only: LINELENGTH, LENBOUNDNAME, LENTIMESERIESNAME, & IWETLAKE, MAXADPIT, & DZERO, DPREC, DEM30, DEM9, DEM6, DEM5, & @@ -25,11 +25,12 @@ module LakModule use ObsModule, only: ObsType use InputOutputModule, only: get_node, URWORD, extract_idnum_or_bndname use BaseDisModule, only: DisBaseType - use SimModule, only: count_errors, store_error, store_error_unit + use SimModule, only: count_errors, store_error, store_error_unit, & + deprecation_warning use GenericUtilitiesModule, only: sim_message, is_same use BlockParserModule, only: BlockParserType use BaseDisModule, only: DisBaseType - use SimVariablesModule, only: errmsg + use SimVariablesModule, only: errmsg, warnmsg use MatrixBaseModule ! implicit none @@ -487,7 +488,7 @@ subroutine lak_read_lakes(this) character(len=9) :: cno character(len=50), dimension(:), allocatable :: caux integer(I4B) :: ierr, ival - logical :: isfound, endOfBlock + logical(LGP) :: isfound, endOfBlock integer(I4B) :: n integer(I4B) :: ii, jj integer(I4B) :: iaux @@ -723,13 +724,15 @@ subroutine lak_read_lake_connections(this) ! -- local character(len=LINELENGTH) :: keyword, cellid integer(I4B) :: ierr, ival - logical :: isfound, endOfBlock + logical(LGP) :: isfound, endOfBlock + logical(LGP) :: is_lake_bed real(DP) :: rval integer(I4B) :: j, n integer(I4B) :: nn integer(I4B) :: ipos, ipos0 integer(I4B) :: icellid, icellid0 - real(DP) :: top, bot + real(DP) :: top + real(DP) :: bot integer(I4B), dimension(:), pointer, contiguous :: nboundchk character(len=LENVARNAME) :: ctypenm @@ -838,16 +841,35 @@ subroutine lak_read_lake_connections(this) write (ctypenm, '(a16)') keyword ! -- bed leakance - !this%bedleak(ipos) = this%parser%GetDouble() + !this%bedleak(ipos) = this%parser%GetDouble() !TODO: use this when NONE keyword deprecated call this%parser%GetStringCaps(keyword) select case (keyword) case ('NONE') - this%bedleak(ipos) = -DONE + is_lake_bed = .FALSE. + this%bedleak(ipos) = DNODATA + ! + ! -- create warning message + write (warnmsg, '(2(a,1x,i0,1x),a,1pe7.1,a)') & + 'BEDLEAK for connection', j, 'in lake', n, 'is specified to '// & + 'be NONE. Lake connections where the lake-GWF connection '// & + 'conductance is solely a function of aquifer properties '// & + 'in the connected GWF cell should be specified with a '// & + 'DNODATA (', DNODATA, ') value.' + ! + ! -- create deprecation warning + call deprecation_warning('CONNECTIONDATA', 'bedleak=NONE', '6.5.0', & + warnmsg, this%parser%GetUnit()) case default - read (keyword, *) this%bedleak(ipos) + read (keyword, *) rval + if (is_same(rval, DNODATA)) then + is_lake_bed = .FALSE. + else + is_lake_bed = .TRUE. + end if + this%bedleak(ipos) = rval end select - if (keyword /= 'NONE' .and. this%bedleak(ipos) < dzero) then + if (is_lake_bed .and. this%bedleak(ipos) < DZERO) then write (errmsg, '(a,1x,i0,1x,a)') 'bedleak FOR LAKE ', n, 'MUST BE >= 0' call store_error(errmsg) end if @@ -1029,7 +1051,7 @@ subroutine lak_read_tables(this) character(len=LINELENGTH) :: line character(len=LINELENGTH) :: keyword integer(I4B) :: ierr - logical :: isfound, endOfBlock + logical(LGP) :: isfound, endOfBlock integer(I4B) :: n integer(I4B) :: iconn integer(I4B) :: ntabs @@ -1223,7 +1245,7 @@ subroutine lak_read_table(this, ilak, filename, laketable) ! -- local character(len=LINELENGTH) :: keyword integer(I4B) :: ierr - logical :: isfound, endOfBlock + logical(LGP) :: isfound, endOfBlock integer(I4B) :: iu integer(I4B) :: n integer(I4B) :: ipos @@ -1467,7 +1489,7 @@ subroutine lak_read_outlets(this) character(len=LENBOUNDNAME) :: bndName character(len=9) :: citem integer(I4B) :: ierr, ival - logical :: isfound, endOfBlock + logical(LGP) :: isfound, endOfBlock integer(I4B) :: n integer(I4B) :: jj integer(I4B), dimension(:), pointer, contiguous :: nboundchk @@ -1658,7 +1680,7 @@ subroutine lak_read_dimensions(this) ! -- local character(len=LINELENGTH) :: keyword integer(I4B) :: ierr - logical :: isfound, endOfBlock + logical(LGP) :: isfound, endOfBlock ! -- format ! ------------------------------------------------------------------------------ ! @@ -1882,10 +1904,10 @@ subroutine lak_read_initial_attr(this) end if length = this%connlength(j) end if - if (this%bedleak(j) < DZERO) then - clb(j) = -DONE + if (is_same(this%bedleak(j), DNODATA)) then + clb(j) = DNODATA else if (this%bedleak(j) > DZERO) then - clb(j) = done / this%bedleak(j) + clb(j) = DONE / this%bedleak(j) else clb(j) = DZERO end if @@ -1894,7 +1916,7 @@ subroutine lak_read_initial_attr(this) else caq(j) = DZERO end if - if (this%bedleak(j) < DZERO) then + if (is_same(this%bedleak(j), DNODATA)) then this%satcond(j) = area / caq(j) else if (clb(j) * caq(j) > DZERO) then this%satcond(j) = area / (clb(j) + caq(j)) @@ -1929,7 +1951,7 @@ subroutine lak_read_initial_attr(this) nn = this%cellid(j) area = this%warea(j) c1 = DZERO - if (clb(j) < DZERO) then + if (is_same(clb(j), DNODATA)) then cbedleak = ' NONE ' cbedcond = ' NONE ' else if (clb(j) > DZERO) then @@ -3421,7 +3443,7 @@ subroutine lak_options(this, option, found) ! -- dummy class(LakType), intent(inout) :: this character(len=*), intent(inout) :: option - logical, intent(inout) :: found + logical(LGP), intent(inout) :: found ! -- local character(len=MAXCHARLEN) :: fname, keyword real(DP) :: r @@ -3619,8 +3641,8 @@ subroutine lak_rp(this) character(len=LINELENGTH) :: title character(len=LINELENGTH) :: line character(len=LINELENGTH) :: text - logical :: isfound - logical :: endOfBlock + logical(LGP) :: isfound + logical(LGP) :: endOfBlock integer(I4B) :: ierr integer(I4B) :: node integer(I4B) :: n @@ -3830,12 +3852,12 @@ subroutine lak_cf(this, reset_mover) ! ------------------------------------------------------------------------------ ! -- dummy class(LakType) :: this - logical, intent(in), optional :: reset_mover + logical(LGP), intent(in), optional :: reset_mover ! -- local integer(I4B) :: j, n integer(I4B) :: igwfnode real(DP) :: hlak, blak - logical :: lrm + logical(LGP) :: lrm ! ------------------------------------------------------------------------------ !! !! -- Calculate lak conductance and update package RHS and HCOF @@ -5103,7 +5125,7 @@ subroutine lak_rp_obs(this) integer(I4B) :: nn2 integer(I4B) :: jj character(len=LENBOUNDNAME) :: bname - logical :: jfound + logical(LGP) :: jfound class(ObserveType), pointer :: obsrv => null() ! -------------------------------------------------------------------------- ! -- formats @@ -5420,11 +5442,11 @@ subroutine lak_solve(this, update) ! SPECIFICATIONS: ! -------------------------------------------------------------------------- use TdisModule, only: delt - logical, intent(in), optional :: update + logical(LGP), intent(in), optional :: update ! -- dummy class(LakType), intent(inout) :: this ! -- local - logical :: lupdate + logical(LGP) :: lupdate integer(I4B) :: i integer(I4B) :: j integer(I4B) :: n @@ -6639,8 +6661,8 @@ subroutine lak_calculate_density_exchange(this, iconn, stage, head, cond, & real(DP) :: elevavg real(DP) :: d1 real(DP) :: d2 - logical :: stage_below_bot - logical :: head_below_bot + logical(LGP) :: stage_below_bot + logical(LGP) :: head_below_bot ! -- formats ! ------------------------------------------------------------------------------ !