diff --git a/autotest/test_chf_dfw_swrt2.py b/autotest/test_chf_dfw_swrt2.py index 8dfb56d9cd5..2dd772cef7b 100644 --- a/autotest/test_chf_dfw_swrt2.py +++ b/autotest/test_chf_dfw_swrt2.py @@ -17,12 +17,14 @@ from framework import TestFramework cases = [ - "chf-swr-t2", + "chf-swrt2-01", + "chf-swrt2-02", ] def build_models(idx, test): dx = 500.0 + width = dx nreach = 11 nper = 1 perlen = [5040 * 2 * 60.0] # 7 days (in seconds) @@ -89,7 +91,7 @@ def build_models(idx, test): export_array_ascii=True, nodes=nodes, nvert=nvert, - width=dx, + width=width, bottom=reach_bottom, idomain=1, vertices=vertices, @@ -131,13 +133,23 @@ def build_models(idx, test): # flw inflow_reach = 0 qinflow = 23.570 - flw = flopy.mf6.ModflowChfflw( - chf, - maxbound=1, - print_input=True, - print_flows=True, - stress_period_data=[(inflow_reach, qinflow)], - ) + if idx == 0: + flw = flopy.mf6.ModflowChfflw( + chf, + maxbound=1, + print_input=True, + print_flows=True, + stress_period_data=[(inflow_reach, qinflow)], + ) + + if idx == 1: + pcp = flopy.mf6.ModflowOlfpcp( + chf, + maxbound=1, + print_input=True, + print_flows=True, + stress_period_data=[(inflow_reach, qinflow / dx / width)], + ) chd = flopy.mf6.ModflowChfchd( chf, diff --git a/autotest/test_olf_dfw_swrt2dis.py b/autotest/test_olf_dfw_swrt2dis.py index e33a150e041..05e7edb07dd 100644 --- a/autotest/test_olf_dfw_swrt2dis.py +++ b/autotest/test_olf_dfw_swrt2dis.py @@ -15,7 +15,8 @@ from framework import TestFramework cases = [ - "olf-swr-t2-dis", + "olf-swrt2-dis01", + "olf-swrt2-dis02", ] @@ -113,16 +114,29 @@ def build_models(idx, test): ], ) - # flw qinflow = 23.570 - spd = [(i, 0, qinflow) for i in range(nrow)] - flw = flopy.mf6.ModflowOlfflw( - olf, - maxbound=len(spd), - print_input=True, - print_flows=True, - stress_period_data=spd, - ) + + if idx == 0: + # apply inflow with flw package + spd = [(i, 0, qinflow) for i in range(nrow)] + flw = flopy.mf6.ModflowOlfflw( + olf, + maxbound=len(spd), + print_input=True, + print_flows=True, + stress_period_data=spd, + ) + + if idx == 1: + # apply inflow with pcp package + spd = spd = [(i, 0, qinflow / dx**2) for i in range(nrow)] + pcp = flopy.mf6.ModflowOlfpcp( + olf, + maxbound=len(spd), + print_input=True, + print_flows=True, + stress_period_data=spd, + ) spd = [(i, ncol - 1, 1.05) for i in range(nrow)] chd = flopy.mf6.ModflowOlfchd( diff --git a/doc/mf6io/chf/chf.tex b/doc/mf6io/chf/chf.tex index 607cdb070d8..5279aeeb9c6 100644 --- a/doc/mf6io/chf/chf.tex +++ b/doc/mf6io/chf/chf.tex @@ -46,6 +46,10 @@ \subsection{Constant Head (CHD) Package} \subsection{Inflow (FLW) Package} \input{chf/flw} +\newpage +\subsection{Precipitation (PCP) Package} +\input{chf/pcp} + \newpage \subsection{Zero-Depth Gradient (ZDG) Package} \input{chf/zdg} diff --git a/doc/mf6io/chf/pcp.tex b/doc/mf6io/chf/pcp.tex new file mode 100644 index 00000000000..82e3f65a228 --- /dev/null +++ b/doc/mf6io/chf/pcp.tex @@ -0,0 +1,47 @@ +Input to the Precipitation (PCP) Package is read from the file that has type ``PCP6'' in the Name File. Any number of PCP Packages can be specified for a single surface water flow model. + +\vspace{5mm} +\subsubsection{Structure of Blocks} +\vspace{5mm} + +\noindent \textit{FOR EACH SIMULATION} +\lstinputlisting[style=blockdefinition]{./mf6ivar/tex/chf-pcp-options.dat} +\lstinputlisting[style=blockdefinition]{./mf6ivar/tex/chf-pcp-dimensions.dat} +\vspace{5mm} +\noindent \textit{FOR ANY STRESS PERIOD} +\lstinputlisting[style=blockdefinition]{./mf6ivar/tex/chf-pcp-period.dat} +\packageperioddescription + +\vspace{5mm} +\subsubsection{Explanation of Variables} +\begin{description} +\input{./mf6ivar/tex/chf-pcp-desc.tex} +\end{description} + +\vspace{5mm} +\subsubsection{Example Input File} +\lstinputlisting[style=inputfile]{./mf6ivar/examples/chf-pcp-example.dat} + +%\vspace{5mm} +%\subsubsection{Available observation types} +%Well Package observations include the simulated well rates (\texttt{wel}), the well discharge that is available for the MVR package (\texttt{to-mvr}), and the reduction in the specified \texttt{q} when the \texttt{AUTO\_FLOW\_REDUCE} option is enabled. The data required for each WEL Package observation type is defined in table~\ref{table:gwf-welobstype}. The sum of \texttt{wel} and \texttt{to-mvr} is equal to the simulated well discharge rate, which may be less than the specified \texttt{q} if the \texttt{AUTO\_FLOW\_REDUCE} option is enabled. The \texttt{DNODATA} value is returned if the \texttt{wel-reduction} observation is specified but the \texttt{AUTO\_FLOW\_REDUCE} option is not enabled. Negative and positive values for an observation represent a loss from and gain to the GWF model, respectively. + +%\begin{longtable}{p{2cm} p{2.75cm} p{2cm} p{1.25cm} p{7cm}} +%\caption{Available WEL Package observation types} \tabularnewline + +%\hline +%\hline +%\textbf{Stress Package} & \textbf{Observation type} & \textbf{ID} & \textbf{ID2} & \textbf{Description} \\ +%\hline +%\endhead + +%\hline +%\endfoot + +%\input{../Common/gwf-welobs.tex} +%\label{table:gwf-welobstype} +%\end{longtable} + +%\vspace{5mm} +%\subsubsection{Example Observation Input File} +%\lstinputlisting[style=inputfile]{./mf6ivar/examples/gwf-wel-example-obs.dat} diff --git a/doc/mf6io/mf6ivar/dfn/chf-cxs.dfn b/doc/mf6io/mf6ivar/dfn/chf-cxs.dfn index 259cf04920c..0fe273aa84c 100644 --- a/doc/mf6io/mf6ivar/dfn/chf-cxs.dfn +++ b/doc/mf6io/mf6ivar/dfn/chf-cxs.dfn @@ -56,7 +56,7 @@ tagged false in_record true reader urword longname number of points used to define cross section -description integer value that defines the number of points used to define the define the shape of a section. NXSPOINTS must be greater than zero or the program will terminate with an error. NXSPOINTS defines the number of points that must be entered for the reach in the CROSSSECTIONDATA block. The sum of NXSPOINTS for all sections must equal the NPOINTS dimension. +description integer value that defines the number of points used to define the define the shape of a section. NXSPOINTS must be greater than 1 or the program will terminate with an error. NXSPOINTS defines the number of points that must be entered for the reach in the CROSSSECTIONDATA block. The sum of NXSPOINTS for all sections must equal the NPOINTS dimension. # --------------------- chf cxs crosssectiondata --------------------- diff --git a/doc/mf6io/mf6ivar/dfn/chf-pcp.dfn b/doc/mf6io/mf6ivar/dfn/chf-pcp.dfn new file mode 100644 index 00000000000..c3c69ce8298 --- /dev/null +++ b/doc/mf6io/mf6ivar/dfn/chf-pcp.dfn @@ -0,0 +1,211 @@ +# --------------------- swf pcp options --------------------- +# flopy multi-package + +block options +name auxiliary +type string +shape (naux) +reader urword +optional true +longname keyword to specify aux variables +description REPLACE auxnames {'{#1}': 'Surface Water Flow'} + +block options +name auxmultname +type string +shape +reader urword +optional true +longname name of auxiliary variable for multiplier +description REPLACE auxmultname {'{#1}': 'precipitation'} + +block options +name boundnames +type keyword +shape +reader urword +optional true +longname +description REPLACE boundnames {'{#1}': 'precipitation'} + +block options +name print_input +type keyword +reader urword +optional true +longname print input to listing file +description REPLACE print_input {'{#1}': 'precipitation'} +mf6internal iprpak + +block options +name print_flows +type keyword +reader urword +optional true +longname print precipitation rates to listing file +description REPLACE print_flows {'{#1}': 'precipitation'} +mf6internal iprflow + +block options +name save_flows +type keyword +reader urword +optional true +longname save precipitation to budget file +description REPLACE save_flows {'{#1}': 'precipitation'} +mf6internal ipakcb + +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}': 'Precipitation'} + +# --------------------- swf pcp dimensions --------------------- + +block dimensions +name maxbound +type integer +reader urword +optional false +longname maximum number of precipitation cells +description REPLACE maxbound {'{#1}': 'precipitation cells'} + + +# --------------------- swf pcp 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 stress_period_data +type recarray cellid precipitation aux boundname +shape (maxbound) +reader urword +longname +description +mf6internal spd + +block period +name cellid +type integer +shape (ncelldim) +tagged false +in_record true +reader urword +longname cell identifier +description REPLACE cellid {} + +block period +name precipitation +type double precision +shape +tagged false +in_record true +reader urword +time_series true +longname precipitation rate +description is the precipitation flux rate ($LT^{-1}$). This rate is multiplied inside the program by the surface area of the cell to calculate the volumetric precipitation rate. If the Options block includes a TIMESERIESFILE entry (see the ``Time-Variable Input'' section), values can be obtained from a time series by entering the time-series name in place of a numeric value. + +block period +name aux +type double precision +in_record true +tagged false +shape (naux) +reader urword +optional true +time_series true +longname auxiliary variables +description REPLACE aux {'{#1}': 'precipitation'} +mf6internal auxvar + +block period +name boundname +type string +shape +tagged false +in_record true +reader urword +optional true +longname precipitation name +description REPLACE boundname {'{#1}': 'precipitation'} diff --git a/doc/mf6io/mf6ivar/dfn/olf-flw.dfn b/doc/mf6io/mf6ivar/dfn/olf-flw.dfn index fca9ff08763..cd6426fcb75 100644 --- a/doc/mf6io/mf6ivar/dfn/olf-flw.dfn +++ b/doc/mf6io/mf6ivar/dfn/olf-flw.dfn @@ -180,8 +180,8 @@ tagged false in_record true reader urword time_series true -longname well rate -description is the volumetric inflow rate. A positive value indicates inflow to the stream. Negative values are not allows. 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. +longname flow rate +description is the volumetric inflow rate. A positive value indicates inflow to the stream. Negative values are not allowed. If the Options block includes a TIMESERIESFILE entry (see the ``Time-Variable Input'' section), values can be obtained from a time series by entering the time-series name in place of a numeric value. block period name aux diff --git a/doc/mf6io/mf6ivar/dfn/olf-pcp.dfn b/doc/mf6io/mf6ivar/dfn/olf-pcp.dfn new file mode 100644 index 00000000000..c3c69ce8298 --- /dev/null +++ b/doc/mf6io/mf6ivar/dfn/olf-pcp.dfn @@ -0,0 +1,211 @@ +# --------------------- swf pcp options --------------------- +# flopy multi-package + +block options +name auxiliary +type string +shape (naux) +reader urword +optional true +longname keyword to specify aux variables +description REPLACE auxnames {'{#1}': 'Surface Water Flow'} + +block options +name auxmultname +type string +shape +reader urword +optional true +longname name of auxiliary variable for multiplier +description REPLACE auxmultname {'{#1}': 'precipitation'} + +block options +name boundnames +type keyword +shape +reader urword +optional true +longname +description REPLACE boundnames {'{#1}': 'precipitation'} + +block options +name print_input +type keyword +reader urword +optional true +longname print input to listing file +description REPLACE print_input {'{#1}': 'precipitation'} +mf6internal iprpak + +block options +name print_flows +type keyword +reader urword +optional true +longname print precipitation rates to listing file +description REPLACE print_flows {'{#1}': 'precipitation'} +mf6internal iprflow + +block options +name save_flows +type keyword +reader urword +optional true +longname save precipitation to budget file +description REPLACE save_flows {'{#1}': 'precipitation'} +mf6internal ipakcb + +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}': 'Precipitation'} + +# --------------------- swf pcp dimensions --------------------- + +block dimensions +name maxbound +type integer +reader urword +optional false +longname maximum number of precipitation cells +description REPLACE maxbound {'{#1}': 'precipitation cells'} + + +# --------------------- swf pcp 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 stress_period_data +type recarray cellid precipitation aux boundname +shape (maxbound) +reader urword +longname +description +mf6internal spd + +block period +name cellid +type integer +shape (ncelldim) +tagged false +in_record true +reader urword +longname cell identifier +description REPLACE cellid {} + +block period +name precipitation +type double precision +shape +tagged false +in_record true +reader urword +time_series true +longname precipitation rate +description is the precipitation flux rate ($LT^{-1}$). This rate is multiplied inside the program by the surface area of the cell to calculate the volumetric precipitation rate. If the Options block includes a TIMESERIESFILE entry (see the ``Time-Variable Input'' section), values can be obtained from a time series by entering the time-series name in place of a numeric value. + +block period +name aux +type double precision +in_record true +tagged false +shape (naux) +reader urword +optional true +time_series true +longname auxiliary variables +description REPLACE aux {'{#1}': 'precipitation'} +mf6internal auxvar + +block period +name boundname +type string +shape +tagged false +in_record true +reader urword +optional true +longname precipitation name +description REPLACE boundname {'{#1}': 'precipitation'} diff --git a/doc/mf6io/mf6ivar/dfn/swf-pcp.dfn b/doc/mf6io/mf6ivar/dfn/swf-pcp.dfn new file mode 100644 index 00000000000..c3c69ce8298 --- /dev/null +++ b/doc/mf6io/mf6ivar/dfn/swf-pcp.dfn @@ -0,0 +1,211 @@ +# --------------------- swf pcp options --------------------- +# flopy multi-package + +block options +name auxiliary +type string +shape (naux) +reader urword +optional true +longname keyword to specify aux variables +description REPLACE auxnames {'{#1}': 'Surface Water Flow'} + +block options +name auxmultname +type string +shape +reader urword +optional true +longname name of auxiliary variable for multiplier +description REPLACE auxmultname {'{#1}': 'precipitation'} + +block options +name boundnames +type keyword +shape +reader urword +optional true +longname +description REPLACE boundnames {'{#1}': 'precipitation'} + +block options +name print_input +type keyword +reader urword +optional true +longname print input to listing file +description REPLACE print_input {'{#1}': 'precipitation'} +mf6internal iprpak + +block options +name print_flows +type keyword +reader urword +optional true +longname print precipitation rates to listing file +description REPLACE print_flows {'{#1}': 'precipitation'} +mf6internal iprflow + +block options +name save_flows +type keyword +reader urword +optional true +longname save precipitation to budget file +description REPLACE save_flows {'{#1}': 'precipitation'} +mf6internal ipakcb + +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}': 'Precipitation'} + +# --------------------- swf pcp dimensions --------------------- + +block dimensions +name maxbound +type integer +reader urword +optional false +longname maximum number of precipitation cells +description REPLACE maxbound {'{#1}': 'precipitation cells'} + + +# --------------------- swf pcp 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 stress_period_data +type recarray cellid precipitation aux boundname +shape (maxbound) +reader urword +longname +description +mf6internal spd + +block period +name cellid +type integer +shape (ncelldim) +tagged false +in_record true +reader urword +longname cell identifier +description REPLACE cellid {} + +block period +name precipitation +type double precision +shape +tagged false +in_record true +reader urword +time_series true +longname precipitation rate +description is the precipitation flux rate ($LT^{-1}$). This rate is multiplied inside the program by the surface area of the cell to calculate the volumetric precipitation rate. If the Options block includes a TIMESERIESFILE entry (see the ``Time-Variable Input'' section), values can be obtained from a time series by entering the time-series name in place of a numeric value. + +block period +name aux +type double precision +in_record true +tagged false +shape (naux) +reader urword +optional true +time_series true +longname auxiliary variables +description REPLACE aux {'{#1}': 'precipitation'} +mf6internal auxvar + +block period +name boundname +type string +shape +tagged false +in_record true +reader urword +optional true +longname precipitation name +description REPLACE boundname {'{#1}': 'precipitation'} diff --git a/doc/mf6io/mf6ivar/examples/chf-pcp-example.dat b/doc/mf6io/mf6ivar/examples/chf-pcp-example.dat new file mode 100644 index 00000000000..d6c462d1c26 --- /dev/null +++ b/doc/mf6io/mf6ivar/examples/chf-pcp-example.dat @@ -0,0 +1,13 @@ +BEGIN OPTIONS + PRINT_INPUT + PRINT_FLOWS +END OPTIONS + +BEGIN dimensions + MAXBOUND 2 +END dimensions + +BEGIN PERIOD 1 + 1 0.005 + 2 0.007 +END PERIOD 1 diff --git a/doc/mf6io/mf6ivar/examples/olf-pcp-example.dat b/doc/mf6io/mf6ivar/examples/olf-pcp-example.dat new file mode 100644 index 00000000000..d6c462d1c26 --- /dev/null +++ b/doc/mf6io/mf6ivar/examples/olf-pcp-example.dat @@ -0,0 +1,13 @@ +BEGIN OPTIONS + PRINT_INPUT + PRINT_FLOWS +END OPTIONS + +BEGIN dimensions + MAXBOUND 2 +END dimensions + +BEGIN PERIOD 1 + 1 0.005 + 2 0.007 +END PERIOD 1 diff --git a/doc/mf6io/mf6ivar/mf6ivar.py b/doc/mf6io/mf6ivar/mf6ivar.py index 1faeffaa07a..064579587dc 100644 --- a/doc/mf6io/mf6ivar/mf6ivar.py +++ b/doc/mf6io/mf6ivar/mf6ivar.py @@ -189,6 +189,7 @@ def parse_mf6var_file(fname): MF6IVAR_DIR_PATH = Path(__file__).parent +MF6IO_DIR_PATH = Path(__file__).parents[1] DFNS_DIR_PATH = MF6IVAR_DIR_PATH / "dfn" EXAMPLES_DIR_PATH = MF6IVAR_DIR_PATH / "examples" MD_DIR_PATH = MF6IVAR_DIR_PATH / "md" @@ -196,7 +197,10 @@ def parse_mf6var_file(fname): RTD_DOC_DIR_PATH = Path(__file__).parents[3] / ".build_rtd_docs" / "_mf6io" COMMON_DFN_PATH = parse_mf6var_file(DFNS_DIR_PATH / "common.dfn") COMMON_DIR_PATH = MF6IVAR_DIR_PATH.parent.parent / "Common" -DEFAULT_MODELS = ["gwf", "gwt", "gwe", "prt"] # , "chf", "olf"] +DEFAULT_MODELS = ["gwf", "gwt", "gwe", "prt"] +DEVELOP_MODELS = ["chf", "olf"] +if (MF6IO_DIR_PATH / "develop.version").is_file(): + DEFAULT_MODELS += DEVELOP_MODELS VALID_TYPES = [ "integer", "double precision", diff --git a/doc/mf6io/olf/olf.tex b/doc/mf6io/olf/olf.tex index 7158fb53531..74e75f288cc 100644 --- a/doc/mf6io/olf/olf.tex +++ b/doc/mf6io/olf/olf.tex @@ -46,6 +46,10 @@ \subsection{Constant Head (CHD) Package} \subsection{Inflow (FLW) Package} \input{olf/flw} +\newpage +\subsection{Inflow (PCP) Package} +\input{olf/pcp} + \newpage \subsection{Zero-Depth Gradient (ZDG) Package} \input{olf/zdg} diff --git a/doc/mf6io/olf/pcp.tex b/doc/mf6io/olf/pcp.tex new file mode 100644 index 00000000000..9ba86be57a4 --- /dev/null +++ b/doc/mf6io/olf/pcp.tex @@ -0,0 +1,47 @@ +Input to the Precipitation (PCP) Package is read from the file that has type ``PCP6'' in the Name File. Any number of PCP Packages can be specified for a single surface water flow model. + +\vspace{5mm} +\subsubsection{Structure of Blocks} +\vspace{5mm} + +\noindent \textit{FOR EACH SIMULATION} +\lstinputlisting[style=blockdefinition]{./mf6ivar/tex/olf-pcp-options.dat} +\lstinputlisting[style=blockdefinition]{./mf6ivar/tex/olf-pcp-dimensions.dat} +\vspace{5mm} +\noindent \textit{FOR ANY STRESS PERIOD} +\lstinputlisting[style=blockdefinition]{./mf6ivar/tex/olf-pcp-period.dat} +\packageperioddescription + +\vspace{5mm} +\subsubsection{Explanation of Variables} +\begin{description} +\input{./mf6ivar/tex/olf-pcp-desc.tex} +\end{description} + +\vspace{5mm} +\subsubsection{Example Input File} +\lstinputlisting[style=inputfile]{./mf6ivar/examples/olf-pcp-example.dat} + +%\vspace{5mm} +%\subsubsection{Available observation types} +%Well Package observations include the simulated well rates (\texttt{wel}), the well discharge that is available for the MVR package (\texttt{to-mvr}), and the reduction in the specified \texttt{q} when the \texttt{AUTO\_FLOW\_REDUCE} option is enabled. The data required for each WEL Package observation type is defined in table~\ref{table:gwf-welobstype}. The sum of \texttt{wel} and \texttt{to-mvr} is equal to the simulated well discharge rate, which may be less than the specified \texttt{q} if the \texttt{AUTO\_FLOW\_REDUCE} option is enabled. The \texttt{DNODATA} value is returned if the \texttt{wel-reduction} observation is specified but the \texttt{AUTO\_FLOW\_REDUCE} option is not enabled. Negative and positive values for an observation represent a loss from and gain to the GWF model, respectively. + +%\begin{longtable}{p{2cm} p{2.75cm} p{2cm} p{1.25cm} p{7cm}} +%\caption{Available WEL Package observation types} \tabularnewline + +%\hline +%\hline +%\textbf{Stress Package} & \textbf{Observation type} & \textbf{ID} & \textbf{ID2} & \textbf{Description} \\ +%\hline +%\endhead + +%\hline +%\endfoot + +%\input{../Common/gwf-welobs.tex} +%\label{table:gwf-welobstype} +%\end{longtable} + +%\vspace{5mm} +%\subsubsection{Example Observation Input File} +%\lstinputlisting[style=inputfile]{./mf6ivar/examples/gwf-wel-example-obs.dat} diff --git a/make/makefile b/make/makefile index 27d99da2582..c2502cc85d0 100644 --- a/make/makefile +++ b/make/makefile @@ -1,51 +1,51 @@ -# makefile created by pymake (version 1.2.10.dev0) for the 'mf6' executable. +# makefile created by pymake (version 1.2.11.dev0) for the 'mf6' executable. include ./makedefaults # Define the source file directories SOURCEDIR1=../src -SOURCEDIR2=../src/Distributed -SOURCEDIR3=../src/Exchange -SOURCEDIR4=../src/Idm -SOURCEDIR5=../src/Idm/selector -SOURCEDIR6=../src/Model -SOURCEDIR7=../src/Model/ChannelFlow -SOURCEDIR8=../src/Model/Connection -SOURCEDIR9=../src/Model/Discretization -SOURCEDIR10=../src/Model/Geometry -SOURCEDIR11=../src/Model/GroundWaterEnergy -SOURCEDIR12=../src/Model/GroundWaterFlow -SOURCEDIR13=../src/Model/GroundWaterFlow/submodules -SOURCEDIR14=../src/Model/GroundWaterTransport -SOURCEDIR15=../src/Model/ModelUtilities -SOURCEDIR16=../src/Model/OverlandFlow -SOURCEDIR17=../src/Model/ParticleTracking -SOURCEDIR18=../src/Model/SurfaceWaterFlow -SOURCEDIR19=../src/Model/TransportModel -SOURCEDIR20=../src/Solution -SOURCEDIR21=../src/Solution/LinearMethods -SOURCEDIR22=../src/Solution/ParticleTracker -SOURCEDIR23=../src/Solution/PETSc -SOURCEDIR24=../src/Timing -SOURCEDIR25=../src/Utilities -SOURCEDIR26=../src/Utilities/ArrayRead -SOURCEDIR27=../src/Utilities/Export -SOURCEDIR28=../src/Utilities/Idm -SOURCEDIR29=../src/Utilities/Idm/mf6blockfile -SOURCEDIR30=../src/Utilities/Idm/netcdf -SOURCEDIR31=../src/Utilities/Libraries -SOURCEDIR32=../src/Utilities/Libraries/blas -SOURCEDIR33=../src/Utilities/Libraries/daglib -SOURCEDIR34=../src/Utilities/Libraries/rcm -SOURCEDIR35=../src/Utilities/Libraries/sparsekit -SOURCEDIR36=../src/Utilities/Libraries/sparskit2 -SOURCEDIR37=../src/Utilities/Matrix -SOURCEDIR38=../src/Utilities/Memory -SOURCEDIR39=../src/Utilities/Observation -SOURCEDIR40=../src/Utilities/OutputControl -SOURCEDIR41=../src/Utilities/TimeSeries -SOURCEDIR42=../src/Utilities/Vector +SOURCEDIR2=../src/Idm +SOURCEDIR3=../src/Idm/selector +SOURCEDIR4=../src/Exchange +SOURCEDIR5=../src/Distributed +SOURCEDIR6=../src/Solution +SOURCEDIR7=../src/Solution/LinearMethods +SOURCEDIR8=../src/Solution/ParticleTracker +SOURCEDIR9=../src/Solution/PETSc +SOURCEDIR10=../src/Timing +SOURCEDIR11=../src/Utilities +SOURCEDIR12=../src/Utilities/Idm +SOURCEDIR13=../src/Utilities/Idm/mf6blockfile +SOURCEDIR14=../src/Utilities/Idm/netcdf +SOURCEDIR15=../src/Utilities/TimeSeries +SOURCEDIR16=../src/Utilities/Memory +SOURCEDIR17=../src/Utilities/OutputControl +SOURCEDIR18=../src/Utilities/ArrayRead +SOURCEDIR19=../src/Utilities/Libraries +SOURCEDIR20=../src/Utilities/Libraries/rcm +SOURCEDIR21=../src/Utilities/Libraries/blas +SOURCEDIR22=../src/Utilities/Libraries/sparskit2 +SOURCEDIR23=../src/Utilities/Libraries/daglib +SOURCEDIR24=../src/Utilities/Libraries/sparsekit +SOURCEDIR25=../src/Utilities/Export +SOURCEDIR26=../src/Utilities/Vector +SOURCEDIR27=../src/Utilities/Matrix +SOURCEDIR28=../src/Utilities/Observation +SOURCEDIR29=../src/Model +SOURCEDIR30=../src/Model/Connection +SOURCEDIR31=../src/Model/ChannelFlow +SOURCEDIR32=../src/Model/OverlandFlow +SOURCEDIR33=../src/Model/ParticleTracking +SOURCEDIR34=../src/Model/SurfaceWaterFlow +SOURCEDIR35=../src/Model/GroundWaterTransport +SOURCEDIR36=../src/Model/ModelUtilities +SOURCEDIR37=../src/Model/GroundWaterFlow +SOURCEDIR38=../src/Model/GroundWaterFlow/submodules +SOURCEDIR39=../src/Model/Discretization +SOURCEDIR40=../src/Model/TransportModel +SOURCEDIR41=../src/Model/Geometry +SOURCEDIR42=../src/Model/GroundWaterEnergy VPATH = \ ${SOURCEDIR1} \ @@ -125,6 +125,7 @@ $(OBJDIR)/utl-ncfidm.o \ $(OBJDIR)/utl-hpcidm.o \ $(OBJDIR)/swf-zdgidm.o \ $(OBJDIR)/swf-stoidm.o \ +$(OBJDIR)/swf-pcpidm.o \ $(OBJDIR)/swf-namidm.o \ $(OBJDIR)/swf-icidm.o \ $(OBJDIR)/swf-flwidm.o \ @@ -143,14 +144,13 @@ $(OBJDIR)/prt-disvidm.o \ $(OBJDIR)/prt-disidm.o \ $(OBJDIR)/olf-zdgidm.o \ $(OBJDIR)/olf-stoidm.o \ +$(OBJDIR)/olf-pcpidm.o \ $(OBJDIR)/olf-namidm.o \ $(OBJDIR)/olf-icidm.o \ $(OBJDIR)/olf-flwidm.o \ $(OBJDIR)/olf-disv2didm.o \ -$(OBJDIR)/olf-disv1didm.o \ $(OBJDIR)/olf-dis2didm.o \ $(OBJDIR)/olf-dfwidm.o \ -$(OBJDIR)/olf-cxsidm.o \ $(OBJDIR)/olf-chdidm.o \ $(OBJDIR)/olf-cdbidm.o \ $(OBJDIR)/gwt-namidm.o \ @@ -193,12 +193,11 @@ $(OBJDIR)/exg-gwegweidm.o \ $(OBJDIR)/exg-chfgwfidm.o \ $(OBJDIR)/chf-zdgidm.o \ $(OBJDIR)/chf-stoidm.o \ +$(OBJDIR)/chf-pcpidm.o \ $(OBJDIR)/chf-namidm.o \ $(OBJDIR)/chf-icidm.o \ $(OBJDIR)/chf-flwidm.o \ -$(OBJDIR)/chf-disv2didm.o \ $(OBJDIR)/chf-disv1didm.o \ -$(OBJDIR)/chf-dis2didm.o \ $(OBJDIR)/chf-dfwidm.o \ $(OBJDIR)/chf-cxsidm.o \ $(OBJDIR)/chf-chdidm.o \ @@ -256,17 +255,17 @@ $(OBJDIR)/TimeArraySeriesManager.o \ $(OBJDIR)/PackageMover.o \ $(OBJDIR)/Obs.o \ $(OBJDIR)/NumericalPackage.o \ +$(OBJDIR)/Particle.o \ $(OBJDIR)/PackageBudget.o \ $(OBJDIR)/HeadFileReader.o \ $(OBJDIR)/BudgetObject.o \ $(OBJDIR)/BoundaryPackage.o \ $(OBJDIR)/CellDefn.o \ -$(OBJDIR)/Particle.o \ +$(OBJDIR)/TrackFile.o \ $(OBJDIR)/sort.o \ $(OBJDIR)/FlowModelInterface.o \ $(OBJDIR)/Cell.o \ $(OBJDIR)/Subcell.o \ -$(OBJDIR)/TrackFile.o \ $(OBJDIR)/TrackControl.o \ $(OBJDIR)/TimeSelect.o \ $(OBJDIR)/prt-fmi.o \ @@ -308,6 +307,7 @@ $(OBJDIR)/MethodSubcellPool.o \ $(OBJDIR)/CellPoly.o \ $(OBJDIR)/CellRectQuad.o \ $(OBJDIR)/CellRect.o \ +$(OBJDIR)/SwfCxsUtils.o \ $(OBJDIR)/VirtualModel.o \ $(OBJDIR)/BaseExchange.o \ $(OBJDIR)/TspSpc.o \ @@ -332,8 +332,9 @@ $(OBJDIR)/MethodCellTernary.o \ $(OBJDIR)/MethodCellPollockQuad.o \ $(OBJDIR)/MethodCellPollock.o \ $(OBJDIR)/MethodCellPassToBot.o \ -$(OBJDIR)/SwfCxsUtils.o \ $(OBJDIR)/Disv1dGeom.o \ +$(OBJDIR)/VectorInterpolation.o \ +$(OBJDIR)/swf-cxs.o \ $(OBJDIR)/CellWithNbrs.o \ $(OBJDIR)/NumericalExchange.o \ $(OBJDIR)/tsp-ssm.o \ @@ -360,20 +361,19 @@ $(OBJDIR)/VirtualSolution.o \ $(OBJDIR)/SparseMatrix.o \ $(OBJDIR)/LinearSolverBase.o \ $(OBJDIR)/ImsReordering.o \ -$(OBJDIR)/StructVector.o \ $(OBJDIR)/ModflowInput.o \ +$(OBJDIR)/DefinitionSelect.o \ +$(OBJDIR)/StructVector.o \ $(OBJDIR)/IdmLogger.o \ $(OBJDIR)/NCFileVars.o \ $(OBJDIR)/Integer1dReader.o \ $(OBJDIR)/Double2dReader.o \ $(OBJDIR)/Double1dReader.o \ -$(OBJDIR)/DefinitionSelect.o \ $(OBJDIR)/MethodCellPool.o \ $(OBJDIR)/CellUtil.o \ -$(OBJDIR)/swf-cxs.o \ $(OBJDIR)/Disv1d.o \ +$(OBJDIR)/swf-dfw.o \ $(OBJDIR)/swf-ic.o \ -$(OBJDIR)/VectorInterpolation.o \ $(OBJDIR)/VirtualExchange.o \ $(OBJDIR)/GridSorting.o \ $(OBJDIR)/DisConnExchange.o \ @@ -411,20 +411,20 @@ $(OBJDIR)/gwe-cnd.o \ $(OBJDIR)/RouterBase.o \ $(OBJDIR)/ImsLinearSolver.o \ $(OBJDIR)/ImsLinearBase.o \ +$(OBJDIR)/DynamicPackageParams.o \ $(OBJDIR)/StructArray.o \ $(OBJDIR)/LoadNCInput.o \ $(OBJDIR)/LayeredArrayReader.o \ -$(OBJDIR)/DynamicPackageParams.o \ $(OBJDIR)/InputLoadType.o \ $(OBJDIR)/ReleaseSchedule.o \ $(OBJDIR)/MethodDisv.o \ $(OBJDIR)/MethodDis.o \ $(OBJDIR)/swf-zdg.o \ $(OBJDIR)/swf-sto.o \ +$(OBJDIR)/swf-pcp.o \ $(OBJDIR)/swf-oc.o \ $(OBJDIR)/swf-obs.o \ $(OBJDIR)/swf-flw.o \ -$(OBJDIR)/swf-dfw.o \ $(OBJDIR)/swf-cdb.o \ $(OBJDIR)/Disv2d.o \ $(OBJDIR)/Dis2d.o \ @@ -440,9 +440,9 @@ $(OBJDIR)/Timer.o \ $(OBJDIR)/LinearSolverFactory.o \ $(OBJDIR)/ImsLinear.o \ $(OBJDIR)/BaseSolution.o \ +$(OBJDIR)/BoundInputContext.o \ $(OBJDIR)/LoadMf6File.o \ $(OBJDIR)/AsciiInputLoadType.o \ -$(OBJDIR)/BoundInputContext.o \ $(OBJDIR)/prt-prp.o \ $(OBJDIR)/prt-oc.o \ $(OBJDIR)/prt-mip.o \ @@ -513,7 +513,11 @@ $(OBJDIR)/gwf-sfr-constant.o \ $(OBJDIR)/RectangularGeometry.o \ $(OBJDIR)/CircularGeometry.o \ $(OBJDIR)/ExplicitModel.o \ -$(OBJDIR)/exg-swfgwfidm.o +$(OBJDIR)/olf-disv1didm.o \ +$(OBJDIR)/olf-cxsidm.o \ +$(OBJDIR)/exg-swfgwfidm.o \ +$(OBJDIR)/chf-disv2didm.o \ +$(OBJDIR)/chf-dis2didm.o # Define the objects that make up the program $(PROGRAM) : $(OBJECTS) diff --git a/msvs/mf6core.vfproj b/msvs/mf6core.vfproj index a90fddd986e..c97b8e6638a 100644 --- a/msvs/mf6core.vfproj +++ b/msvs/mf6core.vfproj @@ -148,6 +148,7 @@ + @@ -199,6 +200,7 @@ + @@ -217,6 +219,7 @@ + @@ -354,6 +357,7 @@ + diff --git a/src/Idm/chf-pcpidm.f90 b/src/Idm/chf-pcpidm.f90 new file mode 100644 index 00000000000..006168835a7 --- /dev/null +++ b/src/Idm/chf-pcpidm.f90 @@ -0,0 +1,437 @@ +! ** Do Not Modify! MODFLOW 6 system generated file. ** +module ChfPcpInputModule + use ConstantsModule, only: LENVARNAME + use InputDefinitionModule, only: InputParamDefinitionType, & + InputBlockDefinitionType + private + public chf_pcp_param_definitions + public chf_pcp_aggregate_definitions + public chf_pcp_block_definitions + public ChfPcpParamFoundType + public chf_pcp_multi_package + public chf_pcp_subpackages + + type ChfPcpParamFoundType + logical :: auxiliary = .false. + logical :: auxmultname = .false. + logical :: boundnames = .false. + logical :: iprpak = .false. + logical :: iprflow = .false. + logical :: ipakcb = .false. + logical :: ts_filerecord = .false. + logical :: ts6 = .false. + logical :: filein = .false. + logical :: ts6_filename = .false. + logical :: obs_filerecord = .false. + logical :: obs6 = .false. + logical :: obs6_filename = .false. + logical :: maxbound = .false. + logical :: cellid = .false. + logical :: precipitation = .false. + logical :: auxvar = .false. + logical :: boundname = .false. + end type ChfPcpParamFoundType + + logical :: chf_pcp_multi_package = .true. + + character(len=16), parameter :: & + chf_pcp_subpackages(*) = & + [ & + ' ' & + ] + + type(InputParamDefinitionType), parameter :: & + chfpcp_auxiliary = InputParamDefinitionType & + ( & + 'CHF', & ! component + 'PCP', & ! subcomponent + 'OPTIONS', & ! block + 'AUXILIARY', & ! tag name + 'AUXILIARY', & ! fortran variable + 'STRING', & ! type + 'NAUX', & ! shape + 'keyword to specify aux variables', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + chfpcp_auxmultname = InputParamDefinitionType & + ( & + 'CHF', & ! component + 'PCP', & ! subcomponent + 'OPTIONS', & ! block + 'AUXMULTNAME', & ! tag name + 'AUXMULTNAME', & ! fortran variable + 'STRING', & ! type + '', & ! shape + 'name of auxiliary variable for multiplier', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + chfpcp_boundnames = InputParamDefinitionType & + ( & + 'CHF', & ! component + 'PCP', & ! subcomponent + 'OPTIONS', & ! block + 'BOUNDNAMES', & ! tag name + 'BOUNDNAMES', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + '', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + chfpcp_iprpak = InputParamDefinitionType & + ( & + 'CHF', & ! component + 'PCP', & ! subcomponent + 'OPTIONS', & ! block + 'PRINT_INPUT', & ! tag name + 'IPRPAK', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'print input to listing file', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + chfpcp_iprflow = InputParamDefinitionType & + ( & + 'CHF', & ! component + 'PCP', & ! subcomponent + 'OPTIONS', & ! block + 'PRINT_FLOWS', & ! tag name + 'IPRFLOW', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'print precipitation rates to listing file', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + chfpcp_ipakcb = InputParamDefinitionType & + ( & + 'CHF', & ! component + 'PCP', & ! subcomponent + 'OPTIONS', & ! block + 'SAVE_FLOWS', & ! tag name + 'IPAKCB', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'save precipitation to budget file', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + chfpcp_ts_filerecord = InputParamDefinitionType & + ( & + 'CHF', & ! component + 'PCP', & ! subcomponent + 'OPTIONS', & ! block + 'TS_FILERECORD', & ! tag name + 'TS_FILERECORD', & ! fortran variable + 'RECORD TS6 FILEIN TS6_FILENAME', & ! type + '', & ! shape + '', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + chfpcp_ts6 = InputParamDefinitionType & + ( & + 'CHF', & ! component + 'PCP', & ! subcomponent + 'OPTIONS', & ! block + 'TS6', & ! tag name + 'TS6', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'head keyword', & ! longname + .true., & ! required + .true., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + chfpcp_filein = InputParamDefinitionType & + ( & + 'CHF', & ! component + 'PCP', & ! subcomponent + 'OPTIONS', & ! block + 'FILEIN', & ! tag name + 'FILEIN', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'file keyword', & ! longname + .true., & ! required + .true., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + chfpcp_ts6_filename = InputParamDefinitionType & + ( & + 'CHF', & ! component + 'PCP', & ! subcomponent + 'OPTIONS', & ! block + 'TS6_FILENAME', & ! tag name + 'TS6_FILENAME', & ! fortran variable + 'STRING', & ! type + '', & ! shape + 'file name of time series information', & ! longname + .true., & ! required + .true., & ! multi-record + .true., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + chfpcp_obs_filerecord = InputParamDefinitionType & + ( & + 'CHF', & ! component + 'PCP', & ! subcomponent + 'OPTIONS', & ! block + 'OBS_FILERECORD', & ! tag name + 'OBS_FILERECORD', & ! fortran variable + 'RECORD OBS6 FILEIN OBS6_FILENAME', & ! type + '', & ! shape + '', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + chfpcp_obs6 = InputParamDefinitionType & + ( & + 'CHF', & ! component + 'PCP', & ! subcomponent + 'OPTIONS', & ! block + 'OBS6', & ! tag name + 'OBS6', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'obs keyword', & ! longname + .true., & ! required + .true., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + chfpcp_obs6_filename = InputParamDefinitionType & + ( & + 'CHF', & ! component + 'PCP', & ! subcomponent + 'OPTIONS', & ! block + 'OBS6_FILENAME', & ! tag name + 'OBS6_FILENAME', & ! fortran variable + 'STRING', & ! type + '', & ! shape + 'obs6 input filename', & ! longname + .true., & ! required + .true., & ! multi-record + .true., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + chfpcp_maxbound = InputParamDefinitionType & + ( & + 'CHF', & ! component + 'PCP', & ! subcomponent + 'DIMENSIONS', & ! block + 'MAXBOUND', & ! tag name + 'MAXBOUND', & ! fortran variable + 'INTEGER', & ! type + '', & ! shape + 'maximum number of precipitation cells', & ! longname + .true., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + chfpcp_cellid = InputParamDefinitionType & + ( & + 'CHF', & ! component + 'PCP', & ! subcomponent + 'PERIOD', & ! block + 'CELLID', & ! tag name + 'CELLID', & ! fortran variable + 'INTEGER1D', & ! type + 'NCELLDIM', & ! shape + 'cell identifier', & ! longname + .true., & ! required + .true., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + chfpcp_precipitation = InputParamDefinitionType & + ( & + 'CHF', & ! component + 'PCP', & ! subcomponent + 'PERIOD', & ! block + 'PRECIPITATION', & ! tag name + 'PRECIPITATION', & ! fortran variable + 'DOUBLE', & ! type + '', & ! shape + 'precipitation rate', & ! longname + .true., & ! required + .true., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .true. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + chfpcp_auxvar = InputParamDefinitionType & + ( & + 'CHF', & ! component + 'PCP', & ! subcomponent + 'PERIOD', & ! block + 'AUX', & ! tag name + 'AUXVAR', & ! fortran variable + 'DOUBLE1D', & ! type + 'NAUX', & ! shape + 'auxiliary variables', & ! longname + .false., & ! required + .true., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .true. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + chfpcp_boundname = InputParamDefinitionType & + ( & + 'CHF', & ! component + 'PCP', & ! subcomponent + 'PERIOD', & ! block + 'BOUNDNAME', & ! tag name + 'BOUNDNAME', & ! fortran variable + 'STRING', & ! type + '', & ! shape + 'precipitation name', & ! longname + .false., & ! required + .true., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + chf_pcp_param_definitions(*) = & + [ & + chfpcp_auxiliary, & + chfpcp_auxmultname, & + chfpcp_boundnames, & + chfpcp_iprpak, & + chfpcp_iprflow, & + chfpcp_ipakcb, & + chfpcp_ts_filerecord, & + chfpcp_ts6, & + chfpcp_filein, & + chfpcp_ts6_filename, & + chfpcp_obs_filerecord, & + chfpcp_obs6, & + chfpcp_obs6_filename, & + chfpcp_maxbound, & + chfpcp_cellid, & + chfpcp_precipitation, & + chfpcp_auxvar, & + chfpcp_boundname & + ] + + type(InputParamDefinitionType), parameter :: & + chfpcp_spd = InputParamDefinitionType & + ( & + 'CHF', & ! component + 'PCP', & ! subcomponent + 'PERIOD', & ! block + 'STRESS_PERIOD_DATA', & ! tag name + 'SPD', & ! fortran variable + 'RECARRAY CELLID PRECIPITATION AUX BOUNDNAME', & ! type + 'MAXBOUND', & ! shape + '', & ! longname + .true., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + chf_pcp_aggregate_definitions(*) = & + [ & + chfpcp_spd & + ] + + type(InputBlockDefinitionType), parameter :: & + chf_pcp_block_definitions(*) = & + [ & + InputBlockDefinitionType( & + 'OPTIONS', & ! blockname + .false., & ! required + .false., & ! aggregate + .false. & ! block_variable + ), & + InputBlockDefinitionType( & + 'DIMENSIONS', & ! blockname + .true., & ! required + .false., & ! aggregate + .false. & ! block_variable + ), & + InputBlockDefinitionType( & + 'PERIOD', & ! blockname + .true., & ! required + .true., & ! aggregate + .true. & ! block_variable + ) & + ] + +end module ChfPcpInputModule diff --git a/src/Idm/olf-pcpidm.f90 b/src/Idm/olf-pcpidm.f90 new file mode 100644 index 00000000000..d430f39e177 --- /dev/null +++ b/src/Idm/olf-pcpidm.f90 @@ -0,0 +1,437 @@ +! ** Do Not Modify! MODFLOW 6 system generated file. ** +module OlfPcpInputModule + use ConstantsModule, only: LENVARNAME + use InputDefinitionModule, only: InputParamDefinitionType, & + InputBlockDefinitionType + private + public olf_pcp_param_definitions + public olf_pcp_aggregate_definitions + public olf_pcp_block_definitions + public OlfPcpParamFoundType + public olf_pcp_multi_package + public olf_pcp_subpackages + + type OlfPcpParamFoundType + logical :: auxiliary = .false. + logical :: auxmultname = .false. + logical :: boundnames = .false. + logical :: iprpak = .false. + logical :: iprflow = .false. + logical :: ipakcb = .false. + logical :: ts_filerecord = .false. + logical :: ts6 = .false. + logical :: filein = .false. + logical :: ts6_filename = .false. + logical :: obs_filerecord = .false. + logical :: obs6 = .false. + logical :: obs6_filename = .false. + logical :: maxbound = .false. + logical :: cellid = .false. + logical :: precipitation = .false. + logical :: auxvar = .false. + logical :: boundname = .false. + end type OlfPcpParamFoundType + + logical :: olf_pcp_multi_package = .true. + + character(len=16), parameter :: & + olf_pcp_subpackages(*) = & + [ & + ' ' & + ] + + type(InputParamDefinitionType), parameter :: & + olfpcp_auxiliary = InputParamDefinitionType & + ( & + 'OLF', & ! component + 'PCP', & ! subcomponent + 'OPTIONS', & ! block + 'AUXILIARY', & ! tag name + 'AUXILIARY', & ! fortran variable + 'STRING', & ! type + 'NAUX', & ! shape + 'keyword to specify aux variables', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + olfpcp_auxmultname = InputParamDefinitionType & + ( & + 'OLF', & ! component + 'PCP', & ! subcomponent + 'OPTIONS', & ! block + 'AUXMULTNAME', & ! tag name + 'AUXMULTNAME', & ! fortran variable + 'STRING', & ! type + '', & ! shape + 'name of auxiliary variable for multiplier', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + olfpcp_boundnames = InputParamDefinitionType & + ( & + 'OLF', & ! component + 'PCP', & ! subcomponent + 'OPTIONS', & ! block + 'BOUNDNAMES', & ! tag name + 'BOUNDNAMES', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + '', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + olfpcp_iprpak = InputParamDefinitionType & + ( & + 'OLF', & ! component + 'PCP', & ! subcomponent + 'OPTIONS', & ! block + 'PRINT_INPUT', & ! tag name + 'IPRPAK', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'print input to listing file', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + olfpcp_iprflow = InputParamDefinitionType & + ( & + 'OLF', & ! component + 'PCP', & ! subcomponent + 'OPTIONS', & ! block + 'PRINT_FLOWS', & ! tag name + 'IPRFLOW', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'print precipitation rates to listing file', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + olfpcp_ipakcb = InputParamDefinitionType & + ( & + 'OLF', & ! component + 'PCP', & ! subcomponent + 'OPTIONS', & ! block + 'SAVE_FLOWS', & ! tag name + 'IPAKCB', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'save precipitation to budget file', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + olfpcp_ts_filerecord = InputParamDefinitionType & + ( & + 'OLF', & ! component + 'PCP', & ! subcomponent + 'OPTIONS', & ! block + 'TS_FILERECORD', & ! tag name + 'TS_FILERECORD', & ! fortran variable + 'RECORD TS6 FILEIN TS6_FILENAME', & ! type + '', & ! shape + '', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + olfpcp_ts6 = InputParamDefinitionType & + ( & + 'OLF', & ! component + 'PCP', & ! subcomponent + 'OPTIONS', & ! block + 'TS6', & ! tag name + 'TS6', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'head keyword', & ! longname + .true., & ! required + .true., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + olfpcp_filein = InputParamDefinitionType & + ( & + 'OLF', & ! component + 'PCP', & ! subcomponent + 'OPTIONS', & ! block + 'FILEIN', & ! tag name + 'FILEIN', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'file keyword', & ! longname + .true., & ! required + .true., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + olfpcp_ts6_filename = InputParamDefinitionType & + ( & + 'OLF', & ! component + 'PCP', & ! subcomponent + 'OPTIONS', & ! block + 'TS6_FILENAME', & ! tag name + 'TS6_FILENAME', & ! fortran variable + 'STRING', & ! type + '', & ! shape + 'file name of time series information', & ! longname + .true., & ! required + .true., & ! multi-record + .true., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + olfpcp_obs_filerecord = InputParamDefinitionType & + ( & + 'OLF', & ! component + 'PCP', & ! subcomponent + 'OPTIONS', & ! block + 'OBS_FILERECORD', & ! tag name + 'OBS_FILERECORD', & ! fortran variable + 'RECORD OBS6 FILEIN OBS6_FILENAME', & ! type + '', & ! shape + '', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + olfpcp_obs6 = InputParamDefinitionType & + ( & + 'OLF', & ! component + 'PCP', & ! subcomponent + 'OPTIONS', & ! block + 'OBS6', & ! tag name + 'OBS6', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'obs keyword', & ! longname + .true., & ! required + .true., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + olfpcp_obs6_filename = InputParamDefinitionType & + ( & + 'OLF', & ! component + 'PCP', & ! subcomponent + 'OPTIONS', & ! block + 'OBS6_FILENAME', & ! tag name + 'OBS6_FILENAME', & ! fortran variable + 'STRING', & ! type + '', & ! shape + 'obs6 input filename', & ! longname + .true., & ! required + .true., & ! multi-record + .true., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + olfpcp_maxbound = InputParamDefinitionType & + ( & + 'OLF', & ! component + 'PCP', & ! subcomponent + 'DIMENSIONS', & ! block + 'MAXBOUND', & ! tag name + 'MAXBOUND', & ! fortran variable + 'INTEGER', & ! type + '', & ! shape + 'maximum number of precipitation cells', & ! longname + .true., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + olfpcp_cellid = InputParamDefinitionType & + ( & + 'OLF', & ! component + 'PCP', & ! subcomponent + 'PERIOD', & ! block + 'CELLID', & ! tag name + 'CELLID', & ! fortran variable + 'INTEGER1D', & ! type + 'NCELLDIM', & ! shape + 'cell identifier', & ! longname + .true., & ! required + .true., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + olfpcp_precipitation = InputParamDefinitionType & + ( & + 'OLF', & ! component + 'PCP', & ! subcomponent + 'PERIOD', & ! block + 'PRECIPITATION', & ! tag name + 'PRECIPITATION', & ! fortran variable + 'DOUBLE', & ! type + '', & ! shape + 'precipitation rate', & ! longname + .true., & ! required + .true., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .true. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + olfpcp_auxvar = InputParamDefinitionType & + ( & + 'OLF', & ! component + 'PCP', & ! subcomponent + 'PERIOD', & ! block + 'AUX', & ! tag name + 'AUXVAR', & ! fortran variable + 'DOUBLE1D', & ! type + 'NAUX', & ! shape + 'auxiliary variables', & ! longname + .false., & ! required + .true., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .true. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + olfpcp_boundname = InputParamDefinitionType & + ( & + 'OLF', & ! component + 'PCP', & ! subcomponent + 'PERIOD', & ! block + 'BOUNDNAME', & ! tag name + 'BOUNDNAME', & ! fortran variable + 'STRING', & ! type + '', & ! shape + 'precipitation name', & ! longname + .false., & ! required + .true., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + olf_pcp_param_definitions(*) = & + [ & + olfpcp_auxiliary, & + olfpcp_auxmultname, & + olfpcp_boundnames, & + olfpcp_iprpak, & + olfpcp_iprflow, & + olfpcp_ipakcb, & + olfpcp_ts_filerecord, & + olfpcp_ts6, & + olfpcp_filein, & + olfpcp_ts6_filename, & + olfpcp_obs_filerecord, & + olfpcp_obs6, & + olfpcp_obs6_filename, & + olfpcp_maxbound, & + olfpcp_cellid, & + olfpcp_precipitation, & + olfpcp_auxvar, & + olfpcp_boundname & + ] + + type(InputParamDefinitionType), parameter :: & + olfpcp_spd = InputParamDefinitionType & + ( & + 'OLF', & ! component + 'PCP', & ! subcomponent + 'PERIOD', & ! block + 'STRESS_PERIOD_DATA', & ! tag name + 'SPD', & ! fortran variable + 'RECARRAY CELLID PRECIPITATION AUX BOUNDNAME', & ! type + 'MAXBOUND', & ! shape + '', & ! longname + .true., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + olf_pcp_aggregate_definitions(*) = & + [ & + olfpcp_spd & + ] + + type(InputBlockDefinitionType), parameter :: & + olf_pcp_block_definitions(*) = & + [ & + InputBlockDefinitionType( & + 'OPTIONS', & ! blockname + .false., & ! required + .false., & ! aggregate + .false. & ! block_variable + ), & + InputBlockDefinitionType( & + 'DIMENSIONS', & ! blockname + .true., & ! required + .false., & ! aggregate + .false. & ! block_variable + ), & + InputBlockDefinitionType( & + 'PERIOD', & ! blockname + .true., & ! required + .true., & ! aggregate + .true. & ! block_variable + ) & + ] + +end module OlfPcpInputModule diff --git a/src/Idm/selector/IdmChfDfnSelector.f90 b/src/Idm/selector/IdmChfDfnSelector.f90 index 62b0f3c00c0..e44bd63aa0e 100644 --- a/src/Idm/selector/IdmChfDfnSelector.f90 +++ b/src/Idm/selector/IdmChfDfnSelector.f90 @@ -13,6 +13,7 @@ module IdmChfDfnSelectorModule use ChfCdbInputModule use ChfChdInputModule use ChfFlwInputModule + use ChfPcpInputModule use ChfStoInputModule use ChfZdgInputModule @@ -66,6 +67,8 @@ function chf_param_definitions(subcomponent) result(input_definition) call set_param_pointer(input_definition, chf_chd_param_definitions) case ('FLW') call set_param_pointer(input_definition, chf_flw_param_definitions) + case ('PCP') + call set_param_pointer(input_definition, chf_pcp_param_definitions) case ('STO') call set_param_pointer(input_definition, chf_sto_param_definitions) case ('ZDG') @@ -96,6 +99,8 @@ function chf_aggregate_definitions(subcomponent) result(input_definition) call set_param_pointer(input_definition, chf_chd_aggregate_definitions) case ('FLW') call set_param_pointer(input_definition, chf_flw_aggregate_definitions) + case ('PCP') + call set_param_pointer(input_definition, chf_pcp_aggregate_definitions) case ('STO') call set_param_pointer(input_definition, chf_sto_aggregate_definitions) case ('ZDG') @@ -126,6 +131,8 @@ function chf_block_definitions(subcomponent) result(input_definition) call set_block_pointer(input_definition, chf_chd_block_definitions) case ('FLW') call set_block_pointer(input_definition, chf_flw_block_definitions) + case ('PCP') + call set_block_pointer(input_definition, chf_pcp_block_definitions) case ('STO') call set_block_pointer(input_definition, chf_sto_block_definitions) case ('ZDG') @@ -155,6 +162,8 @@ function chf_idm_multi_package(subcomponent) result(multi_package) multi_package = chf_chd_multi_package case ('FLW') multi_package = chf_flw_multi_package + case ('PCP') + multi_package = chf_pcp_multi_package case ('STO') multi_package = chf_sto_multi_package case ('ZDG') @@ -187,6 +196,8 @@ function chf_idm_subpackages(subcomponent) result(subpackages) call set_subpkg_pointer(subpackages, chf_chd_subpackages) case ('FLW') call set_subpkg_pointer(subpackages, chf_flw_subpackages) + case ('PCP') + call set_subpkg_pointer(subpackages, chf_pcp_subpackages) case ('STO') call set_subpkg_pointer(subpackages, chf_sto_subpackages) case ('ZDG') @@ -217,6 +228,8 @@ function chf_idm_integrated(subcomponent) result(integrated) integrated = .true. case ('FLW') integrated = .true. + case ('PCP') + integrated = .true. case ('STO') integrated = .true. case ('ZDG') diff --git a/src/Idm/selector/IdmDfnSelector.f90 b/src/Idm/selector/IdmDfnSelector.f90 index 7612c2c8d6d..2efc8d0b9fb 100644 --- a/src/Idm/selector/IdmDfnSelector.f90 +++ b/src/Idm/selector/IdmDfnSelector.f90 @@ -9,6 +9,7 @@ module IdmDfnSelectorModule use IdmGwfDfnSelectorModule use IdmGwtDfnSelectorModule use IdmGweDfnSelectorModule + use IdmSwfDfnSelectorModule use IdmChfDfnSelectorModule use IdmOlfDfnSelectorModule use IdmPrtDfnSelectorModule @@ -41,6 +42,8 @@ function param_definitions(component, subcomponent) result(input_definition) input_definition => gwt_param_definitions(subcomponent) case ('GWE') input_definition => gwe_param_definitions(subcomponent) + case ('SWF') + input_definition => swf_param_definitions(subcomponent) case ('CHF') input_definition => chf_param_definitions(subcomponent) case ('OLF') @@ -70,6 +73,8 @@ function aggregate_definitions(component, subcomponent) result(input_definition) input_definition => gwt_aggregate_definitions(subcomponent) case ('GWE') input_definition => gwe_aggregate_definitions(subcomponent) + case ('SWF') + input_definition => swf_aggregate_definitions(subcomponent) case ('CHF') input_definition => chf_aggregate_definitions(subcomponent) case ('OLF') @@ -99,6 +104,8 @@ function block_definitions(component, subcomponent) result(input_definition) input_definition => gwt_block_definitions(subcomponent) case ('GWE') input_definition => gwe_block_definitions(subcomponent) + case ('SWF') + input_definition => swf_block_definitions(subcomponent) case ('CHF') input_definition => chf_block_definitions(subcomponent) case ('OLF') @@ -127,6 +134,8 @@ function idm_multi_package(component, subcomponent) result(multi_package) multi_package = gwt_idm_multi_package(subcomponent) case ('GWE') multi_package = gwe_idm_multi_package(subcomponent) + case ('SWF') + multi_package = swf_idm_multi_package(subcomponent) case ('CHF') multi_package = chf_idm_multi_package(subcomponent) case ('OLF') @@ -158,6 +167,8 @@ function idm_subpackages(component, subcomponent) result(subpackages) subpackages => gwt_idm_subpackages(subcomponent) case ('GWE') subpackages => gwe_idm_subpackages(subcomponent) + case ('SWF') + subpackages => swf_idm_subpackages(subcomponent) case ('CHF') subpackages => chf_idm_subpackages(subcomponent) case ('OLF') @@ -190,6 +201,8 @@ function idm_integrated(component, subcomponent) result(integrated) integrated = gwt_idm_integrated(subcomponent) case ('GWE') integrated = gwe_idm_integrated(subcomponent) + case ('SWF') + integrated = swf_idm_integrated(subcomponent) case ('CHF') integrated = chf_idm_integrated(subcomponent) case ('OLF') @@ -218,6 +231,8 @@ function idm_component(component) result(integrated) integrated = .true. case ('GWE') integrated = .true. + case ('SWF') + integrated = .true. case ('CHF') integrated = .true. case ('OLF') diff --git a/src/Idm/selector/IdmOlfDfnSelector.f90 b/src/Idm/selector/IdmOlfDfnSelector.f90 index 00cf9913120..33587530db8 100644 --- a/src/Idm/selector/IdmOlfDfnSelector.f90 +++ b/src/Idm/selector/IdmOlfDfnSelector.f90 @@ -13,6 +13,7 @@ module IdmOlfDfnSelectorModule use OlfCdbInputModule use OlfChdInputModule use OlfFlwInputModule + use OlfPcpInputModule use OlfStoInputModule use OlfZdgInputModule @@ -66,6 +67,8 @@ function olf_param_definitions(subcomponent) result(input_definition) call set_param_pointer(input_definition, olf_chd_param_definitions) case ('FLW') call set_param_pointer(input_definition, olf_flw_param_definitions) + case ('PCP') + call set_param_pointer(input_definition, olf_pcp_param_definitions) case ('STO') call set_param_pointer(input_definition, olf_sto_param_definitions) case ('ZDG') @@ -96,6 +99,8 @@ function olf_aggregate_definitions(subcomponent) result(input_definition) call set_param_pointer(input_definition, olf_chd_aggregate_definitions) case ('FLW') call set_param_pointer(input_definition, olf_flw_aggregate_definitions) + case ('PCP') + call set_param_pointer(input_definition, olf_pcp_aggregate_definitions) case ('STO') call set_param_pointer(input_definition, olf_sto_aggregate_definitions) case ('ZDG') @@ -126,6 +131,8 @@ function olf_block_definitions(subcomponent) result(input_definition) call set_block_pointer(input_definition, olf_chd_block_definitions) case ('FLW') call set_block_pointer(input_definition, olf_flw_block_definitions) + case ('PCP') + call set_block_pointer(input_definition, olf_pcp_block_definitions) case ('STO') call set_block_pointer(input_definition, olf_sto_block_definitions) case ('ZDG') @@ -155,6 +162,8 @@ function olf_idm_multi_package(subcomponent) result(multi_package) multi_package = olf_chd_multi_package case ('FLW') multi_package = olf_flw_multi_package + case ('PCP') + multi_package = olf_pcp_multi_package case ('STO') multi_package = olf_sto_multi_package case ('ZDG') @@ -187,6 +196,8 @@ function olf_idm_subpackages(subcomponent) result(subpackages) call set_subpkg_pointer(subpackages, olf_chd_subpackages) case ('FLW') call set_subpkg_pointer(subpackages, olf_flw_subpackages) + case ('PCP') + call set_subpkg_pointer(subpackages, olf_pcp_subpackages) case ('STO') call set_subpkg_pointer(subpackages, olf_sto_subpackages) case ('ZDG') @@ -217,6 +228,8 @@ function olf_idm_integrated(subcomponent) result(integrated) integrated = .true. case ('FLW') integrated = .true. + case ('PCP') + integrated = .true. case ('STO') integrated = .true. case ('ZDG') diff --git a/src/Idm/selector/IdmSwfDfnSelector.f90 b/src/Idm/selector/IdmSwfDfnSelector.f90 index dd881700d1c..c09d0cc160e 100644 --- a/src/Idm/selector/IdmSwfDfnSelector.f90 +++ b/src/Idm/selector/IdmSwfDfnSelector.f90 @@ -15,6 +15,7 @@ module IdmSwfDfnSelectorModule use SwfCdbInputModule use SwfChdInputModule use SwfFlwInputModule + use SwfPcpInputModule use SwfStoInputModule use SwfZdgInputModule @@ -72,6 +73,8 @@ function swf_param_definitions(subcomponent) result(input_definition) call set_param_pointer(input_definition, swf_chd_param_definitions) case ('FLW') call set_param_pointer(input_definition, swf_flw_param_definitions) + case ('PCP') + call set_param_pointer(input_definition, swf_pcp_param_definitions) case ('STO') call set_param_pointer(input_definition, swf_sto_param_definitions) case ('ZDG') @@ -106,6 +109,8 @@ function swf_aggregate_definitions(subcomponent) result(input_definition) call set_param_pointer(input_definition, swf_chd_aggregate_definitions) case ('FLW') call set_param_pointer(input_definition, swf_flw_aggregate_definitions) + case ('PCP') + call set_param_pointer(input_definition, swf_pcp_aggregate_definitions) case ('STO') call set_param_pointer(input_definition, swf_sto_aggregate_definitions) case ('ZDG') @@ -140,6 +145,8 @@ function swf_block_definitions(subcomponent) result(input_definition) call set_block_pointer(input_definition, swf_chd_block_definitions) case ('FLW') call set_block_pointer(input_definition, swf_flw_block_definitions) + case ('PCP') + call set_block_pointer(input_definition, swf_pcp_block_definitions) case ('STO') call set_block_pointer(input_definition, swf_sto_block_definitions) case ('ZDG') @@ -173,6 +180,8 @@ function swf_idm_multi_package(subcomponent) result(multi_package) multi_package = swf_chd_multi_package case ('FLW') multi_package = swf_flw_multi_package + case ('PCP') + multi_package = swf_pcp_multi_package case ('STO') multi_package = swf_sto_multi_package case ('ZDG') @@ -209,6 +218,8 @@ function swf_idm_subpackages(subcomponent) result(subpackages) call set_subpkg_pointer(subpackages, swf_chd_subpackages) case ('FLW') call set_subpkg_pointer(subpackages, swf_flw_subpackages) + case ('PCP') + call set_subpkg_pointer(subpackages, swf_pcp_subpackages) case ('STO') call set_subpkg_pointer(subpackages, swf_sto_subpackages) case ('ZDG') @@ -243,6 +254,8 @@ function swf_idm_integrated(subcomponent) result(integrated) integrated = .true. case ('FLW') integrated = .true. + case ('PCP') + integrated = .true. case ('STO') integrated = .true. case ('ZDG') diff --git a/src/Idm/swf-disv1didm.f90 b/src/Idm/swf-disv1didm.f90 index 8ac4c5119e0..d7c523bf538 100644 --- a/src/Idm/swf-disv1didm.f90 +++ b/src/Idm/swf-disv1didm.f90 @@ -20,14 +20,13 @@ module SwfDisv1DInputModule logical :: export_ascii = .false. logical :: nodes = .false. logical :: nvert = .false. - logical :: length = .false. logical :: width = .false. logical :: bottom = .false. logical :: idomain = .false. logical :: iv = .false. logical :: xv = .false. logical :: yv = .false. - logical :: icell2d = .false. + logical :: icell1d = .false. logical :: fdc = .false. logical :: ncvert = .false. logical :: icvert = .false. @@ -185,24 +184,6 @@ module SwfDisv1DInputModule .false. & ! timeseries ) - type(InputParamDefinitionType), parameter :: & - swfdisv1d_length = InputParamDefinitionType & - ( & - 'SWF', & ! component - 'DISV1D', & ! subcomponent - 'GRIDDATA', & ! block - 'LENGTH', & ! tag name - 'LENGTH', & ! fortran variable - 'DOUBLE1D', & ! type - 'NODES', & ! shape - 'length', & ! longname - .true., & ! required - .false., & ! multi-record - .false., & ! preserve case - .false., & ! layered - .false. & ! timeseries - ) - type(InputParamDefinitionType), parameter :: & swfdisv1d_width = InputParamDefinitionType & ( & @@ -312,16 +293,16 @@ module SwfDisv1DInputModule ) type(InputParamDefinitionType), parameter :: & - swfdisv1d_icell2d = InputParamDefinitionType & + swfdisv1d_icell1d = InputParamDefinitionType & ( & 'SWF', & ! component 'DISV1D', & ! subcomponent - 'CELL2D', & ! block - 'ICELL2D', & ! tag name - 'ICELL2D', & ! fortran variable + 'CELL1D', & ! block + 'ICELL1D', & ! tag name + 'ICELL1D', & ! fortran variable 'INTEGER', & ! type '', & ! shape - 'cell2d number', & ! longname + 'cell1d number', & ! longname .true., & ! required .true., & ! multi-record .false., & ! preserve case @@ -334,7 +315,7 @@ module SwfDisv1DInputModule ( & 'SWF', & ! component 'DISV1D', & ! subcomponent - 'CELL2D', & ! block + 'CELL1D', & ! block 'FDC', & ! tag name 'FDC', & ! fortran variable 'DOUBLE', & ! type @@ -352,7 +333,7 @@ module SwfDisv1DInputModule ( & 'SWF', & ! component 'DISV1D', & ! subcomponent - 'CELL2D', & ! block + 'CELL1D', & ! block 'NCVERT', & ! tag name 'NCVERT', & ! fortran variable 'INTEGER', & ! type @@ -370,7 +351,7 @@ module SwfDisv1DInputModule ( & 'SWF', & ! component 'DISV1D', & ! subcomponent - 'CELL2D', & ! block + 'CELL1D', & ! block 'ICVERT', & ! tag name 'ICVERT', & ! fortran variable 'INTEGER1D', & ! type @@ -394,14 +375,13 @@ module SwfDisv1DInputModule swfdisv1d_export_ascii, & swfdisv1d_nodes, & swfdisv1d_nvert, & - swfdisv1d_length, & swfdisv1d_width, & swfdisv1d_bottom, & swfdisv1d_idomain, & swfdisv1d_iv, & swfdisv1d_xv, & swfdisv1d_yv, & - swfdisv1d_icell2d, & + swfdisv1d_icell1d, & swfdisv1d_fdc, & swfdisv1d_ncvert, & swfdisv1d_icvert & @@ -426,16 +406,16 @@ module SwfDisv1DInputModule ) type(InputParamDefinitionType), parameter :: & - swfdisv1d_cell2d = InputParamDefinitionType & + swfdisv1d_cell1d = InputParamDefinitionType & ( & 'SWF', & ! component 'DISV1D', & ! subcomponent - 'CELL2D', & ! block - 'CELL2D', & ! tag name - 'CELL2D', & ! fortran variable - 'RECARRAY ICELL2D FDC NCVERT ICVERT', & ! type + 'CELL1D', & ! block + 'CELL1D', & ! tag name + 'CELL1D', & ! fortran variable + 'RECARRAY ICELL1D FDC NCVERT ICVERT', & ! type 'NODES', & ! shape - 'cell2d data', & ! longname + 'cell1d data', & ! longname .true., & ! required .false., & ! multi-record .false., & ! preserve case @@ -447,7 +427,7 @@ module SwfDisv1DInputModule swf_disv1d_aggregate_definitions(*) = & [ & swfdisv1d_vertices, & - swfdisv1d_cell2d & + swfdisv1d_cell1d & ] type(InputBlockDefinitionType), parameter :: & @@ -478,7 +458,7 @@ module SwfDisv1DInputModule .false. & ! block_variable ), & InputBlockDefinitionType( & - 'CELL2D', & ! blockname + 'CELL1D', & ! blockname .true., & ! required .true., & ! aggregate .false. & ! block_variable diff --git a/src/Idm/swf-pcpidm.f90 b/src/Idm/swf-pcpidm.f90 new file mode 100644 index 00000000000..1ccd8a3cc79 --- /dev/null +++ b/src/Idm/swf-pcpidm.f90 @@ -0,0 +1,437 @@ +! ** Do Not Modify! MODFLOW 6 system generated file. ** +module SwfPcpInputModule + use ConstantsModule, only: LENVARNAME + use InputDefinitionModule, only: InputParamDefinitionType, & + InputBlockDefinitionType + private + public swf_pcp_param_definitions + public swf_pcp_aggregate_definitions + public swf_pcp_block_definitions + public SwfPcpParamFoundType + public swf_pcp_multi_package + public swf_pcp_subpackages + + type SwfPcpParamFoundType + logical :: auxiliary = .false. + logical :: auxmultname = .false. + logical :: boundnames = .false. + logical :: iprpak = .false. + logical :: iprflow = .false. + logical :: ipakcb = .false. + logical :: ts_filerecord = .false. + logical :: ts6 = .false. + logical :: filein = .false. + logical :: ts6_filename = .false. + logical :: obs_filerecord = .false. + logical :: obs6 = .false. + logical :: obs6_filename = .false. + logical :: maxbound = .false. + logical :: cellid = .false. + logical :: precipitation = .false. + logical :: auxvar = .false. + logical :: boundname = .false. + end type SwfPcpParamFoundType + + logical :: swf_pcp_multi_package = .true. + + character(len=16), parameter :: & + swf_pcp_subpackages(*) = & + [ & + ' ' & + ] + + type(InputParamDefinitionType), parameter :: & + swfpcp_auxiliary = InputParamDefinitionType & + ( & + 'SWF', & ! component + 'PCP', & ! subcomponent + 'OPTIONS', & ! block + 'AUXILIARY', & ! tag name + 'AUXILIARY', & ! fortran variable + 'STRING', & ! type + 'NAUX', & ! shape + 'keyword to specify aux variables', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + swfpcp_auxmultname = InputParamDefinitionType & + ( & + 'SWF', & ! component + 'PCP', & ! subcomponent + 'OPTIONS', & ! block + 'AUXMULTNAME', & ! tag name + 'AUXMULTNAME', & ! fortran variable + 'STRING', & ! type + '', & ! shape + 'name of auxiliary variable for multiplier', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + swfpcp_boundnames = InputParamDefinitionType & + ( & + 'SWF', & ! component + 'PCP', & ! subcomponent + 'OPTIONS', & ! block + 'BOUNDNAMES', & ! tag name + 'BOUNDNAMES', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + '', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + swfpcp_iprpak = InputParamDefinitionType & + ( & + 'SWF', & ! component + 'PCP', & ! subcomponent + 'OPTIONS', & ! block + 'PRINT_INPUT', & ! tag name + 'IPRPAK', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'print input to listing file', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + swfpcp_iprflow = InputParamDefinitionType & + ( & + 'SWF', & ! component + 'PCP', & ! subcomponent + 'OPTIONS', & ! block + 'PRINT_FLOWS', & ! tag name + 'IPRFLOW', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'print precipitation rates to listing file', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + swfpcp_ipakcb = InputParamDefinitionType & + ( & + 'SWF', & ! component + 'PCP', & ! subcomponent + 'OPTIONS', & ! block + 'SAVE_FLOWS', & ! tag name + 'IPAKCB', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'save precipitation to budget file', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + swfpcp_ts_filerecord = InputParamDefinitionType & + ( & + 'SWF', & ! component + 'PCP', & ! subcomponent + 'OPTIONS', & ! block + 'TS_FILERECORD', & ! tag name + 'TS_FILERECORD', & ! fortran variable + 'RECORD TS6 FILEIN TS6_FILENAME', & ! type + '', & ! shape + '', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + swfpcp_ts6 = InputParamDefinitionType & + ( & + 'SWF', & ! component + 'PCP', & ! subcomponent + 'OPTIONS', & ! block + 'TS6', & ! tag name + 'TS6', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'head keyword', & ! longname + .true., & ! required + .true., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + swfpcp_filein = InputParamDefinitionType & + ( & + 'SWF', & ! component + 'PCP', & ! subcomponent + 'OPTIONS', & ! block + 'FILEIN', & ! tag name + 'FILEIN', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'file keyword', & ! longname + .true., & ! required + .true., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + swfpcp_ts6_filename = InputParamDefinitionType & + ( & + 'SWF', & ! component + 'PCP', & ! subcomponent + 'OPTIONS', & ! block + 'TS6_FILENAME', & ! tag name + 'TS6_FILENAME', & ! fortran variable + 'STRING', & ! type + '', & ! shape + 'file name of time series information', & ! longname + .true., & ! required + .true., & ! multi-record + .true., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + swfpcp_obs_filerecord = InputParamDefinitionType & + ( & + 'SWF', & ! component + 'PCP', & ! subcomponent + 'OPTIONS', & ! block + 'OBS_FILERECORD', & ! tag name + 'OBS_FILERECORD', & ! fortran variable + 'RECORD OBS6 FILEIN OBS6_FILENAME', & ! type + '', & ! shape + '', & ! longname + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + swfpcp_obs6 = InputParamDefinitionType & + ( & + 'SWF', & ! component + 'PCP', & ! subcomponent + 'OPTIONS', & ! block + 'OBS6', & ! tag name + 'OBS6', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'obs keyword', & ! longname + .true., & ! required + .true., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + swfpcp_obs6_filename = InputParamDefinitionType & + ( & + 'SWF', & ! component + 'PCP', & ! subcomponent + 'OPTIONS', & ! block + 'OBS6_FILENAME', & ! tag name + 'OBS6_FILENAME', & ! fortran variable + 'STRING', & ! type + '', & ! shape + 'obs6 input filename', & ! longname + .true., & ! required + .true., & ! multi-record + .true., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + swfpcp_maxbound = InputParamDefinitionType & + ( & + 'SWF', & ! component + 'PCP', & ! subcomponent + 'DIMENSIONS', & ! block + 'MAXBOUND', & ! tag name + 'MAXBOUND', & ! fortran variable + 'INTEGER', & ! type + '', & ! shape + 'maximum number of precipitation cells', & ! longname + .true., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + swfpcp_cellid = InputParamDefinitionType & + ( & + 'SWF', & ! component + 'PCP', & ! subcomponent + 'PERIOD', & ! block + 'CELLID', & ! tag name + 'CELLID', & ! fortran variable + 'INTEGER1D', & ! type + 'NCELLDIM', & ! shape + 'cell identifier', & ! longname + .true., & ! required + .true., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + swfpcp_precipitation = InputParamDefinitionType & + ( & + 'SWF', & ! component + 'PCP', & ! subcomponent + 'PERIOD', & ! block + 'PRECIPITATION', & ! tag name + 'PRECIPITATION', & ! fortran variable + 'DOUBLE', & ! type + '', & ! shape + 'precipitation rate', & ! longname + .true., & ! required + .true., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .true. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + swfpcp_auxvar = InputParamDefinitionType & + ( & + 'SWF', & ! component + 'PCP', & ! subcomponent + 'PERIOD', & ! block + 'AUX', & ! tag name + 'AUXVAR', & ! fortran variable + 'DOUBLE1D', & ! type + 'NAUX', & ! shape + 'auxiliary variables', & ! longname + .false., & ! required + .true., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .true. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + swfpcp_boundname = InputParamDefinitionType & + ( & + 'SWF', & ! component + 'PCP', & ! subcomponent + 'PERIOD', & ! block + 'BOUNDNAME', & ! tag name + 'BOUNDNAME', & ! fortran variable + 'STRING', & ! type + '', & ! shape + 'precipitation name', & ! longname + .false., & ! required + .true., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + swf_pcp_param_definitions(*) = & + [ & + swfpcp_auxiliary, & + swfpcp_auxmultname, & + swfpcp_boundnames, & + swfpcp_iprpak, & + swfpcp_iprflow, & + swfpcp_ipakcb, & + swfpcp_ts_filerecord, & + swfpcp_ts6, & + swfpcp_filein, & + swfpcp_ts6_filename, & + swfpcp_obs_filerecord, & + swfpcp_obs6, & + swfpcp_obs6_filename, & + swfpcp_maxbound, & + swfpcp_cellid, & + swfpcp_precipitation, & + swfpcp_auxvar, & + swfpcp_boundname & + ] + + type(InputParamDefinitionType), parameter :: & + swfpcp_spd = InputParamDefinitionType & + ( & + 'SWF', & ! component + 'PCP', & ! subcomponent + 'PERIOD', & ! block + 'STRESS_PERIOD_DATA', & ! tag name + 'SPD', & ! fortran variable + 'RECARRAY CELLID PRECIPITATION AUX BOUNDNAME', & ! type + 'MAXBOUND', & ! shape + '', & ! longname + .true., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + swf_pcp_aggregate_definitions(*) = & + [ & + swfpcp_spd & + ] + + type(InputBlockDefinitionType), parameter :: & + swf_pcp_block_definitions(*) = & + [ & + InputBlockDefinitionType( & + 'OPTIONS', & ! blockname + .false., & ! required + .false., & ! aggregate + .false. & ! block_variable + ), & + InputBlockDefinitionType( & + 'DIMENSIONS', & ! blockname + .true., & ! required + .false., & ! aggregate + .false. & ! block_variable + ), & + InputBlockDefinitionType( & + 'PERIOD', & ! blockname + .true., & ! required + .true., & ! aggregate + .true. & ! block_variable + ) & + ] + +end module SwfPcpInputModule diff --git a/src/Idm/utl-ncfidm.f90 b/src/Idm/utl-ncfidm.f90 index 3df61da5b00..4b01f8388ac 100644 --- a/src/Idm/utl-ncfidm.f90 +++ b/src/Idm/utl-ncfidm.f90 @@ -99,8 +99,8 @@ module UtlNcfInputModule 'INTEGER', & ! type '', & ! shape 'chunking parameter for the time dimension', & ! longname - .true., & ! required - .true., & ! multi-record + .false., & ! required + .false., & ! multi-record .false., & ! preserve case .false., & ! layered .false. & ! timeseries @@ -118,7 +118,7 @@ module UtlNcfInputModule '', & ! shape 'chunking parameter for the mesh face dimension', & ! longname .false., & ! required - .true., & ! multi-record + .false., & ! multi-record .false., & ! preserve case .false., & ! layered .false. & ! timeseries @@ -136,7 +136,7 @@ module UtlNcfInputModule '', & ! shape 'chunking parameter for structured z', & ! longname .false., & ! required - .true., & ! multi-record + .false., & ! multi-record .false., & ! preserve case .false., & ! layered .false. & ! timeseries @@ -154,7 +154,7 @@ module UtlNcfInputModule '', & ! shape 'chunking parameter for structured y', & ! longname .false., & ! required - .true., & ! multi-record + .false., & ! multi-record .false., & ! preserve case .false., & ! layered .false. & ! timeseries @@ -172,7 +172,7 @@ module UtlNcfInputModule '', & ! shape 'chunking parameter for structured x', & ! longname .false., & ! required - .true., & ! multi-record + .false., & ! multi-record .false., & ! preserve case .false., & ! layered .false. & ! timeseries diff --git a/src/Model/ChannelFlow/chf.f90 b/src/Model/ChannelFlow/chf.f90 index 9402a2a8676..5a05cd10075 100644 --- a/src/Model/ChannelFlow/chf.f90 +++ b/src/Model/ChannelFlow/chf.f90 @@ -41,7 +41,7 @@ module ChfModule !< candidates for input and these will be loaded in the order specified. integer(I4B), parameter :: CHF_NMULTIPKG = 50 character(len=LENPACKAGETYPE), dimension(CHF_NMULTIPKG) :: CHF_MULTIPKG - data CHF_MULTIPKG/'FLW6 ', 'CHD6 ', 'CDB6 ', 'ZDG6 ', ' ', & ! 5 + data CHF_MULTIPKG/'FLW6 ', 'CHD6 ', 'CDB6 ', 'ZDG6 ', 'PCP6 ', & ! 5 &45*' '/ ! 50 ! size of supported model package arrays diff --git a/src/Model/Discretization/Disv2d.f90 b/src/Model/Discretization/Disv2d.f90 index e0eb136bf27..31abe7a717a 100644 --- a/src/Model/Discretization/Disv2d.f90 +++ b/src/Model/Discretization/Disv2d.f90 @@ -36,6 +36,7 @@ module Disv2dModule procedure :: dis_da => disv2d_da procedure :: disv2d_load procedure :: get_dis_type => get_dis_type + procedure :: get_dis_enum => get_dis_enum procedure, public :: record_array procedure, public :: record_srcdst_list_header ! -- helper functions @@ -957,6 +958,14 @@ subroutine get_dis_type(this, dis_type) ! end subroutine get_dis_type + !> @brief Get the discretization type enumeration + function get_dis_enum(this) result(dis_enum) + use ConstantsModule, only: DISV2D + class(Disv2dType), intent(in) :: this + integer(I4B) :: dis_enum + dis_enum = DISV2D + end function get_dis_enum + !> @brief Allocate and initialize scalars !< subroutine allocate_scalars(this, name_model, input_mempath) diff --git a/src/Model/ModelUtilities/DiscretizationBase.f90 b/src/Model/ModelUtilities/DiscretizationBase.f90 index 05151ad9dbd..f71032c2656 100644 --- a/src/Model/ModelUtilities/DiscretizationBase.f90 +++ b/src/Model/ModelUtilities/DiscretizationBase.f90 @@ -2,7 +2,11 @@ module BaseDisModule use KindModule, only: DP, I4B, LGP use ConstantsModule, only: LENMODELNAME, LENAUXNAME, LINELENGTH, & - DZERO, LENMEMPATH, DPIO180 + DZERO, LENMEMPATH, DPIO180, DISUNDEF, & + DIS, DISV, DISU, & + DIS2D, DISV2D, DISU2D, & + DIS1D, DISV1D, DISU1D + use SmoothingModule, only: sQuadraticSaturation use ConnectionsModule, only: ConnectionsType use InputOutputModule, only: URWORD, ubdsv1, ubdsvd @@ -112,7 +116,9 @@ module BaseDisModule procedure, public :: get_area procedure, public :: get_area_factor procedure, public :: get_flow_width - + procedure, public :: is_3d + procedure, public :: is_2d + procedure, public :: is_1d end type DisBaseType contains @@ -1158,4 +1164,43 @@ subroutine get_flow_width(this, n, m, idx_conn, width_n, width_m) end subroutine get_flow_width + !> @Brief return true if grid is three dimensional + function is_3d(this) result(r) + ! dummy + class(DisBaseType) :: this + ! return + logical(LGP) :: r + r = .false. + select case (this%get_dis_enum()) + case (DIS, DISV, DISU) + r = .true. + end select + end function is_3d + + !> @Brief return true if grid is two dimensional + function is_2d(this) result(r) + ! dummy + class(DisBaseType) :: this + ! return + logical(LGP) :: r + r = .false. + select case (this%get_dis_enum()) + case (DIS2D, DISV2D, DISU2D) + r = .true. + end select + end function is_2d + + !> @Brief return true if grid is one dimensional + function is_1d(this) result(r) + ! dummy + class(DisBaseType) :: this + ! return + logical(LGP) :: r + r = .false. + select case (this%get_dis_enum()) + case (DIS1D, DISV1D, DISU1D) + r = .true. + end select + end function is_1d + end module BaseDisModule diff --git a/src/Model/OverlandFlow/olf.f90 b/src/Model/OverlandFlow/olf.f90 index 23a5b19d99b..3a2dc7fa4e7 100644 --- a/src/Model/OverlandFlow/olf.f90 +++ b/src/Model/OverlandFlow/olf.f90 @@ -41,7 +41,7 @@ module OlfModule !< candidates for input and these will be loaded in the order specified. integer(I4B), parameter :: OLF_NMULTIPKG = 50 character(len=LENPACKAGETYPE), dimension(OLF_NMULTIPKG) :: OLF_MULTIPKG - data OLF_MULTIPKG/'FLW6 ', 'CHD6 ', 'CDB6 ', 'ZDG6 ', ' ', & ! 5 + data OLF_MULTIPKG/'FLW6 ', 'CHD6 ', 'CDB6 ', 'ZDG6 ', 'PCP6 ', & ! 5 &45*' '/ ! 50 ! size of supported model package arrays diff --git a/src/Model/SurfaceWaterFlow/swf-cdb.f90 b/src/Model/SurfaceWaterFlow/swf-cdb.f90 index d52305906e8..121e66a79b5 100644 --- a/src/Model/SurfaceWaterFlow/swf-cdb.f90 +++ b/src/Model/SurfaceWaterFlow/swf-cdb.f90 @@ -36,7 +36,7 @@ module SwfCdbModule real(DP), dimension(:), pointer, contiguous :: width => null() !< channel width real(DP), pointer :: gravconv => null() !< conversion factor gravity in m/s^2 to model units - ! -- pointers other objects + ! pointers other objects type(SwfCxsType), pointer :: cxs contains diff --git a/src/Model/SurfaceWaterFlow/swf-cxs.f90 b/src/Model/SurfaceWaterFlow/swf-cxs.f90 index 2751f83fc5c..3e3a6cd1b10 100644 --- a/src/Model/SurfaceWaterFlow/swf-cxs.f90 +++ b/src/Model/SurfaceWaterFlow/swf-cxs.f90 @@ -9,7 +9,7 @@ module SwfCxsModule use MemoryHelperModule, only: create_mem_path use MemoryManagerModule, only: mem_allocate use SimVariablesModule, only: errmsg - use SimModule, only: store_error + use SimModule, only: store_error, store_error_filename, count_errors use NumericalPackageModule, only: NumericalPackageType use BaseDisModule, only: DisBaseType @@ -41,6 +41,7 @@ module SwfCxsModule procedure :: log_dimensions procedure :: source_packagedata procedure :: log_packagedata + procedure :: check_packagedata procedure :: source_crosssectiondata procedure :: log_crosssectiondata procedure :: cxs_da @@ -50,6 +51,8 @@ module SwfCxsModule procedure :: get_roughness procedure :: get_conveyance => cxs_conveyance procedure :: get_hydraulic_radius + procedure :: get_wetted_top_width + procedure :: get_maximum_top_width procedure :: write_cxs_table end type SwfCxsType @@ -287,44 +290,47 @@ end subroutine allocate_arrays !> @brief Copy options from IDM into package !< subroutine source_packagedata(this) - ! -- modules + ! modules use KindModule, only: LGP use MemoryManagerExtModule, only: mem_set_value use SimVariablesModule, only: idm_context use SwfCxsInputModule, only: SwfCxsParamFoundType - ! -- dummy + ! dummy class(SwfCxsType) :: this - ! -- locals + ! locals character(len=LENMEMPATH) :: idmMemoryPath type(SwfCxsParamFoundType) :: found - ! - ! -- set memory path + + ! set memory path idmMemoryPath = create_mem_path(this%name_model, 'CXS', idm_context) - ! - ! -- update defaults with idm sourced values + + ! update defaults with idm sourced values call mem_set_value(this%idcxs, 'IDCXS', idmMemoryPath, & found%idcxs) call mem_set_value(this%nxspoints, 'NXSPOINTS', idmMemoryPath, & found%nxspoints) - ! - ! -- ensure idcxs was found + + ! ensure idcxs was found if (.not. found%idcxs) then write (errmsg, '(a)') 'Error in PACKAGEDATA block: IDCXS not found.' call store_error(errmsg) end if - ! - ! -- ensure nxspoints was found + + ! ensure nxspoints was found if (.not. found%nxspoints) then write (errmsg, '(a)') 'Error in PACKAGEDATA block: NXSPOINTS not found.' call store_error(errmsg) end if - ! - ! -- log values to list file + + ! log values to list file if (this%iout > 0) then call this%log_packagedata(found) end if - ! - ! -- Calculate the iacross index array using nxspoints + + ! Check to make sure package data is valid + call this%check_packagedata() + + ! Calculate the iacross index array using nxspoints call calc_iacross(this%nxspoints, this%iacross) end subroutine source_packagedata @@ -340,6 +346,41 @@ subroutine calc_iacross(nxspoints, iacross) end do end subroutine calc_iacross + !> @brief Check packagedata + !< + subroutine check_packagedata(this) + ! dummy arguments + class(SwfCxsType) :: this !< this instance + ! local variables + integer(I4B) :: i + + ! Check that all cross section IDs are in range + do i = 1, size(this%idcxs) + if (this%idcxs(i) <= 0 .or. this%idcxs(i) > this%nsections) then + write (errmsg, '(a, i0, a)') & + 'IDCXS values must be greater than 0 and less than NSECTIONS. & + &Found ', this%idcxs(i), '.' + call store_error(errmsg) + end if + end do + + ! Check that nxspoints are greater than one + do i = 1, size(this%nxspoints) + if (this%nxspoints(i) <= 1) then + write (errmsg, '(a, i0, a, i0, a)') & + 'NXSPOINTS values must be greater than 1 for each cross section. & + &Found ', this%nxspoints(i), ' for cross section ', this%idcxs(i), '.' + call store_error(errmsg) + end if + end do + + ! write summary of package error messages + if (count_errors() > 0) then + call store_error_filename(this%input_fname) + end if + + end subroutine check_packagedata + !> @brief Write user packagedata to list file !< subroutine log_packagedata(this, found) @@ -722,4 +763,48 @@ function get_hydraulic_radius(this, idcxs, width, depth, area) result(r) end if end function get_hydraulic_radius + function get_wetted_top_width(this, idcxs, width, depth) result(r) + ! modules + use SwfCxsUtilsModule, only: get_wetted_topwidth + ! dummy + class(SwfCxsType) :: this + integer(I4B), intent(in) :: idcxs !< cross section id + real(DP), intent(in) :: width !< width in reach + real(DP), intent(in) :: depth !< stage in reach + ! local + real(DP) :: r !< calculated hydraulic radius + integer(I4B) :: i0 + integer(I4B) :: i1 + integer(I4B) :: npts + integer(I4B) :: icalcmeth + call this%get_cross_section_info(idcxs, i0, i1, npts, icalcmeth) + if (npts == 0) then + r = width + else + r = get_wetted_topwidth(npts, this%xfraction(i0:i1), & + this%height(i0:i1), width, depth) + end if + end function get_wetted_top_width + + function get_maximum_top_width(this, idcxs, width) result(r) + ! modules + use SwfCxsUtilsModule, only: get_saturated_topwidth + ! dummy + class(SwfCxsType) :: this + integer(I4B), intent(in) :: idcxs !< cross section id + real(DP), intent(in) :: width !< width in reach + ! local + real(DP) :: r !< calculated hydraulic radius + integer(I4B) :: i0 + integer(I4B) :: i1 + integer(I4B) :: npts + integer(I4B) :: icalcmeth + call this%get_cross_section_info(idcxs, i0, i1, npts, icalcmeth) + if (npts == 0) then + r = width + else + r = get_saturated_topwidth(npts, this%xfraction(i0:i1)) + end if + end function get_maximum_top_width + end module SwfCxsModule diff --git a/src/Model/SurfaceWaterFlow/swf-dfw.f90 b/src/Model/SurfaceWaterFlow/swf-dfw.f90 index 65b0885f584..87d3c30962d 100644 --- a/src/Model/SurfaceWaterFlow/swf-dfw.f90 +++ b/src/Model/SurfaceWaterFlow/swf-dfw.f90 @@ -163,18 +163,12 @@ subroutine dfw_df(this, dis) ! dummy class(SwfDfwType) :: this !< this instance class(DisBaseType), pointer, intent(inout) :: dis !< the pointer to the discretization - ! locals - character(len=10) :: distype = '' ! Set a pointers to passed in objects this%dis => dis ! Set the distype (either DISV1D or DIS2D) - call this%dis%get_dis_type(distype) - if (distype == "DIS2D") then - this%is2d = 1 - end if - if (distype == "DISV2D") then + if (this%dis%is_2d()) then this%is2d = 1 end if diff --git a/src/Model/SurfaceWaterFlow/swf-pcp.f90 b/src/Model/SurfaceWaterFlow/swf-pcp.f90 new file mode 100644 index 00000000000..28c85938b96 --- /dev/null +++ b/src/Model/SurfaceWaterFlow/swf-pcp.f90 @@ -0,0 +1,536 @@ +!> @brief This module contains the precipitation (PCP) package methods +!! +!! This module can be used to represent precipitation onto streams and +!! overland flow cells. +!< +module SwfPcpModule + + use KindModule, only: DP, I4B, LGP + use ConstantsModule, only: DZERO, LENFTYPE, LENPACKAGENAME, MAXCHARLEN, & + LINELENGTH + use MemoryHelperModule, only: create_mem_path + use BndModule, only: BndType + use BndExtModule, only: BndExtType + use SimModule, only: store_error, store_error_filename, count_errors + use SimVariablesModule, only: errmsg + use ObsModule, only: DefaultObsIdProcessor + use TimeArraySeriesLinkModule, only: TimeArraySeriesLinkType + use BlockParserModule, only: BlockParserType + use CharacterStringModule, only: CharacterStringType + use MatrixBaseModule + use GeomUtilModule, only: get_node + use BaseDisModule, only: DisBaseType + use Disv1dModule, only: Disv1dType + use SwfDfwModule, only: SwfDfwType + use SwfCxsModule, only: SwfCxsType + + implicit none + + private + public :: pcp_create + + character(len=LENFTYPE) :: ftype = 'PCP' + character(len=LENPACKAGENAME) :: text = ' PCP' + ! character(len=LENPACKAGENAME) :: texta = ' PCPA' + + type, extends(BndExtType) :: SwfPcpType + real(DP), dimension(:), pointer, contiguous :: precipitation => null() !< boundary precipitation array + logical, pointer, private :: read_as_arrays + + ! pointers to other objects + type(SwfDfwType), pointer :: dfw + type(SwfCxsType), pointer :: cxs + + contains + + procedure :: pcp_allocate_scalars + procedure :: allocate_arrays => pcp_allocate_arrays + procedure :: source_options => pcp_source_options + procedure :: source_dimensions => pcp_source_dimensions + procedure :: log_pcp_options + procedure :: read_initial_attr => pcp_read_initial_attr + procedure :: bnd_rp => pcp_rp + procedure :: bnd_ck => pcp_ck + procedure :: bnd_cf => pcp_cf + procedure :: bnd_fc => pcp_fc + procedure :: bnd_da => pcp_da + procedure :: define_listlabel => pcp_define_listlabel + procedure :: bound_value => pcp_bound_value + procedure, private :: default_nodelist + procedure, private :: reach_length_pointer + ! for observations + procedure, public :: bnd_obs_supported => pcp_obs_supported + procedure, public :: bnd_df_obs => pcp_df_obs + + end type SwfPcpType + +contains + + !> @brief Create a Precipitation Package + !< + subroutine pcp_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, & + mempath, dis, dfw, cxs) + ! dummy + class(BndType), pointer :: packobj !< pointer to default package type + integer(I4B), intent(in) :: id !< package id + integer(I4B), intent(in) :: ibcnum !< boundary condition number + integer(I4B), intent(in) :: inunit !< unit number of CDB package input file + integer(I4B), intent(in) :: iout !< unit number of model listing file + character(len=*), intent(in) :: namemodel !< model name + character(len=*), intent(in) :: pakname !< package name + character(len=*), intent(in) :: mempath !< input mempath + class(DisBaseType), pointer, intent(inout) :: dis !< the pointer to the discretization + type(SwfDfwType), pointer, intent(in) :: dfw !< the pointer to the dfw package + type(SwfCxsType), pointer, intent(in) :: cxs !< the pointer to the cxs package + ! local + type(SwfPcpType), pointer :: pcpobj + + ! allocate precipitation object and scalar variables + allocate (pcpobj) + packobj => pcpobj + + ! create name and memory path + call packobj%set_names(ibcnum, namemodel, pakname, ftype, mempath) + packobj%text = text + + ! allocate scalars + call pcpobj%pcp_allocate_scalars() + + ! initialize package + call packobj%pack_initialize() + + packobj%inunit = inunit + packobj%iout = iout + packobj%id = id + packobj%ibcnum = ibcnum + packobj%ictMemPath = create_mem_path(namemodel, 'DFW') + + ! store pointer to dis + pcpobj%dis => dis + + ! store pointer to dfw + pcpobj%dfw => dfw + + ! store pointer to cxs + pcpobj%cxs => cxs + end subroutine pcp_create + + !> @brief Allocate scalar members + !< + subroutine pcp_allocate_scalars(this) + ! dummy + class(SwfPcpType), intent(inout) :: this + + ! allocate base scalars + call this%BndExtType%allocate_scalars() + + ! allocate internal members + allocate (this%read_as_arrays) + + ! Set values + this%read_as_arrays = .false. + end subroutine pcp_allocate_scalars + + !> @brief Allocate package arrays + !< + subroutine pcp_allocate_arrays(this, nodelist, auxvar) + ! modules + use MemoryManagerModule, only: mem_setptr, mem_checkin + ! dummy + class(SwfPcpType) :: this + integer(I4B), dimension(:), pointer, contiguous, optional :: nodelist + real(DP), dimension(:, :), pointer, contiguous, optional :: auxvar + + ! allocate base arrays + call this%BndExtType%allocate_arrays(nodelist, auxvar) + + ! set input context pointers + call mem_setptr(this%precipitation, 'PRECIPITATION', this%input_mempath) + + ! checkin input context pointers + call mem_checkin(this%precipitation, 'PRECIPITATION', this%memoryPath, & + 'PRECIPITATION', this%input_mempath) + end subroutine pcp_allocate_arrays + + !> @brief Source options specific to PCPType + !< + subroutine pcp_source_options(this) + ! modules + use MemoryManagerExtModule, only: mem_set_value + implicit none + ! dummy + class(SwfPcpType), intent(inout) :: this + ! local + logical(LGP) :: found_readasarrays = .false. + + ! source common bound options + call this%BndExtType%source_options() + + ! update defaults with idm sourced values + call mem_set_value(this%read_as_arrays, 'READASARRAYS', this%input_mempath, & + found_readasarrays) + + ! log pcp params + call this%log_pcp_options(found_readasarrays) + end subroutine pcp_source_options + + !> @brief Log options specific to SwfPcpType + !< + subroutine log_pcp_options(this, found_readasarrays) + implicit none + ! dummy + class(SwfPcpType), intent(inout) :: this + logical(LGP), intent(in) :: found_readasarrays + ! formats + character(len=*), parameter :: fmtreadasarrays = & + &"(4x, 'PRECIPITATION INPUT WILL BE READ AS ARRAY(S).')" + + ! log found options + write (this%iout, '(/1x,a)') 'PROCESSING '//trim(adjustl(this%text)) & + //' OPTIONS' + + if (found_readasarrays) then + write (this%iout, fmtreadasarrays) + end if + + ! close logging block + write (this%iout, '(1x,a)') & + 'END OF '//trim(adjustl(this%text))//' OPTIONS' + end subroutine log_pcp_options + + !> @brief Source the dimensions for this package + !< + subroutine pcp_source_dimensions(this) + ! dummy + class(SwfPcpType), intent(inout) :: this + + if (this%read_as_arrays) then + + ! Set maxbound to the number of cells per layer, which is simply + ! nrow * ncol for a dis2d grid, and nodesuser for disv2d and disv1d + this%maxbound = this%dis%get_ncpl() + + ! verify dimensions were set + if (this%maxbound <= 0) then + write (errmsg, '(a)') & + 'MAXBOUND must be an integer greater than zero.' + call store_error(errmsg) + call store_error_filename(this%input_fname) + end if + + else + + ! source maxbound + call this%BndExtType%source_dimensions() + + end if + + ! Call define_listlabel to construct the list label that is written + ! when PRINT_INPUT option is used. + call this%define_listlabel() + end subroutine pcp_source_dimensions + + !> @brief Part of allocate and read + !< + subroutine pcp_read_initial_attr(this) + ! dummy + class(SwfPcpType), intent(inout) :: this + + if (this%read_as_arrays) then + call this%default_nodelist() + end if + end subroutine pcp_read_initial_attr + + !> @brief Read and Prepare + !! + !! Read itmp and read new boundaries if itmp > 0 + !< + subroutine pcp_rp(this) + ! modules + use TdisModule, only: kper + implicit none + ! dummy + class(SwfPcpType), intent(inout) :: this + + if (this%iper /= kper) return + + if (this%read_as_arrays) then + ! no need to do anything because this%precipitation points directly to + ! the input context precipitation, which is automatically updated by idm + else + call this%BndExtType%bnd_rp() + end if + + ! Write the list to iout if requested + if (this%iprpak /= 0) then + call this%write_list() + end if + end subroutine pcp_rp + + !> @brief Ensure precipitation is positive + !< + subroutine pcp_ck(this) + ! dummy + class(SwfPcpType), intent(inout) :: this + ! local + character(len=30) :: nodestr + integer(I4B) :: i, nr + character(len=*), parameter :: fmterr = & + &"('Specified stress ',i0, & + &' precipitation (',g0,') is less than zero for cell', a)" + + ! Ensure precipitation rates are positive + do i = 1, this%nbound + nr = this%nodelist(i) + if (nr <= 0) cycle + if (this%precipitation(i) < DZERO) then + call this%dis%noder_to_string(nr, nodestr) + write (errmsg, fmt=fmterr) i, this%precipitation(i), trim(nodestr) + call store_error(errmsg) + end if + end do + + ! write summary of package error messages + if (count_errors() > 0) then + call store_error_filename(this%input_fname) + end if + end subroutine pcp_ck + + !> @brief Formulate the HCOF and RHS terms + !! + !! Skip if no precipitation. Otherwise, calculate hcof and rhs + !< + subroutine pcp_cf(this) + ! dummy + class(SwfPcpType) :: this + ! local + integer(I4B) :: i + integer(I4B) :: node + integer(I4B) :: idcxs + real(DP) :: qpcp + real(DP) :: area + real(DP) :: width_channel + real(DP) :: top_width + real(DP), dimension(:), pointer :: reach_length + + ! Return if no precipitation + if (this%nbound == 0) return + + ! Set pointer to reach_length for 1d + reach_length => this%reach_length_pointer() + + ! Calculate hcof and rhs for each precipitation entry + do i = 1, this%nbound + + ! Find the node number + node = this%nodelist(i) + + ! cycle if nonexistent bound + if (node <= 0) then + this%hcof(i) = DZERO + this%rhs(i) = DZERO + cycle + end if + + ! Initialize hcof + this%hcof(i) = DZERO + + ! Determine the water surface area + if (this%dis%is_2d()) then + ! this is for overland flow case + area = this%dis%get_area(node) + else if (this%dis%is_1d()) then + ! this is for channel case + idcxs = this%dfw%idcxs(node) + top_width = this%cxs%get_maximum_top_width(idcxs, width_channel) + area = reach_length(node) * top_width + end if + + ! calculate volumetric precipitation flow in L^3/T + qpcp = this%precipitation(i) * area + + ! multiplier + if (this%iauxmultcol > 0) then + qpcp = qpcp * this%auxvar(this%iauxmultcol, i) + end if + + ! rhs contribution + this%rhs(i) = -qpcp + + ! zero out contribution if cell is inactive or constant head + if (this%ibound(node) <= 0) then + this%rhs(i) = DZERO + cycle + end if + + end do + end subroutine pcp_cf + + !> @brief Copy rhs and hcof into solution rhs and amat + !< + subroutine pcp_fc(this, rhs, ia, idxglo, matrix_sln) + ! dummy + class(SwfPcpType) :: 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) :: i, n, ipos + + ! Copy package rhs and hcof into solution rhs and amat + do i = 1, this%nbound + n = this%nodelist(i) + if (n <= 0) cycle + rhs(n) = rhs(n) + this%rhs(i) + ipos = ia(n) + call matrix_sln%add_value_pos(idxglo(ipos), this%hcof(i)) + end do + end subroutine pcp_fc + + !> @brief Deallocate memory + !< + subroutine pcp_da(this) + ! modules + use MemoryManagerModule, only: mem_deallocate + ! dummy + class(SwfPcpType) :: this + + ! Deallocate parent package + call this%BndExtType%bnd_da() + + ! scalars + deallocate (this%read_as_arrays) + + ! arrays + call mem_deallocate(this%precipitation, 'PRECIPITATION', this%memoryPath) + + ! pointers + nullify (this%dis) + nullify (this%dfw) + nullify (this%cxs) + end subroutine pcp_da + + !> @brief Define the list heading that is written to iout when PRINT_INPUT + !! option is used. + !< + subroutine pcp_define_listlabel(this) + ! dummy + class(SwfPcpType), intent(inout) :: this + ! + ! create the header list label + this%listlabel = trim(this%filtyp)//' NO.' + if (this%dis%ndim == 3) then + write (this%listlabel, '(a, a7)') trim(this%listlabel), 'LAYER' + write (this%listlabel, '(a, a7)') trim(this%listlabel), 'ROW' + write (this%listlabel, '(a, a7)') trim(this%listlabel), 'COL' + elseif (this%dis%ndim == 2) then + write (this%listlabel, '(a, a7)') trim(this%listlabel), 'LAYER' + write (this%listlabel, '(a, a7)') trim(this%listlabel), 'CELL2D' + else + write (this%listlabel, '(a, a7)') trim(this%listlabel), 'NODE' + end if + write (this%listlabel, '(a, a16)') trim(this%listlabel), 'PRECIPITATION' +! if(this%multindex > 0) & +! write(this%listlabel, '(a, a16)') trim(this%listlabel), 'MULTIPLIER' + if (this%inamedbound == 1) then + write (this%listlabel, '(a, a16)') trim(this%listlabel), 'BOUNDARY NAME' + end if + end subroutine pcp_define_listlabel + + !> @brief Assign default nodelist when READASARRAYS is specified. + !< + subroutine default_nodelist(this) + ! dummy + class(SwfPcpType) :: this + ! local + integer(I4B) :: nodeu, noder + + ! This is only called for readasarrays, so nodelist will be the size of + ! the user grid, and will have a value of 0 for any entries where idomain + ! is not 1 + do nodeu = 1, this%maxbound + noder = this%dis%get_nodenumber(nodeu, 0) + this%nodelist(nodeu) = noder + end do + + ! Assign nbound + this%nbound = this%maxbound + + end subroutine default_nodelist + + ! Procedures related to observations + + !> @brief + !! + !! Overrides BndType%bnd_obs_supported() + !< + logical function pcp_obs_supported(this) + implicit none + ! dummy + class(SwfPcpType) :: this + pcp_obs_supported = .true. + end function pcp_obs_supported + + !> @brief Implements bnd_df_obs + !! + !! Store observation type supported by PCP package. Overrides + !! BndType%bnd_df_obs + !< + subroutine pcp_df_obs(this) + implicit none + ! dummy + class(SwfPcpType) :: this + ! local + integer(I4B) :: indx + + call this%obs%StoreObsType('pcp', .true., indx) + this%obs%obsData(indx)%ProcessIdPtr => DefaultObsIdProcessor + end subroutine pcp_df_obs + + !> @brief Return requested boundary value + !< + function pcp_bound_value(this, col, row) result(bndval) + ! modules + use ConstantsModule, only: DZERO + ! dummy + class(SwfPcpType), intent(inout) :: this !< BndExtType object + integer(I4B), intent(in) :: col + integer(I4B), intent(in) :: row + ! result + real(DP) :: bndval + + select case (col) + case (1) + if (this%iauxmultcol > 0) then + bndval = this%precipitation(row) * this%auxvar(this%iauxmultcol, row) + else + bndval = this%precipitation(row) + end if + case default + errmsg = 'Programming error. PCP bound value requested column '& + &'outside range of ncolbnd (1).' + call store_error(errmsg) + call store_error_filename(this%input_fname) + end select + end function pcp_bound_value + + function reach_length_pointer(this) result(ptr) + ! dummy + class(SwfPcpType) :: this !< this instance + ! return + real(DP), dimension(:), pointer :: ptr + ! local + class(DisBaseType), pointer :: dis + + ptr => null() + dis => this%dis + select type (dis) + type is (Disv1dType) + ptr => dis%length + end select + + end function reach_length_pointer + +end module SwfPcpModule + diff --git a/src/Model/SurfaceWaterFlow/swf-sto.f90 b/src/Model/SurfaceWaterFlow/swf-sto.f90 index dd0c5db739d..74bf6fa0eaf 100644 --- a/src/Model/SurfaceWaterFlow/swf-sto.f90 +++ b/src/Model/SurfaceWaterFlow/swf-sto.f90 @@ -209,7 +209,6 @@ subroutine sto_fc(this, kiter, stage_old, stage_new, matrix_sln, idxglo, rhs) integer(I4B), intent(in), dimension(:) :: idxglo real(DP), intent(inout), dimension(:) :: rhs ! -- local - character(len=LINELENGTH) :: distype = '' ! -- formats character(len=*), parameter :: fmtsperror = & &"('Detected time step length of zero. SWF Storage Package cannot be ', & @@ -224,8 +223,7 @@ subroutine sto_fc(this, kiter, stage_old, stage_new, matrix_sln, idxglo, rhs) call store_error(errmsg, terminate=.TRUE.) end if - call this%dis%get_dis_type(distype) - if (distype == 'DISV1D') then + if (this%dis%is_1d()) then call this%sto_fc_dis1d(kiter, stage_old, stage_new, matrix_sln, idxglo, rhs) else call this%sto_fc_dis2d(kiter, stage_old, stage_new, matrix_sln, idxglo, rhs) diff --git a/src/Model/SurfaceWaterFlow/swf.f90 b/src/Model/SurfaceWaterFlow/swf.f90 index 7d8c50144cb..70223ee3f4e 100644 --- a/src/Model/SurfaceWaterFlow/swf.f90 +++ b/src/Model/SurfaceWaterFlow/swf.f90 @@ -836,6 +836,7 @@ subroutine package_create(this, filtyp, ipakid, ipaknum, pakname, mempath, & use ChdModule, only: chd_create use SwfCdbModule, only: cdb_create use SwfZdgModule, only: zdg_create + use SwfPcpModule, only: pcp_create ! dummy class(SwfModelType) :: this character(len=*), intent(in) :: filtyp @@ -867,6 +868,9 @@ subroutine package_create(this, filtyp, ipakid, ipaknum, pakname, mempath, & case ('ZDG6') call zdg_create(packobj, ipakid, ipaknum, inunit, iout, this%name, & pakname, mempath, this%dis, this%cxs, this%dfw%unitconv) + case ('PCP6') + call pcp_create(packobj, ipakid, ipaknum, inunit, iout, this%name, & + pakname, mempath, this%dis, this%dfw, this%cxs) case default write (errmsg, *) 'Invalid package type: ', filtyp call store_error(errmsg) @@ -1071,7 +1075,7 @@ subroutine create_packages(this) this%inoc = inunit case ('OBS6') this%inobs = inunit - case ('CHD6', 'FLW6', 'CDB6', 'ZDG6') + case ('CHD6', 'FLW6', 'CDB6', 'ZDG6', 'PCP6') call expandarray(bndpkgs) bndpkgs(size(bndpkgs)) = n case default diff --git a/src/meson.build b/src/meson.build index 0cd60f953c5..3049d11692b 100644 --- a/src/meson.build +++ b/src/meson.build @@ -90,6 +90,7 @@ modflow_sources = files( 'Idm' / 'swf-flwidm.f90', 'Idm' / 'swf-chdidm.f90', 'Idm' / 'swf-cdbidm.f90', + 'Idm' / 'swf-pcpidm.f90', 'Idm' / 'swf-stoidm.f90', 'Idm' / 'swf-zdgidm.f90', 'Idm' / 'chf-disv1didm.f90', @@ -102,6 +103,7 @@ modflow_sources = files( 'Idm' / 'chf-flwidm.f90', 'Idm' / 'chf-chdidm.f90', 'Idm' / 'chf-cdbidm.f90', + 'Idm' / 'chf-pcpidm.f90', 'Idm' / 'chf-stoidm.f90', 'Idm' / 'chf-zdgidm.f90', 'Idm' / 'olf-disv1didm.f90', @@ -114,6 +116,7 @@ modflow_sources = files( 'Idm' / 'olf-flwidm.f90', 'Idm' / 'olf-chdidm.f90', 'Idm' / 'olf-cdbidm.f90', + 'Idm' / 'olf-pcpidm.f90', 'Idm' / 'olf-stoidm.f90', 'Idm' / 'olf-zdgidm.f90', 'Idm' / 'sim-namidm.f90', @@ -214,6 +217,7 @@ modflow_sources = files( 'Model' / 'SurfaceWaterFlow' / 'swf-obs.f90', 'Model' / 'SurfaceWaterFlow' / 'swf-oc.f90', 'Model' / 'SurfaceWaterFlow' / 'swf-flw.f90', + 'Model' / 'SurfaceWaterFlow' / 'swf-pcp.f90', 'Model' / 'SurfaceWaterFlow' / 'swf-sto.f90', 'Model' / 'SurfaceWaterFlow' / 'swf-cdb.f90', 'Model' / 'SurfaceWaterFlow' / 'swf-zdg.f90', diff --git a/utils/idmloader/dfns.txt b/utils/idmloader/dfns.txt index d95d93e4757..de3f3604364 100644 --- a/utils/idmloader/dfns.txt +++ b/utils/idmloader/dfns.txt @@ -42,6 +42,21 @@ gwe-disv.dfn gwe-disu.dfn gwe-dis.dfn +# swf model +swf-nam.dfn +swf-disv1d.dfn +swf-dis2d.dfn +swf-disv2d.dfn +swf-cxs.dfn +swf-dfw.dfn +swf-ic.dfn +swf-cdb.dfn +swf-chd.dfn +swf-flw.dfn +swf-pcp.dfn +swf-sto.dfn +swf-zdg.dfn + # chf model chf-nam.dfn chf-disv1d.dfn @@ -51,6 +66,7 @@ chf-ic.dfn chf-cdb.dfn chf-chd.dfn chf-flw.dfn +chf-pcp.dfn chf-sto.dfn chf-zdg.dfn @@ -63,6 +79,7 @@ olf-ic.dfn olf-cdb.dfn olf-chd.dfn olf-flw.dfn +olf-pcp.dfn olf-sto.dfn olf-zdg.dfn