diff --git a/doc/Common/gwe-obstypetable.tex b/doc/Common/gwe-obstypetable.tex index 501f5cb63c3..ff089c6f6da 100644 --- a/doc/Common/gwe-obstypetable.tex +++ b/doc/Common/gwe-obstypetable.tex @@ -57,8 +57,8 @@ \hline % \input{../Common/gwe-esrobs.tex} \\ % \hline -% \input{../Common/gwe-sfeobs.tex} \\ -% \hline +\input{../Common/gwe-sfeobs.tex} \\ +\hline % \input{../Common/gwe-lkeobs.tex} \\ % \hline % \input{../Common/gwe-mweobs.tex} \\ diff --git a/doc/Common/gwe-sfeobs.tex b/doc/Common/gwe-sfeobs.tex index cf35588bad0..b6b602d8049 100644 --- a/doc/Common/gwe-sfeobs.tex +++ b/doc/Common/gwe-sfeobs.tex @@ -1,16 +1,17 @@ % general APT observations -SFE & temperature & ifno or boundname & -- & Reach temperature. If boundname is specified, boundname must be unique for each reach. \\ -SFE & flow-ja-face & ifno or boundname & ifno or -- & Energy flow between two reaches. If a boundname is specified for ID1, then the result is the total energy flow for all reaches. If a boundname is specified for ID1 then ID2 is not used.\\ -SFE & storage & ifno or boundname & -- & Simulated energy storage flow rate for a reach or group of reaches. \\ -SFE & constant & ifno or boundname & -- & Simulated energy constant-flow rate for a reach or group of reaches. \\ -SFE & from-mvr & ifno or boundname & -- & Simulated energy inflow into a reach or group of reaches from the MVE package. Energy inflow is calculated as the product of provider temperature and the mover flow rate. \\ -SFE & to-mvr & ifno or boundname & -- & Energy outflow from a reach, or a group of reaches 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 reach is observed. \\ -SFE & sfe & ifno or boundname & -- & Energy flow rate for a reach or group of reaches and its aquifer connection(s). \\ +SFE & temperature & rno or boundname & -- & Reach temperature. If boundname is specified, boundname must be unique for each reach. \\ +SFE & flow-ja-face & rno or boundname & rno or -- & Energy flow between two reaches. If a boundname is specified for ID1, then the result is the total energy flow for all reaches. If a boundname is specified for ID1 then ID2 is not used.\\ +SFE & storage & rno or boundname & -- & Simulated energy storage flow rate for a reach or group of reaches. \\ +SFE & constant & rno or boundname & -- & Simulated energy constant-flow rate for a reach or group of reaches. \\ +SFE & from-mvr & rno or boundname & -- & Simulated energy inflow into a reach or group of reaches from the MVE package. Energy inflow is calculated as the product of provider temperature and the mover flow rate. \\ +SFE & to-mvr & rno or boundname & -- & Energy outflow from a reach, or a group of reaches 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 reach is observed. \\ +SFE & sfe & rno or boundname & -- & Energy flow rate for a reach or group of reaches and its aquifer connection(s). \\ -%observations specific to the stream transport package +%observations specific to the stream energy transport package % rainfall evaporation runoff ext-inflow withdrawal outflow -SFE & rainfall & ifno or boundname & -- & Rainfall rate applied to a reach or group of reaches multiplied by the rainfall temperature. \\ -SFE & evaporation & ifno or boundname & -- & Simulated evaporation rate from a reach or group of reaches multiplied by the latent heat of vaporization, heat capacity of the simulated fluid, and the density of the simulated fluid. \\ -SFE & runoff & ifno or boundname & -- & Runoff rate applied to a reach or group of reaches multiplied by the runoff temperature. \\ -SFE & ext-inflow & ifno or boundname & -- & Energy inflow into a reach or group of reaches calculated as the external inflow rate multiplied by the inflow temperature. \\ -SFE & ext-outflow & ifno or boundname & -- & External outflow from a reach or group of reaches to an external boundary. If boundname is not specified for ID, then the external outflow from a specific reach is observed. In this case, ID is the reach ifno. +SFE & rainfall & rno or boundname & -- & Rainfall rate applied to a reach or group of reaches multiplied by the rainfall temperature. \\ +SFE & evaporation & rno or boundname & -- & Simulated evaporation rate from a reach or group of reaches multiplied by the latent heat of vaporization for determining the amount of energy lost from a reach. \\ +SFE & runoff & rno or boundname & -- & Runoff rate applied to a reach or group of reaches multiplied by the runoff temperature. \\ +SFE & ext-inflow & rno or boundname & -- & Energy inflow into a reach or group of reaches calculated as the external inflow rate multiplied by the inflow temperature. \\ +SFE & ext-outflow & rno or boundname & -- & External outflow from a reach or group of reaches to an external boundary. If boundname is not specified for ID, then the external outflow from a specific reach is observed. In this case, ID is the reach rno. \\ +SFE & strmbd-cond & rno or boundname & -- & Amount of heat conductively exchanged with the streambed material. diff --git a/doc/mf6io/gwe/gwe.tex b/doc/mf6io/gwe/gwe.tex index 7e49294e095..2655c0d07e5 100644 --- a/doc/mf6io/gwe/gwe.tex +++ b/doc/mf6io/gwe/gwe.tex @@ -125,6 +125,10 @@ \subsection{Constant Temperature (CTP) Package} \subsection{Energy Source Loading (ESL) Package} \input{gwe/esl} +\newpage +\subsection{Streamflow Energy Transport (SFE) Package} +\input{gwe/sfe} + \newpage \subsection{Flow Model Interface (FMI) Package} \input{gwe/fmi} diff --git a/doc/mf6io/gwe/namefile.tex b/doc/mf6io/gwe/namefile.tex index e23b8cb35de..613065d678b 100644 --- a/doc/mf6io/gwe/namefile.tex +++ b/doc/mf6io/gwe/namefile.tex @@ -29,10 +29,12 @@ \subsubsection{Explanation of Variables} IC6 & Initial Conditions Package \\ OC6 & Output Control Option \\ ADV6 & Advection Package \\ -DSP6 & Dispersion Package \\ +CND6 & Conduction Package \\ SSM6 & Source and Sink Mixing Package \\ EST6 & Energy Storage and Transfer Package \\ CTP6 & Constant Temperature Package & * \\ +ESL6 & Energy Source Loading Package & * \\ +SFE6 & Streamflow Energy Transport Package & * \\ OBS6 & Observations Option \\ \hline \end{tabular*} diff --git a/doc/mf6io/gwe/sfe.tex b/doc/mf6io/gwe/sfe.tex new file mode 100644 index 00000000000..4f1e5fca4db --- /dev/null +++ b/doc/mf6io/gwe/sfe.tex @@ -0,0 +1,55 @@ +Streamflow Energy Transport (SFE) Package information is read from the file that is specified by ``SFE6'' as the file type. There can be as many SFE Packages as necessary for a GWE model. Each SFE Package is designed to work with flows from a corresponding GWF SFR Package. By default \mf uses the SFE package name to determine which SFR Package corresponds to the SFE Package. Therefore, the package name of the SFE Package (as specified in the GWE name file) must match with the name of the corresponding SFR 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 SFE Package cannot be used without a corresponding GWF SFR Package. + +The SFE Package does not have a dimensions block; instead, dimensions for the SFE Package are set using the dimensions from the corresponding SFR Package. For example, the SFR Package requires specification of the number of reaches (NREACHES). SFE sets the number of reaches equal to NREACHES. Therefore, the PACKAGEDATA block below must have NREACHES entries in it. + +\vspace{5mm} +\subsubsection{Structure of Blocks} +\lstinputlisting[style=blockdefinition]{./mf6ivar/tex/gwe-sfe-options.dat} +\lstinputlisting[style=blockdefinition]{./mf6ivar/tex/gwe-sfe-packagedata.dat} +\lstinputlisting[style=blockdefinition]{./mf6ivar/tex/gwe-sfe-period.dat} + +\vspace{5mm} +\subsubsection{Explanation of Variables} +\begin{description} +\input{./mf6ivar/tex/gwe-sfe-desc.tex} +\end{description} + +\vspace{5mm} +\subsubsection{Example Input File} +\lstinputlisting[style=inputfile]{./mf6ivar/examples/gwe-sfe-example.dat} + +\vspace{5mm} +\subsubsection{Available observation types} +Streamflow Energy Transport Package observations include reach temperature and all of the terms that contribute to the continuity equation for each reach. Additional SFE Package observations include energy flow rates for individual reaches, or groups of reaches. The data required for each SFE Package observation type is defined in table~\ref{table:gwe-sfeobstype}. Negative and positive values for \texttt{sfe} 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 SFE package, respectively. + +\begin{longtable}{p{2cm} p{2.75cm} p{2cm} p{1.25cm} p{7cm}} +\caption{Available SFE 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 SFE 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-sfeobs.tex} +\label{table:gwe-sfeobstype} +\end{longtable} + +\vspace{5mm} +\subsubsection{Example Observation Input File} +\lstinputlisting[style=inputfile]{./mf6ivar/examples/gwe-sfe-example-obs.dat} + + diff --git a/doc/mf6io/mf6ivar/dfn/common.dfn b/doc/mf6io/mf6ivar/dfn/common.dfn index b69ae67edf9..0fd5220c2f0 100644 --- a/doc/mf6io/mf6ivar/dfn/common.dfn +++ b/doc/mf6io/mf6ivar/dfn/common.dfn @@ -21,6 +21,9 @@ description keyword to indicate that the list of {#1} {#2} will be printed to th name print_concentration description keyword to indicate that the list of {#1} {#2} will be printed to the listing file for every stress period in which ``CONCENTRATION PRINT'' is specified in Output Control. If there is no Output Control option and PRINT\_{#3} is specified, then {#2} are printed for the last time step of each stress period. +name print_temperature +description keyword to indicate that the list of {#1} {#2} 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\_{#3} is specified, then {#2} are printed for the last time step of each stress period. + name print_flows description keyword to indicate that the list of {#1} 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/dfn/gwe-sfe.dfn b/doc/mf6io/mf6ivar/dfn/gwe-sfe.dfn new file mode 100644 index 00000000000..610e3911ff1 --- /dev/null +++ b/doc/mf6io/mf6ivar/dfn/gwe-sfe.dfn @@ -0,0 +1,480 @@ +# --------------------- gwe sfe 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 provided in the corresponding flow package (i.e., FLOW\_PACKAE\_NAME). If specified, then the simulated temperatures from this advanced energy 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 energy 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}': 'reach'} + +block options +name print_input +type keyword +reader urword +optional true +longname print input to listing file +description REPLACE print_input {'{#1}': 'reach'} + +block options +name print_temperature +type keyword +reader urword +optional true +longname print calculated temperature to listing file +description REPLACE print_temperature {'{#1}': 'reach', '{#2}': 'temperatures', '{#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}': 'reach'} + +block options +name save_flows +type keyword +reader urword +optional true +longname save reach flows to budget file +description REPLACE save_flows {'{#1}': 'reach'} + +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 temperature 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}': 'SFT'} + + +# --------------------- gwe sfe packagedata --------------------- + +block packagedata +name packagedata +type recarray rno strt ktf rbthcnd aux boundname +shape (maxbound) +reader urword +longname +description + +block packagedata +name rno +type integer +shape +tagged false +in_record true +reader urword +longname reach number for this entry +description integer value that defines the reach number associated with the specified PACKAGEDATA data on the line. RNO must be greater than zero and less than or equal to NREACHES. Reach information must be specified for every reach or the program will terminate with an error. The program will also terminate with an error if information for a reach 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 reach temperature +description real value that defines the starting temperature for the reach. + +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 stream reach. + +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 streambed 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}': 'reach'} + +block packagedata +name boundname +type string +shape +tagged false +in_record true +reader urword +optional true +longname well name +description REPLACE boundname {'{#1}': 'reach'} + + +# --------------------- gwe sfe 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 reachperioddata +type recarray rno reachsetting +shape +reader urword +longname +description + +block period +name rno +type integer +shape +tagged false +in_record true +reader urword +longname reach number for this entry +description integer value that defines the reach number associated with the specified PERIOD data on the line. RNO must be greater than zero and less than or equal to NREACHES. +numeric_index true + +block period +name reachsetting +type keystring status temperature rainfall evaporation runoff 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 REACHSETTING string include: STATUS, TEMPERATURE, RAINFALL, EVAPORATION, RUNOFF, and AUXILIARY. These settings are used to assign the temperature of associated with the corresponding flow terms. Temperatures cannot be specified for all flow terms. For example, the Streamflow Package supports a ``DIVERSION'' flow term. Diversion water will be routed using the calculated temperature of the reach. + +block period +name status +type string +shape +tagged true +in_record true +reader urword +longname reach temperature status +description keyword option to define reach status. STATUS can be ACTIVE, INACTIVE, or CONSTANT. By default, STATUS is ACTIVE, which means that temperature will be calculated for the reach. If a reach is inactive, then there will be no energy fluxes into or out of the reach and the inactive value will be written for the reach temperature. If a reach is constant, then the temperature for the reach 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 reach temperature +description real or character value that defines the temperature for the reach. The specified TEMPERATURE is only applied if the reach is a constant temperature 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 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 $(^{\circ}C)$ for 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 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 $(^{\circ}C)$ for the reach. 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 inflow +type string +shape +tagged true +in_record true +reader urword +time_series true +longname inflow temperature +description real or character value that defines the temperature of inflow $(^{\circ}C)$ for the reach. 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-sfe-example-obs.dat b/doc/mf6io/mf6ivar/examples/gwe-sfe-example-obs.dat new file mode 100644 index 00000000000..ec5baaedc76 --- /dev/null +++ b/doc/mf6io/mf6ivar/examples/gwe-sfe-example-obs.dat @@ -0,0 +1,24 @@ +BEGIN options + DIGITS 7 + PRINT_INPUT +END options + +BEGIN continuous FILEOUT gwe_sfe02.sfe.obs.csv + sfe-1-temp TEMPERATURE 1 + sfe-1-extinflow EXT-INFLOW 1 + sfe-1-rain RAINFALL 1 + sfe-1-roff RUNOFF 1 + sfe-1-stor STORAGE 1 + sfe-1-const CONSTANT 1 + sfe-1-gwe1 SFE 1 1 + sfe-1-gwe2 SFE 1 2 + sfe-2-gwe1 SFE 2 1 + sfe-1-mylake1 SFE MYREACHES + sfe-1-fjf FLOW-JA-FACE 1 2 + sfe-2-fjf FLOW-JA-FACE 2 1 + sfe-3-fjf FLOW-JA-FACE 2 3 + sfe-4-fjf FLOW-JA-FACE 3 2 + sfe-5-fjf FLOW-JA-FACE MYREACH1 + sfe-6-fjf FLOW-JA-FACE MYREACH2 + sfe-7-fjf FLOW-JA-FACE MYREACH3 +END continuous diff --git a/doc/mf6io/mf6ivar/examples/gwe-sfe-example.dat b/doc/mf6io/mf6ivar/examples/gwe-sfe-example.dat new file mode 100644 index 00000000000..3f819067162 --- /dev/null +++ b/doc/mf6io/mf6ivar/examples/gwe-sfe-example.dat @@ -0,0 +1,24 @@ +BEGIN OPTIONS + AUXILIARY aux1 aux2 + BOUNDNAMES + PRINT_INPUT + PRINT_TEMPERATURE + PRINT_FLOWS + SAVE_FLOWS + TEMPERATURE FILEOUT gwe_sfe_02.sfe.bin + BUDGET FILEOUT gwe_sfe_02.sfe.bud + OBS6 FILEIN gwe_sfe_02.sfe.obs +END OPTIONS + +BEGIN PACKAGEDATA +# L STRT aux1 aux2 bname + 1 5.000 9.90 99.90 REACH1 + 2 5.000 9.90 99.90 REACH2 + 3 5.000 9.90 99.90 REACH3 +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 2646e453e2b..ee570409435 100644 --- a/doc/mf6io/mf6ivar/md/mf6ivar.md +++ b/doc/mf6io/mf6ivar/md/mf6ivar.md @@ -462,7 +462,7 @@ | GWF | RCHA | OPTIONS | SAVE_FLOWS | KEYWORD | keyword to indicate that recharge flow terms will be written to the file specified with ``BUDGET FILEOUT'' in Output Control. | | GWF | RCHA | OPTIONS | TAS6 | KEYWORD | keyword to specify that record corresponds to a time-array-series file. | | GWF | RCHA | OPTIONS | FILEIN | KEYWORD | keyword to specify that an input filename is expected next. | -| GWF | RCHA | OPTIONS | TAS6_FILENAME | STRING | defines a time-array-series file defining a time-array series that can be used to assign time-varying values. See the Time-Variable Input section for instructions on using the time-array series capability. | +| GWF | RCHA | OPTIONS | TAS6_FILENAME | STRING | defines a time-array-series file defining a time-array series that can be used to assign time-varying values. See the ``Time-Variable Input'' section for instructions on using the time-array series capability. | | GWF | RCHA | OPTIONS | OBS6 | KEYWORD | keyword to specify that record corresponds to an observations file. | | GWF | RCHA | OPTIONS | OBS6_FILENAME | STRING | name of input file to define observations for the Recharge 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 Recharge package. | | GWF | RCHA | 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. | @@ -551,7 +551,7 @@ | GWF | MAW | CONNECTIONDATA | ICON | INTEGER | integer value that defines the GWF connection number for this multi-aquifer well connection entry. ICONN must be greater than zero and less than or equal to NGWFNODES for multi-aquifer well IFNO. | | GWF | MAW | CONNECTIONDATA | CELLID | INTEGER (NCELLDIM) | is the cell identifier, and depends on the type of grid that is used for the simulation. For a structured grid that uses the DIS input file, CELLID is the layer, row, and column. For a grid that uses the DISV input file, CELLID is the layer and CELL2D number. If the model uses the unstructured discretization (DISU) input file, CELLID is the node number for the cell. One or more screened intervals can be connected to the same CELLID if CONDEQN for a well is MEAN. The program will terminate with an error if MAW wells using SPECIFIED, THIEM, SKIN, or CUMULATIVE conductance equations have more than one connection to the same CELLID. | | GWF | MAW | CONNECTIONDATA | SCRN_TOP | DOUBLE PRECISION | value that defines the top elevation of the screen for the multi-aquifer well connection. If CONDEQN is SPECIFIED, THIEM, SKIN, or COMPOSITE, SCRN\_TOP can be any value and is set to the top of the cell. If CONDEQN is MEAN, SCRN\_TOP is set to the multi-aquifer well connection cell top if the specified value is greater than the cell top. The program will terminate with an error if the screen top is less than the screen bottom. | -| GWF | MAW | CONNECTIONDATA | SCRN_BOT | DOUBLE PRECISION | value that defines the bottom elevation of the screen for the multi-aquifer well connection. If CONDEQN is SPECIFIED, THIEM, SKIN, or COMPOSITE, SCRN\_BOT can be any value is set to the bottom of the cell. If CONDEQN is MEAN, SCRN\_BOT is set to the multi-aquifer well connection cell bottom if the specified value is less than the cell bottom. The program will terminate with an error if the screen bottom is greater than the screen top. | +| GWF | MAW | CONNECTIONDATA | SCRN_BOT | DOUBLE PRECISION | value that defines the bottom elevation of the screen for the multi-aquifer well connection. If CONDEQN is SPECIFIED, THIEM, SKIN, or COMPOSITE, SCRN\_BOT can be any value and is set to the bottom of the cell. If CONDEQN is MEAN, SCRN\_BOT is set to the multi-aquifer well connection cell bottom if the specified value is less than the cell bottom. The program will terminate with an error if the screen bottom is greater than the screen top. | | GWF | MAW | CONNECTIONDATA | HK_SKIN | DOUBLE PRECISION | value that defines the skin (filter pack) hydraulic conductivity (if CONDEQN for the multi-aquifer well is SKIN, CUMULATIVE, or MEAN) or conductance (if CONDEQN for the multi-aquifer well is SPECIFIED) for each GWF node connected to the multi-aquifer well (NGWFNODES). If CONDEQN is SPECIFIED, HK\_SKIN must be greater than or equal to zero. HK\_SKIN can be any value if CONDEQN is THIEM. Otherwise, HK\_SKIN must be greater than zero. If CONDEQN is SKIN, the contrast between the cell transmissivity (the product of geometric mean horizontal hydraulic conductivity and the cell thickness) and the well transmissivity (the product of HK\_SKIN and the screen thicknesses) must be greater than one in node CELLID or the program will terminate with an error condition; if an error condition occurs, it is suggested that the HK\_SKIN be reduced to a value less than K11 and K22 in node CELLID or the THEIM or MEAN conductance equations be used for these multi-aquifer wells. | | GWF | MAW | CONNECTIONDATA | RADIUS_SKIN | DOUBLE PRECISION | real value that defines the skin radius (filter pack radius) for the multi-aquifer well. RADIUS\_SKIN can be any value if CONDEQN is SPECIFIED or THIEM. If CONDEQN is SKIN, CUMULATIVE, or MEAN, the program will terminate with an error if RADIUS\_SKIN is less than or equal to the RADIUS for the multi-aquifer well. | | GWF | MAW | 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. | @@ -1337,6 +1337,44 @@ | GWE | SSM | FILEINPUT | FILEIN | KEYWORD | keyword to specify that an input filename is expected next. | | GWE | SSM | FILEINPUT | SPT6_FILENAME | STRING | character string that defines the path and filename for the file containing source and sink input data for the flow package. The SPT6\_FILENAME file is a flexible input file that allows temperatures to be specified by stress period and with time series. Instructions for creating the SPT6\_FILENAME input file are provided in the next section on file input for boundary temperatures. | | GWE | SSM | FILEINPUT | MIXED | KEYWORD | keyword to specify that these stress package boundaries will have the mixed condition. The MIXED condition is described in the SOURCES block for AUXMIXED. The MIXED condition allows for water to be withdrawn at a temperature that is less than the cell temperature. It is intended primarily for representing evapotranspiration. | +| GWE | SFE | 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 | SFE | 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 | SFE | OPTIONS | FLOW_PACKAGE_AUXILIARY_NAME | STRING | keyword to specify the name of an auxiliary variable provided in the corresponding flow package (i.e., FLOW\_PACKAE\_NAME). If specified, then the simulated temperatures from this advanced energy 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 energy transport package are read from a file, then this option will have no effect. | +| GWE | SFE | OPTIONS | BOUNDNAMES | KEYWORD | keyword to indicate that boundary names may be provided with the list of reach cells. | +| GWE | SFE | OPTIONS | PRINT_INPUT | KEYWORD | keyword to indicate that the list of reach information will be written to the listing file immediately after it is read. | +| GWE | SFE | OPTIONS | PRINT_TEMPERATURE | KEYWORD | keyword to indicate that the list of reach temperatures 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 temperatures are printed for the last time step of each stress period. | +| GWE | SFE | OPTIONS | PRINT_FLOWS | KEYWORD | keyword to indicate that the list of reach 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 | SFE | OPTIONS | SAVE_FLOWS | KEYWORD | keyword to indicate that reach flow terms will be written to the file specified with ``BUDGET FILEOUT'' in Output Control. | +| GWE | SFE | OPTIONS | TEMPERATURE | KEYWORD | keyword to specify that record corresponds to temperature. | +| GWE | SFE | OPTIONS | TEMPFILE | STRING | name of the binary output file to write temperature information. | +| GWE | SFE | OPTIONS | BUDGET | KEYWORD | keyword to specify that record corresponds to the budget. | +| GWE | SFE | OPTIONS | FILEOUT | KEYWORD | keyword to specify that an output filename is expected next. | +| GWE | SFE | OPTIONS | BUDGETFILE | STRING | name of the binary output file to write budget information. | +| GWE | SFE | OPTIONS | BUDGETCSV | KEYWORD | keyword to specify that record corresponds to the budget CSV. | +| GWE | SFE | 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 | SFE | OPTIONS | TS6 | KEYWORD | keyword to specify that record corresponds to a time-series file. | +| GWE | SFE | OPTIONS | FILEIN | KEYWORD | keyword to specify that an input filename is expected next. | +| GWE | SFE | 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 | SFE | OPTIONS | OBS6 | KEYWORD | keyword to specify that record corresponds to an observations file. | +| GWE | SFE | OPTIONS | OBS6_FILENAME | STRING | name of input file to define observations for the SFT 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 SFT package. | +| GWE | SFE | PACKAGEDATA | RNO | INTEGER | integer value that defines the reach number associated with the specified PACKAGEDATA data on the line. RNO must be greater than zero and less than or equal to NREACHES. Reach information must be specified for every reach or the program will terminate with an error. The program will also terminate with an error if information for a reach is specified more than once. | +| GWE | SFE | PACKAGEDATA | STRT | DOUBLE PRECISION | real value that defines the starting temperature for the reach. | +| GWE | SFE | PACKAGEDATA | KTF | DOUBLE PRECISION | is the thermal conductivity of the of the interface between the aquifer cell and the stream reach. | +| GWE | SFE | PACKAGEDATA | RBTHCND | DOUBLE PRECISION | real value that defines the thickness of the streambed material through which conduction occurs. Must be greater than 0. | +| GWE | SFE | PACKAGEDATA | AUX | DOUBLE PRECISION (NAUX) | represents the values of the auxiliary variables for each reach. The values of auxiliary variables must be present for each reach. 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 | SFE | PACKAGEDATA | BOUNDNAME | STRING | name of the reach 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 | SFE | 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 | SFE | PERIOD | RNO | INTEGER | integer value that defines the reach number associated with the specified PERIOD data on the line. RNO must be greater than zero and less than or equal to NREACHES. | +| GWE | SFE | PERIOD | REACHSETTING | KEYSTRING | line of information that is parsed into a keyword and values. Keyword values that can be used to start the REACHSETTING string include: STATUS, TEMPERATURE, RAINFALL, EVAPORATION, RUNOFF, and AUXILIARY. These settings are used to assign the temperature of associated with the corresponding flow terms. Temperatures cannot be specified for all flow terms. For example, the Streamflow Package supports a ``DIVERSION'' flow term. Diversion water will be routed using the calculated temperature of the reach. | +| GWE | SFE | PERIOD | STATUS | STRING | keyword option to define reach status. STATUS can be ACTIVE, INACTIVE, or CONSTANT. By default, STATUS is ACTIVE, which means that temperature will be calculated for the reach. If a reach is inactive, then there will be no energy fluxes into or out of the reach and the inactive value will be written for the reach temperature. If a reach is constant, then the temperature for the reach will be fixed at the user specified value. | +| GWE | SFE | PERIOD | TEMPERATURE | STRING | real or character value that defines the temperature for the reach. The specified TEMPERATURE is only applied if the reach is a constant temperature 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 | SFE | PERIOD | RAINFALL | STRING | real or character value that defines the rainfall temperature $(^{\circ}C)$ for 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 | SFE | 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 | SFE | PERIOD | RUNOFF | STRING | real or character value that defines the temperature of runoff $(^{\circ}C)$ for the reach. 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 | SFE | PERIOD | INFLOW | STRING | real or character value that defines the temperature of inflow $(^{\circ}C)$ for the reach. 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 | SFE | PERIOD | AUXILIARY | KEYWORD | keyword for specifying auxiliary variable. | +| GWE | SFE | 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 | SFE | 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 | FMI | OPTIONS | SAVE_FLOWS | KEYWORD | keyword to indicate that FMI flow terms will be written to the file specified with ``BUDGET FILEOUT'' in Output Control. | | GWE | FMI | OPTIONS | FLOW_IMBALANCE_CORRECTION | KEYWORD | correct for an imbalance in flows by assuming that any residual flow error comes in or leaves at the temperature of the cell. When this option is activated, the GWE Model budget written to the listing file will contain two additional entries: FLOW-ERROR and FLOW-CORRECTION. These two entries will be equal but opposite in sign. The FLOW-CORRECTION term is a mass flow that is added to offset the error caused by an imprecise flow balance. If these terms are not relatively small, the flow model should be rerun with stricter convergence tolerances. | | GWE | FMI | PACKAGEDATA | FLOWTYPE | STRING | is the word GWFBUDGET, GWFHEAD, GWFMOVER or the name of an advanced GWF stress package. If GWFBUDGET is specified, then the corresponding file must be a budget file from a previous GWF Model run. If an advanced GWF stress package name appears then the corresponding file must be the budget file saved by a LAK, SFR, MAW or UZF Package. | diff --git a/doc/mf6io/mf6ivar/mf6ivar.py b/doc/mf6io/mf6ivar/mf6ivar.py index e8c204d80df..328b3ee2d53 100644 --- a/doc/mf6io/mf6ivar/mf6ivar.py +++ b/doc/mf6io/mf6ivar/mf6ivar.py @@ -751,6 +751,7 @@ def write_appendix(texdir, allblocks): "gwe-nam", "gwe-oc", "gwe-ssm", + "gwe-sfe", "gwe-fmi", "utl-spc", "utl-spca", diff --git a/doc/mf6io/mf6ivar/tex/appendixA.tex b/doc/mf6io/mf6ivar/tex/appendixA.tex index dc136dd01d5..6272dfc456b 100644 --- a/doc/mf6io/mf6ivar/tex/appendixA.tex +++ b/doc/mf6io/mf6ivar/tex/appendixA.tex @@ -290,6 +290,10 @@ GWE & SSM & SOURCES & yes \\ GWE & SSM & FILEINPUT & yes \\ \hline +GWE & SFE & OPTIONS & yes \\ +GWE & SFE & PACKAGEDATA & yes \\ +GWE & SFE & PERIOD & yes \\ +\hline GWE & FMI & OPTIONS & yes \\ GWE & FMI & PACKAGEDATA & yes \\ \hline diff --git a/doc/mf6io/mf6ivar/tex/gwe-sfe-desc.tex b/doc/mf6io/mf6ivar/tex/gwe-sfe-desc.tex new file mode 100644 index 00000000000..af8496fe18d --- /dev/null +++ b/doc/mf6io/mf6ivar/tex/gwe-sfe-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 provided in the corresponding flow package (i.e., FLOW\_PACKAE\_NAME). If specified, then the simulated temperatures from this advanced energy 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 energy 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 reach cells. + +\item \texttt{PRINT\_INPUT}---keyword to indicate that the list of reach information will be written to the listing file immediately after it is read. + +\item \texttt{PRINT\_TEMPERATURE}---keyword to indicate that the list of reach temperatures 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 temperatures are printed for the last time step of each stress period. + +\item \texttt{PRINT\_FLOWS}---keyword to indicate that the list of reach 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 reach 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 SFT 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 SFT package. + +\end{description} +\item \textbf{Block: PACKAGEDATA} + +\begin{description} +\item \texttt{rno}---integer value that defines the reach number associated with the specified PACKAGEDATA data on the line. RNO must be greater than zero and less than or equal to NREACHES. Reach information must be specified for every reach or the program will terminate with an error. The program will also terminate with an error if information for a reach is specified more than once. + +\item \texttt{strt}---real value that defines the starting temperature for the reach. + +\item \texttt{ktf}---is the thermal conductivity of the of the interface between the aquifer cell and the stream reach. + +\item \texttt{rbthcnd}---real value that defines the thickness of the streambed material through which conduction occurs. Must be greater than 0. + +\item \textcolor{blue}{\texttt{aux}---represents the values of the auxiliary variables for each reach. The values of auxiliary variables must be present for each reach. 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 reach 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{rno}---integer value that defines the reach number associated with the specified PERIOD data on the line. RNO must be greater than zero and less than or equal to NREACHES. + +\item \texttt{reachsetting}---line of information that is parsed into a keyword and values. Keyword values that can be used to start the REACHSETTING string include: STATUS, TEMPERATURE, RAINFALL, EVAPORATION, RUNOFF, and AUXILIARY. These settings are used to assign the temperature of associated with the corresponding flow terms. Temperatures cannot be specified for all flow terms. For example, the Streamflow Package supports a ``DIVERSION'' flow term. Diversion water will be routed using the calculated temperature of the reach. + +\begin{lstlisting}[style=blockdefinition] +STATUS +TEMPERATURE <@temperature@> +RAINFALL <@rainfall@> +EVAPORATION <@evaporation@> +RUNOFF <@runoff@> +INFLOW <@inflow@> +AUXILIARY <@auxval@> +\end{lstlisting} + +\item \texttt{status}---keyword option to define reach status. STATUS can be ACTIVE, INACTIVE, or CONSTANT. By default, STATUS is ACTIVE, which means that temperature will be calculated for the reach. If a reach is inactive, then there will be no energy fluxes into or out of the reach and the inactive value will be written for the reach temperature. If a reach is constant, then the temperature for the reach will be fixed at the user specified value. + +\item \textcolor{blue}{\texttt{temperature}---real or character value that defines the temperature for the reach. The specified TEMPERATURE is only applied if the reach is a constant temperature 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{rainfall}---real or character value that defines the rainfall temperature $(^{\circ}C)$ for 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{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 $(^{\circ}C)$ for the reach. 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{inflow}---real or character value that defines the temperature of inflow $(^{\circ}C)$ for the reach. 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-sfe-options.dat b/doc/mf6io/mf6ivar/tex/gwe-sfe-options.dat new file mode 100644 index 00000000000..ef83c7fa718 --- /dev/null +++ b/doc/mf6io/mf6ivar/tex/gwe-sfe-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-sfe-packagedata.dat b/doc/mf6io/mf6ivar/tex/gwe-sfe-packagedata.dat new file mode 100644 index 00000000000..d75a5bae2d0 --- /dev/null +++ b/doc/mf6io/mf6ivar/tex/gwe-sfe-packagedata.dat @@ -0,0 +1,5 @@ +BEGIN PACKAGEDATA + [<@aux(naux)@>] [] + [<@aux(naux)@>] [] + ... +END PACKAGEDATA diff --git a/doc/mf6io/mf6ivar/tex/gwe-sfe-period.dat b/doc/mf6io/mf6ivar/tex/gwe-sfe-period.dat new file mode 100644 index 00000000000..1b56b2824e2 --- /dev/null +++ b/doc/mf6io/mf6ivar/tex/gwe-sfe-period.dat @@ -0,0 +1,5 @@ +BEGIN PERIOD + + + ... +END PERIOD diff --git a/doc/mf6io/mf6ivar/tex/gwf-disu-cell2d.dat b/doc/mf6io/mf6ivar/tex/gwf-disu-cell2d.dat index 27900d67235..f6d08961367 100644 --- a/doc/mf6io/mf6ivar/tex/gwf-disu-cell2d.dat +++ b/doc/mf6io/mf6ivar/tex/gwf-disu-cell2d.dat @@ -1,5 +1,5 @@ BEGIN CELL2D + [ - - ... + ...] END CELL2D diff --git a/doc/mf6io/mf6ivar/tex/gwf-disu-vertices.dat b/doc/mf6io/mf6ivar/tex/gwf-disu-vertices.dat index 6831f23b5ff..a4bc80c5453 100644 --- a/doc/mf6io/mf6ivar/tex/gwf-disu-vertices.dat +++ b/doc/mf6io/mf6ivar/tex/gwf-disu-vertices.dat @@ -1,5 +1,5 @@ BEGIN VERTICES + [ - - ... + ...] END VERTICES diff --git a/doc/mf6io/mf6ivar/tex/gwf-maw-desc.tex b/doc/mf6io/mf6ivar/tex/gwf-maw-desc.tex index b1861a0423c..d3648dc02e9 100644 --- a/doc/mf6io/mf6ivar/tex/gwf-maw-desc.tex +++ b/doc/mf6io/mf6ivar/tex/gwf-maw-desc.tex @@ -93,7 +93,7 @@ \item \texttt{scrn\_top}---value that defines the top elevation of the screen for the multi-aquifer well connection. If CONDEQN is SPECIFIED, THIEM, SKIN, or COMPOSITE, SCRN\_TOP can be any value and is set to the top of the cell. If CONDEQN is MEAN, SCRN\_TOP is set to the multi-aquifer well connection cell top if the specified value is greater than the cell top. The program will terminate with an error if the screen top is less than the screen bottom. -\item \texttt{scrn\_bot}---value that defines the bottom elevation of the screen for the multi-aquifer well connection. If CONDEQN is SPECIFIED, THIEM, SKIN, or COMPOSITE, SCRN\_BOT can be any value is set to the bottom of the cell. If CONDEQN is MEAN, SCRN\_BOT is set to the multi-aquifer well connection cell bottom if the specified value is less than the cell bottom. The program will terminate with an error if the screen bottom is greater than the screen top. +\item \texttt{scrn\_bot}---value that defines the bottom elevation of the screen for the multi-aquifer well connection. If CONDEQN is SPECIFIED, THIEM, SKIN, or COMPOSITE, SCRN\_BOT can be any value and is set to the bottom of the cell. If CONDEQN is MEAN, SCRN\_BOT is set to the multi-aquifer well connection cell bottom if the specified value is less than the cell bottom. The program will terminate with an error if the screen bottom is greater than the screen top. \item \texttt{hk\_skin}---value that defines the skin (filter pack) hydraulic conductivity (if CONDEQN for the multi-aquifer well is SKIN, CUMULATIVE, or MEAN) or conductance (if CONDEQN for the multi-aquifer well is SPECIFIED) for each GWF node connected to the multi-aquifer well (NGWFNODES). If CONDEQN is SPECIFIED, HK\_SKIN must be greater than or equal to zero. HK\_SKIN can be any value if CONDEQN is THIEM. Otherwise, HK\_SKIN must be greater than zero. If CONDEQN is SKIN, the contrast between the cell transmissivity (the product of geometric mean horizontal hydraulic conductivity and the cell thickness) and the well transmissivity (the product of HK\_SKIN and the screen thicknesses) must be greater than one in node CELLID or the program will terminate with an error condition; if an error condition occurs, it is suggested that the HK\_SKIN be reduced to a value less than K11 and K22 in node CELLID or the THEIM or MEAN conductance equations be used for these multi-aquifer wells. diff --git a/doc/mf6io/mf6ivar/tex/gwf-rcha-desc.tex b/doc/mf6io/mf6ivar/tex/gwf-rcha-desc.tex index aab5a2209fe..1f558f3244e 100644 --- a/doc/mf6io/mf6ivar/tex/gwf-rcha-desc.tex +++ b/doc/mf6io/mf6ivar/tex/gwf-rcha-desc.tex @@ -21,7 +21,7 @@ \item \texttt{FILEIN}---keyword to specify that an input filename is expected next. -\item \texttt{tas6\_filename}---defines a time-array-series file defining a time-array series that can be used to assign time-varying values. See the Time-Variable Input section for instructions on using the time-array series capability. +\item \texttt{tas6\_filename}---defines a time-array-series file defining a time-array series that can be used to assign time-varying values. See the ``Time-Variable Input'' section for instructions on using the time-array series capability. \item \texttt{OBS6}---keyword to specify that record corresponds to an observations file. diff --git a/doc/mf6io/mf6ivar/tex/gwt-disu-cell2d.dat b/doc/mf6io/mf6ivar/tex/gwt-disu-cell2d.dat index 27900d67235..f6d08961367 100644 --- a/doc/mf6io/mf6ivar/tex/gwt-disu-cell2d.dat +++ b/doc/mf6io/mf6ivar/tex/gwt-disu-cell2d.dat @@ -1,5 +1,5 @@ BEGIN CELL2D + [ - - ... + ...] END CELL2D diff --git a/doc/mf6io/mf6ivar/tex/gwt-disu-vertices.dat b/doc/mf6io/mf6ivar/tex/gwt-disu-vertices.dat index 6831f23b5ff..a4bc80c5453 100644 --- a/doc/mf6io/mf6ivar/tex/gwt-disu-vertices.dat +++ b/doc/mf6io/mf6ivar/tex/gwt-disu-vertices.dat @@ -1,5 +1,5 @@ BEGIN VERTICES + [ - - ... + ...] END VERTICES diff --git a/make/makefile b/make/makefile index c7e4afe208f..d0362441da3 100644 --- a/make/makefile +++ b/make/makefile @@ -279,6 +279,7 @@ $(OBJDIR)/gwf3buy8.o \ $(OBJDIR)/GhostNode.o \ $(OBJDIR)/gwf3evt8.o \ $(OBJDIR)/gwf3chd8.o \ +$(OBJDIR)/gwe1sfe1.o \ $(OBJDIR)/gwe1est1.o \ $(OBJDIR)/gwe1esl1.o \ $(OBJDIR)/gwe1ctp1.o \ diff --git a/msvs/mf6core.vfproj b/msvs/mf6core.vfproj index bd21cae7f1a..497173b176f 100644 --- a/msvs/mf6core.vfproj +++ b/msvs/mf6core.vfproj @@ -141,7 +141,8 @@ - + + diff --git a/src/Model/GroundWaterEnergy/gwe1.f90 b/src/Model/GroundWaterEnergy/gwe1.f90 index 11d2e8a25a2..21fef839832 100644 --- a/src/Model/GroundWaterEnergy/gwe1.f90 +++ b/src/Model/GroundWaterEnergy/gwe1.f90 @@ -767,7 +767,7 @@ subroutine package_create(this, filtyp, ipakid, ipaknum, pakname, mempath, & use GweCtpModule, only: ctp_create use GweEslModule, only: esl_create !use GweLkeModule, only: lke_create - !use GweSfeModule, only: sfe_create + use GweSfeModule, only: sfe_create !use GweMweModule, only: mwe_create !use GweUzeModule, only: uze_create use ApiModule, only: api_create @@ -798,10 +798,10 @@ subroutine package_create(this, filtyp, ipakid, ipaknum, pakname, mempath, & ! call lke_create(packobj, ipakid, ipaknum, inunit, iout, this%name, & ! pakname, this%fmi, this%tsplab, this%eqnsclfac, & ! this%gwecommon) - !case ('SFE6') - ! call sfe_create(packobj, ipakid, ipaknum, inunit, iout, this%name, & - ! pakname, this%fmi, this%tsplab, this%eqnsclfac, & - ! this%gwecommon) + case ('SFE6') + call sfe_create(packobj, ipakid, ipaknum, inunit, iout, this%name, & + pakname, this%fmi, this%eqnsclfac, this%gwecommon, & + this%depvartype, this%depvarunit, this%depvarunitabbrev) !case ('MWE6') ! call mwe_create(packobj, ipakid, ipaknum, inunit, iout, this%name, & ! pakname, this%fmi, this%tsplab, this%eqnsclfac, & diff --git a/src/Model/GroundWaterEnergy/gwe1sfe1.f90 b/src/Model/GroundWaterEnergy/gwe1sfe1.f90 new file mode 100644 index 00000000000..76300171b31 --- /dev/null +++ b/src/Model/GroundWaterEnergy/gwe1sfe1.f90 @@ -0,0 +1,1147 @@ +! -- Stream Energy Transport Module +! -- todo: Temperature decay? +! -- todo: save the sfe temperature into the sfr aux variable? (perhaps needed for GWT-GWE exchanges) +! -- todo: calculate the sfr VISC aux variable using temperature? +! +! SFR flows (sfrbudptr) index var SFE term Transport Type +!--------------------------------------------------------------------------------- + +! -- terms from SFR 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 * tmpext = this%qfrommvr(:) ! kluge note: include rhow*cpw in comments for various terms +! TO-MVR idxbudtmvr TO-MVR q * tfeat + +! -- SFR terms +! RAINFALL idxbudrain RAINFALL q * train +! EVAPORATION idxbudevap EVAPORATION tfeat 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 :: idxbudoutf => null() !< index of outflow terms in flowbudptr + integer(I4B), pointer :: idxbudsbcd => null() !< index of streambed 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 + + real(DP), dimension(:), pointer, contiguous :: ktf => null() !< thermal conductivity between the apt and groundwater cell + real(DP), dimension(:), pointer, contiguous :: rfeatthk => null() !< thickness of streambed/lakebed/filter-pack material through which thermal conduction occurs + + contains + + procedure :: bnd_da => sfe_da + procedure :: allocate_scalars + procedure :: apt_allocate_arrays => sfe_allocate_arrays + procedure :: find_apt_package => find_sfe_package + procedure :: pak_fc_expanded => sfe_fc_expanded + procedure :: pak_solve => sfe_solve + procedure :: pak_get_nbudterms => sfe_get_nbudterms + procedure :: pak_setup_budobj => sfe_setup_budobj + procedure :: pak_fill_budobj => sfe_fill_budobj + procedure :: sfe_rain_term + procedure :: sfe_evap_term + procedure :: sfe_roff_term + procedure :: sfe_iflw_term + procedure :: sfe_outf_term + procedure :: pak_df_obs => sfe_df_obs + procedure :: pak_rp_obs => sfe_rp_obs + procedure :: pak_bd_obs => sfe_bd_obs + procedure :: pak_set_stressperiod => sfe_set_stressperiod + + end type GweSfeType + +contains + + !> @brief Create a new sfe package + !< + subroutine sfe_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(GweSfeType), pointer :: sfeobj + ! + ! -- Allocate the object and assign values to object variables + allocate (sfeobj) + packobj => sfeobj + ! + ! -- Create name and memory path + call packobj%set_names(ibcnum, namemodel, pakname, ftype) + packobj%text = text + ! + ! -- Allocate scalars + call sfeobj%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 GwfGwt exchange is + ! created, it sets fmi%bndlist so that the GWT model has access to all + ! the flow packages + sfeobj%fmi => fmi + ! + ! -- Store pointer to governing equation scale factor + sfeobj%eqnsclfac => eqnsclfac + ! + ! -- Set labels that will be used in generalized APT class + sfeobj%depvartype = dvt + sfeobj%depvarunit = dvu + sfeobj%depvarunitabbrev = dvua + ! + ! -- Return + return + end subroutine sfe_create + + !> @brief Find corresponding sfe package + !< + subroutine find_sfe_package(this) + ! -- modules + use MemoryManagerModule, only: mem_allocate + ! -- dummy + class(GweSfeType) :: 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 (SfrType) + 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%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 ('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 concbud(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' + ! + ! -- Streambed conduction term + this%idxbudsbcd = this%idxbudgwf + ! + ! -- Return + return + end subroutine find_sfe_package + + !> @brief Add matrix terms related to SFE + !! + !! This will be called from TspAptType%apt_fc_expanded() + !! in order to add matrix terms specifically for SFE + !< + subroutine sfe_fc_expanded(this, rhs, ia, idxglo, matrix_sln) + ! -- dummy + class(GweSfeType) :: 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 + 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%sfe_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%sfe_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%sfe_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%sfe_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 outflow contribution + if (this%idxbudoutf /= 0) then + do j = 1, this%flowbudptr%budterm(this%idxbudoutf)%nlist + call this%sfe_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 streambed 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) + 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 sfe_fc_expanded + + !> @ brief Add terms specific to sfr to the explicit sfe solve + !< + subroutine sfe_solve(this) + ! -- dummy + class(GweSfeType) :: 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%sfe_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%sfe_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%sfe_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%sfe_iflw_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%sfe_outf_term(j, n1, n2, rrate) + this%dbuff(n1) = this%dbuff(n1) + rrate + end do + end if + ! + ! Note: explicit streambed conduction terms??? + ! + ! -- Return + return + end subroutine sfe_solve + + !> @brief Function to return the number of budget terms just for this package. + !! + !! This overrides a function in the parent class. + !< + function sfe_get_nbudterms(this) result(nbudterms) + ! -- dummy + class(GweSfeType) :: this + ! -- return + integer(I4B) :: nbudterms + ! + ! -- Number of budget terms is 6: + ! 1. rainfall + ! 2. evaporation + ! 3. runoff + ! 4. ext-inflow + ! 5. ext-outflow + ! 6. streambed-cond + nbudterms = 6 + ! + ! -- Return + return + end function sfe_get_nbudterms + + !> @brief Set up the budget object that stores all the sfe flows + !< + subroutine sfe_setup_budobj(this, idx) + ! -- modules + use ConstantsModule, only: LENBUDTXT + ! -- dummy + class(GweSfeType) :: this + integer(I4B), intent(inout) :: idx + ! -- local + integer(I4B) :: n, n1, n2 + integer(I4B) :: maxlist, naux + real(DP) :: q + character(len=LENBUDTXT) :: text + ! + ! -- + 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) + ! + ! -- + 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) + ! + ! -- + 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) + ! + ! -- + 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) + ! + ! -- + 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) + ! + ! -- Conduction through the wetted streambed + text = ' STREAMBED-COND' + idx = idx + 1 + maxlist = this%flowbudptr%budterm(this%idxbudsbcd)%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 sfe_setup_budobj + + !> @brief Copy flow terms into this%budobj + !< + subroutine sfe_fill_budobj(this, idx, x, flowja, ccratin, ccratout) + ! -- dummy + class(GweSfeType) :: 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 + 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%sfe_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%sfe_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%sfe_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 + ! + ! -- Ext-inflow + idx = idx + 1 + nlist = this%flowbudptr%budterm(this%idxbudiflw)%nlist + call this%budobj%budterm(idx)%reset(nlist) + do j = 1, nlist + call this%sfe_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 + ! + ! -- 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%sfe_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 + ! + ! -- Strmbd-cond + idx = idx + 1 + call this%budobj%budterm(idx)%reset(this%maxbound) + do j = 1, this%flowbudptr%budterm(this%idxbudsbcd)%nlist + q = DZERO + n1 = this%flowbudptr%budterm(this%idxbudsbcd)%id1(j) + if (this%iboundpak(n1) /= 0) then + igwfnode = this%flowbudptr%budterm(this%idxbudsbcd)%id2(j) + ! -- For now, there is only 1 aux variable under 'GWF' + auxpos = this%flowbudptr%budterm(this%idxbudgwf)%naux + 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 sfe_fill_budobj + + !> @brief Allocate scalars specific to the streamflow energy transport (SFE) + !! package. + !< + subroutine allocate_scalars(this) + ! -- modules + use MemoryManagerModule, only: mem_allocate + ! -- dummy + class(GweSfeType) :: 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%idxbudoutf, 'IDXBUDOUTF', this%memoryPath) + call mem_allocate(this%idxbudsbcd, 'IDXBUDSBCD', this%memoryPath) + ! + ! -- Initialize + this%idxbudrain = 0 + this%idxbudevap = 0 + this%idxbudroff = 0 + this%idxbudiflw = 0 + this%idxbudoutf = 0 + this%idxbudsbcd = 0 + ! + ! -- Return + return + end subroutine allocate_scalars + + !> @brief Allocate arrays specific to the streamflow energy transport (SFE) + !! package. + !< + subroutine sfe_allocate_arrays(this) + ! -- modules + use MemoryManagerModule, only: mem_allocate + ! -- dummy + class(GweSfeType), 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 sfe_allocate_arrays + + !> @brief Deallocate memory + !< + subroutine sfe_da(this) + ! -- modules + use MemoryManagerModule, only: mem_deallocate + ! -- dummy + class(GweSfeType) :: 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%idxbudoutf) + call mem_deallocate(this%idxbudsbcd) + ! + ! -- 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 sfe_da + + !> @brief Rain term + !< + subroutine sfe_rain_term(this, ientry, n1, n2, rrate, rhsval, hcofval) + ! -- dummy + class(GweSfeType) :: 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 ! kluge note: think about budget / sensible heat issue + if (present(rhsval)) rhsval = -rrate + if (present(hcofval)) hcofval = DZERO + ! + ! -- Return + return + end subroutine sfe_rain_term + + !> @brief Evaporative term + !< + subroutine sfe_evap_term(this, ientry, n1, n2, rrate, rhsval, hcofval) + ! -- dummy + class(GweSfeType) :: 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 / this%eqnsclfac ! kluge note: divided by eqnsclfac for fc purposes because rrate is in terms of energy + if (present(rhsval)) rhsval = -rrate + if (present(hcofval)) hcofval = DZERO + ! + ! -- Return + return + end subroutine sfe_evap_term + + !> @brief Runoff term + !< + subroutine sfe_roff_term(this, ientry, n1, n2, rrate, rhsval, hcofval) + ! -- dummy + class(GweSfeType) :: 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 sfe_roff_term + + !> @brief Inflow Term + !! + !! Accounts for energy added via streamflow entering into a stream channel; + !! for example, energy entering the model domain via a specified flow in a + !! stream channel. + !< + subroutine sfe_iflw_term(this, ientry, n1, n2, rrate, rhsval, hcofval) + ! -- dummy + class(GweSfeType) :: 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 sfe_iflw_term + + !> @brief Outflow term + !! + !! Accounts for the energy leaving a stream channel, for example, energy exiting the + !! model domain via a flow in a stream channel flowing out of the active domain. + !< + subroutine sfe_outf_term(this, ientry, n1, n2, rrate, rhsval, hcofval) + ! -- dummy + class(GweSfeType) :: 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 sfe_outf_term + + !> @brief Observations + !! + !! Store the observation type supported by the APT package and overide + !! BndType%bnd_df_obs + !< + subroutine sfe_df_obs(this) + ! -- modules + ! -- dummy + class(GweSfeType) :: 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 reaches. + 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: sfe + call this%obs%StoreObsType('sfe', .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 ext-outflow observation type. + call this%obs%StoreObsType('ext-outflow', .true., indx) + this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsID + ! + ! -- Return + return + end subroutine sfe_df_obs + + !> @brief Process package specific obs + !! + !! Method to process specific observations for this package. + !< + subroutine sfe_rp_obs(this, obsrv, found) + ! -- dummy + class(GweSfeType), intent(inout) :: this !< package class + type(ObserveType), intent(inout) :: obsrv !< observation object + logical, intent(inout) :: found !< indicate whether observation was found + ! -- local + ! + 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 ('EXT-OUTFLOW') + call this%rp_obs_byfeature(obsrv) + case ('TO-MVR') + call this%rp_obs_byfeature(obsrv) + case default + found = .false. + end select + ! + ! -- Return + return + end subroutine sfe_rp_obs + + !> @brief Calculate observation value and pass it back to APT + !< + subroutine sfe_bd_obs(this, obstypeid, jj, v, found) + ! -- dummy + class(GweSfeType), 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%sfe_rain_term(jj, n1, n2, v) + end if + case ('EVAPORATION') + if (this%iboundpak(jj) /= 0) then + call this%sfe_evap_term(jj, n1, n2, v) + end if + case ('RUNOFF') + if (this%iboundpak(jj) /= 0) then + call this%sfe_roff_term(jj, n1, n2, v) + end if + case ('EXT-INFLOW') + if (this%iboundpak(jj) /= 0) then + call this%sfe_iflw_term(jj, n1, n2, v) + end if + case ('EXT-OUTFLOW') + if (this%iboundpak(jj) /= 0) then + call this%sfe_outf_term(jj, n1, n2, v) + end if + case default + found = .false. + end select + ! + ! -- Return + return + end subroutine sfe_bd_obs + + !> @brief Sets the stress period attributes for keyword use. + !< + subroutine sfe_set_stressperiod(this, itemno, keyword, found) + ! -- modules + use TimeSeriesManagerModule, only: read_value_or_time_series_adv + ! -- dummy + class(GweSfeType), 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 + ! 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 ('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, 'INFLOW') + case default + ! + ! -- Keyword not recognized so return to caller with found = .false. + found = .false. + end select + ! +999 continue + ! + ! -- Return + return + end subroutine sfe_set_stressperiod + +end module GweSfeModule diff --git a/src/Model/GroundWaterTransport/gwt1lkt1.f90 b/src/Model/GroundWaterTransport/gwt1lkt1.f90 index e8775deec83..9e441516268 100644 --- a/src/Model/GroundWaterTransport/gwt1lkt1.f90 +++ b/src/Model/GroundWaterTransport/gwt1lkt1.f90 @@ -542,12 +542,13 @@ end subroutine lkt_setup_budobj !> @brief Copy flow terms into this%budobj !< - subroutine lkt_fill_budobj(this, idx, x, ccratin, ccratout) + subroutine lkt_fill_budobj(this, idx, x, flowja, ccratin, ccratout) ! -- modules ! -- dummy class(GwtLktType) :: 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 diff --git a/src/Model/GroundWaterTransport/gwt1mwt1.f90 b/src/Model/GroundWaterTransport/gwt1mwt1.f90 index 842a051235f..1cd782c9917 100644 --- a/src/Model/GroundWaterTransport/gwt1mwt1.f90 +++ b/src/Model/GroundWaterTransport/gwt1mwt1.f90 @@ -473,12 +473,13 @@ end subroutine mwt_setup_budobj !> @brief Copy flow terms into this%budobj !< - subroutine mwt_fill_budobj(this, idx, x, ccratin, ccratout) + subroutine mwt_fill_budobj(this, idx, x, flowja, ccratin, ccratout) ! -- modules ! -- dummy class(GwtMwtType) :: 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 diff --git a/src/Model/GroundWaterTransport/gwt1sft1.f90 b/src/Model/GroundWaterTransport/gwt1sft1.f90 index fc6ffafc171..ef36c177631 100644 --- a/src/Model/GroundWaterTransport/gwt1sft1.f90 +++ b/src/Model/GroundWaterTransport/gwt1sft1.f90 @@ -502,12 +502,13 @@ end subroutine sft_setup_budobj !> @brief Copy flow terms into this%budobj !< - subroutine sft_fill_budobj(this, idx, x, ccratin, ccratout) + subroutine sft_fill_budobj(this, idx, x, flowja, ccratin, ccratout) ! -- modules ! -- dummy class(GwtSftType) :: 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 diff --git a/src/Model/GroundWaterTransport/gwt1uzt1.f90 b/src/Model/GroundWaterTransport/gwt1uzt1.f90 index 4006062fb28..bd67facdf71 100644 --- a/src/Model/GroundWaterTransport/gwt1uzt1.f90 +++ b/src/Model/GroundWaterTransport/gwt1uzt1.f90 @@ -466,12 +466,13 @@ subroutine uzt_setup_budobj(this, idx) end subroutine uzt_setup_budobj !> @brief Copy flow terms into this%budobj - subroutine uzt_fill_budobj(this, idx, x, ccratin, ccratout) + subroutine uzt_fill_budobj(this, idx, x, flowja, ccratin, ccratout) ! -- modules ! -- dummy class(GwtUztType) :: 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 diff --git a/src/Model/TransportModel/tsp1apt1.f90 b/src/Model/TransportModel/tsp1apt1.f90 index 4d2bb855b0d..f92089279f2 100644 --- a/src/Model/TransportModel/tsp1apt1.f90 +++ b/src/Model/TransportModel/tsp1apt1.f90 @@ -80,7 +80,6 @@ module TspAptModule integer(I4B), pointer :: idxprepak => null() !< budget-object index that precedes package-specific budget objects integer(I4B), pointer :: idxlastpak => null() !< budget-object index of last package-specific budget object real(DP), dimension(:), pointer, contiguous :: strt => null() !< starting feature concentration (or temperature) - real(DP), dimension(:), pointer, contiguous :: rfeatthk => null() !< thickness of streambed/lakebed/filter-pack material through which thermal conduction occurs integer(I4B), dimension(:), pointer, contiguous :: idxlocnode => null() !< map position in global rhs and x array of pack entry integer(I4B), dimension(:), pointer, contiguous :: idxpakdiag => null() !< map diag position of feature in global amat integer(I4B), dimension(:), pointer, contiguous :: idxdglo => null() !< map position in global array of package diagonal row entries @@ -2311,7 +2310,7 @@ subroutine apt_fill_budobj(this, x, flowja) ! ! -- individual package terms processed last idx = this%idxprepak - call this%pak_fill_budobj(idx, x, ccratin, ccratout) + call this%pak_fill_budobj(idx, x, flowja, ccratin, ccratout) ! ! --Terms are filled, now accumulate them for this time step call this%budobj%accumulate_terms() @@ -2322,12 +2321,13 @@ end subroutine apt_fill_budobj !> @brief Copy flow terms into this%budobj, must be overridden !< - subroutine pak_fill_budobj(this, idx, x, ccratin, ccratout) + subroutine pak_fill_budobj(this, idx, x, flowja, ccratin, ccratout) ! -- modules ! -- dummy class(TspAptType) :: 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 diff --git a/src/meson.build b/src/meson.build index ac732137c9a..210ce79274e 100644 --- a/src/meson.build +++ b/src/meson.build @@ -70,6 +70,7 @@ modflow_sources = files( 'Model' / 'GroundWaterEnergy' / 'gwe1est1.f90', 'Model' / 'GroundWaterEnergy' / 'gwe1ic1idm.f90', 'Model' / 'GroundWaterEnergy' / 'gwe1idm.f90', + 'Model' / 'GroundWaterEnergy' / 'gwe1sfe1.f90', 'Model' / 'GroundWaterFlow' / 'gwf3.f90', 'Model' / 'GroundWaterFlow' / 'gwf3api8.f90', 'Model' / 'GroundWaterFlow' / 'gwf3buy8.f90',