From 57790ba87f6dfc37c89f73c091e58889085a1c8f Mon Sep 17 00:00:00 2001 From: Eric Morway Date: Thu, 8 Feb 2024 07:50:23 -0800 Subject: [PATCH] Adding lake energy transport (LKE) package. Includes new autotest --- autotest/test_gwe_lke_conduction.py | 780 +++++++ doc/Common/gwe-lkeobs.tex | 31 +- doc/mf6io/gwe/gwe.tex | 4 + doc/mf6io/gwe/lke.tex | 55 + doc/mf6io/gwe/namefile.tex | 1 + doc/mf6io/mf6io_copy.bbl | 289 +++ doc/mf6io/mf6ivar/dfn/gwe-lke.dfn | 481 ++++ .../mf6ivar/examples/gwe-lke-example-obs.dat | 25 + .../mf6ivar/examples/gwe-lke-example.dat | 24 + doc/mf6io/mf6ivar/md/mf6ivar.md | 38 + doc/mf6io/mf6ivar/mf6ivar.py | 1 + doc/mf6io/mf6ivar/tex/appendixA.tex | 4 + doc/mf6io/mf6ivar/tex/gwe-lke-desc.tex | 101 + doc/mf6io/mf6ivar/tex/gwe-lke-options.dat | 15 + doc/mf6io/mf6ivar/tex/gwe-lke-packagedata.dat | 5 + doc/mf6io/mf6ivar/tex/gwe-lke-period.dat | 5 + doc/mf6io/usgs.bst | 2080 +++++++++++++++++ make/makefile | 1 + msvs/mf6core.vfproj | 1 + src/Model/GroundWaterEnergy/gwe1.f90 | 50 +- src/Model/GroundWaterEnergy/gwe1lke1.f90 | 1241 ++++++++++ src/Model/TransportModel/tsp1apt1.f90 | 4 +- 22 files changed, 5189 insertions(+), 47 deletions(-) create mode 100644 autotest/test_gwe_lke_conduction.py create mode 100644 doc/mf6io/gwe/lke.tex create mode 100644 doc/mf6io/mf6io_copy.bbl create mode 100644 doc/mf6io/mf6ivar/dfn/gwe-lke.dfn create mode 100644 doc/mf6io/mf6ivar/examples/gwe-lke-example-obs.dat create mode 100644 doc/mf6io/mf6ivar/examples/gwe-lke-example.dat create mode 100644 doc/mf6io/mf6ivar/tex/gwe-lke-desc.tex create mode 100644 doc/mf6io/mf6ivar/tex/gwe-lke-options.dat create mode 100644 doc/mf6io/mf6ivar/tex/gwe-lke-packagedata.dat create mode 100644 doc/mf6io/mf6ivar/tex/gwe-lke-period.dat create mode 100644 doc/mf6io/usgs.bst create mode 100644 src/Model/GroundWaterEnergy/gwe1lke1.f90 diff --git a/autotest/test_gwe_lke_conduction.py b/autotest/test_gwe_lke_conduction.py new file mode 100644 index 00000000000..412df9816e9 --- /dev/null +++ b/autotest/test_gwe_lke_conduction.py @@ -0,0 +1,780 @@ +# Simple single lake model. Lake cut into top two layers of a 5 layer +# model. Model is loosely based on the first example problem in +# Merritt and Konikow (2000) which also is one of the MT3D-USGS test +# problems. This test developed to isolate lake-aquifer interaction; +# no SFR or other advanced packages. Problem set up to have only +# conductive exchange with groundwater, then groundwater pass-through: +# that is, gw inflow on the left side, gw outflow on the +# right side of the lake. +# +# starting groundwater temperature: 4.0 +# left chd boundary inflow temperature: 4.0 +# starting lake temperature: 20.0 +# + +import os + +import numpy as np +import pytest +import flopy +from framework import TestFramework + + +def process_line(line): + m_arr = line.strip().split() + if any("=" in itm and len(itm) > 1 for itm in m_arr): + m_arr = [ + float(itm.split("=")[-1]) if len(itm.split("=")) > 1 else itm + for itm in m_arr + ] + nm = m_arr[-2] + else: + nm = m_arr[-3] + val = m_arr[-1] + return {nm: float(val)} + + +def get_bud(fname, srchStr): + in_bud_lst = {} + out_bud_lst = {} + with open(fname, "r") as f: + for line in f: + if srchStr in line: + # Read the package budget + line = next(f) + while not "TOTAL IN =" in line: + if "=" in line: + in_bud_lst.update(process_line(line)) + + line = next(f) + + # Get "total in" + dct = process_line(line) + T_in = dct["IN"] + + line = next(f) + while not "TOTAL OUT =" in line: + if "=" in line: + out_bud_lst.update(process_line(line)) + + line = next(f) + + # Get "total out" + dct = process_line(line) + T_out = dct["OUT"] + + break + + return T_in, T_out, in_bud_lst, out_bud_lst + + +def trenddetector(list_of_index, array_of_data, order=1): + result = np.polyfit(list_of_index, list(array_of_data), order) + slope = result[-2] + return float(slope) + + +cases = ["lke-conductn", "lke-conductm", "lke-conductr"] + +# +# The last letter in the names above indicates the following +# n = "no lk/gw exchange" +# m = "mixed" (i.e., convection one direction, conductive gradient the other direction?) +# r = "reversed thermal gradients (warm gw, cold lake) + +strt_gw_temp = [4.0, 4.0, 20.0] +strt_lk_temp = [20.0, 20.0, 4.0] +lak_leakance = [0.0, 1.0, 1.0] +strt_lk_stg = [33.75, 33.75, 33.75] +lkbdthkcnd = [ + 0.0001, + 0.0001, + 0.0001, +] # Thickness to consider for feature/gw conduction + +# Model units +length_units = "m" +time_units = "days" + +# model domain and grid definition +delr = [ + 76.2, + 304.8, + 304.8, + 304.8, + 304.8, + 304.8, + 152.4, + 152.4, + 152.4, + 152.4, + 152.4, + 304.8, + 304.8, + 304.8, + 304.8, + 304.8, + 76.2, +] + +delc = [ + 76.2, + 304.8, + 304.8, + 304.8, + 304.8, + 304.8, + 152.4, + 152.4, + 152.4, + 152.4, + 152.4, + 304.8, + 304.8, + 304.8, + 304.8, + 304.8, + 76.2, +] + +fixedstrthds = [ + 35.052, + 34.9267, + 34.7216, + 34.5062, + 34.2755, + 34.0237, + 33.8143, + 33.6657, + 33.5077, + 33.3394, + 33.1599, + 32.8728, + 32.4431, + 31.9632, + 31.4353, + 30.8627, + 30.48, +] + +nrow = len(delc) +ncol = len(delr) +top = np.ones((nrow, ncol)) * 35.6616 +bot1 = np.ones_like(top) * 32.6136 +bot2 = np.ones_like(top) * 29.5656 +bot3 = np.ones_like(top) * 26.5176 +bot4 = np.ones_like(top) * 23.4696 +bot5 = np.ones_like(top) * 20.4216 +botm = np.array([bot1, bot2, bot3, bot4, bot5]) +nlay = botm.shape[0] +ibound = np.ones_like(botm) + +# deactive gw cells where lake cells are active +ibound[0, 6:11, 6:11] = 0 # layer 1 +ibound[1, 7:10, 7:10] = 0 # layer 2 + +strthd = np.zeros_like(ibound) +for j in np.arange(ncol): + strthd[:, :, j] = fixedstrthds[j] + +# setup lake array +lakibnd = np.zeros_like(ibound) +lakibnd[0] = 1 - ibound[0] # layer 1 +lakibnd[1] = 1 - ibound[1] # layer 2 + +# NPF parameters +k11 = 9.144 # = 30 ft/day +k33 = 0.9144 # = 30 ft/day +ss = 3e-4 +sy = 0.20 +hani = 1 +laytyp = 1 + +# Package boundary conditions +chdl = 35.052 +chdr = 30.48 +viscref = 8.904e-4 + +# time params +transient = {0: True} +nstp = [10] +tsmult = [1.0] +perlen = [5000] + +# solver params +nouter, ninner = 1000, 300 +hclose, rclose, relax = 1e-3, 1e-4, 0.97 + +# Transport related parameters +al = 1 # longitudinal dispersivity ($m$) +ath1 = al # horizontal transverse dispersivity +atv = al # vertical transverse dispersivity +mixelm = 0 # Upstream vs TVD (Upstream selected) +porosity = 0.20 # porosity (unitless) +K_therm = 2.0 # Thermal conductivity # ($W/m/C$) +rhow = 1000 # Density of water ($kg/m^3$) +rhos = 2650 # Density of the aquifer material ($kg/m^3$) +Cpw = 4180 # Heat Capacity of water ($J/kg/C$) +Cps = 880 # Heat capacity of the solids ($J/kg/C$) +lhv = 2454000.0 # Latent heat of vaporization ($J/kg$) +K_therm_lakebed = 1.5 # Thermal conductivity of the lakebed material ($W/m/C$) + + +# +# MODFLOW 6 flopy GWF & GWE simulation object (sim) is returned +# + + +def build_models(idx, test): + global lak_lkup_dict + + # Base simulation and model name and workspace + ws = test.workspace + name = cases[idx] + + print("Building model...{}".format(name)) + + # generate names for each model + gwfname = "gwf-" + name + gwename = "gwe-" + name + + sim = flopy.mf6.MFSimulation( + sim_name=name, sim_ws=ws, exe_name="mf6", version="mf6" + ) + + tdis_rc = [] + for i in range(len(nstp)): + tdis_rc.append((perlen[i], nstp[i], tsmult[i])) + + flopy.mf6.ModflowTdis( + sim, nper=len(nstp), perioddata=tdis_rc, time_units=time_units + ) + + gwf = flopy.mf6.ModflowGwf( + sim, modelname=gwfname, save_flows=True, newtonoptions="newton" + ) + + # Instantiating solver + ims = flopy.mf6.ModflowIms( + sim, + print_option="ALL", + outer_dvclose=hclose, + outer_maximum=nouter, + under_relaxation="cooley", + inner_maximum=ninner, + inner_dvclose=hclose, + rcloserecord=rclose, + linear_acceleration="BICGSTAB", + scaling_method="NONE", + reordering_method="NONE", + relaxation_factor=relax, + filename="{}.ims".format(gwfname), + ) + sim.register_ims_package(ims, [gwfname]) + + # Instantiate discretization package + flopy.mf6.ModflowGwfdis( + gwf, + length_units=length_units, + nlay=nlay, + nrow=nrow, + ncol=ncol, + delr=delr, + delc=delc, + top=top, + botm=botm, + idomain=ibound, + filename="{}.dis".format(gwfname), + ) + + # Instantiate node property flow package + flopy.mf6.ModflowGwfnpf( + gwf, + save_specific_discharge=True, + icelltype=1, # >0 means saturated thickness varies with computed head + k=k11, + k33=k33, + ) + + # Instantiate storage package + flopy.mf6.ModflowGwfsto( + gwf, + save_flows=False, + iconvert=laytyp, + ss=ss, + sy=sy, + transient=transient, + ) + + # Instantiate initial conditions package + flopy.mf6.ModflowGwfic(gwf, strt=strthd) + + # Instantiate output control package + flopy.mf6.ModflowGwfoc( + gwf, + budget_filerecord=f"{gwfname}.cbc", + head_filerecord=f"{gwfname}.hds", + headprintrecord=[("COLUMNS", 17, "WIDTH", 15, "DIGITS", 6, "GENERAL")], + saverecord=[("HEAD", "ALL"), ("BUDGET", "ALL")], + printrecord=[("HEAD", "ALL"), ("BUDGET", "LAST")], + ) + + # Instantiate constant head package + # (for driving gw flow from left to right) + chdlistl = [] + chdlistr = [] + for k in np.arange(nlay): + for i in np.arange(nrow): + # left side + if botm[k, i, 0] <= chdl: + chdlistl.append([(k, i, 0), chdl, strt_gw_temp[idx]]) + # right side + if botm[k, i, -1] <= chdr: + chdlistr.append([(k, i, ncol - 1), chdr, 10.0]) + + flopy.mf6.ModflowGwfchd( + gwf, + stress_period_data=chdlistl, + print_input=True, + print_flows=True, + save_flows=False, + pname="CHD-L", + auxiliary="TEMPERATURE", + filename=f"{gwfname}.left.chd", + ) + + flopy.mf6.ModflowGwfchd( + gwf, + stress_period_data=chdlistr, + print_input=True, + print_flows=True, + save_flows=False, + pname="CHD-R", + auxiliary="TEMPERATURE", + filename=f"{gwfname}.right.chd", + ) + + # Instantiate lake package + lakeconnectiondata = [] + nlakecon = [0] # Expand this to [0, 0, ...] for each additional lake + ilakconn = -1 + lak_lkup_dict = {} + for k in [0, 1]: + for i in range(nrow): + for j in range(ncol): + if lakibnd[k, i, j] == 0: + continue + else: + ilak = int(lakibnd[k, i, j] - 1) + # back + if i > 0: + if ( + lakibnd[k, i - 1, j] == 0 + and ibound[k, i - 1, j] == 1 + ): + ilakconn += 1 + # by setting belev==telev, MF6 will automatically + # re-assign elevations based on cell dimensions + h = [ + ilak, # + ilakconn, # + (k, i - 1, j), # + "horizontal", # + lak_leakance[idx], # + 0.0, # + 0.0, # + delc[i] / 2.0, # + delr[j], # + ] + lakeconnectiondata.append(h) + lak_lkup_dict.update({ilakconn: (k, i, j)}) + + # left + if j > 0: + if ( + lakibnd[k, i, j - 1] == 0 + and ibound[k, i, j - 1] == 1 + ): + ilakconn += 1 + h = [ + ilak, + ilakconn, + (k, i, j - 1), + "horizontal", + lak_leakance[idx], + 0.0, + 0.0, + delr[j] / 2.0, + delc[i], + ] + lakeconnectiondata.append(h) + lak_lkup_dict.update({ilakconn: (k, i, j)}) + + # right + if j < ncol - 1: + if ( + lakibnd[k, i, j + 1] == 0 + and ibound[k, i, j + 1] == 1 + ): + ilakconn += 1 + h = [ + ilak, + ilakconn, + (k, i, j + 1), + "horizontal", + lak_leakance[idx], + 0.0, + 0.0, + delr[j] / 2.0, + delc[i], + ] + lakeconnectiondata.append(h) + lak_lkup_dict.update({ilakconn: (k, i, j)}) + + # front + if i < nrow - 1: + if ( + lakibnd[k, i + 1, j] == 0 + and ibound[k, i + 1, j] == 1 + ): + ilakconn += 1 + h = [ + ilak, + ilakconn, + (k, i + 1, j), + "horizontal", + lak_leakance[idx], + 0.0, + 0.0, + delc[i] / 2.0, + delr[j], + ] + lakeconnectiondata.append(h) + lak_lkup_dict.update({ilakconn: (k, i, j)}) + + # vertical + if lakibnd[k, i, j] == 1 and ibound[k + 1, i, j] == 1: + ilakconn += 1 + v = [ + ilak, + ilakconn, + (k + 1, i, j), + "vertical", + lak_leakance[idx], + 0.0, + 0.0, + 0.0, + 0.0, + ] + lakeconnectiondata.append(v) + lak_lkup_dict.update({ilakconn: (k, i, j)}) + + strtStg = strt_lk_stg[idx] + lakpackagedata = [ + [0, strtStg, len(lakeconnectiondata), strt_lk_temp[idx], "lake1"] + ] + lak_pkdat_dict = {"filename": "lak_pakdata.in", "data": lakpackagedata} + + lakeperioddata = {0: []} + + lak_obs = { + "{}.lakeobs".format(gwfname): [ + ("lakestage", "stage", "lake1"), + ("gwexchng", "lak", "lake1"), + ] + } + lak = flopy.mf6.ModflowGwflak( + gwf, + auxiliary="TEMPERATURE", + time_conversion=86400.0, + print_stage=True, + print_flows=True, + budget_filerecord=gwfname + ".lak.bud", + length_conversion=1.0, + mover=False, + pname="LAK-1", + boundnames=True, + nlakes=len(lakpackagedata), + noutlets=0, + packagedata=lak_pkdat_dict, + connectiondata=lakeconnectiondata, + perioddata=lakeperioddata, + observations=lak_obs, + filename="{}.lak".format(gwfname), + ) + + # pull in the tabfile defining the lake stage, vol, & surface area + fname = os.path.join("data", "vsc04-laktab", "stg-vol-surfarea.dat") + tabinput = [] + with open(fname, "r") as f: + # peel off the hdr line + hdr = next(f) + for line in f: + m_arr = line.strip().split(",") + # , , , + tabinput.append([float(m_arr[0]), m_arr[1], m_arr[2]]) + + tab6_filename = "{}.laktab".format(gwfname) + flopy.mf6.ModflowUtllaktab( + gwf, + nrow=len(tabinput), + ncol=3, + table=tabinput, + filename=tab6_filename, + pname="LAK_tab", + parent_file=lak, + ) + + # ----------------- + # Create GWE model + # ----------------- + + gwe = flopy.mf6.ModflowGwe( + sim, modelname=gwename, model_nam_file="{}.nam".format(gwename) + ) + gwe.name_file.save_flows = True + + imsgwe = flopy.mf6.ModflowIms( + sim, + print_option="ALL", + outer_dvclose=hclose, + outer_maximum=nouter, + under_relaxation="NONE", + inner_maximum=ninner, + inner_dvclose=hclose, + rcloserecord=rclose, + linear_acceleration="BICGSTAB", + scaling_method="NONE", + reordering_method="NONE", + relaxation_factor=relax, + filename=f"{gwename}.ims", + ) + sim.register_ims_package(imsgwe, [gwename]) + + # Instantiating MODFLOW 6 enregy transport discretization package + flopy.mf6.ModflowGwedis( + gwe, + nlay=nlay, + nrow=nrow, + ncol=ncol, + delr=delr, + delc=delc, + top=top, + botm=botm, + idomain=ibound, + filename="{}.dis".format(gwename), + ) + + # Instantiating MODFLOW 6 energy transport initial temperatures + strttemp = strt_gw_temp[idx] + flopy.mf6.ModflowGweic( + gwe, strt=strttemp, filename="{}.ic".format(gwename) + ) + + # Instantiate mobile storage and transfer package + flopy.mf6.ModflowGweest( + gwe, + porosity=porosity, + cps=Cps, + rhos=rhos, + packagedata=[Cpw, rhow, lhv], + pname="MST-1", + filename=f"{gwename}.mst", + ) + + # Instantiating MODFLOW 6 energy transport advection package + if mixelm == 0: + scheme = "UPSTREAM" + elif mixelm == -1: + scheme = "TVD" + else: + raise Exception() + + # Instantiate advection package + flopy.mf6.ModflowGweadv( + gwe, scheme=scheme, filename="{}.adv".format(gwename) + ) + + # Instantiate dispersion package + flopy.mf6.ModflowGwecnd( + gwe, + xt3d_off=True, + ktw=0.5918, + kts=0.2700, + filename="{}.dsp".format(gwename), + ) + + # Instantiate source/sink mixing package + sourcerecarray = [ + ("CHD-L", "AUX", "TEMPERATURE"), + ("CHD-R", "AUX", "TEMPERATURE"), + ] + flopy.mf6.ModflowGwessm( + gwe, sources=sourcerecarray, filename=f"{gwename}.ssm" + ) + + # Instantiating MODFLOW 6 transport output control package + flopy.mf6.ModflowGweoc( + gwe, + budget_filerecord="{}.cbc".format(gwename), + temperature_filerecord="{}.ucn".format(gwename), + temperatureprintrecord=[ + ("COLUMNS", 17, "WIDTH", 15, "DIGITS", 6, "GENERAL") + ], + saverecord=[("TEMPERATURE", "ALL"), ("BUDGET", "ALL")], + printrecord=[("TEMPERATURE", "ALL"), ("BUDGET", "ALL")], + filename="{}.oc".format(gwename), + ) + + # Instantiating MODFLOW 6 lake energy transport (lke) package + lkepackagedata = [ + (0, strt_lk_temp[idx], K_therm_lakebed, lkbdthkcnd[idx], "lake1") + ] + + # lkeperioddata = {0: [(0, "STATUS", "CONSTANT"), (0, "TEMPERATURE", 4.0)]} + + # note: for specifying lake number, use fortran indexing! + lke_obs = { + "{}.lakobs".format(gwename): [ + ("resTemp", "temperature", 1), + ("resGwEnerExchng", "lke", "lake1"), + ] + } + + flopy.mf6.ModflowGwelke( + gwe, # Set time_conversion for use with Manning's eqn. + flow_package_name="LAK-1", + flow_package_auxiliary_name="TEMPERATURE", + budget_filerecord=gwename + ".lke.bud", + boundnames=True, + save_flows=True, + print_input=True, + print_flows=False, + print_temperature=True, + packagedata=lkepackagedata, + # lakeperioddata=lkeperioddata, + observations=lke_obs, + pname="LKE-1", + filename="{}.lke".format(gwename), + ) + + # GWF-GWE exchange + flopy.mf6.ModflowGwfgwe( + sim, + exgtype="GWF6-GWE6", + exgmnamea=gwfname, + exgmnameb=gwename, + filename=f"{name}.gwfgwe", + ) + + return sim, None + + +def check_output(idx, test): + print("evaluating results...") + + # read flow results from model + name = cases[idx] + gwename = "gwe-" + name + + # Retrieve simulated temperature for the lake + fname = gwename + ".lakobs" + lktemp_file = os.path.join(test.workspace, fname) + lktemp = np.genfromtxt(lktemp_file, names=True, delimiter=",") + lktemp = lktemp["RESTEMP"].astype(float).reshape((lktemp.size, 1)) + + # Retrieve groundwater temperatures + fname = gwename + ".ucn" + fname = os.path.join(test.workspace, fname) + assert os.path.isfile(fname) + gwtempobj = flopy.utils.HeadFile( + fname, precision="double", text="TEMPERATURE" + ) + gwe_temps = gwtempobj.get_alldata() + + # gw exchng (item 'GWF') should be zero in heat transport budget + srchStr = "LKE-1 BUDGET FOR ENTIRE MODEL AT END OF TIME STEP 1, STRESS PERIOD 1" + fname = gwename + ".lst" + fname = os.path.join(test.workspace, fname) + + # Retrieve budget + T_in, T_out, in_bud_lst, out_bud_lst = get_bud(fname, srchStr) + assert np.isclose( + T_in, T_out, atol=0.1 + ), "There is a heat budget discrepancy where there shouldn't be" + + msg1 = "Budget item 'GWF' should be 0.0 for this scenario" + msg2 = ( + "Thermal conduction is occurring in the wrong direction based " + "on the thermal gradient between the lake and groundwater system" + ) + msg3 = ( + "There should be a cooling trend in the lake based on heat loss " + "to the groundwater system" + ) + msg4 = ( + "There should be a warming trend in the groundwater adjacent " + "to the lake" + ) + msg5 = ( + "Budget item 'GWF' should reflect heat entering the lake " + "(via gw/sw exchange)" + ) + msg6 = ( + "Budget item 'GWF' should reflect heat exiting the lake " + "(via gw/sw exchange)" + ) + + if name[-1] == "n": + + assert in_bud_lst["GWF"] == 0.0, msg1 + assert out_bud_lst["GWF"] == 0.0, msg1 + + if name[-1] != "n": + + assert in_bud_lst["GWF"] > 0.0, msg5 + assert out_bud_lst["GWF"] > 0.0, msg6 + + # Determine gw/sfe temperature gradient direction + if lktemp[0] > gwe_temps[0, 0, 0, 0]: + # conduction will be from lake to gw cells + assert in_bud_lst["LAKEBED-COND"] == 0.0, msg2 + assert out_bud_lst["LAKEBED-COND"] > 0.0, msg2 + + slp = trenddetector(np.arange(len(lktemp)), lktemp) + # Lake should be cooling through conductive exchange with cold gw + assert slp < 0.0, msg3 + + slp = trenddetector(np.arange(lktemp.shape[0]), gwe_temps[:, 1, 8, 11]) + # gw should be warming through conductive exchange with a warm lake + assert slp > 0.0, msg4 + + else: # thermally reversed scenario (cold lake, warm gw) + + # conduction will be from gw cells to lake + assert in_bud_lst["LAKEBED-COND"] > 0.0, msg2 + assert out_bud_lst["LAKEBED-COND"] == 0.0, msg2 + + slp = trenddetector(np.arange(len(lktemp)), lktemp) + # Lake should be warming through conductive exchange with warm gw + assert slp > 0.0, msg3 + + slp = trenddetector(np.arange(lktemp.shape[0]), gwe_temps[:, 1, 8, 11]) + # gw should be cooling through conductive exchange with a cold lake + assert slp < 0.0, msg4 + + +# - No need to change any code below +@pytest.mark.parametrize( + "idx, name", + list(enumerate(cases)), +) +def test_mf6model(idx, name, function_tmpdir, targets): + test = TestFramework( + name=name, + workspace=function_tmpdir, + targets=targets, + build=lambda t: build_models(idx, t), + check=lambda t: check_output(idx, t), + ) + test.run() diff --git a/doc/Common/gwe-lkeobs.tex b/doc/Common/gwe-lkeobs.tex index ac32aee4ffe..f66ba397ae3 100644 --- a/doc/Common/gwe-lkeobs.tex +++ b/doc/Common/gwe-lkeobs.tex @@ -1,25 +1,18 @@ % general APT observations -LKE & temperature & ifno or boundname & -- & Lake temperature. If boundname is specified, boundname must be unique for each lake. \\ -LKE & flow-ja-face & ifno or boundname & ifno or -- & Energy flow between two lakes connected by an outlet. If more than one outlet is used to connect the same two lakes, then the energy flow for only the first outlet can be observed. If a boundname is specified for ID1, then the result is the total energy flow for all outlets for a lake. If a boundname is specified for ID1 then ID2 is not used.\\ -LKE & storage & ifno or boundname & -- & Simulated energy storage flow rate for a lake or group of lakes. \\ -LKE & constant & ifno or boundname & -- & Simulated energy constant-flow rate for a lake or group of lakes. \\ -LKE & from-mvr & ifno or boundname & -- & Simulated energy inflow into a lake or group of lakes from the MVE package. Energy inflow is calculated as the product of provider temperature and the mover flow rate. \\ +LKE & temperature & lakeno or boundname & -- & Lake temperature. If boundname is specified, boundname must be unique for each lake. \\ +LKE & flow-ja-face & lakeno or boundname & lakeno or -- & Energy flow between two lakes connected by an outlet. If more than one outlet is used to connect the same two lakes, then the energy flow for only the first outlet can be observed. If a boundname is specified for ID1, then the result is the total energy flow for all outlets for a lake. If a boundname is specified for ID1 then ID2 is not used.\\ +LKE & storage & lakeno or boundname & -- & Simulated energy storage flow rate for a lake or group of lakes. \\ +LKE & constant & lakeno or boundname & -- & Simulated energy constant-flow rate for a lake or group of lakes. \\ +LKE & from-mvr & lakeno or boundname & -- & Simulated energy inflow into a lake or group of lakes from the MVE package. Energy inflow is calculated as the product of provider temperature and the mover flow rate. \\ LKE & to-mvr & outletno or boundname & -- & Energy outflow from a lake outlet, a lake, or a group of lakes that is available for the MVR package. If boundname is not specified for ID, then the outflow available for the MVR package from a specific lake outlet is observed. In this case, ID is the outlet number, which must be between 1 and NOUTLETS. \\ -LKE & lkt & ifno or boundname & \texttt{iconn} or -- & Energy flow rate for a lake or group of lakes and its aquifer connection(s). If boundname is not specified for ID, then the simulated lake-aquifer flow rate at a specific lake connection is observed. In this case, ID2 must be specified and is the connection number \texttt{iconn} for lake \texttt{ifno}. \\ +LKE & lke & lakeno or boundname & \texttt{iconn} or -- & Energy flow rate for a lake or group of lakes and its aquifer connection(s). If boundname is not specified for ID, then the simulated lake-aquifer flow rate at a specific lake connection is observed. In this case, ID2 must be specified and is the connection number \texttt{iconn} for lake \texttt{lakeno}. \\ %observations specific to the lake package % rainfall evaporation runoff ext-inflow withdrawal outflow -LKE & rainfall & ifno or boundname & -- & Rainfall rate applied to a lake or group of lakes multiplied by the rainfall temperature. \\ -LKE & evaporation & ifno or boundname & -- & Simulated evaporation rate from a lake or group of lakes multiplied by latent heat of vaporization, heat capcity of the simulated fluid, and the density of the simulated fluid. \\ -LKE & runoff & ifno or boundname & -- & Runoff rate applied to a lake or group of lakes multiplied by the runoff temperature. \\ -LKE & ext-inflow & ifno or boundname & -- & Energy inflow into a lake or group of lakes calculated as the external inflow rate multiplied by the inflow temperature. \\ -LKE & withdrawal & ifno or boundname & -- & Specified withdrawal rate from a lake or group of lakes multiplied by the simulated lake temperature. \\ -LKE & ext-outflow & ifno or boundname & -- & External outflow from a lake or a group of lakes, through their outlets, to an external boundary. If the water mover is active, the reported ext-outflow value plus the rate to mover is equal to the total outlet outflow. +LKE & rainfall & lakeno or boundname & -- & Rainfall rate applied to a lake or group of lakes multiplied by the rainfall temperature. \\ +LKE & evaporation & lakeno or boundname & -- & Simulated evaporation rate from a lake or group of lakes multiplied by the latent heat of evaporation for determining the energy lost from a lake. \\ +LKE & runoff & lakeno or boundname & -- & Runoff rate applied to a lake or group of lakes multiplied by the runoff temperature. \\ +LKE & ext-inflow & lakeno or boundname & -- & Energy inflow into a lake or group of lakes calculated as the external inflow rate multiplied by the inflow temperature. \\ +LKE & withdrawal & lakeno or boundname & -- & Specified withdrawal rate from a lake or group of lakes multiplied by the simulated lake temperature. \\ +LKE & ext-outflow & lakeno or boundname & -- & External outflow from a lake or a group of lakes, through their outlets, to an external boundary. If the water mover is active, the reported ext-outflow value plus the rate to mover is equal to the total outlet outflow. -%LKE & outlet-inflow & ifno or boundname & -- & Simulated inflow from upstream lake outlets into a lake or group of lakes. \\ -%LKE & inflow & ifno or boundname & -- & Sum of specified inflow and simulated inflow from upstream lake outlets into a lake or group of lakes. \\ -%LKE & outlet & outletno or boundname & -- & Simulate outlet flow rate from a lake outlet, a lake, or a group of lakes. If boundname is not specified for ID, then the flow from a specific lake outlet is observed. In this case, ID is the outlet number outletno. \\ -%LKE & volume & ifno or boundname & -- & Simulated lake volume or group of lakes. \\ -%LKE & surface-area & ifno or boundname & -- & Simulated surface area for a lake or group of lakes. \\ -%LKE & wetted-area & ifno or boundname & \texttt{iconn} or -- & Simulated wetted-area for a lake or group of lakes and its aquifer connection(s). If boundname is not specified for ID, then the wetted area of a specific lake connection is observed. In this case, ID2 must be specified and is the connection number \texttt{iconn}. \\ -%LKE & conductance & ifno or boundname & \texttt{iconn} or -- & Calculated conductance for a lake or group of lakes and its aquifer connection(s). If boundname is not specified for ID, then the calculated conductance of a specific lake connection is observed. In this case, ID2 must be specified and is the connection number \texttt{iconn}. diff --git a/doc/mf6io/gwe/gwe.tex b/doc/mf6io/gwe/gwe.tex index 2655c0d07e5..6840cf3baa1 100644 --- a/doc/mf6io/gwe/gwe.tex +++ b/doc/mf6io/gwe/gwe.tex @@ -129,6 +129,10 @@ \subsection{Energy Source Loading (ESL) Package} \subsection{Streamflow Energy Transport (SFE) Package} \input{gwe/sfe} +\newpage +\subsection{Lake Energy Transport (LKE) Package} +\input{gwe/lke} + \newpage \subsection{Flow Model Interface (FMI) Package} \input{gwe/fmi} diff --git a/doc/mf6io/gwe/lke.tex b/doc/mf6io/gwe/lke.tex new file mode 100644 index 00000000000..4b9e28581c5 --- /dev/null +++ b/doc/mf6io/gwe/lke.tex @@ -0,0 +1,55 @@ +Lake Energy Transport (LKE) Package information is read from the file that is specified by ``LKE6'' as the file type. There can be as many LKE Packages as necessary for a GWE model. Each LKE Package is designed to work with flows from a single corresponding GWF LAK Package. By default \mf uses the LKE package name to determine which LAK Package corresponds to the LKE Package. Therefore, the package name of the LKE Package (as specified in the GWE name file) must match with the name of the corresponding LAK Package (as specified in the GWF name file). Alternatively, the name of the flow package can be specified using the FLOW\_PACKAGE\_NAME keyword in the options block. The GWE LKE Package cannot be used without a corresponding GWF LAK Package. + +The LKE Package does not have a dimensions block; instead, dimensions for the LKE Package are set using the dimensions from the corresponding LAK Package. For example, the LAK Package requires specification of the number of lakes (NLAKES). LKE sets the number of lakes equal to NLAKES. Therefore, the PACKAGEDATA block below must have NLAKES entries in it. + +\vspace{5mm} +\subsubsection{Structure of Blocks} +\lstinputlisting[style=blockdefinition]{./mf6ivar/tex/gwe-lke-options.dat} +\lstinputlisting[style=blockdefinition]{./mf6ivar/tex/gwe-lke-packagedata.dat} +\lstinputlisting[style=blockdefinition]{./mf6ivar/tex/gwe-lke-period.dat} + +\vspace{5mm} +\subsubsection{Explanation of Variables} +\begin{description} +\input{./mf6ivar/tex/gwe-lke-desc.tex} +\end{description} + +\vspace{5mm} +\subsubsection{Example Input File} +\lstinputlisting[style=inputfile]{./mf6ivar/examples/gwe-lke-example.dat} + +\vspace{5mm} +\subsubsection{Available observation types} +Lake Energy Transport Package observations include lake temperature and all of the terms that contribute to the continuity equation for each lake. Additional LKE Package observations include energy flow rates for individual outlets, lakes, or groups of lakes (\texttt{outlet}). The data required for each LKE Package observation type is defined in table~\ref{table:gwe-lkeobstype}. Negative and positive values for \texttt{lke} observations represent a loss from and gain to the GWE model, respectively. For all other flow terms, negative and positive values represent a loss from and gain from the LKE package, respectively. + +\begin{longtable}{p{2cm} p{2.75cm} p{2cm} p{1.25cm} p{7cm}} +\caption{Available LKE Package observation types} \tabularnewline + +\hline +\hline +\textbf{Stress Package} & \textbf{Observation type} & \textbf{ID} & \textbf{ID2} & \textbf{Description} \\ +\hline +\endfirsthead + +\captionsetup{textformat=simple} +\caption*{\textbf{Table \arabic{table}.}{\quad}Available LKE Package observation types.---Continued} \tabularnewline + +\hline +\hline +\textbf{Stress Package} & \textbf{Observation type} & \textbf{ID} & \textbf{ID2} & \textbf{Description} \\ +\hline +\endhead + + +\hline +\endfoot + +\input{../Common/gwe-lkeobs.tex} +\label{table:gwe-lkeobstype} +\end{longtable} + +\vspace{5mm} +\subsubsection{Example Observation Input File} +\lstinputlisting[style=inputfile]{./mf6ivar/examples/gwe-lke-example-obs.dat} + + diff --git a/doc/mf6io/gwe/namefile.tex b/doc/mf6io/gwe/namefile.tex index 613065d678b..12afbd6b30e 100644 --- a/doc/mf6io/gwe/namefile.tex +++ b/doc/mf6io/gwe/namefile.tex @@ -35,6 +35,7 @@ \subsubsection{Explanation of Variables} CTP6 & Constant Temperature Package & * \\ ESL6 & Energy Source Loading Package & * \\ SFE6 & Streamflow Energy Transport Package & * \\ +LKE6 & Lake Energy Transport Package & * \\ OBS6 & Observations Option \\ \hline \end{tabular*} diff --git a/doc/mf6io/mf6io_copy.bbl b/doc/mf6io/mf6io_copy.bbl new file mode 100644 index 00000000000..9a3a5427419 --- /dev/null +++ b/doc/mf6io/mf6io_copy.bbl @@ -0,0 +1,289 @@ +\begin{thebibliography}{41} +\providecommand{\natexlab}[1]{#1} +\expandafter\ifx\csname urlstyle\endcsname\relax + \providecommand{\doi}[1]{doi:\discretionary{}{}{}#1}\else + \providecommand{\doi}{doi:\discretionary{}{}{}\begingroup + \urlstyle{rm}\Url}\fi + +\bibitem[{Anderman and Hill(2000)}]{anderman2000modflow} +Anderman, E.R., and Hill, M.C., 2000, MODFLOW-2000, the U.S. Geological Survey + modular ground-water model-documentation of the Hydrogeologic-Unit Flow (HUF) + Package: {U.S. Geological Survey Open-File Report 2000--342, 89 p.} + +\bibitem[{Anderman and Hill(2003)}]{anderman2003modflow} +Anderman, E.R., and Hill, M.C., 2003, MODFLOW-2000, the U.S. Geological Survey + modular ground-water model---Three additions to the Hydrogeologic-Unit Flow + (HUF) Package: Alternative storage for the uppermost active cells, flows in + hydrogeologic units, and the hydraulic-conductivity depth-dependence (KDEP) + capability: {U.S. Geological Survey Open-File Report 2003--347, 36 p.} + +\bibitem[{Bakker and others(2013)Bakker, Schaars, Hughes, Langevin, and + Dausman}]{bakker2013documentation} +Bakker, Mark, Schaars, Frans, Hughes, J.D., Langevin, C.D., and Dausman, A.M., + 2013, Documentation of the seawater intrusion (SWI2) package for MODFLOW: + {U.S. Geological Survey Techniques and Methods, book 6, chap. A46, 47 p.}, + accessed June 27, 2017, at \url{https://pubs.er.usgs.gov/publication/tm6A46}. + +\bibitem[{Banta(2000)}]{modflowdrtpack} +Banta, E.R., 2000, MODFLOW-2000, the U.S. Geological Survey Modular + Ground-Water Model; documentation of packages for simulating + evapotranspiration with a segmented function (ETS1) and drains with return + flow (DRT1): {U.S. Geological Survey Open File Report 2000--466, 127 p}. + +\bibitem[{Banta(2011)}]{banta2011modflow} +Banta, E.R., 2011, MODFLOW-CDSS, a version of MODFLOW-2005 with modifications + for Colorado Decision Support Systems: {U.S. Geological Survey Open-File + Report 2011--1213, 19 p.}, accessed June 27, 2017, at + \url{https://pubs.er.usgs.gov/publication/ofr20111213}. + +\bibitem[{Bedekar and others(2016)Bedekar, Morway, Langevin, and + Tonkin}]{mt3dusgs} +Bedekar, Vivek, Morway, E.D., Langevin, C.D., and Tonkin, M.J., 2016, MT3D-USGS + version 1: A U.S. Geological Survey release of MT3DMS updated with new and + expanded transport capabilities for use with MODFLOW: {U.S. Geological Survey + Techniques and Methods, book 6, chap. A53, 69 p.}, + \url{https://doi.org/10.3133/tm6a53}, \url{http://dx.doi.org/10.3133/tm6A53}. + +\bibitem[{Fenske and others(1996)Fenske, Leake, and + Prudic}]{fenske1996documentation} +Fenske, J.P., Leake, S.A., and Prudic, D.E., 1996, Documentation of a computer + program (RES1) to simulate leakage from reservoirs using the modular + finite-difference ground-water flow model (MODFLOW): {U.S. Geological Survey + Open-File Report 96--364, 51 p.}, accessed June 27, 2017, at + \url{https://pubs.er.usgs.gov/publication/ofr96364}. + +\bibitem[{Halford and Hanson(2002)}]{halford2002} +Halford, K.J., and Hanson, R.T., 2002, User guide for the drawdown-limited, + multi-node well (MNW) package for the U.S. Geological Survey's modular + three-dimensional finite-difference ground-water flow model, versions + MODFLOW-96 and MODFLOW-2000: {U.S. Geological Survey Open-File Report + 02--293, 33 p.} + +\bibitem[{Hanson and Leake(1999)}]{hanson1999documentation} +Hanson, R.T., and Leake, S.A., 1999, Documentation for HYDMOD---A program for + extracting and processing time-series data from the U.S. Geological Survey's + modular three-dimensional finite-difference ground-water flow model: {U.S. + Geological Survey Open-File Report 98--564, 57 p.}, accessed June 27, 2017, + at \url{https://pubs.er.usgs.gov/publication/ofr98564}. + +\bibitem[{Harbaugh(2005)}]{modflow2005} +Harbaugh, A.W., 2005, MODFLOW-2005, the U.S. Geological Survey modular + ground-water model---the Ground-Water Flow Process: {U.S. Geological Survey + Techniques and Methods, book 6, chap. A16, variously paged}, accessed June + 27, 2017, at \url{https://pubs.usgs.gov/tm/2005/tm6A16/}. + +\bibitem[{Healy and Ronan(1996)}]{healy1996} +Healy, R.W., and Ronan, A.D., 1996, Documentation of Computer Program VS2DH for + Simulation of Energy Transport in Variably Saturated Porous Media: + Modification of the U.S. Geological Survey's Computer Program VS2DT: {U.S. + Geological Survey Water-Resources Investigation Report 96-4230, 36 p.}, + accessed September 27, 2022, at \url{https://doi.org/10.3133/wri964230}, at + \url{https://pubs.usgs.gov/wri/1996/4230/report.pdf}. + +\bibitem[{Hecht-Mendez and others(2010)Hecht-Mendez, Molina-Giraldo, Blum, and + Bayer}]{hechtmendez} +Hecht-Mendez, J., Molina-Giraldo, N., Blum, P., and Bayer, P., 2010, Evaluating + mt3dms for heat transport simulation of closed geothermal systems: + Groundwater, v.~48, no.~5, p.~741--756, + \url{https://doi.org/10.1111/j.1745-6584.2010.00678.x}. + +\bibitem[{Hill(1990)}]{hill1990preconditioned} +Hill, M.C., 1990, Preconditioned Conjugate-Gradient 2 (PCG2), a computer + program for solving ground-water flow equations: {U.S. Geological Survey + Water-Resources Investigations Report 90--4048, 25 p.}, accessed June 27, + 2017, at \url{https://pubs.usgs.gov/wri/wrir_90-4048}. + +\bibitem[{Hill and others(2000)Hill, Banta, Harbaugh, and + Anderman}]{hill2000modflow} +Hill, M.C., Banta, E.R., Harbaugh, A.W., and Anderman, E.R., 2000, + MODFLOW-2000, the U.S. Geological Survey modular ground-water model---User + guide to the observation, sensitivity, and parameter-estimation processes and + three post-processing programs: {U.S. Geological Survey Open-File Report + 00--184, 210 p.} + +\bibitem[{Hoffmann and others(2003)Hoffmann, Leake, Galloway, and + Wilson}]{hoffmann2003modflow} +Hoffmann, J{\"o}rn, Leake, S.A., Galloway, D.L., and Wilson, A.M., 2003, + MODFLOW-2000 Ground-Water Model---User Guide to the Subsidence and + Aquifer-System Compaction (SUB) Package: {U.S. Geological Survey Open-File + Report 03--233, 44 p.}, accessed June 27, 2017, at + \url{https://pubs.usgs.gov/of/2003/ofr03-233/}. + +\bibitem[{Hsieh and Freckleton(1993)}]{hsieh1993hfb} +Hsieh, P.A., and Freckleton, J.R., 1993, Documentation of a computer program to + simulate horizontal-flow barriers using the U.S. Geological Survey's modular + three-dimensional finite-difference ground-water flow model: {U.S. Geological + Survey Open-File Report 92--477, 32 p.}, accessed June 27, 2017, at + \url{https://pubs.er.usgs.gov/publication/ofr92477}. + +\bibitem[{Hughes and others(2012)Hughes, Langevin, Chartier, and + White}]{hughes2012documentation} +Hughes, J.D., Langevin, C.D., Chartier, K.L., and White, J.T., 2012, + Documentation of the Surface-Water Routing (SWR1) Process for modeling + surface-water flow with the U.S. Geological Survey modular groundwater model + (MODFLOW-2005): {U.S. Geological Survey Techniques and Methods, book 6, chap. + A40 (Version 1.0), 113 p.}, accessed June 27, 2017, at + \url{https://pubs.usgs.gov/tm/6a40/}. + +\bibitem[{Hughes and others(2017)Hughes, Langevin, and + Banta}]{modflow6framework} +Hughes, J.D., Langevin, C.D., and Banta, E.R., 2017, Documentation for the + MODFLOW 6 framework: {U.S. Geological Survey Techniques and Methods, book 6, + chap. A57, 36 p.}, \url{https://doi.org/10.3133/tm6A57}. + +\bibitem[{Hughes and others(2022{\natexlab{a}})Hughes, Russcher, Langevin, + Morway, and McDonald}]{modflow6api} +Hughes, J.D., Russcher, M.J., Langevin, C.D., Morway, E.D., and McDonald, R.R., + 2022{\natexlab{a}}, The {MODFLOW Application Programming Interface} for + simulation control and software interoperability: Environmental Modelling \& + Software, v. 148, 105257, + \url{https://doi.org/10.1016/j.envsoft.2021.105257}. + +\bibitem[{Hughes and others(2022{\natexlab{b}})Hughes, Leake, Galloway, and + White}]{modflow6csub} +Hughes, J.D., Leake, S.A., Galloway, D.L., and White, J.T., 2022{\natexlab{b}}, + Documentation for the Skeletal Storage, Compaction, and Subsidence (CSUB) + Package of MODFLOW 6: {U.S. Geological Survey Techniques and Methods, book 6, + chap. A62, 57 p.}, \url{https://doi.org/10.3133/tm6A62}. + +\bibitem[{Kipp(1987)}]{kipp1987} +Kipp, K.L., 1987, HST3D: A Computer Code for Simulation of Heat and Solute + Transport in Three-Dimensional Ground-Water Flow Systems: {U.S. Geological + Survey Water-Resources Investigation Report 86-4095, 517 p.}, accessed + September 27, 2022, at \url{https://pubs.usgs.gov/wri/1986/4095/report.pdf}. + +\bibitem[{Konikow and others(2009)Konikow, Hornberger, Halford, and + Hanson}]{konikow2009} +Konikow, L.F., Hornberger, G.Z., Halford, K.J., and Hanson, R.T., 2009, Revised + multi-node well (MNW2) package for MODFLOW ground-water flow model: {U.S. + Geological Survey Techniques and Methods, book 6, chap. A30, 67 p.}, accessed + June 27, 2017, at \url{https://pubs.usgs.gov/tm/tm6a30/}. + +\bibitem[{Langevin and others(2008)Langevin, Thorne~Jr, Dausman, Sukop, and + Guo}]{langevin2008seawat} +Langevin, C.D., Thorne~Jr, D.T., Dausman, A.M., Sukop, M.C., and Guo, Weixing, + 2008, {SEAWAT} Version 4---A computer program for simulation of multi-species + solute and heat transport: {U.S. Geological Survey Techniques and Methods, + book 6, chap. A22, 39 p.}, accessed June 27, 2017, at + \url{https://pubs.er.usgs.gov/publication/tm6A22}. + +\bibitem[{Langevin and others(2017)Langevin, Hughes, Provost, Banta, Niswonger, + and Panday}]{modflow6gwf} +Langevin, C.D., Hughes, J.D., Provost, A.M., Banta, E.R., Niswonger, R.G., and + Panday, Sorab, 2017, Documentation for the MODFLOW 6 Groundwater Flow (GWF) + Model: {U.S. Geological Survey Techniques and Methods, book 6, chap. A55, 197 + p.}, \url{https://doi.org/10.3133/tm6A55}. + +\bibitem[{Langevin and others(2020)Langevin, Panday, and + Provost}]{langevin2020hydraulic} +Langevin, C.D., Panday, Sorab, and Provost, A.M., 2020, Hydraulic-head + formulation for density-dependent flow and transport: Groundwater, v.~58, + no.~3, p.~349--362. + +\bibitem[{Langevin and others(2022)Langevin, Provost, Panday, and + Hughes}]{modflow6gwt} +Langevin, C.D., Provost, A.M., Panday, Sorab, and Hughes, J.D., 2022, + Documentation for the MODFLOW 6 Groundwater Transport (GWT) Model: {U.S. + Geological Survey Techniques and Methods, book 6, chap. A61, 56 p.}, + \url{https://doi.org/10.3133/tm6A61}. + +\bibitem[{Leake and Galloway(2007)}]{leake2007modflow} +Leake, S.A., and Galloway, D.L., 2007, MODFLOW Ground-water model---User guide + to the Subsidence and Aquifer-System Compaction Package (SUB-WT) for + Water-Table Aquifers: {U.S. Geological Survey Techniques and Methods, book 6, + chap. A23, 42 p.}, accessed June 27, 2017, at + \url{https://pubs.er.usgs.gov/publication/tm6A23}. + +\bibitem[{Leake and Lilly(1997)}]{leake1997documentation} +Leake, S.A., and Lilly, M.R., 1997, Documentation of computer program (FHB1) + for assignment of transient specified-flow and specified-head boundaries in + applications of the modular finite-diference ground-water flow model + (MODFLOW): {U.S. Geological Survey Open-File Report 97--571, 50 p.}, accessed + June 27, 2017, at \url{https://pubs.er.usgs.gov/publication/ofr97571}. + +\bibitem[{Ma and Zheng(2010)}]{mazheng2010} +Ma, Rui, and Zheng, Chunmiao, 2010, Effects of density and viscosity in + modeling heat as a groundwater tracer: Groundwater, v.~48, no.~3, + p.~380--389, \url{https://doi.org/10.1111/j.1745-6584.2009.00660.x}. + +\bibitem[{Maddock and others(2012)Maddock, Baird, Hanson, Schmid, and + Ajami}]{modflowripetpack} +Maddock, Thomas, III, Baird, K.J., Hanson, R.T., Schmid, Wolfgang, and Ajami, + Hoori, 2012, RIP-ET---A Riparian Evapotranspiration Package for MODFLOW-2005: + {U.S. Geological Survey Techniques and Methods, book 6, chap. A39, 76 p.}, + accessed June 27, 2017, at \url{https://pubs.usgs.gov/tm/tm6a39/}. + +\bibitem[{Merritt and Konikow(2000)}]{modflowlak3pack} +Merritt, M.L., and Konikow, L.F., 2000, Documentation of a computer program to + simulate lake-aquifer interaction using the MODFLOW ground-water flow model + and the MOC3D solute-transport model: {U.S. Geological Survey Water-Resources + Investigations Report 00--4167, 146 p.}, accessed June 27, 2017, at + \url{https://pubs.er.usgs.gov/publication/wri004167}. + +\bibitem[{Niswonger and Prudic(2005)}]{modflowsfr2pack} +Niswonger, R.G., and Prudic, D.E., 2005, Documentation of the + Streamflow-Routing (SFR2) Package to include unsaturated flow beneath + streams---A modification to SFR1: {U.S. Geological Survey Techniques and + Methods, book 6, chap. A13, 50 p.}, accessed June 27, 2017, at + \url{https://pubs.er.usgs.gov/publication/tm6A13}. + +\bibitem[{Niswonger and others(2006)Niswonger, Prudic, and Regan}]{UZF} +Niswonger, R.G., Prudic, D.E., and Regan, R.S., 2006, Documentation of the + Unsaturated-Zone Flow (UZF1) Package for modeling unsaturated flow between + the land surface and the water table with {MODFLOW}-2005: {U.S. Geological + Survey Techniques and Methods, book 6, chap. A19, 62 p.}, accessed June 27, + 2017, at \url{https://pubs.usgs.gov/tm/2006/tm6a19/}. + +\bibitem[{Panday and others(2013)Panday, Langevin, Niswonger, Ibaraki, and + Hughes}]{modflowusg} +Panday, Sorab, Langevin, C.D., Niswonger, R.G., Ibaraki, Motomu, and Hughes, + J.D., 2013, MODFLOW-USG version 1---An unstructured grid version of MODFLOW + for simulating groundwater flow and tightly coupled processes using a control + volume finite-difference formulation: {U.S. Geological Survey Techniques and + Methods, book 6, chap. A45, 66 p.}, accessed June 27, 2017, at + \url{https://pubs.usgs.gov/tm/06/a45/}. + +\bibitem[{Provost and others(2017)Provost, Langevin, and Hughes}]{modflow6xt3d} +Provost, A.M., Langevin, C.D., and Hughes, J.D., 2017, Documentation for the + ``XT3D'' Option in the Node Property Flow (NPF) Package of MODFLOW 6: {U.S. + Geological Survey Techniques and Methods, book 6, chap. A56, 46 p.}, + \url{https://doi.org/10.3133/tm6A56}. + +\bibitem[{Prudic(1989)}]{prudic1989str} +Prudic, D.E., 1989, Documentation of a computer program to simulate + stream-aquifer relations using a modular, finite-difference, ground-water + flow model: {U.S. Geological Survey Open-File Report 88--729, 113 p.}, + accessed June 27, 2017, at + \url{https://pubs.er.usgs.gov/publication/ofr88729}. + +\bibitem[{Prudic and others(2004)Prudic, Konikow, and Banta}]{modflowsfr1pack} +Prudic, D.E., Konikow, L.F., and Banta, E.R., 2004, A New Streamflow-Routing + (SFR1) Package to simulate stream-aquifer interaction with MODFLOW-2000: + {U.S. Geological Survey Open File Report 2004--1042, 104 p.}, accessed June + 27, 2017, at \url{https://pubs.er.usgs.gov/publication/ofr20041042}. + +\bibitem[{Voss(1984)}]{Voss1984sutra} +Voss, C.I., 1984, SUTRA---A finite-element simulation model for + saturated-unsaturated fluid-density-dependent ground-water flow with energy + transport or chemically-reactive single-species solute transport: {U.S. + Geological Survey Water-Resources Investigations Report 84--4369, 409 p.} + +\bibitem[{Zheng(2010)}]{zheng2010supplemental} +Zheng, Chunmiao, 2010, MT3DMS v5.3, Supplemental User's Guide: {Technical + Report Prepared for the U.S. Army Corps of Engineers, 51 p.} + +\bibitem[{Zheng and Wang(1999)}]{zheng1999mt3dms} +Zheng, Chunmiao, and Wang, P.P., 1999, MT3DMS---A modular three-dimensional + multi-species transport model for simulation of advection, dispersion and + chemical reactions of contaminants in groundwater systems; Documentation and + user's guide: {Contract report SERDP--99--1: Vicksburg, Miss., U.S. Army + Engineer Research and Development Center, 169 p.} + +\bibitem[{Zheng and others(2001)Zheng, Hill, and Hsieh}]{zheng2001modflow} +Zheng, Chunmiao, Hill, M.C., and Hsieh, P.A., 2001, MODFLOW-2000, the U.S. + Geological Survey Modular Ground-Water Model---User guide to the LMT6 + package, the linkage with MT3DMS for multi-species mass transport modeling: + {U.S. Geological Survey Open-File Report 01--82, 43 p.}, accessed June 27, + 2017, at \url{https://pubs.er.usgs.gov/publication/ofr0182}. + +\end{thebibliography} diff --git a/doc/mf6io/mf6ivar/dfn/gwe-lke.dfn b/doc/mf6io/mf6ivar/dfn/gwe-lke.dfn new file mode 100644 index 00000000000..b59b50420b2 --- /dev/null +++ b/doc/mf6io/mf6ivar/dfn/gwe-lke.dfn @@ -0,0 +1,481 @@ +# --------------------- gwe lke options --------------------- +# flopy multi-package + +block options +name flow_package_name +type string +shape +reader urword +optional true +longname keyword to specify name of corresponding flow package +description keyword to specify the name of the corresponding flow package. If not specified, then the corresponding flow package must have the same name as this advanced transport package (the name associated with this package in the GWE name file). + +block options +name auxiliary +type string +shape (naux) +reader urword +optional true +longname keyword to specify aux variables +description REPLACE auxnames {'{#1}': 'Groundwater Energy Transport'} + +block options +name flow_package_auxiliary_name +type string +shape +reader urword +optional true +longname keyword to specify name of temperature auxiliary variable in flow package +description keyword to specify the name of an auxiliary variable in the corresponding flow package. If specified, then the simulated temperatures from this advanced transport package will be copied into the auxiliary variable specified with this name. Note that the flow package must have an auxiliary variable with this name or the program will terminate with an error. If the flows for this advanced transport package are read from a file, then this option will have no effect. + +block options +name boundnames +type keyword +shape +reader urword +optional true +longname +description REPLACE boundnames {'{#1}': 'lake'} + +block options +name print_input +type keyword +reader urword +optional true +longname print input to listing file +description REPLACE print_input {'{#1}': 'lake'} + +block options +name print_temperature +type keyword +reader urword +optional true +longname print calculated temperatures to listing file +description REPLACE print_temperature {'{#1}': 'lake', '{#2}': 'temperature', '{#3}': 'TEMPERATURE'} + +block options +name print_flows +type keyword +reader urword +optional true +longname print calculated flows to listing file +description REPLACE print_flows {'{#1}': 'lake'} + +block options +name save_flows +type keyword +reader urword +optional true +longname save lake flows to budget file +description REPLACE save_flows {'{#1}': 'lake'} + +block options +name temperature_filerecord +type record temperature fileout tempfile +shape +reader urword +tagged true +optional true +longname +description + +block options +name temperature +type keyword +shape +in_record true +reader urword +tagged true +optional false +longname stage keyword +description keyword to specify that record corresponds to temperature. + +block options +name tempfile +type string +preserve_case true +shape +in_record true +reader urword +tagged false +optional false +longname file keyword +description name of the binary output file to write temperature information. + +block options +name budget_filerecord +type record budget fileout budgetfile +shape +reader urword +tagged true +optional true +longname +description + +block options +name budget +type keyword +shape +in_record true +reader urword +tagged true +optional false +longname budget keyword +description keyword to specify that record corresponds to the budget. + +block options +name fileout +type keyword +shape +in_record true +reader urword +tagged true +optional false +longname file keyword +description keyword to specify that an output filename is expected next. + +block options +name budgetfile +type string +preserve_case true +shape +in_record true +reader urword +tagged false +optional false +longname file keyword +description name of the binary output file to write budget information. + +block options +name budgetcsv_filerecord +type record budgetcsv fileout budgetcsvfile +shape +reader urword +tagged true +optional true +longname +description + +block options +name budgetcsv +type keyword +shape +in_record true +reader urword +tagged true +optional false +longname budget keyword +description keyword to specify that record corresponds to the budget CSV. + +block options +name budgetcsvfile +type string +preserve_case true +shape +in_record true +reader urword +tagged false +optional false +longname file keyword +description name of the comma-separated value (CSV) output file to write budget summary information. A budget summary record will be written to this file for each time step of the simulation. + +block options +name ts_filerecord +type record ts6 filein ts6_filename +shape +reader urword +tagged true +optional true +longname +description + +block options +name ts6 +type keyword +shape +in_record true +reader urword +tagged true +optional false +longname head keyword +description keyword to specify that record corresponds to a time-series file. + +block options +name filein +type keyword +shape +in_record true +reader urword +tagged true +optional false +longname file keyword +description keyword to specify that an input filename is expected next. + +block options +name ts6_filename +type string +preserve_case true +in_record true +reader urword +optional false +tagged false +longname file name of time series information +description REPLACE timeseriesfile {} + +block options +name obs_filerecord +type record obs6 filein obs6_filename +shape +reader urword +tagged true +optional true +longname +description + +block options +name obs6 +type keyword +shape +in_record true +reader urword +tagged true +optional false +longname obs keyword +description keyword to specify that record corresponds to an observations file. + +block options +name obs6_filename +type string +preserve_case true +in_record true +tagged false +reader urword +optional false +longname obs6 input filename +description REPLACE obs6_filename {'{#1}': 'LKE'} + + +# --------------------- gwe lke packagedata --------------------- + +block packagedata +name packagedata +type recarray lakeno strt ktf rbthcnd aux boundname +shape (maxbound) +reader urword +longname +description + +block packagedata +name lakeno +type integer +shape +tagged false +in_record true +reader urword +longname lake number for this entry +description integer value that defines the lake number associated with the specified PACKAGEDATA data on the line. LAKENO must be greater than zero and less than or equal to NLAKES. Lake information must be specified for every lake or the program will terminate with an error. The program will also terminate with an error if information for a lake is specified more than once. +numeric_index true + +block packagedata +name strt +type double precision +shape +tagged false +in_record true +reader urword +longname starting lake temperature +description real value that defines the starting temperature for the lake. + +block packagedata +name ktf +type double precision +shape +tagged false +in_record true +reader urword +longname boundary thermal conductivity +description is the thermal conductivity of the of the interface between the aquifer cell and the lake. + +block packagedata +name rbthcnd +type double precision +shape +tagged false +in_record true +reader urword +longname streambed thickness +description real value that defines the thickness of the lakebed material through which conduction occurs. Must be greater than 0. + +block packagedata +name aux +type double precision +in_record true +tagged false +shape (naux) +reader urword +time_series true +optional true +longname auxiliary variables +description REPLACE aux {'{#1}': 'lake'} + +block packagedata +name boundname +type string +shape +tagged false +in_record true +reader urword +optional true +longname lake name +description REPLACE boundname {'{#1}': 'lake'} + + +# --------------------- gwe lke period --------------------- + +block period +name iper +type integer +block_variable True +in_record true +tagged false +shape +valid +reader urword +optional false +longname stress period number +description REPLACE iper {} + +block period +name lakeperioddata +type recarray lakeno laksetting +shape +reader urword +longname +description + +block period +name lakeno +type integer +shape +tagged false +in_record true +reader urword +longname lake number for this entry +description integer value that defines the lake number associated with the specified PERIOD data on the line. LAKENO must be greater than zero and less than or equal to NLAKES. +numeric_index true + +block period +name laksetting +type keystring status temperature rainfall evaporation runoff ext-inflow auxiliaryrecord +shape +tagged false +in_record true +reader urword +longname +description line of information that is parsed into a keyword and values. Keyword values that can be used to start the LAKSETTING string include: STATUS, TEMPERATURE, RAINFALL, EVAPORATION, RUNOFF, and AUXILIARY. These settings are used to assign the temperature associated with the corresponding flow terms. Temperatures cannot be specified for all flow terms. For example, the Lake Package supports a ``WITHDRAWAL'' flow term. If this withdrawal term is active, then water will be withdrawn from the lake at the calculated temperature of the lake. + +block period +name status +type string +shape +tagged true +in_record true +reader urword +longname lake temperature status +description keyword option to define lake status. STATUS can be ACTIVE, INACTIVE, or CONSTANT. By default, STATUS is ACTIVE, which means that temperature will be calculated for the lake. If a lake is inactive, then there will be no solute mass fluxes into or out of the lake and the inactive value will be written for the lake temperature. If a lake is constant, then the temperature for the lake will be fixed at the user specified value. + +block period +name temperature +type string +shape +tagged true +in_record true +time_series true +reader urword +longname lake temperature +description real or character value that defines the temperature for the lake. The specified TEMPERATURE is only applied if the lake is a constant temperature lake. If the Options block includes a TIMESERIESFILE entry (see the ``Time-Variable Input'' section), values can be obtained from a time series by entering the time-series name in place of a numeric value. + +block period +name rainfall +type string +shape +tagged true +in_record true +reader urword +time_series true +longname rainfall temperature +description real or character value that defines the rainfall temperature for the lake. If the Options block includes a TIMESERIESFILE entry (see the ``Time-Variable Input'' section), values can be obtained from a time series by entering the time-series name in place of a numeric value. + +block period +name evaporation +type string +shape +tagged true +in_record true +reader urword +time_series true +longname evaporation temperature +description real or character value that defines the temperature of evaporated water $(^{\circ}C)$ for the reach. If this temperature value is larger than the simulated temperature in the reach, then the evaporated water will be removed at the same temperature as the 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 +name runoff +type string +shape +tagged true +in_record true +reader urword +time_series true +longname runoff temperature +description real or character value that defines the temperature of runoff for the lake. Value must be greater than or equal to zero. If the Options block includes a TIMESERIESFILE entry (see the ``Time-Variable Input'' section), values can be obtained from a time series by entering the time-series name in place of a numeric value. + +block period +name ext-inflow +type string +shape +tagged true +in_record true +reader urword +time_series true +longname ext-inflow temperature +description real or character value that defines the temperature of external inflow for the lake. Value must be greater than or equal to zero. If the Options block includes a TIMESERIESFILE entry (see the ``Time-Variable Input'' section), values can be obtained from a time series by entering the time-series name in place of a numeric value. + +block period +name auxiliaryrecord +type record auxiliary auxname auxval +shape +tagged +in_record true +reader urword +longname +description + +block period +name auxiliary +type keyword +shape +in_record true +reader urword +longname +description keyword for specifying auxiliary variable. + +block period +name auxname +type string +shape +tagged false +in_record true +reader urword +longname +description name for the auxiliary variable to be assigned AUXVAL. AUXNAME must match one of the auxiliary variable names defined in the OPTIONS block. If AUXNAME does not match one of the auxiliary variable names defined in the OPTIONS block the data are ignored. + +block period +name auxval +type double precision +shape +tagged false +in_record true +reader urword +time_series true +longname auxiliary variable value +description value for the auxiliary variable. If the Options block includes a TIMESERIESFILE entry (see the ``Time-Variable Input'' section), values can be obtained from a time series by entering the time-series name in place of a numeric value. diff --git a/doc/mf6io/mf6ivar/examples/gwe-lke-example-obs.dat b/doc/mf6io/mf6ivar/examples/gwe-lke-example-obs.dat new file mode 100644 index 00000000000..c37a5c8f190 --- /dev/null +++ b/doc/mf6io/mf6ivar/examples/gwe-lke-example-obs.dat @@ -0,0 +1,25 @@ +BEGIN options + DIGITS 7 + PRINT_INPUT +END options + +BEGIN continuous FILEOUT gwe_lke02.lke.obs.csv + lke-1-temp TEMPERATURE 1 + lke-1-extinflow EXT-INFLOW 1 + lke-1-rain RAINFALL 1 + lke-1-roff RUNOFF 1 + lke-1-wdrl WITHDRAWAL 1 + lke-1-stor STORAGE 1 + lke-1-const CONSTANT 1 + lke-1-gwe1 LKE 1 1 + lke-1-gwe2 LKE 1 2 + lke-2-gwe1 LKE 2 1 + lke-1-mylake1 LKE MYLAKE1 + lke-1-fjf FLOW-JA-FACE 1 2 + lke-2-fjf FLOW-JA-FACE 2 1 + lke-3-fjf FLOW-JA-FACE 2 3 + lke-4-fjf FLOW-JA-FACE 3 2 + lke-5-fjf FLOW-JA-FACE MYLAKE1 + lke-6-fjf FLOW-JA-FACE MYLAKE2 + lke-7-fjf FLOW-JA-FACE MYLAKE3 +END continuous diff --git a/doc/mf6io/mf6ivar/examples/gwe-lke-example.dat b/doc/mf6io/mf6ivar/examples/gwe-lke-example.dat new file mode 100644 index 00000000000..1ffe73824fa --- /dev/null +++ b/doc/mf6io/mf6ivar/examples/gwe-lke-example.dat @@ -0,0 +1,24 @@ +BEGIN OPTIONS + AUXILIARY aux1 aux2 + BOUNDNAMES + PRINT_INPUT + PRINT_TEMPERATURE + PRINT_FLOWS + SAVE_FLOWS + TEMPERATURE FILEOUT gwe_lke_02.lke.bin + BUDGET FILEOUT gwe_lke_02.lke.bud + OBS6 FILEIN gwe_lke_02.lke.obs +END OPTIONS + +BEGIN PACKAGEDATA +# L STRT aux1 aux2 bname + 1 5.0 99.0 999.0 MYLAKE1 + 2 6.0 99.0 999.0 MYLAKE2 + 3 7.0 99.0 999.0 MYLAKE3 +END PACKAGEDATA + +BEGIN PERIOD 1 + 1 STATUS ACTIVE + 2 STATUS ACTIVE + 3 STATUS ACTIVE +END PERIOD 1 diff --git a/doc/mf6io/mf6ivar/md/mf6ivar.md b/doc/mf6io/mf6ivar/md/mf6ivar.md index ee570409435..e68ea78a611 100644 --- a/doc/mf6io/mf6ivar/md/mf6ivar.md +++ b/doc/mf6io/mf6ivar/md/mf6ivar.md @@ -1298,6 +1298,44 @@ | GWE | EST | PACKAGEDATA | RHOW | DOUBLE PRECISION | is a user-specified value of the density of water. Value will remain fixed for the entire simulation. For example, if working in SI units, values may be entered as kg/m3. | | GWE | EST | PACKAGEDATA | LATHEATVAP | DOUBLE PRECISION | is the user-specified value for the latent heat of vaporization. For example, if working in SI units, values may be entered as kJ/kg. | | GWE | IC | GRIDDATA | STRT | DOUBLE PRECISION (NODES) | is the initial (starting) temperature---that is, the temperature at the beginning of the GWE Model simulation. STRT must be specified for all GWE Model simulations. One value is read for every model cell. | +| GWE | LKE | OPTIONS | FLOW_PACKAGE_NAME | STRING | keyword to specify the name of the corresponding flow package. If not specified, then the corresponding flow package must have the same name as this advanced transport package (the name associated with this package in the GWE name file). | +| GWE | LKE | OPTIONS | AUXILIARY | STRING (NAUX) | defines an array of one or more auxiliary variable names. There is no limit on the number of auxiliary variables that can be provided on this line; however, lists of information provided in subsequent blocks must have a column of data for each auxiliary variable name defined here. The number of auxiliary variables detected on this line determines the value for naux. Comments cannot be provided anywhere on this line as they will be interpreted as auxiliary variable names. Auxiliary variables may not be used by the package, but they will be available for use by other parts of the program. The program will terminate with an error if auxiliary variables are specified on more than one line in the options block. | +| GWE | LKE | OPTIONS | FLOW_PACKAGE_AUXILIARY_NAME | STRING | keyword to specify the name of an auxiliary variable in the corresponding flow package. If specified, then the simulated temperatures from this advanced transport package will be copied into the auxiliary variable specified with this name. Note that the flow package must have an auxiliary variable with this name or the program will terminate with an error. If the flows for this advanced transport package are read from a file, then this option will have no effect. | +| GWE | LKE | OPTIONS | BOUNDNAMES | KEYWORD | keyword to indicate that boundary names may be provided with the list of lake cells. | +| GWE | LKE | OPTIONS | PRINT_INPUT | KEYWORD | keyword to indicate that the list of lake information will be written to the listing file immediately after it is read. | +| GWE | LKE | OPTIONS | PRINT_TEMPERATURE | KEYWORD | keyword to indicate that the list of lake temperature will be printed to the listing file for every stress period in which ``TEMPERATURE PRINT'' is specified in Output Control. If there is no Output Control option and PRINT\_TEMPERATURE is specified, then temperature are printed for the last time step of each stress period. | +| GWE | LKE | OPTIONS | PRINT_FLOWS | KEYWORD | keyword to indicate that the list of lake flow rates will be printed to the listing file for every stress period time step in which ``BUDGET PRINT'' is specified in Output Control. If there is no Output Control option and ``PRINT\_FLOWS'' is specified, then flow rates are printed for the last time step of each stress period. | +| GWE | LKE | OPTIONS | SAVE_FLOWS | KEYWORD | keyword to indicate that lake flow terms will be written to the file specified with ``BUDGET FILEOUT'' in Output Control. | +| GWE | LKE | OPTIONS | TEMPERATURE | KEYWORD | keyword to specify that record corresponds to temperature. | +| GWE | LKE | OPTIONS | TEMPFILE | STRING | name of the binary output file to write temperature information. | +| GWE | LKE | OPTIONS | BUDGET | KEYWORD | keyword to specify that record corresponds to the budget. | +| GWE | LKE | OPTIONS | FILEOUT | KEYWORD | keyword to specify that an output filename is expected next. | +| GWE | LKE | OPTIONS | BUDGETFILE | STRING | name of the binary output file to write budget information. | +| GWE | LKE | OPTIONS | BUDGETCSV | KEYWORD | keyword to specify that record corresponds to the budget CSV. | +| GWE | LKE | OPTIONS | BUDGETCSVFILE | STRING | name of the comma-separated value (CSV) output file to write budget summary information. A budget summary record will be written to this file for each time step of the simulation. | +| GWE | LKE | OPTIONS | TS6 | KEYWORD | keyword to specify that record corresponds to a time-series file. | +| GWE | LKE | OPTIONS | FILEIN | KEYWORD | keyword to specify that an input filename is expected next. | +| GWE | LKE | OPTIONS | TS6_FILENAME | STRING | defines a time-series file defining time series that can be used to assign time-varying values. See the ``Time-Variable Input'' section for instructions on using the time-series capability. | +| GWE | LKE | OPTIONS | OBS6 | KEYWORD | keyword to specify that record corresponds to an observations file. | +| GWE | LKE | OPTIONS | OBS6_FILENAME | STRING | name of input file to define observations for the LKE package. See the ``Observation utility'' section for instructions for preparing observation input files. Tables \ref{table:gwf-obstypetable} and \ref{table:gwt-obstypetable} lists observation type(s) supported by the LKE package. | +| GWE | LKE | PACKAGEDATA | LAKENO | INTEGER | integer value that defines the lake number associated with the specified PACKAGEDATA data on the line. LAKENO must be greater than zero and less than or equal to NLAKES. Lake information must be specified for every lake or the program will terminate with an error. The program will also terminate with an error if information for a lake is specified more than once. | +| GWE | LKE | PACKAGEDATA | STRT | DOUBLE PRECISION | real value that defines the starting temperature for the lake. | +| GWE | LKE | PACKAGEDATA | KTF | DOUBLE PRECISION | is the thermal conductivity of the of the interface between the aquifer cell and the lake. | +| GWE | LKE | PACKAGEDATA | RBTHCND | DOUBLE PRECISION | real value that defines the thickness of the lakebed material through which conduction occurs. Must be greater than 0. | +| GWE | LKE | PACKAGEDATA | AUX | DOUBLE PRECISION (NAUX) | represents the values of the auxiliary variables for each lake. The values of auxiliary variables must be present for each lake. The values must be specified in the order of the auxiliary variables specified in the OPTIONS block. If the package supports time series and the Options block includes a TIMESERIESFILE entry (see the ``Time-Variable Input'' section), values can be obtained from a time series by entering the time-series name in place of a numeric value. | +| GWE | LKE | PACKAGEDATA | BOUNDNAME | STRING | name of the lake cell. BOUNDNAME is an ASCII character variable that can contain as many as 40 characters. If BOUNDNAME contains spaces in it, then the entire name must be enclosed within single quotes. | +| GWE | LKE | PERIOD | IPER | INTEGER | integer value specifying the starting stress period number for which the data specified in the PERIOD block apply. IPER must be less than or equal to NPER in the TDIS Package and greater than zero. The IPER value assigned to a stress period block must be greater than the IPER value assigned for the previous PERIOD block. The information specified in the PERIOD block will continue to apply for all subsequent stress periods, unless the program encounters another PERIOD block. | +| GWE | LKE | PERIOD | LAKENO | INTEGER | integer value that defines the lake number associated with the specified PERIOD data on the line. LAKENO must be greater than zero and less than or equal to NLAKES. | +| GWE | LKE | PERIOD | LAKSETTING | KEYSTRING | line of information that is parsed into a keyword and values. Keyword values that can be used to start the LAKSETTING string include: STATUS, TEMPERATURE, RAINFALL, EVAPORATION, RUNOFF, and AUXILIARY. These settings are used to assign the temperature associated with the corresponding flow terms. Temperatures cannot be specified for all flow terms. For example, the Lake Package supports a ``WITHDRAWAL'' flow term. If this withdrawal term is active, then water will be withdrawn from the lake at the calculated temperature of the lake. | +| GWE | LKE | PERIOD | STATUS | STRING | keyword option to define lake status. STATUS can be ACTIVE, INACTIVE, or CONSTANT. By default, STATUS is ACTIVE, which means that temperature will be calculated for the lake. If a lake is inactive, then there will be no solute mass fluxes into or out of the lake and the inactive value will be written for the lake temperature. If a lake is constant, then the temperature for the lake will be fixed at the user specified value. | +| GWE | LKE | PERIOD | TEMPERATURE | STRING | real or character value that defines the temperature for the lake. The specified TEMPERATURE is only applied if the lake is a constant temperature lake. If the Options block includes a TIMESERIESFILE entry (see the ``Time-Variable Input'' section), values can be obtained from a time series by entering the time-series name in place of a numeric value. | +| GWE | LKE | PERIOD | RAINFALL | STRING | real or character value that defines the rainfall temperature for the lake. If the Options block includes a TIMESERIESFILE entry (see the ``Time-Variable Input'' section), values can be obtained from a time series by entering the time-series name in place of a numeric value. | +| GWE | LKE | PERIOD | EVAPORATION | STRING | real or character value that defines the temperature of evaporated water $(^{\circ}C)$ for the reach. If this temperature value is larger than the simulated temperature in the reach, then the evaporated water will be removed at the same temperature as the 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. | +| GWE | LKE | PERIOD | RUNOFF | STRING | real or character value that defines the temperature of runoff for the lake. Value must be greater than or equal to zero. If the Options block includes a TIMESERIESFILE entry (see the ``Time-Variable Input'' section), values can be obtained from a time series by entering the time-series name in place of a numeric value. | +| GWE | LKE | PERIOD | EXT-INFLOW | STRING | real or character value that defines the temperature of external inflow for the lake. Value must be greater than or equal to zero. If the Options block includes a TIMESERIESFILE entry (see the ``Time-Variable Input'' section), values can be obtained from a time series by entering the time-series name in place of a numeric value. | +| GWE | LKE | PERIOD | AUXILIARY | KEYWORD | keyword for specifying auxiliary variable. | +| GWE | LKE | PERIOD | AUXNAME | STRING | name for the auxiliary variable to be assigned AUXVAL. AUXNAME must match one of the auxiliary variable names defined in the OPTIONS block. If AUXNAME does not match one of the auxiliary variable names defined in the OPTIONS block the data are ignored. | +| GWE | LKE | PERIOD | AUXVAL | DOUBLE PRECISION | value for the auxiliary variable. If the Options block includes a TIMESERIESFILE entry (see the ``Time-Variable Input'' section), values can be obtained from a time series by entering the time-series name in place of a numeric value. | | GWE | NAM | OPTIONS | LIST | STRING | is name of the listing file to create for this GWE model. If not specified, then the name of the list file will be the basename of the GWE model name file and the ``.lst'' extension. For example, if the GWE name file is called ``my.model.nam'' then the list file will be called ``my.model.lst''. | | GWE | NAM | OPTIONS | PRINT_INPUT | KEYWORD | keyword to indicate that the list of all model stress package information will be written to the listing file immediately after it is read. | | GWE | NAM | OPTIONS | PRINT_FLOWS | KEYWORD | keyword to indicate that the list of all model package flow rates will be printed to the listing file for every stress period time step in which ``BUDGET PRINT'' is specified in Output Control. If there is no Output Control option and ``PRINT\_FLOWS'' is specified, then flow rates are printed for the last time step of each stress period. | diff --git a/doc/mf6io/mf6ivar/mf6ivar.py b/doc/mf6io/mf6ivar/mf6ivar.py index 328b3ee2d53..25d59480ac5 100644 --- a/doc/mf6io/mf6ivar/mf6ivar.py +++ b/doc/mf6io/mf6ivar/mf6ivar.py @@ -748,6 +748,7 @@ def write_appendix(texdir, allblocks): "gwe-esl", "gwe-est", "gwe-ic", + "gwe-lke", "gwe-nam", "gwe-oc", "gwe-ssm", diff --git a/doc/mf6io/mf6ivar/tex/appendixA.tex b/doc/mf6io/mf6ivar/tex/appendixA.tex index 6272dfc456b..ccdf2aab7a3 100644 --- a/doc/mf6io/mf6ivar/tex/appendixA.tex +++ b/doc/mf6io/mf6ivar/tex/appendixA.tex @@ -280,6 +280,10 @@ \hline GWE & IC & GRIDDATA & no \\ \hline +GWE & LKE & OPTIONS & yes \\ +GWE & LKE & PACKAGEDATA & yes \\ +GWE & LKE & PERIOD & yes \\ +\hline GWE & NAM & OPTIONS & yes \\ GWE & NAM & PACKAGES & yes \\ \hline diff --git a/doc/mf6io/mf6ivar/tex/gwe-lke-desc.tex b/doc/mf6io/mf6ivar/tex/gwe-lke-desc.tex new file mode 100644 index 00000000000..7a240c13d5d --- /dev/null +++ b/doc/mf6io/mf6ivar/tex/gwe-lke-desc.tex @@ -0,0 +1,101 @@ +% DO NOT MODIFY THIS FILE DIRECTLY. IT IS CREATED BY mf6ivar.py + +\item \textbf{Block: OPTIONS} + +\begin{description} +\item \texttt{flow\_package\_name}---keyword to specify the name of the corresponding flow package. If not specified, then the corresponding flow package must have the same name as this advanced transport package (the name associated with this package in the GWE name file). + +\item \texttt{auxiliary}---defines an array of one or more auxiliary variable names. There is no limit on the number of auxiliary variables that can be provided on this line; however, lists of information provided in subsequent blocks must have a column of data for each auxiliary variable name defined here. The number of auxiliary variables detected on this line determines the value for naux. Comments cannot be provided anywhere on this line as they will be interpreted as auxiliary variable names. Auxiliary variables may not be used by the package, but they will be available for use by other parts of the program. The program will terminate with an error if auxiliary variables are specified on more than one line in the options block. + +\item \texttt{flow\_package\_auxiliary\_name}---keyword to specify the name of an auxiliary variable in the corresponding flow package. If specified, then the simulated temperatures from this advanced transport package will be copied into the auxiliary variable specified with this name. Note that the flow package must have an auxiliary variable with this name or the program will terminate with an error. If the flows for this advanced transport package are read from a file, then this option will have no effect. + +\item \texttt{BOUNDNAMES}---keyword to indicate that boundary names may be provided with the list of lake cells. + +\item \texttt{PRINT\_INPUT}---keyword to indicate that the list of lake information will be written to the listing file immediately after it is read. + +\item \texttt{PRINT\_TEMPERATURE}---keyword to indicate that the list of lake temperature will be printed to the listing file for every stress period in which ``TEMPERATURE PRINT'' is specified in Output Control. If there is no Output Control option and PRINT\_TEMPERATURE is specified, then temperature are printed for the last time step of each stress period. + +\item \texttt{PRINT\_FLOWS}---keyword to indicate that the list of lake flow rates will be printed to the listing file for every stress period time step in which ``BUDGET PRINT'' is specified in Output Control. If there is no Output Control option and ``PRINT\_FLOWS'' is specified, then flow rates are printed for the last time step of each stress period. + +\item \texttt{SAVE\_FLOWS}---keyword to indicate that lake flow terms will be written to the file specified with ``BUDGET FILEOUT'' in Output Control. + +\item \texttt{TEMPERATURE}---keyword to specify that record corresponds to temperature. + +\item \texttt{tempfile}---name of the binary output file to write temperature information. + +\item \texttt{BUDGET}---keyword to specify that record corresponds to the budget. + +\item \texttt{FILEOUT}---keyword to specify that an output filename is expected next. + +\item \texttt{budgetfile}---name of the binary output file to write budget information. + +\item \texttt{BUDGETCSV}---keyword to specify that record corresponds to the budget CSV. + +\item \texttt{budgetcsvfile}---name of the comma-separated value (CSV) output file to write budget summary information. A budget summary record will be written to this file for each time step of the simulation. + +\item \texttt{TS6}---keyword to specify that record corresponds to a time-series file. + +\item \texttt{FILEIN}---keyword to specify that an input filename is expected next. + +\item \texttt{ts6\_filename}---defines a time-series file defining time series that can be used to assign time-varying values. See the ``Time-Variable Input'' section for instructions on using the time-series capability. + +\item \texttt{OBS6}---keyword to specify that record corresponds to an observations file. + +\item \texttt{obs6\_filename}---name of input file to define observations for the LKE package. See the ``Observation utility'' section for instructions for preparing observation input files. Tables \ref{table:gwf-obstypetable} and \ref{table:gwt-obstypetable} lists observation type(s) supported by the LKE package. + +\end{description} +\item \textbf{Block: PACKAGEDATA} + +\begin{description} +\item \texttt{lakeno}---integer value that defines the lake number associated with the specified PACKAGEDATA data on the line. LAKENO must be greater than zero and less than or equal to NLAKES. Lake information must be specified for every lake or the program will terminate with an error. The program will also terminate with an error if information for a lake is specified more than once. + +\item \texttt{strt}---real value that defines the starting temperature for the lake. + +\item \texttt{ktf}---is the thermal conductivity of the of the interface between the aquifer cell and the lake. + +\item \texttt{rbthcnd}---real value that defines the thickness of the lakebed material through which conduction occurs. Must be greater than 0. + +\item \textcolor{blue}{\texttt{aux}---represents the values of the auxiliary variables for each lake. The values of auxiliary variables must be present for each lake. The values must be specified in the order of the auxiliary variables specified in the OPTIONS block. If the package supports time series and the Options block includes a TIMESERIESFILE entry (see the ``Time-Variable Input'' section), values can be obtained from a time series by entering the time-series name in place of a numeric value.} + +\item \texttt{boundname}---name of the lake cell. BOUNDNAME is an ASCII character variable that can contain as many as 40 characters. If BOUNDNAME contains spaces in it, then the entire name must be enclosed within single quotes. + +\end{description} +\item \textbf{Block: PERIOD} + +\begin{description} +\item \texttt{iper}---integer value specifying the starting stress period number for which the data specified in the PERIOD block apply. IPER must be less than or equal to NPER in the TDIS Package and greater than zero. The IPER value assigned to a stress period block must be greater than the IPER value assigned for the previous PERIOD block. The information specified in the PERIOD block will continue to apply for all subsequent stress periods, unless the program encounters another PERIOD block. + +\item \texttt{lakeno}---integer value that defines the lake number associated with the specified PERIOD data on the line. LAKENO must be greater than zero and less than or equal to NLAKES. + +\item \texttt{laksetting}---line of information that is parsed into a keyword and values. Keyword values that can be used to start the LAKSETTING string include: STATUS, TEMPERATURE, RAINFALL, EVAPORATION, RUNOFF, and AUXILIARY. These settings are used to assign the temperature associated with the corresponding flow terms. Temperatures cannot be specified for all flow terms. For example, the Lake Package supports a ``WITHDRAWAL'' flow term. If this withdrawal term is active, then water will be withdrawn from the lake at the calculated temperature of the lake. + +\begin{lstlisting}[style=blockdefinition] +STATUS +TEMPERATURE <@temperature@> +RAINFALL <@rainfall@> +EVAPORATION <@evaporation@> +RUNOFF <@runoff@> +EXT-INFLOW <@ext-inflow@> +AUXILIARY <@auxval@> +\end{lstlisting} + +\item \texttt{status}---keyword option to define lake status. STATUS can be ACTIVE, INACTIVE, or CONSTANT. By default, STATUS is ACTIVE, which means that temperature will be calculated for the lake. If a lake is inactive, then there will be no solute mass fluxes into or out of the lake and the inactive value will be written for the lake temperature. If a lake is constant, then the temperature for the lake will be fixed at the user specified value. + +\item \textcolor{blue}{\texttt{temperature}---real or character value that defines the temperature for the lake. The specified TEMPERATURE is only applied if the lake is a constant temperature lake. If the Options block includes a TIMESERIESFILE entry (see the ``Time-Variable Input'' section), values can be obtained from a time series by entering the time-series name in place of a numeric value.} + +\item \textcolor{blue}{\texttt{rainfall}---real or character value that defines the rainfall temperature for the lake. If the Options block includes a TIMESERIESFILE entry (see the ``Time-Variable Input'' section), values can be obtained from a time series by entering the time-series name in place of a numeric value.} + +\item \textcolor{blue}{\texttt{evaporation}---real or character value that defines the temperature of evaporated water $(^{\circ}C)$ for the reach. If this temperature value is larger than the simulated temperature in the reach, then the evaporated water will be removed at the same temperature as the 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.} + +\item \textcolor{blue}{\texttt{runoff}---real or character value that defines the temperature of runoff for the lake. Value must be greater than or equal to zero. If the Options block includes a TIMESERIESFILE entry (see the ``Time-Variable Input'' section), values can be obtained from a time series by entering the time-series name in place of a numeric value.} + +\item \textcolor{blue}{\texttt{ext-inflow}---real or character value that defines the temperature of external inflow for the lake. Value must be greater than or equal to zero. If the Options block includes a TIMESERIESFILE entry (see the ``Time-Variable Input'' section), values can be obtained from a time series by entering the time-series name in place of a numeric value.} + +\item \texttt{AUXILIARY}---keyword for specifying auxiliary variable. + +\item \texttt{auxname}---name for the auxiliary variable to be assigned AUXVAL. AUXNAME must match one of the auxiliary variable names defined in the OPTIONS block. If AUXNAME does not match one of the auxiliary variable names defined in the OPTIONS block the data are ignored. + +\item \textcolor{blue}{\texttt{auxval}---value for the auxiliary variable. If the Options block includes a TIMESERIESFILE entry (see the ``Time-Variable Input'' section), values can be obtained from a time series by entering the time-series name in place of a numeric value.} + +\end{description} + diff --git a/doc/mf6io/mf6ivar/tex/gwe-lke-options.dat b/doc/mf6io/mf6ivar/tex/gwe-lke-options.dat new file mode 100644 index 00000000000..ef83c7fa718 --- /dev/null +++ b/doc/mf6io/mf6ivar/tex/gwe-lke-options.dat @@ -0,0 +1,15 @@ +BEGIN OPTIONS + [FLOW_PACKAGE_NAME ] + [AUXILIARY ] + [FLOW_PACKAGE_AUXILIARY_NAME ] + [BOUNDNAMES] + [PRINT_INPUT] + [PRINT_TEMPERATURE] + [PRINT_FLOWS] + [SAVE_FLOWS] + [TEMPERATURE FILEOUT ] + [BUDGET FILEOUT ] + [BUDGETCSV FILEOUT ] + [TS6 FILEIN ] + [OBS6 FILEIN ] +END OPTIONS diff --git a/doc/mf6io/mf6ivar/tex/gwe-lke-packagedata.dat b/doc/mf6io/mf6ivar/tex/gwe-lke-packagedata.dat new file mode 100644 index 00000000000..74aaecb370e --- /dev/null +++ b/doc/mf6io/mf6ivar/tex/gwe-lke-packagedata.dat @@ -0,0 +1,5 @@ +BEGIN PACKAGEDATA + [<@aux(naux)@>] [] + [<@aux(naux)@>] [] + ... +END PACKAGEDATA diff --git a/doc/mf6io/mf6ivar/tex/gwe-lke-period.dat b/doc/mf6io/mf6ivar/tex/gwe-lke-period.dat new file mode 100644 index 00000000000..dfe899b47ef --- /dev/null +++ b/doc/mf6io/mf6ivar/tex/gwe-lke-period.dat @@ -0,0 +1,5 @@ +BEGIN PERIOD + + + ... +END PERIOD diff --git a/doc/mf6io/usgs.bst b/doc/mf6io/usgs.bst new file mode 100644 index 00000000000..326cc9cf966 --- /dev/null +++ b/doc/mf6io/usgs.bst @@ -0,0 +1,2080 @@ +%% +%% This is file `usgs.bst', +%%% ADAPTED BY MIKE FIENEN FROM agufull08.bst +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% merlin.mbs (with options: `head,ay,nat,seq-labc,nm-rev1,jnrlst,lab,lab-it,keyxyr,blkyear,dt-beg,yr-par,xmth,note-yr,thtit-a,trnum-it,vol-it,volp-com,pgsep-c,num-xser,ser-vol,ser-ed,pg-bk,pg-pre,pre-edn,agu-doi,doi,edpar,bkedcap,edby,blk-com,pp,ed,abr,ednx,xedn,jabr,and-com,em-it,nfss,{}') +%% physjour.mbs (with options: `ay,nat,seq-labc,nm-rev1,jnrlst,lab,lab-it,keyxyr,blkyear,dt-beg,yr-par,xmth,note-yr,thtit-a,trnum-it,vol-it,volp-com,pgsep-c,num-xser,ser-vol,ser-ed,pg-bk,pg-pre,pre-edn,agu-doi,doi,edpar,bkedcap,edby,blk-com,pp,ed,abr,ednx,xedn,jabr,and-com,em-it,nfss,{}') +%% geojour.mbs (with options: `ay,nat,seq-labc,nm-rev1,jnrlst,lab,lab-it,keyxyr,blkyear,dt-beg,yr-par,xmth,note-yr,thtit-a,trnum-it,vol-it,volp-com,pgsep-c,num-xser,ser-vol,ser-ed,pg-bk,pg-pre,pre-edn,agu-doi,doi,edpar,bkedcap,edby,blk-com,pp,ed,abr,ednx,xedn,jabr,and-com,em-it,nfss,{}') +%% photjour.mbs (with options: `ay,nat,seq-labc,nm-rev1,jnrlst,lab,lab-it,keyxyr,blkyear,dt-beg,yr-par,xmth,note-yr,thtit-a,trnum-it,vol-it,volp-com,pgsep-c,num-xser,ser-vol,ser-ed,pg-bk,pg-pre,pre-edn,agu-doi,doi,edpar,bkedcap,edby,blk-com,pp,ed,abr,ednx,xedn,jabr,and-com,em-it,nfss,{}') +%% merlin.mbs (with options: `tail,ay,nat,seq-labc,nm-rev1,jnrlst,lab,lab-it,keyxyr,blkyear,dt-beg,yr-par,xmth,note-yr,thtit-a,trnum-it,vol-it,volp-com,pgsep-c,num-xser,ser-vol,ser-ed,pg-bk,pg-pre,pre-edn,agu-doi,doi,edpar,bkedcap,edby,blk-com,pp,ed,abr,ednx,xedn,jabr,and-com,em-it,nfss,{}') +%% ---------------------------------------- +%% *** For journals of the American Geophysical Union *** +%% *** NOTE: this version does not limit the number of authors in ref list. +%% *** Use agu08.bst to limit authors to maximum 9. +%% *** +%% ---------------------------------------- +%% *** Version 3.1 from 2008/08/27 +%% *** Multiple authors of same first author and year now in order of citation +%% *** and other minor fixes +%% *** Renamed to agu08.bst and agufull08.bst +%% *** +%% *** Version 3.0 from 2004/02/06 +%% *** Changed date format for AGU journals +%% *** The date now appears in parentheses after authors +%% *** +%% *** Version 2.2 from 2003/06/26 +%% *** (with bug fix from 2003/08/19) +%% *** Includes new fields eid and doi +%% *** The eid is what the AGU calls "citation number" +%% *** and doi is the DOI number; both of these are +%% *** used as substitution for page number +%% *** The issue number is now also included as +%% *** 84(3) for vol. 84, nr. 3 +%% *** +%% *** Version 2.1d from 1999/05/20 +%% *** Book editors done right as P. James (Ed.), +%% *** Missing italics with some authors fixed +%% *** +%% *** Version 2.1c from 1999/02/11 +%% *** This version does not crash older BibTeX installations with +%% *** more than 3000 wiz-functions +%% *** +%% *** Version 2.1b from 1997/11/18 +%% *** (page numbers over 9999 are broken with commas, as 12,345) +%% *** +%% *** Version 2.1a from 1997/05/26 +%% *** (contains improvements from copy editor comments, +%% *** notes added with first word lowercase (bug in 2.1 fixed) +%% *** and journal `number' never output +%% *** abbreviation for grl corrected) +%% *** +%% +%% Copyright 1994-2008 Patrick W Daly + % =============================================================== + % IMPORTANT NOTICE: + % This bibliographic style (bst) file has been generated from one or + % more master bibliographic style (mbs) files, listed above. + % + % This generated file can be redistributed and/or modified under the terms + % of the LaTeX Project Public License Distributed from CTAN + % archives in directory macros/latex/base/lppl.txt; either + % version 1 of the License, or any later version. + % =============================================================== + % Name and version information of the main mbs file: + % \ProvidesFile{merlin.mbs}[2008/08/27 4.30 (PWD, AO, DPC)] + % For use with BibTeX version 0.99a or later + %------------------------------------------------------------------- + % This bibliography style file is intended for texts in ENGLISH + % This is an author-year citation style bibliography. As such, it is + % non-standard LaTeX, and requires a special package file to function properly. + % Such a package is natbib.sty by Patrick W. Daly + % The form of the \bibitem entries is + % \bibitem[Jones et al.(1990)]{key}... + % \bibitem[Jones et al.(1990)Jones, Baker, and Smith]{key}... + % The essential feature is that the label (the part in brackets) consists + % of the author names, as they should appear in the citation, with the year + % in parentheses following. There must be no space before the opening + % parenthesis! + % With natbib v5.3, a full list of authors may also follow the year. + % In natbib.sty, it is possible to define the type of enclosures that is + % really wanted (brackets or parentheses), but in either case, there must + % be parentheses in the label. + % The \cite command functions as follows: + % \citet{key} ==>> Jones et al. (1990) + % \citet*{key} ==>> Jones, Baker, and Smith (1990) + % \citep{key} ==>> (Jones et al., 1990) + % \citep*{key} ==>> (Jones, Baker, and Smith, 1990) + % \citep[chap. 2]{key} ==>> (Jones et al., 1990, chap. 2) + % \citep[e.g.][]{key} ==>> (e.g. Jones et al., 1990) + % \citep[e.g.][p. 32]{key} ==>> (e.g. Jones et al., 1990, p. 32) + % \citeauthor{key} ==>> Jones et al. + % \citeauthor*{key} ==>> Jones, Baker, and Smith + % \citeyear{key} ==>> 1990 + %--------------------------------------------------------------------- + +ENTRY + { address + author + booktitle + chapter + doi + urldate + url + urllink + edition + editor + eid + howpublished + institution + journal + key + month + note + number + organization + pages + publisher + school + series + title + type + volume + year + } + {} + { label extra.label sort.label short.list } +INTEGERS { output.state before.all mid.sentence after.sentence after.block } +FUNCTION {init.state.consts} +{ #0 'before.all := + #1 'mid.sentence := + #2 'after.sentence := + #3 'after.block := +} +STRINGS { s t} +FUNCTION {output.nonnull} +{ 's := + output.state mid.sentence = + { ", " * write$ } + { output.state after.block = + { add.period$ write$ + newline$ + "\newblock " write$ + } + { output.state before.all = + 'write$ + { add.period$ " " * write$ } + if$ + } + if$ + mid.sentence 'output.state := + } + if$ + s +} +FUNCTION {outputc.nonnull} +{ 's := + output.state mid.sentence = + { ": " * write$ } + { output.state after.block = + { add.period$ write$ + newline$ + "\newblock " write$ + } + { output.state before.all = + 'write$ + { add.period$ " " * write$ } + if$ + } + if$ + mid.sentence 'output.state := + } + if$ + s +} +FUNCTION {output} +{ duplicate$ empty$ + 'pop$ + 'output.nonnull + if$ +} +FUNCTION {outputc} +{ duplicate$ empty$ + 'pop$ + 'outputc.nonnull + if$ +} +FUNCTION {output.check} +{ 't := + duplicate$ empty$ + { pop$ "empty " t * " in " * cite$ * warning$ } + 'output.nonnull + if$ +} +FUNCTION {outputc.check} +{ 't := + duplicate$ empty$ + { pop$ "empty " t * " in " * cite$ * warning$ } + 'outputc.nonnull + if$ +} +FUNCTION {fin.entry} +{ add.period$ + write$ + newline$ +} + +FUNCTION {new.block} +{ output.state before.all = + 'skip$ + { after.block 'output.state := } + if$ +} +FUNCTION {new.sentence} +{ output.state after.block = + 'skip$ + { output.state before.all = + 'skip$ + { after.sentence 'output.state := } + if$ + } + if$ +} +FUNCTION {add.blank} +{ " " * before.all 'output.state := +} + +FUNCTION {date.block} +{ + skip$ +} + +FUNCTION {not} +{ { #0 } + { #1 } + if$ +} +FUNCTION {and} +{ 'skip$ + { pop$ #0 } + if$ +} +FUNCTION {or} +{ { pop$ #1 } + 'skip$ + if$ +} +FUNCTION {new.block.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.block + if$ +} +FUNCTION {field.or.null} +{ duplicate$ empty$ + { pop$ "" } + 'skip$ + if$ +} +FUNCTION {emphasize} +{ duplicate$ empty$ + { pop$ "" } + { "\textit{" swap$ * "}" * } + if$ +} +FUNCTION {cite.name.font} +%{ emphasize } +{ } +FUNCTION {tie.or.space.prefix} +{ duplicate$ text.length$ #3 < + { "~" } + { " " } + if$ + swap$ +} + +FUNCTION {capitalize} +{ "u" change.case$ "t" change.case$ } + +FUNCTION {space.word} +{ " " swap$ * " " * } + % Here are the language-specific definitions for explicit words. + % Each function has a name bbl.xxx where xxx is the English word. + % The language selected here is ENGLISH +FUNCTION {bbl.and} +{ "and" } + +FUNCTION {bbl.etal} +{ "and others" } + +FUNCTION {bbl.andothers} +{ "and others" } + +FUNCTION {bbl.editors} +{ "eds." } + +FUNCTION {bbl.editor} +{ "ed." } + +FUNCTION {bbl.edby} +{ "edited by" } + +FUNCTION {bbl.edition} +{ "ed." } + +FUNCTION {bbl.volume} +{ "v." } + +FUNCTION {bbl.of} +{ "of" } + +FUNCTION {bbl.number} +{ "no." } + +FUNCTION {bbl.nr} +{ "no." } + +FUNCTION {bbl.in} +{ "\emph{in}" } + +FUNCTION {bbl.pages} +{ "p." } + +FUNCTION {bbl.page} +{ "p." } + +FUNCTION {bbl.chapter} +{ "Chap." } + +FUNCTION {bbl.techrep} +%{ "Tech. Rep." } REMOVE THE TECH REPORT WORDS FOR USGS +{""} +FUNCTION {bbl.mthesis} +{ "M.S. thesis" } + +FUNCTION {bbl.phdthesis} +{ "Ph.D. thesis" } + +MACRO {jan} {"Jan."} + +MACRO {feb} {"Feb."} + +MACRO {mar} {"Mar."} + +MACRO {apr} {"Apr."} + +MACRO {may} {"May"} + +MACRO {jun} {"Jun."} + +MACRO {jul} {"Jul."} + +MACRO {aug} {"Aug."} + +MACRO {sep} {"Sep."} + +MACRO {oct} {"Oct."} + +MACRO {nov} {"Nov."} + +MACRO {dec} {"Dec."} + + %------------------------------------------------------------------- + % Begin module: + % \ProvidesFile{physjour.mbs}[2002/01/14 2.2 (PWD)] +MACRO {aa}{"Astron. \& Astrophys."} +MACRO {aasup}{"Astron. \& Astrophys. Suppl. Ser."} +MACRO {aj} {"Astron. J."} +MACRO {aph} {"Acta Phys."} +MACRO {advp} {"Adv. Phys."} +MACRO {ajp} {"Amer. J. Phys."} +MACRO {ajm} {"Amer. J. Math."} +MACRO {amsci} {"Amer. Sci."} +MACRO {anofd} {"Ann. Fluid Dyn."} +MACRO {am} {"Ann. Math."} +MACRO {ap} {"Ann. Phys. (NY)"} +MACRO {adp} {"Ann. Phys. (Leipzig)"} +MACRO {ao} {"Appl. Opt."} +MACRO {apl} {"Appl. Phys. Lett."} +MACRO {app} {"Astroparticle Phys."} +MACRO {apj} {"Astrophys. J."} +MACRO {apjsup} {"Astrophys. J. Suppl."} +MACRO {apss} {"Astrophys. Space Sci."} +MACRO {araa} {"Ann. Rev. Astron. Astrophys."} +MACRO {baas} {"Bull. Amer. Astron. Soc."} +MACRO {baps} {"Bull. Amer. Phys. Soc."} +MACRO {cmp} {"Comm. Math. Phys."} +MACRO {cpam} {"Commun. Pure Appl. Math."} +MACRO {cppcf} {"Comm. Plasma Phys. \& Controlled Fusion"} +MACRO {cpc} {"Comp. Phys. Comm."} +MACRO {cqg} {"Class. Quant. Grav."} +MACRO {cra} {"C. R. Acad. Sci. A"} +MACRO {fed} {"Fusion Eng. \& Design"} +MACRO {ft} {"Fusion Tech."} +MACRO {grg} {"Gen. Relativ. Gravit."} +MACRO {ieeens} {"IEEE Trans. Nucl. Sci."} +MACRO {ieeeps} {"IEEE Trans. Plasma Sci."} +MACRO {ijimw} {"Interntl. J. Infrared \& Millimeter Waves"} +MACRO {ip} {"Infrared Phys."} +MACRO {irp} {"Infrared Phys."} +MACRO {jap} {"J. Appl. Phys."} +MACRO {jasa} {"J. Acoust. Soc. America"} +MACRO {jcp} {"J. Comp. Phys."} +MACRO {jetp} {"Sov. Phys.--JETP"} +MACRO {jfe} {"J. Fusion Energy"} +MACRO {jfm} {"J. Fluid Mech."} +MACRO {jmp} {"J. Math. Phys."} +MACRO {jne} {"J. Nucl. Energy"} +MACRO {jnec} {"J. Nucl. Energy, C: Plasma Phys., Accelerators, Thermonucl. Res."} +MACRO {jnm} {"J. Nucl. Mat."} +MACRO {jpc} {"J. Phys. Chem."} +MACRO {jpp} {"J. Plasma Phys."} +MACRO {jpsj} {"J. Phys. Soc. Japan"} +MACRO {jsi} {"J. Sci. Instrum."} +MACRO {jvst} {"J. Vac. Sci. \& Tech."} +MACRO {nat} {"Nature"} +MACRO {nature} {"Nature"} +MACRO {nedf} {"Nucl. Eng. \& Design/Fusion"} +MACRO {nf} {"Nucl. Fusion"} +MACRO {nim} {"Nucl. Inst. \& Meth."} +MACRO {nimpr} {"Nucl. Inst. \& Meth. in Phys. Res."} +MACRO {np} {"Nucl. Phys."} +MACRO {npb} {"Nucl. Phys. B"} +MACRO {nt/f} {"Nucl. Tech./Fusion"} +MACRO {npbpc} {"Nucl. Phys. B (Proc. Suppl.)"} +MACRO {inc} {"Nuovo Cimento"} +MACRO {nc} {"Nuovo Cimento"} +MACRO {pf} {"Phys. Fluids"} +MACRO {pfa} {"Phys. Fluids A: Fluid Dyn."} +MACRO {pfb} {"Phys. Fluids B: Plasma Phys."} +MACRO {pl} {"Phys. Lett."} +MACRO {pla} {"Phys. Lett. A"} +MACRO {plb} {"Phys. Lett. B"} +MACRO {prep} {"Phys. Rep."} +MACRO {pnas} {"Proc. Nat. Acad. Sci. USA"} +MACRO {pp} {"Phys. Plasmas"} +MACRO {ppcf} {"Plasma Phys. \& Controlled Fusion"} +MACRO {phitrsl} {"Philos. Trans. Roy. Soc. London"} +MACRO {prl} {"Phys. Rev. Lett."} +MACRO {pr} {"Phys. Rev."} +MACRO {physrev} {"Phys. Rev."} +MACRO {pra} {"Phys. Rev. A"} +MACRO {prb} {"Phys. Rev. B"} +MACRO {prc} {"Phys. Rev. C"} +MACRO {prd} {"Phys. Rev. D"} +MACRO {pre} {"Phys. Rev. E"} +MACRO {ps} {"Phys. Scripta"} +MACRO {procrsl} {"Proc. Roy. Soc. London"} +MACRO {rmp} {"Rev. Mod. Phys."} +MACRO {rsi} {"Rev. Sci. Inst."} +MACRO {science} {"Science"} +MACRO {sciam} {"Sci. Am."} +MACRO {sam} {"Stud. Appl. Math."} +MACRO {sjpp} {"Sov. J. Plasma Phys."} +MACRO {spd} {"Sov. Phys.--Doklady"} +MACRO {sptp} {"Sov. Phys.--Tech. Phys."} +MACRO {spu} {"Sov. Phys.--Uspeki"} +MACRO {st} {"Sky and Telesc."} + % End module: physjour.mbs + %------------------------------------------------------------------- + % Begin module: + % \ProvidesFile{geojour.mbs}[2002/07/10 2.0h (PWD)] +MACRO {aisr} {"Adv. Space Res."} +MACRO {ag} {"Ann. Geophys."} +MACRO {anigeo} {"Ann. Geofis."} +MACRO {angl} {"Ann. Glaciol."} +MACRO {andmet} {"Ann. d. Meteor."} +MACRO {andgeo} {"Ann. d. Geophys."} +MACRO {andphy} {"Ann. Phys.-Paris"} +MACRO {afmgb} {"Arch. Meteor. Geophys. Bioklimatol."} +MACRO {atph} {"Atm\'osphera"} +MACRO {aao} {"Atmos. Ocean"} +MACRO {ass}{"Astrophys. Space Sci."} +MACRO {atenv} {"Atmos. Environ."} +MACRO {aujag} {"Aust. J. Agr. Res."} +MACRO {aumet} {"Aust. Meteorol. Mag."} +MACRO {blmet} {"Bound.-Lay. Meteorol."} +MACRO {bams} {"Bull. Amer. Meteorol. Soc."} +MACRO {cch} {"Clim. Change"} +MACRO {cdyn} {"Clim. Dynam."} +MACRO {cbul} {"Climatol. Bull."} +MACRO {cap} {"Contrib. Atmos. Phys."} +MACRO {dsr} {"Deep-Sea Res."} +MACRO {dhz} {"Dtsch. Hydrogr. Z."} +MACRO {dao} {"Dynam. Atmos. Oceans"} +MACRO {eco} {"Ecology"} +MACRO {empl}{"Earth, Moon and Planets"} +MACRO {envres} {"Environ. Res."} +MACRO {envst} {"Environ. Sci. Technol."} +MACRO {ecms} {"Estuarine Coastal Mar. Sci."} +MACRO {expa}{"Exper. Astron."} +MACRO {geoint} {"Geofis. Int."} +MACRO {geopub} {"Geofys. Publ."} +MACRO {geogeo} {"Geol. Geofiz."} +MACRO {gafd} {"Geophys. Astrophys. Fluid Dyn."} +MACRO {gfd} {"Geophys. Fluid Dyn."} +MACRO {geomag} {"Geophys. Mag."} +MACRO {georl} {"Geophys. Res. Lett."} +MACRO {grl} {"Geophys. Res. Lett."} +MACRO {ga} {"Geophysica"} +MACRO {gs} {"Geophysics"} +MACRO {ieeetap} {"IEEE Trans. Antenn. Propag."} +MACRO {ijawp} {"Int. J. Air Water Pollut."} +MACRO {ijc} {"Int. J. Climatol."} +MACRO {ijrs} {"Int. J. Remote Sens."} +MACRO {jam} {"J. Appl. Meteorol."} +MACRO {jaot} {"J. Atmos. Ocean. Technol."} +MACRO {jatp} {"J. Atmos. Terr. Phys."} +MACRO {jastp} {"J. Atmos. Solar-Terr. Phys."} +MACRO {jce} {"J. Climate"} +MACRO {jcam} {"J. Climate Appl. Meteor."} +MACRO {jcm} {"J. Climate Meteor."} +MACRO {jcy} {"J. Climatol."} +MACRO {jgr} {"J. Geophys. Res."} +MACRO {jga} {"J. Glaciol."} +MACRO {jh} {"J. Hydrol."} +MACRO {jmr} {"J. Mar. Res."} +MACRO {jmrj} {"J. Meteor. Res. Japan"} +MACRO {jm} {"J. Meteor."} +MACRO {jpo} {"J. Phys. Oceanogr."} +MACRO {jra} {"J. Rech. Atmos."} +MACRO {jaes} {"J. Aeronaut. Sci."} +MACRO {japca} {"J. Air Pollut. Control Assoc."} +MACRO {jas} {"J. Atmos. Sci."} +MACRO {jmts} {"J. Mar. Technol. Soc."} +MACRO {jmsj} {"J. Meteorol. Soc. Japan"} +MACRO {josj} {"J. Oceanogr. Soc. Japan"} +MACRO {jwm} {"J. Wea. Mod."} +MACRO {lao} {"Limnol. Oceanogr."} +MACRO {mwl} {"Mar. Wea. Log"} +MACRO {mau} {"Mausam"} +MACRO {meteor} {"``Meteor'' Forschungsergeb."} +MACRO {map} {"Meteorol. Atmos. Phys."} +MACRO {metmag} {"Meteor. Mag."} +MACRO {metmon} {"Meteor. Monogr."} +MACRO {metrun} {"Meteor. Rundsch."} +MACRO {metzeit} {"Meteor. Z."} +MACRO {metgid} {"Meteor. Gidrol."} +MACRO {mwr} {"Mon. Weather Rev."} +MACRO {nwd} {"Natl. Weather Dig."} +MACRO {nzjmfr} {"New Zeal. J. Mar. Freshwater Res."} +MACRO {npg} {"Nonlin. Proc. Geophys."} +MACRO {om} {"Oceanogr. Meteorol."} +MACRO {ocac} {"Oceanol. Acta"} +MACRO {oceanus} {"Oceanus"} +MACRO {paleoc} {"Paleoceanography"} +MACRO {pce} {"Phys. Chem. Earth"} +MACRO {pmg} {"Pap. Meteor. Geophys."} +MACRO {ppom} {"Pap. Phys. Oceanogr. Meteor."} +MACRO {physzeit} {"Phys. Z."} +MACRO {pps} {"Planet. Space Sci."} +MACRO {pss} {"Planet. Space Sci."} +MACRO {pag} {"Pure Appl. Geophys."} +MACRO {qjrms} {"Quart. J. Roy. Meteorol. Soc."} +MACRO {quatres} {"Quat. Res."} +MACRO {rsci} {"Radio Sci."} +MACRO {rse} {"Remote Sens. Environ."} +MACRO {rgeo} {"Rev. Geophys."} +MACRO {rgsp} {"Rev. Geophys. Space Phys."} +MACRO {rdgeo} {"Rev. Geofis."} +MACRO {revmeta} {"Rev. Meteorol."} +MACRO {sgp}{"Surveys in Geophys."} +MACRO {sp} {"Solar Phys."} +MACRO {ssr} {"Space Sci. Rev."} +MACRO {tellus} {"Tellus"} +MACRO {tac} {"Theor. Appl. Climatol."} +MACRO {tagu} {"Trans. Am. Geophys. Union (EOS)"} +MACRO {wrr} {"Water Resour. Res."} +MACRO {weather} {"Weather"} +MACRO {wafc} {"Weather Forecast."} +MACRO {ww} {"Weatherwise"} +MACRO {wmob} {"WMO Bull."} +MACRO {zeitmet} {"Z. Meteorol."} + % End module: geojour.mbs + %------------------------------------------------------------------- + % Begin module: + % \ProvidesFile{photjour.mbs}[1999/02/24 2.0b (PWD)] + +MACRO {appopt} {"Appl. Opt."} +MACRO {bell} {"Bell Syst. Tech. J."} +MACRO {ell} {"Electron. Lett."} +MACRO {jasp} {"J. Appl. Spectr."} +MACRO {jqe} {"IEEE J. Quantum Electron."} +MACRO {jlwt} {"J. Lightwave Technol."} +MACRO {jmo} {"J. Mod. Opt."} +MACRO {josa} {"J. Opt. Soc. America"} +MACRO {josaa} {"J. Opt. Soc. Amer.~A"} +MACRO {josab} {"J. Opt. Soc. Amer.~B"} +MACRO {jdp} {"J. Phys. (Paris)"} +MACRO {oc} {"Opt. Commun."} +MACRO {ol} {"Opt. Lett."} +MACRO {phtl} {"IEEE Photon. Technol. Lett."} +MACRO {pspie} {"Proc. Soc. Photo-Opt. Instrum. Eng."} +MACRO {sse} {"Solid-State Electron."} +MACRO {sjot} {"Sov. J. Opt. Technol."} +MACRO {sjqe} {"Sov. J. Quantum Electron."} +MACRO {sleb} {"Sov. Phys.--Leb. Inst. Rep."} +MACRO {stph} {"Sov. Phys.--Techn. Phys."} +MACRO {stphl} {"Sov. Techn. Phys. Lett."} +MACRO {vr} {"Vision Res."} +MACRO {zph} {"Z. f. Physik"} +MACRO {zphb} {"Z. f. Physik~B"} +MACRO {zphd} {"Z. f. Physik~D"} + +MACRO {CLEO} {"CLEO"} +MACRO {ASSL} {"Adv. Sol.-State Lasers"} +MACRO {OSA} {"OSA"} + % End module: photjour.mbs +%% Copyright 1994-2008 Patrick W Daly +MACRO {acmcs} {"ACM Comput. Surv."} + +MACRO {acta} {"Acta Inf."} + +MACRO {cacm} {"Commun. ACM"} + +MACRO {ibmjrd} {"IBM J. Res. Dev."} + +MACRO {ibmsj} {"IBM Syst.~J."} + +MACRO {ieeese} {"IEEE Trans. Software Eng."} + +MACRO {ieeetc} {"IEEE Trans. Comput."} + +MACRO {ieeetcad} + {"IEEE Trans. Comput. Aid. Des."} + +MACRO {ipl} {"Inf. Process. Lett."} + +MACRO {jacm} {"J.~ACM"} + +MACRO {jcss} {"J.~Comput. Syst. Sci."} + +MACRO {scp} {"Sci. Comput. Program."} + +MACRO {sicomp} {"SIAM J. Comput."} + +MACRO {tocs} {"ACM Trans. Comput. Syst."} + +MACRO {tods} {"ACM Trans. Database Syst."} + +MACRO {tog} {"ACM Trans. Graphic."} + +MACRO {toms} {"ACM Trans. Math. Software"} + +MACRO {toois} {"ACM Trans. Office Inf. Syst."} + +MACRO {toplas} {"ACM Trans. Progr. Lang. Syst."} + +MACRO {tcs} {"Theor. Comput. Sci."} + +FUNCTION {bibinfo.check} +{ swap$ + duplicate$ missing$ + { + pop$ pop$ + "" + } + { duplicate$ empty$ + { + swap$ pop$ + } + { swap$ + pop$ + } + if$ + } + if$ +} +FUNCTION {bibinfo.warn} +{ swap$ + duplicate$ missing$ + { + swap$ "missing " swap$ * " in " * cite$ * warning$ pop$ + "" + } + { duplicate$ empty$ + { + swap$ "empty " swap$ * " in " * cite$ * warning$ + } + { swap$ + pop$ + } + if$ + } + if$ +} + + +STRINGS {ss tt fm} +FUNCTION {format.onlyfirst} +{ + 'ss := %% Make a copy of the name in s + %% Extract the First (and possible Medium) names + %% and store it in variable fm + ss #1 "{ff}" format.name$ 'fm := + + %% Note that now fm could contain: + %% * An empty string ("") if the author has no first name (only Last name was provided) + %% * A single word (like "First") if the author has no medium name + %% * A sequence of words (like "First Medium") + %% For the last case we want to abbreviate "Medium", without dot + + %% Test if we are in the first case + fm empty$ { + % If empty (no first name), use the standard formatting + ss #1 "{vv~}{ll}{, f{.}.}{, jj}" format.name$ + }{ % Otherwise, attempt the trick + %% Now the trick. Interpret "First Medium" + %% as if "Medium" were a last name, and abbreviate it + fm #1 "{f.}{l}" format.name$ 'tt := %% And store the result in tt + %% Consider the particular case in which no Medium name is present + %% In this case, "First" will be interpreted as a last name, and + %% thus abbreviated. This can be detected because the resulting + %% string has length 1 + tt text.length$ #1 > { %% If there was a medium name + fm #1 "{f.}{l.}" format.name$ 'tt := + tt %% Store the abbreviated version + }{ %% Else store the original version of the name + fm + } if$ + + %% After the above, the top of the stack will contain + %% either "First" unabbreviated (if the author has not middle name) + %% or "First M", as required + 'tt := %% Copy that value to tt + + %% Now complete the standard formatting of the author, omitting + %% the first name part, which is stored in tt + ss #1 "{vv~}{ll}{, jj}" format.name$ + %% And concatenate to it the value of tt + ", " * + tt * + }if$ %% If the trick has to be done +} + +INTEGERS { nameptr namesleft numnames } +STRINGS { bibinfo} + +FUNCTION {format.names} +{ 'bibinfo := + duplicate$ empty$ 'skip$ { + 's := + "" 't := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{vv~}{ll}{, ff}{, jj}" + format.name$ + bibinfo bibinfo.check + format.onlyfirst 't := + nameptr #1 > + { + namesleft #1 > + { ", " * t * } + { + s nameptr "{ll}" format.name$ duplicate$ "others" = + { 't := } + { pop$ } + if$ + numnames #1 > + { "," * } + 'skip$ + if$ + t "others" = + { + " " * bbl.etal * + } + { + bbl.and + space.word * t * + } + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ + } if$ +} + + +FUNCTION {format.names.ed} +{ + 'bibinfo := + duplicate$ empty$ 'skip$ { + 's := + "" 't := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{f.~}{vv~}{ll}{, jj}" + format.name$ + bibinfo bibinfo.check + 't := + nameptr #1 > + { + namesleft #1 > + { ", " * t * } + { + s nameptr "{ll}" format.name$ duplicate$ "others" = + { 't := } + { pop$ } + if$ + numnames #2 > + { "," * } + 'skip$ + if$ + t "others" = + { + + " " * bbl.etal * + } + { + bbl.and + space.word * t * + } + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ + } if$ +} +FUNCTION {format.key} +{ empty$ + { key field.or.null } + { "" } + if$ +} + +FUNCTION {format.authors} +{ author "author" format.names +} +FUNCTION {get.bbl.editor} +{ editor num.names$ #1 > 'bbl.editors 'bbl.editor if$ } + +FUNCTION {format.editors} +{ editor "editor" format.names duplicate$ empty$ 'skip$ + { + " " * + get.bbl.editor + capitalize + "(" swap$ * ")" * + * + } + if$ +} +FUNCTION {format.book.pages} +{ pages "pages" bibinfo.check + duplicate$ empty$ 'skip$ + { "~" * bbl.pages * } + if$ +} +FUNCTION {format.doi} +{ doi empty$ + { "" } + { + urldate empty$ + { + "\url{https://doi.org/" doi * "}" * + } + { + "at \url{https://doi.org/" doi * "}" * + } + if$ + } + if$ +} +FUNCTION {format.urldate} +{ urldate empty$ + { "" } + { + url empty$ + { + doi empty$ + { "" } + { + "accessed " urldate * + } + if$ + } + { + "accessed " urldate * + } + if$ + } + if$ +} +FUNCTION {format.url} +{ url empty$ + { "" } + { + urldate empty$ + { + "\url{" url * "}" * + } + { + "at \url{" url * "}" * + } + if$ + } + if$ +} +FUNCTION {format.urllink} +{ urllink empty$ + { "" } + { + " (Available online at \url{" urllink * "})" * + } + if$ +} +FUNCTION {format.note} +{ + note empty$ + { "" } + { note #1 #1 substring$ + duplicate$ "{" = + 'skip$ + { output.state mid.sentence = + { "l" } + { "u" } + if$ + change.case$ + } + if$ + note #2 global.max$ substring$ * "note" bibinfo.check + } + if$ +} + +FUNCTION {format.title} +{ title + duplicate$ empty$ 'skip$ + { "t" change.case$ } + if$ + "title" bibinfo.check +} +FUNCTION {format.full.names} +{'s := + "" 't := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{vv~}{ll}" format.name$ + 't := + nameptr #1 > + { + namesleft #1 > + { ", " * t * } + { + s nameptr "{ll}" format.name$ duplicate$ "others" = + { 't := } + { pop$ } + if$ + t "others" = + { + " " * bbl.etal * + cite.name.font + } + { + numnames #2 > + { "," * } + 'skip$ + if$ + bbl.and + space.word * t * + } + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ + t "others" = + 'skip$ + { cite.name.font } + if$ +} + +FUNCTION {author.editor.key.full} +{ author empty$ + { editor empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.full.names } + if$ + } + { author format.full.names } + if$ +} + +FUNCTION {author.key.full} +{ author empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { author format.full.names } + if$ +} + +FUNCTION {editor.key.full} +{ editor empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.full.names } + if$ +} + +FUNCTION {make.full.names} +{ type$ "book" = + type$ "inbook" = + or + 'author.editor.key.full + { type$ "proceedings" = + 'editor.key.full + 'author.key.full + if$ + } + if$ +} + +FUNCTION {output.bibitem} +{ newline$ + "\bibitem[{" write$ + label write$ + ")" make.full.names duplicate$ short.list = + { pop$ } + { * } + if$ + "}]{" * write$ + cite$ write$ + "}" write$ + newline$ + "" + before.all 'output.state := +} + +FUNCTION {if.digit} +{ duplicate$ "0" = + swap$ duplicate$ "1" = + swap$ duplicate$ "2" = + swap$ duplicate$ "3" = + swap$ duplicate$ "4" = + swap$ duplicate$ "5" = + swap$ duplicate$ "6" = + swap$ duplicate$ "7" = + swap$ duplicate$ "8" = + swap$ "9" = or or or or or or or or or +} +FUNCTION {n.separate} +{ 't := + "" + #0 'numnames := + { t empty$ not } + { t #-1 #1 substring$ if.digit + { numnames #1 + 'numnames := } + { #0 'numnames := } + if$ + t #-1 #1 substring$ swap$ * + t #-2 global.max$ substring$ 't := + numnames #5 = + { duplicate$ #1 #2 substring$ swap$ + #3 global.max$ substring$ + "," swap$ * * + } + 'skip$ + if$ + } + while$ +} +FUNCTION {n.dashify} +{ + n.separate + 't := + "" + { t empty$ not } + { t #1 #1 substring$ "-" = + { t #1 #2 substring$ "--" = not + { "--" * + t #2 global.max$ substring$ 't := + } + { { t #1 #1 substring$ "-" = } + { "-" * + t #2 global.max$ substring$ 't := + } + while$ + } + if$ + } + { t #1 #1 substring$ * + t #2 global.max$ substring$ 't := + } + if$ + } + while$ +} + +FUNCTION {word.in} +{ bbl.in + " " * } + +FUNCTION {format.date} +{ year "year" bibinfo.check duplicate$ empty$ + { + } + 'skip$ + if$ + extra.label * + before.all 'output.state := + ", " swap$ * "" * +} +FUNCTION {format.btitle} +{ title "title" bibinfo.check + duplicate$ empty$ 'skip$ + { + %emphasize + } + if$ +} +FUNCTION {either.or.check} +{ empty$ + 'pop$ + { "can't use both " swap$ * " fields in " * cite$ * warning$ } + if$ +} +FUNCTION {format.bvolume} +{ volume empty$ + { "" } + { bbl.volume volume tie.or.space.prefix + "volume" bibinfo.check * * + series "series" bibinfo.check + duplicate$ empty$ 'pop$ + + % { emphasize ", " * swap$ * } % REMOVE ITALICS FOR USGS + { ", " * swap$ * } + if$ + "volume and number" number either.or.check + } + if$ +} +FUNCTION {format.number.series} +{ volume empty$ + { number empty$ + { series field.or.null } + { series empty$ + { number "number" bibinfo.check } + { output.state mid.sentence = + { bbl.number } + { bbl.number capitalize } + if$ + number tie.or.space.prefix "number" bibinfo.check * * + bbl.in space.word * + series "series" bibinfo.check * + } + if$ + } + if$ + } + { "" } + if$ +} + +FUNCTION {format.edition} +{ edition duplicate$ empty$ 'skip$ + { + output.state mid.sentence = + { "l" } + { "t" } + if$ change.case$ + "edition" bibinfo.check + " " * bbl.edition * + } + if$ +} +INTEGERS { multiresult } +FUNCTION {multi.page.check} +{ 't := + #0 'multiresult := + { multiresult not + t empty$ not + and + } + { t #1 #1 substring$ + duplicate$ "-" = + swap$ duplicate$ "," = + swap$ "+" = + or or + { #1 'multiresult := } + { t #2 global.max$ substring$ 't := } + if$ + } + while$ + multiresult +} +FUNCTION {format.pages} +{ pages duplicate$ empty$ 'skip$ + { duplicate$ multi.page.check + { + bbl.pages swap$ + n.dashify + } + { + bbl.page swap$ + } + if$ + tie.or.space.prefix + "pages" bibinfo.check + * * + } + if$ +} +FUNCTION {format.journal.pages} +{ pages duplicate$ empty$ 'pop$ + { swap$ duplicate$ empty$ + { pop$ pop$ format.pages } + { + ", p.~" * + swap$ + n.dashify + "pages" bibinfo.check + * + } + if$ + } + if$ +} +FUNCTION {format.journal.eid} +{ eid "eid" bibinfo.check + duplicate$ empty$ 'pop$ + { swap$ duplicate$ empty$ 'skip$ + { + ", " * + } + if$ + swap$ * + } + if$ +} +FUNCTION {format.vol.num.pages} +{ volume field.or.null + duplicate$ empty$ 'skip$ + { + bbl.volume swap$ tie.or.space.prefix + "volume" bibinfo.check + * * + } + if$ + number "number" bibinfo.check duplicate$ empty$ 'skip$ + { + swap$ duplicate$ empty$ + { "there's a number but no volume in " cite$ * warning$ } + 'skip$ + if$ + swap$ + ", " bbl.nr * number tie.or.space.prefix pop$ * swap$ * + } + if$ * + eid empty$ + { format.journal.pages } + { format.journal.eid } + if$ +} + +FUNCTION {format.chapter.pages} +{ chapter empty$ + 'format.pages + { type empty$ + { bbl.chapter } + { type "l" change.case$ + "type" bibinfo.check + } + if$ + chapter tie.or.space.prefix + "chapter" bibinfo.check + * * + pages empty$ + 'skip$ + { ", " * format.pages * } + if$ + } + if$ +} + +FUNCTION {format.booktitle} +{ + booktitle "booktitle" bibinfo.check + %emphasize +} + +FUNCTION {format.editor} +{ + editor "editor" format.names + duplicate$ empty$ 'pop$ + { + %emphasize + } + if$ +} + +FUNCTION {format.in.ed.booktitle} +{ format.booktitle duplicate$ empty$ 'skip$ + { + format.bvolume duplicate$ empty$ 'pop$ + { ", " swap$ * * } + if$ + editor "editor" format.names.ed duplicate$ empty$ 'pop$ + { + bbl.edby + " " * swap$ * + swap$ + "," * + " " * swap$ + * } + if$ + word.in swap$ * + } + if$ +} + +FUNCTION {formatc.in.ed.booktitle} +{ format.editor duplicate$ empty$ 'skip$ + { + format.bvolume duplicate$ empty$ 'pop$ + { ", " swap$ * * } + if$ + format.booktitle duplicate$ empty$ 'pop$ + { + swap$ + "," * + " " * swap$ + * } + if$ + word.in swap$ * + } + if$ +} + +FUNCTION {format.thesis.type} +{ type duplicate$ empty$ + 'pop$ + { swap$ pop$ + "t" change.case$ "type" bibinfo.check + } + if$ +} +FUNCTION {format.tr.number} +{ number "number" bibinfo.check + type duplicate$ empty$ + { pop$ bbl.techrep } + 'skip$ + if$ + "type" bibinfo.check + swap$ duplicate$ empty$ + { pop$ "t" change.case$ } + { tie.or.space.prefix * * } + if$ +} +FUNCTION {format.article.crossref} +{ + word.in + " \cite{" * crossref * "}" * +} +FUNCTION {format.book.crossref} +{ volume duplicate$ empty$ + { "empty volume in " cite$ * "'s crossref of " * crossref * warning$ + pop$ word.in + } + { bbl.volume + swap$ tie.or.space.prefix "volume" bibinfo.check * * bbl.of space.word * + } + if$ + " \cite{" * crossref * "}" * +} +FUNCTION {format.incoll.inproc.crossref} +{ + word.in + " \cite{" * crossref * "}" * +} +FUNCTION {format.org.or.pub} +{ 't := + "" + address empty$ t empty$ and + 'skip$ + { + t empty$ + { address "address" bibinfo.check * + } + { t * + address empty$ + 'skip$ + { ", " * address "address" bibinfo.check * } + if$ + } + if$ + } + if$ +} +FUNCTION {formatc.org.or.pub} +{ 't := + "" + address empty$ t empty$ and + 'skip$ + { + t empty$ + { address "address" bibinfo.check * + } + { t * + address empty$ + 'skip$ + { ": " * address "address" bibinfo.check * } + if$ + } + if$ + } + if$ +} +FUNCTION {format.publisher.address} +{ format.org.or.pub publisher "publisher" bibinfo.warn +} +FUNCTION {formatc.publisher.address} +{ formatc.org.or.pub publisher "publisher" bibinfo.warn +} + +FUNCTION {format.organization.address} +{ organization "organization" bibinfo.check format.org.or.pub +} + +FUNCTION {article} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.date "year" output.check + date.block + format.title "title" output.check + crossref missing$ + { + journal + "journal" bibinfo.check + %emphasize + "journal" outputc.check + format.vol.num.pages output + format.urldate output + format.doi output + format.url output + format.urllink output + } + { format.article.crossref output.nonnull + format.pages output + } + if$ + format.note output + fin.entry +} +FUNCTION {book} +{ output.bibitem + author empty$ + { format.editors "author and editor" output.check + editor format.key output + } + { format.authors output.nonnull + crossref missing$ + { "author and editor" editor either.or.check } + 'skip$ + if$ + } + if$ + format.date "year" output.check + date.block + format.btitle "title" output.check + publisher empty$ + { format.number.series outputc.nonnull } + { formatc.publisher.address output + format.book.pages output + } + if$ + format.urldate output + format.doi output + format.url output + format.urllink output + format.note output + fin.entry +} +FUNCTION {booklet} +{ output.bibitem + format.authors output + author format.key output + format.date "year" output.check + date.block + format.title "title" output.check + howpublished "howpublished" bibinfo.check output + address "address" bibinfo.check output + format.book.pages output + format.urldate output + format.doi output + format.url output + format.urllink output + format.note output + fin.entry +} + +FUNCTION {inbook} +{ output.bibitem + author empty$ + { format.editors "author and editor" output.check + editor format.key output + } + { format.authors output.nonnull + crossref missing$ + { "author and editor" editor either.or.check } + 'skip$ + if$ + } + if$ + format.date "year" output.check + date.block + format.btitle "title" output.check + publisher empty$ + { format.number.series outputc.nonnull } + { formatc.publisher.address output + format.book.pages output + } +% crossref missing$ +% { +% format.bvolume output +% format.chapter.pages "chapter and pages" output.check +% format.number.series output +% format.edition output +% formatc.publisher.address output +% } +% { +% format.chapter.pages "chapter and pages" output.check +% format.book.crossref output.nonnull +% } + if$ + format.urldate output + format.doi output + format.url output + format.urllink output + format.note output + fin.entry +} + +FUNCTION {incollection} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.date "year" output.check + date.block + format.title "title" output.check + publisher empty$ + { formatc.in.ed.booktitle "booktitle" output.check + format.number.series outputc.nonnull } + { formatc.in.ed.booktitle "booktitle" output.check + formatc.publisher.address output + format.book.pages output + } +% crossref missing$ +% { format.in.ed.booktitle "booktitle" output.check +% format.number.series output +% format.edition output +% format.chapter.pages output +% formatc.publisher.address output +% } +% { format.incoll.inproc.crossref output.nonnull +% format.chapter.pages output +% } + if$ + format.urldate output + format.doi output + format.url output + format.urllink output + format.note output + fin.entry +} +FUNCTION {inproceedings} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.date "year" output.check + date.block + format.title "title" output.check + crossref missing$ + { format.in.ed.booktitle "booktitle" output.check + format.number.series output + publisher empty$ + { format.organization.address output } + { organization "organization" bibinfo.check output + format.publisher.address output + } + if$ + format.pages output + } + { format.incoll.inproc.crossref output.nonnull + format.pages output + } + if$ + format.urldate output + format.doi output + format.url output + format.urllink output + format.note output + fin.entry +} +FUNCTION {conference} { inproceedings } +FUNCTION {manual} +{ output.bibitem + format.authors output + author format.key output + format.date "year" output.check + date.block + format.btitle "title" output.check + organization "organization" bibinfo.check output + address "address" bibinfo.check output + format.edition output + format.urldate output + format.doi output + format.url output + format.urllink output + format.note output + fin.entry +} + +FUNCTION {mastersthesis} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.date "year" output.check + date.block + format.title + "title" output.check + bbl.mthesis format.thesis.type output.nonnull + school "school" bibinfo.warn output + address "address" bibinfo.check output + format.urldate output + format.doi output + format.url output + format.urllink output + format.note output + format.book.pages output + fin.entry +} + +FUNCTION {misc} +{ output.bibitem + format.authors output + author format.key output + format.date "year" output.check + date.block + format.title output + howpublished "howpublished" bibinfo.check output + format.urldate output + format.doi output + format.url output + format.urllink output + format.note output + fin.entry +} +FUNCTION {phdthesis} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.date "year" output.check + date.block + format.title + "title" output.check + bbl.phdthesis format.thesis.type output.nonnull + school "school" bibinfo.warn output + address "address" bibinfo.check output + format.urldate output + format.doi output + format.url output + format.urllink output + format.note output + format.book.pages output + fin.entry +} + +FUNCTION {proceedings} +{ output.bibitem + format.editors output + editor format.key output + format.date "year" output.check + date.block + format.btitle "title" output.check + format.bvolume output + format.number.series output + publisher empty$ + { format.organization.address output } + { organization "organization" bibinfo.check output + format.publisher.address output + } + if$ + format.urldate output + format.doi output + format.url output + format.urllink output + format.note output + fin.entry +} + +FUNCTION {techreport} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.date "year" output.check + date.block + format.title + "title" output.check + % format.tr.number emphasize output.nonnull + institution "institution" bibinfo.warn output + address "address" bibinfo.check output + format.book.pages output + fin.entry +} + +FUNCTION {online} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.date "year" output.check + date.block + format.title + "title" output.check + % format.tr.number emphasize output.nonnull + + fin.entry +} + +FUNCTION {unpublished} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.date "year" output.check + date.block + format.title "title" output.check + format.urldate output + format.doi output + format.url output + format.urllink output + format.note "note" output.check + fin.entry +} + +FUNCTION {default.type} { misc } +READ +FUNCTION {sortify} +{ purify$ + "l" change.case$ +} +INTEGERS { len } +FUNCTION {chop.word} +{ 's := + 'len := + s #1 len substring$ = + { s len #1 + global.max$ substring$ } + 's + if$ +} +FUNCTION {format.lab.names} +{ 's := + "" 't := + s #1 "{vv~}{ll}" format.name$ + s num.names$ duplicate$ + #2 > + { pop$ + " " * bbl.etal * + cite.name.font + "others" 't := + } + { #2 < + 'skip$ + { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" = + { + " " * bbl.etal * + cite.name.font + "others" 't := + } + { bbl.and space.word * s #2 "{vv~}{ll}" format.name$ + * } + if$ + } + if$ + } + if$ + t "others" = + 'skip$ + { cite.name.font } + if$ +} + +FUNCTION {author.key.label} +{ author empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {author.editor.key.label} +{ author empty$ + { editor empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.lab.names } + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {editor.key.label} +{ editor empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.lab.names } + if$ +} + +FUNCTION {calc.short.authors} +{ type$ "book" = + type$ "inbook" = + or + 'author.editor.key.label + { type$ "proceedings" = + 'editor.key.label + 'author.key.label + if$ + } + if$ + 'short.list := +} + +FUNCTION {calc.label} +{ calc.short.authors + short.list + "(" + * + year duplicate$ empty$ + short.list key field.or.null = or + { pop$ "" } + 'skip$ + if$ + * + 'label := +} + +FUNCTION {sort.format.names} +{ 's := + #1 'nameptr := + "" + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{vv{ } }{ll{ }}{ f{ }}{ jj{ }}" + format.name$ 't := + nameptr #1 > + { + " " * + namesleft #1 = t "others" = and + { "zzzzz" 't := } + 'skip$ + if$ + numnames #2 > nameptr #2 = and + { "zz" * year field.or.null * " " * + #1 'namesleft := + } + { t sortify * } + if$ + } + { t sortify * } + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ +} + +FUNCTION {sort.format.title} +{ 't := + "A " #2 + "An " #3 + "The " #4 t chop.word + chop.word + chop.word + sortify + #1 global.max$ substring$ +} +FUNCTION {author.sort} +{ author empty$ + { key empty$ + { "to sort, need author or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { author sort.format.names } + if$ +} +FUNCTION {author.editor.sort} +{ author empty$ + { editor empty$ + { key empty$ + { "to sort, need author, editor, or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { editor sort.format.names } + if$ + } + { author sort.format.names } + if$ +} +FUNCTION {editor.sort} +{ editor empty$ + { key empty$ + { "to sort, need editor or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { editor sort.format.names } + if$ +} +FUNCTION {presort} +{ calc.label + label sortify + " " + * + type$ "book" = + type$ "inbook" = + or + 'author.editor.sort + { type$ "proceedings" = + 'editor.sort + 'author.sort + if$ + } + if$ + #1 entry.max$ substring$ + 'sort.label := + sort.label + * + #1 entry.max$ substring$ + 'sort.key$ := +} + +ITERATE {presort} +SORT +STRINGS { last.label next.extra } +INTEGERS { last.extra.num last.extra.num.extended last.extra.num.blank number.label } +FUNCTION {initialize.extra.label.stuff} +{ #0 int.to.chr$ 'last.label := + "" 'next.extra := + #0 'last.extra.num := + "a" chr.to.int$ #1 - 'last.extra.num.blank := + last.extra.num.blank 'last.extra.num.extended := + #0 'number.label := +} +FUNCTION {forward.pass} +{ last.label label = + { last.extra.num #1 + 'last.extra.num := + last.extra.num "z" chr.to.int$ > + { "a" chr.to.int$ 'last.extra.num := + last.extra.num.extended #1 + 'last.extra.num.extended := + } + 'skip$ + if$ + last.extra.num.extended last.extra.num.blank > + { last.extra.num.extended int.to.chr$ + last.extra.num int.to.chr$ + * 'extra.label := } + { last.extra.num int.to.chr$ 'extra.label := } + if$ + } + { "a" chr.to.int$ 'last.extra.num := + "" 'extra.label := + label 'last.label := + } + if$ + number.label #1 + 'number.label := +} +FUNCTION {reverse.pass} +{ next.extra "b" = + { "a" 'extra.label := } + 'skip$ + if$ + extra.label 'next.extra := + extra.label + duplicate$ empty$ + 'skip$ + { "{\natexlab{" swap$ * "}}" * } + if$ + 'extra.label := + label extra.label * 'label := +} +EXECUTE {initialize.extra.label.stuff} +ITERATE {forward.pass} +REVERSE {reverse.pass} +FUNCTION {bib.sort.order} +{ sort.label + " " + * + year field.or.null sortify + * + #1 entry.max$ substring$ + 'sort.key$ := +} +ITERATE {bib.sort.order} +SORT +FUNCTION {begin.bib} +{ preamble$ empty$ + 'skip$ + { preamble$ write$ newline$ } + if$ + "\begin{thebibliography}{" number.label int.to.str$ * "}" * + write$ newline$ + "\providecommand{\natexlab}[1]{#1}" + write$ newline$ + "\expandafter\ifx\csname urlstyle\endcsname\relax" + write$ newline$ + " \providecommand{\doi}[1]{doi:\discretionary{}{}{}#1}\else" + write$ newline$ + " \providecommand{\doi}{doi:\discretionary{}{}{}\begingroup \urlstyle{rm}\Url}\fi" + write$ newline$ +} +EXECUTE {begin.bib} +EXECUTE {init.state.consts} +ITERATE {call.type$} +FUNCTION {end.bib} +{ newline$ + "\end{thebibliography}" write$ newline$ +} +EXECUTE {end.bib} +%% End of customized bst file +%% +%% End of file `agufull08.bst'. diff --git a/make/makefile b/make/makefile index d0362441da3..068f81bd825 100644 --- a/make/makefile +++ b/make/makefile @@ -280,6 +280,7 @@ $(OBJDIR)/GhostNode.o \ $(OBJDIR)/gwf3evt8.o \ $(OBJDIR)/gwf3chd8.o \ $(OBJDIR)/gwe1sfe1.o \ +$(OBJDIR)/gwe1lke1.o \ $(OBJDIR)/gwe1est1.o \ $(OBJDIR)/gwe1esl1.o \ $(OBJDIR)/gwe1ctp1.o \ diff --git a/msvs/mf6core.vfproj b/msvs/mf6core.vfproj index 497173b176f..1fbd78462a0 100644 --- a/msvs/mf6core.vfproj +++ b/msvs/mf6core.vfproj @@ -142,6 +142,7 @@ + diff --git a/src/Model/GroundWaterEnergy/gwe1.f90 b/src/Model/GroundWaterEnergy/gwe1.f90 index 21fef839832..e2c86d2c738 100644 --- a/src/Model/GroundWaterEnergy/gwe1.f90 +++ b/src/Model/GroundWaterEnergy/gwe1.f90 @@ -86,7 +86,7 @@ module GweModule &'MWE6 ', 'UZE6 ', 'API6 ', ' ', ' ', & ! 10 &40*' '/ ! 50 - ! -- size of supported model package arrays + ! -- Size of supported model package arrays integer(I4B), parameter :: NIUNIT_GWE = GWE_NBASEPKG + GWE_NMULTIPKG contains @@ -133,7 +133,7 @@ subroutine gwe_cr(filename, id, modelname) ! -- Call parent class routine call this%tsp_cr(filename, id, modelname, 'GWE', indis) ! - ! -- create model packages + ! -- Create model packages call this%create_packages(indis) ! ! -- Return @@ -288,7 +288,7 @@ subroutine gwe_ar(this) ! -- Call dis_ar to write binary grid file !call this%dis%dis_ar(this%npf%icelltype) ! - ! -- set up output control + ! -- Set up output control call this%oc%oc_ar(this%x, this%dis, DHNOFLO, this%depvartype) call this%budget%set_ibudcsv(this%oc%ibudcsv) ! @@ -357,7 +357,7 @@ subroutine gwe_ad(this) if (iFailedStepRetry > 0) irestore = 1 if (irestore == 0) then ! - ! -- copy x into xold + ! -- Copy x into xold do n = 1, this%dis%nodes if (this%ibound(n) == 0) then this%xold(n) = DZERO @@ -367,7 +367,7 @@ subroutine gwe_ad(this) end do else ! - ! -- copy xold into x if this time step is a redo + ! -- Copy xold into x if this time step is a redo do n = 1, this%dis%nodes this%x(n) = this%xold(n) end do @@ -400,7 +400,6 @@ end subroutine gwe_ad !! subroutines !< subroutine gwe_cf(this, kiter) - ! -- modules ! -- dummy class(GweModelType) :: this integer(I4B), intent(in) :: kiter @@ -424,7 +423,6 @@ end subroutine gwe_cf !! subroutines !< subroutine gwe_fc(this, kiter, matrix_sln, inwtflag) - ! -- modules ! -- dummy class(GweModelType) :: this integer(I4B), intent(in) :: kiter @@ -434,7 +432,7 @@ subroutine gwe_fc(this, kiter, matrix_sln, inwtflag) class(BndType), pointer :: packobj integer(I4B) :: ip ! - ! -- call fc routines + ! -- Call fc routines call this%fmi%fmi_fc(this%dis%nodes, this%xold, this%nja, matrix_sln, & this%idxglo, this%rhs) if (this%inmvt > 0) then @@ -456,7 +454,7 @@ subroutine gwe_fc(this, kiter, matrix_sln, inwtflag) call this%ssm%ssm_fc(matrix_sln, this%idxglo, this%rhs) end if ! - ! -- packages + ! -- Packages do ip = 1, this%bndlist%Count() packobj => GetBndFromList(this%bndlist, ip) call packobj%bnd_fc(this%rhs, this%ia, this%idxglo, matrix_sln) @@ -481,8 +479,6 @@ subroutine gwe_cc(this, innertot, kiter, iend, icnvgmod, cpak, ipak, dpak) character(len=LENPAKLOC), intent(inout) :: cpak integer(I4B), intent(inout) :: ipak real(DP), intent(inout) :: dpak - ! -- local - ! -- formats ! ! -- If mover is on, then at least 2 outers required if (this%inmvt > 0) call this%mvt%mvt_cc(kiter, iend, icnvgmod, cpak, dpak) @@ -740,10 +736,10 @@ subroutine allocate_scalars(this, modelname) class(GweModelType) :: this character(len=*), intent(in) :: modelname ! - ! -- allocate parent class scalars + ! -- Allocate parent class scalars call this%allocate_tsp_scalars(modelname) ! - ! -- allocate members that are part of model class + ! -- Allocate members that are part of model class call mem_allocate(this%inest, 'INEST', this%memoryPath) call mem_allocate(this%incnd, 'INCND', this%memoryPath) ! @@ -766,7 +762,7 @@ subroutine package_create(this, filtyp, ipakid, ipaknum, pakname, mempath, & use SimModule, only: store_error use GweCtpModule, only: ctp_create use GweEslModule, only: esl_create - !use GweLkeModule, only: lke_create + use GweLkeModule, only: lke_create use GweSfeModule, only: sfe_create !use GweMweModule, only: mwe_create !use GweUzeModule, only: uze_create @@ -794,10 +790,10 @@ subroutine package_create(this, filtyp, ipakid, ipaknum, pakname, mempath, & case ('ESL6') call esl_create(packobj, ipakid, ipaknum, inunit, iout, this%name, & pakname, this%gwecommon) - !case ('LKE6') - ! call lke_create(packobj, ipakid, ipaknum, inunit, iout, this%name, & - ! pakname, this%fmi, this%tsplab, this%eqnsclfac, & - ! this%gwecommon) + case ('LKE6') + call lke_create(packobj, ipakid, ipaknum, inunit, iout, this%name, & + pakname, this%fmi, this%eqnsclfac, this%gwecommon, & + this%depvartype, this%depvarunit, this%depvarunitabbrev) case ('SFE6') call sfe_create(packobj, ipakid, ipaknum, inunit, iout, this%name, & pakname, this%fmi, this%eqnsclfac, this%gwecommon, & @@ -838,9 +834,11 @@ end subroutine package_create !> @brief Cast to GweModelType !< function CastAsGweModel(model) result(gwemodel) + ! -- dummy class(*), pointer :: model !< The object to be cast + ! -- return class(GweModelType), pointer :: gwemodel !< The GWE model - + ! gwemodel => null() if (.not. associated(model)) return select type (model) @@ -877,10 +875,10 @@ subroutine create_bndpkgs(this, bndpkgs, pkgtypes, pkgnames, & character(len=LENMEMPATH) :: mempath integer(I4B), pointer :: inunit integer(I4B) :: n - + ! if (allocated(bndpkgs)) then ! - ! -- create stress packages + ! -- Create stress packages ipakid = 1 bndptype = '' do n = 1, size(bndpkgs) @@ -901,7 +899,7 @@ subroutine create_bndpkgs(this, bndpkgs, pkgtypes, pkgnames, & ipaknum = ipaknum + 1 end do ! - ! -- cleanup + ! -- Cleanup deallocate (bndpkgs) end if ! @@ -942,10 +940,10 @@ subroutine create_gwe_packages(this, indis) integer(I4B) :: n character(len=LENMEMPATH) :: mempathcnd = '' ! - ! -- set input memory paths, input/model and input/model/namfile + ! -- Set input memory paths, input/model and input/model/namfile model_mempath = create_mem_path(component=this%name, context=idm_context) ! - ! -- set pointers to model path package info + ! -- Set pointers to model path package info call mem_setptr(pkgtypes, 'PKGTYPES', model_mempath) call mem_setptr(pkgnames, 'PKGNAMES', model_mempath) call mem_setptr(mempaths, 'MEMPATHS', model_mempath) @@ -953,13 +951,13 @@ subroutine create_gwe_packages(this, indis) ! do n = 1, size(pkgtypes) ! - ! attributes for this input package + ! -- Attributes for this input package pkgtype = pkgtypes(n) pkgname = pkgnames(n) mempath = mempaths(n) inunit => inunits(n) ! - ! -- create dis package as it is a prerequisite for other packages + ! -- Create dis package as it is a prerequisite for other packages select case (pkgtype) case ('EST6') this%inest = inunit diff --git a/src/Model/GroundWaterEnergy/gwe1lke1.f90 b/src/Model/GroundWaterEnergy/gwe1lke1.f90 new file mode 100644 index 00000000000..46c932ffad8 --- /dev/null +++ b/src/Model/GroundWaterEnergy/gwe1lke1.f90 @@ -0,0 +1,1241 @@ +! -- Lake Energy Transport Module +! -- todo: what to do about reactions in lake? Decay? +! -- todo: save the lke temperatures into the lak aux variable? +! +! LAK flows (lakbudptr) index var LKT term Transport Type +!--------------------------------------------------------------------------------- + +! -- terms from LAK that will be handled by parent APT Package +! FLOW-JA-FACE idxbudfjf FLOW-JA-FACE cv2cv +! GWF (aux FLOW-AREA) idxbudgwf GWF cv2gwf +! STORAGE (aux VOLUME) idxbudsto none used for cv volumes +! FROM-MVR idxbudfmvr FROM-MVR q * cext = this%qfrommvr(:) +! TO-MVR idxbudtmvr TO-MVR q * cfeat + +! -- LAK terms +! RAINFALL idxbudrain RAINFALL q * crain +! EVAPORATION idxbudevap EVAPORATION cfeat null() !< pointer to shared gwe data used by multiple packages but set in mst + + integer(I4B), pointer :: idxbudrain => null() ! index of rainfall terms in flowbudptr + integer(I4B), pointer :: idxbudevap => null() ! index of evaporation terms in flowbudptr + integer(I4B), pointer :: idxbudroff => null() ! index of runoff terms in flowbudptr + integer(I4B), pointer :: idxbudiflw => null() ! index of inflow terms in flowbudptr + integer(I4B), pointer :: idxbudwdrl => null() ! index of withdrawal terms in flowbudptr + integer(I4B), pointer :: idxbudoutf => null() ! index of outflow terms in flowbudptr + integer(I4B), pointer :: idxbudlbcd => null() ! index of lakebed conduction terms in flowbudptr + + real(DP), dimension(:), pointer, contiguous :: temprain => null() ! rainfall temperature + real(DP), dimension(:), pointer, contiguous :: tempevap => null() ! evaporation temperature + real(DP), dimension(:), pointer, contiguous :: temproff => null() ! runoff temperature + real(DP), dimension(:), pointer, contiguous :: tempiflw => null() ! inflow temperature + + contains + + procedure :: bnd_da => lke_da + procedure :: allocate_scalars + procedure :: apt_allocate_arrays => lke_allocate_arrays + procedure :: find_apt_package => find_lke_package + procedure :: pak_fc_expanded => lke_fc_expanded + procedure :: pak_solve => lke_solve + procedure :: pak_get_nbudterms => lke_get_nbudterms + procedure :: pak_setup_budobj => lke_setup_budobj + procedure :: pak_fill_budobj => lke_fill_budobj + procedure :: lke_rain_term + procedure :: lke_evap_term + procedure :: lke_roff_term + procedure :: lke_iflw_term + procedure :: lke_wdrl_term + procedure :: lke_outf_term + procedure :: pak_df_obs => lke_df_obs + procedure :: pak_rp_obs => lke_rp_obs + procedure :: pak_bd_obs => lke_bd_obs + procedure :: pak_set_stressperiod => lke_set_stressperiod + + end type GweLkeType + +contains + + !> @brief Create a new lke package + !< + subroutine lke_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, & + fmi, eqnsclfac, gwecommon, dvt, dvu, dvua) + ! -- dummy + class(BndType), pointer :: packobj + integer(I4B), intent(in) :: id + integer(I4B), intent(in) :: ibcnum + integer(I4B), intent(in) :: inunit + integer(I4B), intent(in) :: iout + character(len=*), intent(in) :: namemodel + character(len=*), intent(in) :: pakname + type(TspFmiType), pointer :: fmi + real(DP), intent(in), pointer :: eqnsclfac !< governing equation scale factor + type(GweInputDataType), intent(in), target :: gwecommon !< shared data container for use by multiple GWE packages + character(len=*), intent(in) :: dvt !< For GWE, set to "TEMPERATURE" in TspAptType + character(len=*), intent(in) :: dvu !< For GWE, set to "energy" in TspAptType + character(len=*), intent(in) :: dvua !< For GWE, set to "E" in TspAptType + ! -- local + type(GweLkeType), pointer :: lkeobj + ! + ! -- Allocate the object and assign values to object variables + allocate (lkeobj) + packobj => lkeobj + ! + ! -- Create name and memory path + call packobj%set_names(ibcnum, namemodel, pakname, ftype) + packobj%text = text + ! + ! -- Allocate scalars + call lkeobj%allocate_scalars() + ! + ! -- Initialize package + call packobj%pack_initialize() + ! + packobj%inunit = inunit + packobj%iout = iout + packobj%id = id + packobj%ibcnum = ibcnum + packobj%ncolbnd = 1 + packobj%iscloc = 1 + ! + ! -- Store pointer to flow model interface. When the GwfGwe exchange is + ! created, it sets fmi%bndlist so that the GWE model has access to all + ! the flow packages + lkeobj%fmi => fmi + ! + ! -- Store pointer to governing equation scale factor + lkeobj%eqnsclfac => eqnsclfac + ! + ! -- Store pointer to shared data module for accessing cpw, rhow + ! for the budget calculations, and for accessing the latent heat of + ! vaporization for evaporative cooling. + lkeobj%gwecommon => gwecommon + ! + ! -- Set labels that will be used in generalized APT class + lkeobj%depvartype = dvt + lkeobj%depvarunit = dvu + lkeobj%depvarunitabbrev = dvua + ! + ! -- Return + return + end subroutine lke_create + + !> @brief Find corresponding lke package + !< + subroutine find_lke_package(this) + ! -- modules + use MemoryManagerModule, only: mem_allocate + ! -- dummy + class(GweLkeType) :: this + ! -- local + character(len=LINELENGTH) :: errmsg + class(BndType), pointer :: packobj + integer(I4B) :: ip, icount + integer(I4B) :: nbudterm + logical :: found + ! + ! -- Initialize found to false, and error later if flow package cannot + ! be found + found = .false. + ! + ! -- If user is specifying flows in a binary budget file, then set up + ! the budget file reader, otherwise set a pointer to the flow package + ! budobj + if (this%fmi%flows_from_file) then + call this%fmi%set_aptbudobj_pointer(this%flowpackagename, this%flowbudptr) + if (associated(this%flowbudptr)) found = .true. + ! + else + if (associated(this%fmi%gwfbndlist)) then + ! -- Look through gwfbndlist for a flow package with the same name as + ! this transport package name + do ip = 1, this%fmi%gwfbndlist%Count() + packobj => GetBndFromList(this%fmi%gwfbndlist, ip) + if (packobj%packName == this%flowpackagename) then + found = .true. + ! + ! -- Store BndType pointer to packobj, and then + ! use the select type to point to the budobj in flow package + this%flowpackagebnd => packobj + select type (packobj) + type is (LakType) + this%flowbudptr => packobj%budobj + end select + end if + if (found) exit + end do + end if + end if + ! + ! -- Error if flow package not found + if (.not. found) then + write (errmsg, '(a)') 'COULD NOT FIND FLOW PACKAGE WITH NAME '& + &//trim(adjustl(this%flowpackagename))//'.' + call store_error(errmsg) + call this%parser%StoreErrorUnit() + end if + ! + ! -- Allocate space for idxbudssm, which indicates whether this is a + ! special budget term or one that is a general source and sink + nbudterm = this%flowbudptr%nbudterm + call mem_allocate(this%idxbudssm, nbudterm, 'IDXBUDSSM', this%memoryPath) + ! + ! -- Process budget terms and identify special budget terms + write (this%iout, '(/, a, a)') & + 'PROCESSING '//ftype//' INFORMATION FOR ', this%packName + write (this%iout, '(a)') ' IDENTIFYING FLOW TERMS IN '//flowtype//' PACKAGE' + write (this%iout, '(a, i0)') & + ' NUMBER OF '//flowtype//' = ', this%flowbudptr%ncv + icount = 1 + do ip = 1, this%flowbudptr%nbudterm + select case (trim(adjustl(this%flowbudptr%budterm(ip)%flowtype))) + case ('FLOW-JA-FACE') + this%idxbudfjf = ip + this%idxbudssm(ip) = 0 + case ('GWF') + this%idxbudgwf = ip + this%idxbudlbcd = ip + this%idxbudssm(ip) = 0 + case ('STORAGE') + this%idxbudsto = ip + this%idxbudssm(ip) = 0 + case ('RAINFALL') + this%idxbudrain = ip + this%idxbudssm(ip) = 0 + case ('EVAPORATION') + this%idxbudevap = ip + this%idxbudssm(ip) = 0 + case ('RUNOFF') + this%idxbudroff = ip + this%idxbudssm(ip) = 0 + case ('EXT-INFLOW') + this%idxbudiflw = ip + this%idxbudssm(ip) = 0 + case ('WITHDRAWAL') + this%idxbudwdrl = ip + this%idxbudssm(ip) = 0 + case ('EXT-OUTFLOW') + this%idxbudoutf = ip + this%idxbudssm(ip) = 0 + case ('TO-MVR') + this%idxbudtmvr = ip + this%idxbudssm(ip) = 0 + case ('FROM-MVR') + this%idxbudfmvr = ip + this%idxbudssm(ip) = 0 + case ('AUXILIARY') + this%idxbudaux = ip + this%idxbudssm(ip) = 0 + case default + ! + ! -- Set idxbudssm equal to a column index for where the temperatures + ! are stored in the tempbud(nbudssm, ncv) array + this%idxbudssm(ip) = icount + icount = icount + 1 + end select + write (this%iout, '(a, i0, " = ", a,/, a, i0)') & + ' TERM ', ip, trim(adjustl(this%flowbudptr%budterm(ip)%flowtype)), & + ' MAX NO. OF ENTRIES = ', this%flowbudptr%budterm(ip)%maxlist + end do + write (this%iout, '(a, //)') 'DONE PROCESSING '//ftype//' INFORMATION' + ! + ! -- Return + return + end subroutine find_lke_package + + !> @brief Add matrix terms related to LKE + !! + !! This will be called from TspAptType%apt_fc_expanded() + !! in order to add matrix terms specifically for LKE + !< + subroutine lke_fc_expanded(this, rhs, ia, idxglo, matrix_sln) + ! -- dummy + class(GweLkeType) :: this + real(DP), dimension(:), intent(inout) :: rhs + integer(I4B), dimension(:), intent(in) :: ia + integer(I4B), dimension(:), intent(in) :: idxglo + class(MatrixBaseType), pointer :: matrix_sln + ! -- local + integer(I4B) :: j, n, n1, n2 + integer(I4B) :: iloc + integer(I4B) :: iposd, iposoffd + integer(I4B) :: ipossymd, ipossymoffd + integer(I4B) :: auxpos + real(DP) :: rrate + real(DP) :: rhsval + real(DP) :: hcofval + real(DP) :: ctherm !< thermal conductance + real(DP) :: wa !< wetted area + real(DP) :: ktf !< thermal conductivity of streambed material + real(DP) :: s !< thickness of conductive streambed material + ! + ! -- Add rainfall contribution + if (this%idxbudrain /= 0) then + do j = 1, this%flowbudptr%budterm(this%idxbudrain)%nlist + call this%lke_rain_term(j, n1, n2, rrate, rhsval, hcofval) + iloc = this%idxlocnode(n1) + iposd = this%idxpakdiag(n1) + call matrix_sln%add_value_pos(iposd, hcofval) + rhs(iloc) = rhs(iloc) + rhsval + end do + end if + ! + ! -- Add evaporation contribution + if (this%idxbudevap /= 0) then + do j = 1, this%flowbudptr%budterm(this%idxbudevap)%nlist + call this%lke_evap_term(j, n1, n2, rrate, rhsval, hcofval) + iloc = this%idxlocnode(n1) + iposd = this%idxpakdiag(n1) + call matrix_sln%add_value_pos(iposd, hcofval) + rhs(iloc) = rhs(iloc) + rhsval + end do + end if + ! + ! -- Add runoff contribution + if (this%idxbudroff /= 0) then + do j = 1, this%flowbudptr%budterm(this%idxbudroff)%nlist + call this%lke_roff_term(j, n1, n2, rrate, rhsval, hcofval) + iloc = this%idxlocnode(n1) + iposd = this%idxpakdiag(n1) + call matrix_sln%add_value_pos(iposd, hcofval) + rhs(iloc) = rhs(iloc) + rhsval + end do + end if + ! + ! -- Add inflow contribution + if (this%idxbudiflw /= 0) then + do j = 1, this%flowbudptr%budterm(this%idxbudiflw)%nlist + call this%lke_iflw_term(j, n1, n2, rrate, rhsval, hcofval) + iloc = this%idxlocnode(n1) + iposd = this%idxpakdiag(n1) + call matrix_sln%add_value_pos(iposd, hcofval) + rhs(iloc) = rhs(iloc) + rhsval + end do + end if + ! + ! -- Add withdrawal contribution + if (this%idxbudwdrl /= 0) then + do j = 1, this%flowbudptr%budterm(this%idxbudwdrl)%nlist + call this%lke_wdrl_term(j, n1, n2, rrate, rhsval, hcofval) + iloc = this%idxlocnode(n1) + iposd = this%idxpakdiag(n1) + call matrix_sln%add_value_pos(iposd, hcofval) + rhs(iloc) = rhs(iloc) + rhsval + end do + end if + ! + ! -- Add outflow contribution + if (this%idxbudoutf /= 0) then + do j = 1, this%flowbudptr%budterm(this%idxbudoutf)%nlist + call this%lke_outf_term(j, n1, n2, rrate, rhsval, hcofval) + iloc = this%idxlocnode(n1) + iposd = this%idxpakdiag(n1) + call matrix_sln%add_value_pos(iposd, hcofval) + rhs(iloc) = rhs(iloc) + rhsval + end do + end if + ! + ! -- Add lakebed conduction contribution + do j = 1, this%flowbudptr%budterm(this%idxbudgwf)%nlist + ! + ! -- Set n to feature number and process if active feature + n = this%flowbudptr%budterm(this%idxbudgwf)%id1(j) + if (this%iboundpak(n) /= 0) then + ! + ! -- Set acoef and rhs to negative so they are relative to sfe and not gwe + auxpos = this%flowbudptr%budterm(this%idxbudgwf)%naux + wa = this%flowbudptr%budterm(this%idxbudgwf)%auxvar(auxpos, j) + ktf = this%ktf(n) + s = this%rfeatthk(n) + ctherm = ktf * wa / s + ! + ! -- Add to sfe row + iposd = this%idxdglo(j) + iposoffd = this%idxoffdglo(j) + call matrix_sln%add_value_pos(iposd, -ctherm) ! kluge note: make sure the signs on ctherm are correct here and below + call matrix_sln%add_value_pos(iposoffd, ctherm) + ! + ! -- Add to gwe row for sfe connection + ipossymd = this%idxsymdglo(j) + ipossymoffd = this%idxsymoffdglo(j) + call matrix_sln%add_value_pos(ipossymd, -ctherm) + call matrix_sln%add_value_pos(ipossymoffd, ctherm) + end if + end do + ! + ! -- Return + return + end subroutine lke_fc_expanded + + !> @brief Add terms specific to lakes to the explicit lake solve + !< + subroutine lke_solve(this) + ! -- dummy + class(GweLkeType) :: this + ! -- local + integer(I4B) :: j + integer(I4B) :: n1, n2 + real(DP) :: rrate + ! + ! -- Add rainfall contribution + if (this%idxbudrain /= 0) then + do j = 1, this%flowbudptr%budterm(this%idxbudrain)%nlist + call this%lke_rain_term(j, n1, n2, rrate) + this%dbuff(n1) = this%dbuff(n1) + rrate + end do + end if + ! + ! -- Add evaporation contribution + if (this%idxbudevap /= 0) then + do j = 1, this%flowbudptr%budterm(this%idxbudevap)%nlist + call this%lke_evap_term(j, n1, n2, rrate) + this%dbuff(n1) = this%dbuff(n1) + rrate + end do + end if + ! + ! -- Add runoff contribution + if (this%idxbudroff /= 0) then + do j = 1, this%flowbudptr%budterm(this%idxbudroff)%nlist + call this%lke_roff_term(j, n1, n2, rrate) + this%dbuff(n1) = this%dbuff(n1) + rrate + end do + end if + ! + ! -- Add inflow contribution + if (this%idxbudiflw /= 0) then + do j = 1, this%flowbudptr%budterm(this%idxbudiflw)%nlist + call this%lke_iflw_term(j, n1, n2, rrate) + this%dbuff(n1) = this%dbuff(n1) + rrate + end do + end if + ! + ! -- Add withdrawal contribution + if (this%idxbudwdrl /= 0) then + do j = 1, this%flowbudptr%budterm(this%idxbudwdrl)%nlist + call this%lke_wdrl_term(j, n1, n2, rrate) + this%dbuff(n1) = this%dbuff(n1) + rrate + end do + end if + ! + ! -- Add outflow contribution + if (this%idxbudoutf /= 0) then + do j = 1, this%flowbudptr%budterm(this%idxbudoutf)%nlist + call this%lke_outf_term(j, n1, n2, rrate) + this%dbuff(n1) = this%dbuff(n1) + rrate + end do + end if + ! + ! -- Return + return + end subroutine lke_solve + + !> @brief Function to return the number of budget terms just for this package. + !! + !! This overrides a function in the parent class. + !< + function lke_get_nbudterms(this) result(nbudterms) + ! -- dummy + class(GweLkeType) :: this + ! -- Return + integer(I4B) :: nbudterms + ! + ! -- Number of budget terms is 7 + ! 1) rainfall + ! 2) evap + ! 3) runoff + ! 4) ext-inflow + ! 5) withdrawl + ! 6) ext-outflow + ! 7) lakebed-cond + ! + nbudterms = 7 + ! + ! -- Return + return + end function lke_get_nbudterms + + !> @brief Set up the budget object that stores all the lake flows + !< + subroutine lke_setup_budobj(this, idx) + ! -- modules + use ConstantsModule, only: LENBUDTXT + ! -- dummy + class(GweLkeType) :: this + integer(I4B), intent(inout) :: idx + ! -- local + integer(I4B) :: n, n1, n2 + integer(I4B) :: maxlist, naux + real(DP) :: q + character(len=LENBUDTXT) :: text + ! + ! -- Addition of heat associated with rainfall directly on the lake surface + text = ' RAINFALL' + idx = idx + 1 + maxlist = this%flowbudptr%budterm(this%idxbudrain)%maxlist + naux = 0 + call this%budobj%budterm(idx)%initialize(text, & + this%name_model, & + this%packName, & + this%name_model, & + this%packName, & + maxlist, .false., .false., & + naux) + ! + ! -- Evaporative cooling from lake surface + text = ' EVAPORATION' + idx = idx + 1 + maxlist = this%flowbudptr%budterm(this%idxbudevap)%maxlist + naux = 0 + call this%budobj%budterm(idx)%initialize(text, & + this%name_model, & + this%packName, & + this%name_model, & + this%packName, & + maxlist, .false., .false., & + naux) + ! + ! -- Addition of heat associated with runoff that flows to the lake + text = ' RUNOFF' + idx = idx + 1 + maxlist = this%flowbudptr%budterm(this%idxbudroff)%maxlist + naux = 0 + call this%budobj%budterm(idx)%initialize(text, & + this%name_model, & + this%packName, & + this%name_model, & + this%packName, & + maxlist, .false., .false., & + naux) + ! + ! -- Addition of heat associated with user-specified inflow to the lake + text = ' EXT-INFLOW' + idx = idx + 1 + maxlist = this%flowbudptr%budterm(this%idxbudiflw)%maxlist + naux = 0 + call this%budobj%budterm(idx)%initialize(text, & + this%name_model, & + this%packName, & + this%name_model, & + this%packName, & + maxlist, .false., .false., & + naux) + ! + ! -- Removal of heat associated with user-specified withdrawal from lake + text = ' WITHDRAWAL' + idx = idx + 1 + maxlist = this%flowbudptr%budterm(this%idxbudwdrl)%maxlist + naux = 0 + call this%budobj%budterm(idx)%initialize(text, & + this%name_model, & + this%packName, & + this%name_model, & + this%packName, & + maxlist, .false., .false., & + naux) + ! + ! -- Removal of heat associated with outflow from lake that leaves + ! model domain + text = ' EXT-OUTFLOW' + idx = idx + 1 + maxlist = this%flowbudptr%budterm(this%idxbudoutf)%maxlist + naux = 0 + call this%budobj%budterm(idx)%initialize(text, & + this%name_model, & + this%packName, & + this%name_model, & + this%packName, & + maxlist, .false., .false., & + naux) + ! + ! -- Conductive exchange of heat through the wetted lakebed + text = ' LAKEBED-COND' + idx = idx + 1 + maxlist = this%flowbudptr%budterm(this%idxbudlbcd)%maxlist + naux = 0 + call this%budobj%budterm(idx)%initialize(text, & + this%name_model, & + this%packName, & + this%name_model, & + this%packName, & + maxlist, .false., .false., & + naux) + call this%budobj%budterm(idx)%reset(maxlist) + q = DZERO + do n = 1, maxlist + n1 = this%flowbudptr%budterm(this%idxbudgwf)%id1(n) + n2 = this%flowbudptr%budterm(this%idxbudgwf)%id2(n) + call this%budobj%budterm(idx)%update_term(n1, n2, q) + end do + ! + ! -- Return + return + end subroutine lke_setup_budobj + + !> @brief Copy flow terms into this%budobj + !< + subroutine lke_fill_budobj(this, idx, x, flowja, ccratin, ccratout) + ! -- dummy + class(GweLkeType) :: this + integer(I4B), intent(inout) :: idx + real(DP), dimension(:), intent(in) :: x + real(DP), dimension(:), contiguous, intent(inout) :: flowja + real(DP), intent(inout) :: ccratin + real(DP), intent(inout) :: ccratout + ! -- local + integer(I4B) :: j, n1, n2 + integer(I4B) :: nlist + integer(I4B) :: igwfnode + integer(I4B) :: idiag + integer(I4B) :: auxpos + real(DP) :: q + real(DP) :: ctherm !< thermal conductance + real(DP) :: wa !< wetted area + real(DP) :: ktf !< thermal conductivity of streambed material + real(DP) :: s !< thickness of conductive streambed materia + ! + ! -- Rain + idx = idx + 1 + nlist = this%flowbudptr%budterm(this%idxbudrain)%nlist + call this%budobj%budterm(idx)%reset(nlist) + do j = 1, nlist + call this%lke_rain_term(j, n1, n2, q) + call this%budobj%budterm(idx)%update_term(n1, n2, q) + call this%apt_accumulate_ccterm(n1, q, ccratin, ccratout) + end do + ! + ! -- Evaporation + idx = idx + 1 + nlist = this%flowbudptr%budterm(this%idxbudevap)%nlist + call this%budobj%budterm(idx)%reset(nlist) + do j = 1, nlist + call this%lke_evap_term(j, n1, n2, q) + call this%budobj%budterm(idx)%update_term(n1, n2, q) + call this%apt_accumulate_ccterm(n1, q, ccratin, ccratout) + end do + ! + ! -- Runoff + idx = idx + 1 + nlist = this%flowbudptr%budterm(this%idxbudroff)%nlist + call this%budobj%budterm(idx)%reset(nlist) + do j = 1, nlist + call this%lke_roff_term(j, n1, n2, q) + call this%budobj%budterm(idx)%update_term(n1, n2, q) + call this%apt_accumulate_ccterm(n1, q, ccratin, ccratout) + end do + ! + ! -- Est-Inflow + idx = idx + 1 + nlist = this%flowbudptr%budterm(this%idxbudiflw)%nlist + call this%budobj%budterm(idx)%reset(nlist) + do j = 1, nlist + call this%lke_iflw_term(j, n1, n2, q) + call this%budobj%budterm(idx)%update_term(n1, n2, q) + call this%apt_accumulate_ccterm(n1, q, ccratin, ccratout) + end do + ! + ! -- Withdrawal + idx = idx + 1 + nlist = this%flowbudptr%budterm(this%idxbudwdrl)%nlist + call this%budobj%budterm(idx)%reset(nlist) + do j = 1, nlist + call this%lke_wdrl_term(j, n1, n2, q) + call this%budobj%budterm(idx)%update_term(n1, n2, q) + call this%apt_accumulate_ccterm(n1, q, ccratin, ccratout) + end do + ! + ! -- Ext-Outflow + idx = idx + 1 + nlist = this%flowbudptr%budterm(this%idxbudoutf)%nlist + call this%budobj%budterm(idx)%reset(nlist) + do j = 1, nlist + call this%lke_outf_term(j, n1, n2, q) + call this%budobj%budterm(idx)%update_term(n1, n2, q) + call this%apt_accumulate_ccterm(n1, q, ccratin, ccratout) + end do + ! + ! -- Lakebed-Cond + idx = idx + 1 + call this%budobj%budterm(idx)%reset(this%maxbound) + do j = 1, this%flowbudptr%budterm(this%idxbudlbcd)%nlist + q = DZERO + n1 = this%flowbudptr%budterm(this%idxbudlbcd)%id1(j) + if (this%iboundpak(n1) /= 0) then + igwfnode = this%flowbudptr%budterm(this%idxbudlbcd)%id2(j) + auxpos = this%flowbudptr%budterm(this%idxbudgwf)%naux ! for now there is only 1 aux variable under 'GWF' + wa = this%flowbudptr%budterm(this%idxbudgwf)%auxvar(auxpos, j) + ktf = this%ktf(n1) + s = this%rfeatthk(n1) + ctherm = ktf * wa / s + q = ctherm * (x(igwfnode) - this%xnewpak(n1)) + end if + call this%budobj%budterm(idx)%update_term(n1, igwfnode, q) + call this%apt_accumulate_ccterm(n1, q, ccratin, ccratout) + if (this%iboundpak(n1) /= 0) then + ! -- Contribution to gwe cell budget + this%simvals(n1) = this%simvals(n1) - q + idiag = this%dis%con%ia(igwfnode) + flowja(idiag) = flowja(idiag) - q + end if + end do + ! + ! -- Return + return + end subroutine lke_fill_budobj + + !> @brief Allocate scalars specific to the lake energy transport (LKE) + !! package. + !< + subroutine allocate_scalars(this) + ! -- modules + use MemoryManagerModule, only: mem_allocate + ! -- dummy + class(GweLkeType) :: this + ! + ! -- Allocate scalars in TspAptType + call this%TspAptType%allocate_scalars() + ! + ! -- Allocate + call mem_allocate(this%idxbudrain, 'IDXBUDRAIN', this%memoryPath) + call mem_allocate(this%idxbudevap, 'IDXBUDEVAP', this%memoryPath) + call mem_allocate(this%idxbudroff, 'IDXBUDROFF', this%memoryPath) + call mem_allocate(this%idxbudiflw, 'IDXBUDIFLW', this%memoryPath) + call mem_allocate(this%idxbudwdrl, 'IDXBUDWDRL', this%memoryPath) + call mem_allocate(this%idxbudoutf, 'IDXBUDOUTF', this%memoryPath) + call mem_allocate(this%idxbudlbcd, 'IDXBUDLBCD', this%memoryPath) + ! + ! -- Initialize + this%idxbudrain = 0 + this%idxbudevap = 0 + this%idxbudroff = 0 + this%idxbudiflw = 0 + this%idxbudwdrl = 0 + this%idxbudoutf = 0 + this%idxbudlbcd = 0 + ! + ! -- Return + return + end subroutine allocate_scalars + + !> @brief Allocate arrays specific to the lake energy transport (LKE) + !! package. + !< + subroutine lke_allocate_arrays(this) + ! -- modules + use MemoryManagerModule, only: mem_allocate + ! -- dummy + class(GweLkeType), intent(inout) :: this + ! -- local + integer(I4B) :: n + ! + ! -- Time series + call mem_allocate(this%temprain, this%ncv, 'TEMPRAIN', this%memoryPath) + call mem_allocate(this%tempevap, this%ncv, 'TEMPEVAP', this%memoryPath) + call mem_allocate(this%temproff, this%ncv, 'TEMPROFF', this%memoryPath) + call mem_allocate(this%tempiflw, this%ncv, 'TEMPIFLW', this%memoryPath) + ! + ! -- Call standard TspAptType allocate arrays + call this%TspAptType%apt_allocate_arrays() + ! + ! -- Initialize + do n = 1, this%ncv + this%temprain(n) = DZERO + this%tempevap(n) = DZERO + this%temproff(n) = DZERO + this%tempiflw(n) = DZERO + end do + ! + ! + ! -- Return + return + end subroutine lke_allocate_arrays + + !> @brief Deallocate memory + !< + subroutine lke_da(this) + ! -- modules + use MemoryManagerModule, only: mem_deallocate + ! -- dummy + class(GweLkeType) :: this + ! + ! -- Deallocate scalars + call mem_deallocate(this%idxbudrain) + call mem_deallocate(this%idxbudevap) + call mem_deallocate(this%idxbudroff) + call mem_deallocate(this%idxbudiflw) + call mem_deallocate(this%idxbudwdrl) + call mem_deallocate(this%idxbudoutf) + call mem_deallocate(this%idxbudlbcd) + ! + ! -- Deallocate time series + call mem_deallocate(this%temprain) + call mem_deallocate(this%tempevap) + call mem_deallocate(this%temproff) + call mem_deallocate(this%tempiflw) + ! + ! -- Deallocate scalars in TspAptType + call this%TspAptType%bnd_da() + ! + ! -- Return + return + end subroutine lke_da + + !> @brief Rain term + !< + subroutine lke_rain_term(this, ientry, n1, n2, rrate, & + rhsval, hcofval) + ! -- dummy + class(GweLkeType) :: this + integer(I4B), intent(in) :: ientry + integer(I4B), intent(inout) :: n1 + integer(I4B), intent(inout) :: n2 + real(DP), intent(inout), optional :: rrate + real(DP), intent(inout), optional :: rhsval + real(DP), intent(inout), optional :: hcofval + ! -- local + real(DP) :: qbnd + real(DP) :: ctmp + ! + n1 = this%flowbudptr%budterm(this%idxbudrain)%id1(ientry) + n2 = this%flowbudptr%budterm(this%idxbudrain)%id2(ientry) + qbnd = this%flowbudptr%budterm(this%idxbudrain)%flow(ientry) + ctmp = this%temprain(n1) + if (present(rrate)) rrate = ctmp * qbnd * this%eqnsclfac + if (present(rhsval)) rhsval = -rrate + if (present(hcofval)) hcofval = DZERO + ! + ! -- Return + return + end subroutine lke_rain_term + + !> @brief Evaporative term + !< + subroutine lke_evap_term(this, ientry, n1, n2, rrate, & + rhsval, hcofval) + ! -- dummy + class(GweLkeType) :: this + integer(I4B), intent(in) :: ientry + integer(I4B), intent(inout) :: n1 + integer(I4B), intent(inout) :: n2 + real(DP), intent(inout), optional :: rrate + real(DP), intent(inout), optional :: rhsval + real(DP), intent(inout), optional :: hcofval + ! -- local + real(DP) :: qbnd + real(DP) :: heatlat + ! + n1 = this%flowbudptr%budterm(this%idxbudevap)%id1(ientry) + n2 = this%flowbudptr%budterm(this%idxbudevap)%id2(ientry) + ! -- Note that qbnd is negative for evap + qbnd = this%flowbudptr%budterm(this%idxbudevap)%flow(ientry) + heatlat = this%gwecommon%gwerhow * this%gwecommon%gwelatheatvap + if (present(rrate)) rrate = qbnd * heatlat + if (present(rhsval)) rhsval = -rrate + if (present(hcofval)) hcofval = DZERO + ! + ! -- Return + return + end subroutine lke_evap_term + + !> @brief Runoff term + !< + subroutine lke_roff_term(this, ientry, n1, n2, rrate, & + rhsval, hcofval) + ! -- dummy + class(GweLkeType) :: this + integer(I4B), intent(in) :: ientry + integer(I4B), intent(inout) :: n1 + integer(I4B), intent(inout) :: n2 + real(DP), intent(inout), optional :: rrate + real(DP), intent(inout), optional :: rhsval + real(DP), intent(inout), optional :: hcofval + ! -- local + real(DP) :: qbnd + real(DP) :: ctmp + ! + n1 = this%flowbudptr%budterm(this%idxbudroff)%id1(ientry) + n2 = this%flowbudptr%budterm(this%idxbudroff)%id2(ientry) + qbnd = this%flowbudptr%budterm(this%idxbudroff)%flow(ientry) + ctmp = this%temproff(n1) + if (present(rrate)) rrate = ctmp * qbnd * this%eqnsclfac + if (present(rhsval)) rhsval = -rrate + if (present(hcofval)) hcofval = DZERO + ! + ! -- Return + return + end subroutine lke_roff_term + + !> @brief Inflow Term + !! + !! Accounts for energy flowing into a lake from a connected stream, for + !! example. + !< + subroutine lke_iflw_term(this, ientry, n1, n2, rrate, & + rhsval, hcofval) + ! -- dummy + class(GweLkeType) :: this + integer(I4B), intent(in) :: ientry + integer(I4B), intent(inout) :: n1 + integer(I4B), intent(inout) :: n2 + real(DP), intent(inout), optional :: rrate + real(DP), intent(inout), optional :: rhsval + real(DP), intent(inout), optional :: hcofval + ! -- local + real(DP) :: qbnd + real(DP) :: ctmp + ! + n1 = this%flowbudptr%budterm(this%idxbudiflw)%id1(ientry) + n2 = this%flowbudptr%budterm(this%idxbudiflw)%id2(ientry) + qbnd = this%flowbudptr%budterm(this%idxbudiflw)%flow(ientry) + ctmp = this%tempiflw(n1) + if (present(rrate)) rrate = ctmp * qbnd * this%eqnsclfac + if (present(rhsval)) rhsval = -rrate + if (present(hcofval)) hcofval = DZERO + ! + ! -- Return + return + end subroutine lke_iflw_term + + !> @brief Specified withdrawal term + !! + !! Accounts for energy associated with a withdrawal of water from a lake + !! or group of lakes. + !< + subroutine lke_wdrl_term(this, ientry, n1, n2, rrate, & + rhsval, hcofval) + ! -- dummy + class(GweLkeType) :: this + integer(I4B), intent(in) :: ientry + integer(I4B), intent(inout) :: n1 + integer(I4B), intent(inout) :: n2 + real(DP), intent(inout), optional :: rrate + real(DP), intent(inout), optional :: rhsval + real(DP), intent(inout), optional :: hcofval + ! -- local + real(DP) :: qbnd + real(DP) :: ctmp + ! + n1 = this%flowbudptr%budterm(this%idxbudwdrl)%id1(ientry) + n2 = this%flowbudptr%budterm(this%idxbudwdrl)%id2(ientry) + qbnd = this%flowbudptr%budterm(this%idxbudwdrl)%flow(ientry) + ctmp = this%xnewpak(n1) + if (present(rrate)) rrate = ctmp * qbnd * this%eqnsclfac + if (present(rhsval)) rhsval = DZERO + if (present(hcofval)) hcofval = qbnd * this%eqnsclfac + ! + ! -- Return + return + end subroutine lke_wdrl_term + + !> @brief Outflow term + !! + !! Accounts for the energy leaving a lake, for example, energy exiting a + !! lake via a flow into a draining stream channel. + !< + subroutine lke_outf_term(this, ientry, n1, n2, rrate, & + rhsval, hcofval) + ! -- dummy + class(GweLkeType) :: this + integer(I4B), intent(in) :: ientry + integer(I4B), intent(inout) :: n1 + integer(I4B), intent(inout) :: n2 + real(DP), intent(inout), optional :: rrate + real(DP), intent(inout), optional :: rhsval + real(DP), intent(inout), optional :: hcofval + ! -- local + real(DP) :: qbnd + real(DP) :: ctmp + ! + n1 = this%flowbudptr%budterm(this%idxbudoutf)%id1(ientry) + n2 = this%flowbudptr%budterm(this%idxbudoutf)%id2(ientry) + qbnd = this%flowbudptr%budterm(this%idxbudoutf)%flow(ientry) + ctmp = this%xnewpak(n1) + if (present(rrate)) rrate = ctmp * qbnd * this%eqnsclfac + if (present(rhsval)) rhsval = DZERO + if (present(hcofval)) hcofval = qbnd * this%eqnsclfac + ! + ! -- Return + return + end subroutine lke_outf_term + + !> @brief Defined observation types + !! + !! Store the observation type supported by the APT package and overide + !! BndType%bnd_df_obs + !< + subroutine lke_df_obs(this) + ! -- dummy + class(GweLkeType) :: this + ! -- local + integer(I4B) :: indx + ! + ! -- Store obs type and assign procedure pointer + ! for temperature observation type. + call this%obs%StoreObsType('temperature', .false., indx) + this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsID + ! + ! -- Store obs type and assign procedure pointer + ! for flow between features, such as lake to lake. + call this%obs%StoreObsType('flow-ja-face', .true., indx) + this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsID12 + ! + ! -- Store obs type and assign procedure pointer + ! for from-mvr observation type. + call this%obs%StoreObsType('from-mvr', .true., indx) + this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsID + ! + ! -- Store obs type and assign procedure pointer + ! for to-mvr observation type. + call this%obs%StoreObsType('to-mvr', .true., indx) + this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsID + ! + ! -- Store obs type and assign procedure pointer + ! for storage observation type. + call this%obs%StoreObsType('storage', .true., indx) + this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsID + ! + ! -- Store obs type and assign procedure pointer + ! for constant observation type. + call this%obs%StoreObsType('constant', .true., indx) + this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsID + ! + ! -- Store obs type and assign procedure pointer + ! for observation type: lke + call this%obs%StoreObsType('lke', .true., indx) + this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsID + ! + ! -- Store obs type and assign procedure pointer + ! for rainfall observation type. + call this%obs%StoreObsType('rainfall', .true., indx) + this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsID + ! + ! -- Store obs type and assign procedure pointer + ! for evaporation observation type. + call this%obs%StoreObsType('evaporation', .true., indx) + this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsID + ! + ! -- Store obs type and assign procedure pointer + ! for runoff observation type. + call this%obs%StoreObsType('runoff', .true., indx) + this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsID + ! + ! -- Store obs type and assign procedure pointer + ! for inflow observation type. + call this%obs%StoreObsType('ext-inflow', .true., indx) + this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsID + ! + ! -- Store obs type and assign procedure pointer + ! for withdrawal observation type. + call this%obs%StoreObsType('withdrawal', .true., indx) + this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsID + ! + ! -- Store obs type and assign procedure pointer + ! for ext-outflow observation type. + call this%obs%StoreObsType('ext-outflow', .true., indx) + this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsID + ! + ! -- Return + return + end subroutine lke_df_obs + + !> @brief Process package specific obs + !! + !! Method to process specific observations for this package. + !< + subroutine lke_rp_obs(this, obsrv, found) + ! -- dummy + class(GweLkeType), intent(inout) :: this !< package class + type(ObserveType), intent(inout) :: obsrv !< observation object + logical, intent(inout) :: found !< indicate whether observation was found + ! + found = .true. + select case (obsrv%ObsTypeId) + case ('RAINFALL') + call this%rp_obs_byfeature(obsrv) + case ('EVAPORATION') + call this%rp_obs_byfeature(obsrv) + case ('RUNOFF') + call this%rp_obs_byfeature(obsrv) + case ('EXT-INFLOW') + call this%rp_obs_byfeature(obsrv) + case ('WITHDRAWAL') + call this%rp_obs_byfeature(obsrv) + case ('EXT-OUTFLOW') + call this%rp_obs_byfeature(obsrv) + case ('TO-MVR') + call this%rp_obs_budterm(obsrv, & + this%flowbudptr%budterm(this%idxbudtmvr)) + case default + found = .false. + end select + ! + ! -- Return + return + end subroutine lke_rp_obs + + !> @brief Calculate observation value and pass it back to APT + !< + subroutine lke_bd_obs(this, obstypeid, jj, v, found) + ! -- dummy + class(GweLkeType), intent(inout) :: this + character(len=*), intent(in) :: obstypeid + real(DP), intent(inout) :: v + integer(I4B), intent(in) :: jj + logical, intent(inout) :: found + ! -- local + integer(I4B) :: n1, n2 + ! + found = .true. + select case (obstypeid) + case ('RAINFALL') + if (this%iboundpak(jj) /= 0) then + call this%lke_rain_term(jj, n1, n2, v) + end if + case ('EVAPORATION') + if (this%iboundpak(jj) /= 0) then + call this%lke_evap_term(jj, n1, n2, v) + end if + case ('RUNOFF') + if (this%iboundpak(jj) /= 0) then + call this%lke_roff_term(jj, n1, n2, v) + end if + case ('EXT-INFLOW') + if (this%iboundpak(jj) /= 0) then + call this%lke_iflw_term(jj, n1, n2, v) + end if + case ('WITHDRAWAL') + if (this%iboundpak(jj) /= 0) then + call this%lke_wdrl_term(jj, n1, n2, v) + end if + case ('EXT-OUTFLOW') + if (this%iboundpak(jj) /= 0) then + call this%lke_outf_term(jj, n1, n2, v) + end if + case default + found = .false. + end select + ! + ! -- Return + return + end subroutine lke_bd_obs + + !> @brief Sets the stress period attributes for keyword use. + !< + subroutine lke_set_stressperiod(this, itemno, keyword, found) + ! -- modules + use TimeSeriesManagerModule, only: read_value_or_time_series_adv + ! -- dummy + class(GweLkeType), intent(inout) :: this + integer(I4B), intent(in) :: itemno + character(len=*), intent(in) :: keyword + logical, intent(inout) :: found + ! -- local + character(len=LINELENGTH) :: text + integer(I4B) :: ierr + integer(I4B) :: jj + real(DP), pointer :: bndElem => null() + ! + ! RAINFALL + ! EVAPORATION + ! RUNOFF + ! EXT-INFLOW + ! WITHDRAWAL + ! + found = .true. + select case (keyword) + case ('RAINFALL') + ierr = this%apt_check_valid(itemno) + if (ierr /= 0) then + goto 999 + end if + call this%parser%GetString(text) + jj = 1 + bndElem => this%temprain(itemno) + call read_value_or_time_series_adv(text, itemno, jj, bndElem, & + this%packName, 'BND', this%tsManager, & + this%iprpak, 'RAINFALL') + case ('EVAPORATION') + ierr = this%apt_check_valid(itemno) + if (ierr /= 0) then + goto 999 + end if + call this%parser%GetString(text) + jj = 1 + bndElem => this%tempevap(itemno) + call read_value_or_time_series_adv(text, itemno, jj, bndElem, & + this%packName, 'BND', this%tsManager, & + this%iprpak, 'EVAPORATION') + case ('RUNOFF') + ierr = this%apt_check_valid(itemno) + if (ierr /= 0) then + goto 999 + end if + call this%parser%GetString(text) + jj = 1 + bndElem => this%temproff(itemno) + call read_value_or_time_series_adv(text, itemno, jj, bndElem, & + this%packName, 'BND', this%tsManager, & + this%iprpak, 'RUNOFF') + case ('EXT-INFLOW') + ierr = this%apt_check_valid(itemno) + if (ierr /= 0) then + goto 999 + end if + call this%parser%GetString(text) + jj = 1 + bndElem => this%tempiflw(itemno) + call read_value_or_time_series_adv(text, itemno, jj, bndElem, & + this%packName, 'BND', this%tsManager, & + this%iprpak, 'EXT-INFLOW') + case default + ! + ! -- Keyword not recognized so return to caller with found = .false. + found = .false. + end select + ! +999 continue + ! + ! -- Return + return + end subroutine lke_set_stressperiod + +end module GweLkeModule diff --git a/src/Model/TransportModel/tsp1apt1.f90 b/src/Model/TransportModel/tsp1apt1.f90 index c37b82b693a..facc861b3bb 100644 --- a/src/Model/TransportModel/tsp1apt1.f90 +++ b/src/Model/TransportModel/tsp1apt1.f90 @@ -2813,7 +2813,7 @@ subroutine apt_rp_obs(this) ' must be assigned to a feature with a unique boundname.' call store_error(errmsg) end if - case ('LKT', 'SFT', 'MWT', 'UZT') + case ('LKT', 'SFT', 'MWT', 'UZT', 'LKE', 'SFE') call this%rp_obs_budterm(obsrv, & this%flowbudptr%budterm(this%idxbudgwf)) case ('FLOW-JA-FACE') @@ -2898,7 +2898,7 @@ subroutine apt_bd_obs(this) if (this%iboundpak(jj) /= 0) then v = this%xnewpak(jj) end if - case ('LKT', 'SFT', 'MWT', 'UZT') + case ('LKT', 'SFT', 'MWT', 'UZT', 'LKE', 'SFE') n = this%flowbudptr%budterm(this%idxbudgwf)%id1(jj) if (this%iboundpak(n) /= 0) then igwfnode = this%flowbudptr%budterm(this%idxbudgwf)%id2(jj)