From 7f37518b139d308d9b97a4e2245f97eefd9f29d1 Mon Sep 17 00:00:00 2001 From: langevin-usgs Date: Fri, 9 Feb 2024 12:55:46 -0600 Subject: [PATCH 1/2] docs(mf6io): correct description of CDIST in gwfgwf/gwtgwt (#1606) * docs(mf6io): correct description of CDIST in gwfgwf/gwtgwt * correct deprecation warnings to use proper version number --- doc/mf6io/mf6ivar/dfn/exg-gwfgwf.dfn | 3 ++- doc/mf6io/mf6ivar/dfn/exg-gwtgwt.dfn | 2 +- doc/mf6io/mf6ivar/md/mf6ivar.md | 4 ++-- doc/mf6io/mf6ivar/tex/exg-gwfgwf-desc.tex | 2 +- doc/mf6io/mf6ivar/tex/exg-gwtgwt-desc.tex | 2 +- src/Model/GroundWaterFlow/gwf3lak8.f90 | 2 +- src/Model/GroundWaterFlow/gwf3sfr8.f90 | 2 +- 7 files changed, 9 insertions(+), 8 deletions(-) diff --git a/doc/mf6io/mf6ivar/dfn/exg-gwfgwf.dfn b/doc/mf6io/mf6ivar/dfn/exg-gwfgwf.dfn index 2232bfbdf90..e27195cb393 100644 --- a/doc/mf6io/mf6ivar/dfn/exg-gwfgwf.dfn +++ b/doc/mf6io/mf6ivar/dfn/exg-gwfgwf.dfn @@ -8,7 +8,8 @@ shape (naux) reader urword optional true longname keyword to specify aux variables -description an array of auxiliary variable names. There is no limit on the number of auxiliary variables that can be provided. Most auxiliary variables will not be used by the GWF-GWF Exchange, but they will be available for use by other parts of the program. If an auxiliary variable with the name ``ANGLDEGX'' is found, then this information will be used as the angle (provided in degrees) between the connection face normal and the x axis, where a value of zero indicates that a normal vector points directly along the positive x axis. The connection face normal is a normal vector on the cell face shared between the cell in model 1 and the cell in model 2 pointing away from the model 1 cell. Additional information on ``ANGLDEGX'' is provided in the description of the DISU Package. If an auxiliary variable with the name ``CDIST'' is found, then this information will be used as the straight-line connection distance, including the vertical component, between the two cell centers. Both ANGLDEGX and CDIST are required if specific discharge is calculated for either of the groundwater models. +description an array of auxiliary variable names. There is no limit on the number of auxiliary variables that can be provided. Most auxiliary variables will not be used by the GWF-GWF Exchange, but they will be available for use by other parts of the program. If an auxiliary variable with the name ``ANGLDEGX'' is found, then this information will be used as the angle (provided in degrees) between the connection face normal and the x axis, where a value of zero indicates that a normal vector points directly along the positive x axis. The connection face normal is a normal vector on the cell face shared between the cell in model 1 and the cell in model 2 pointing away from the model 1 cell. Additional information on ``ANGLDEGX'' and when it is required is provided in the description of the DISU Package. If an auxiliary variable with the name ``CDIST'' is found, then this information will be used in the calculation of specific discharge within model cells connected by the exchange. For a horizontal connection, CDIST should be specified as the horizontal distance between the cell centers, and should not include the vertical component. For vertical connections, CDIST should be specified as the difference in elevation between the two cell centers. Both ANGLDEGX and CDIST are required if specific discharge is calculated for either of the groundwater models. + block options name boundnames diff --git a/doc/mf6io/mf6ivar/dfn/exg-gwtgwt.dfn b/doc/mf6io/mf6ivar/dfn/exg-gwtgwt.dfn index f5aeb241996..7d8b419ddd1 100644 --- a/doc/mf6io/mf6ivar/dfn/exg-gwtgwt.dfn +++ b/doc/mf6io/mf6ivar/dfn/exg-gwtgwt.dfn @@ -24,7 +24,7 @@ shape (naux) reader urword optional true longname keyword to specify aux variables -description an array of auxiliary variable names. There is no limit on the number of auxiliary variables that can be provided. Most auxiliary variables will not be used by the GWF-GWF Exchange, but they will be available for use by other parts of the program. If an auxiliary variable with the name ``ANGLDEGX'' is found, then this information will be used as the angle (provided in degrees) between the connection face normal and the x axis, where a value of zero indicates that a normal vector points directly along the positive x axis. The connection face normal is a normal vector on the cell face shared between the cell in model 1 and the cell in model 2 pointing away from the model 1 cell. Additional information on ``ANGLDEGX'' is provided in the description of the DISU Package. If an auxiliary variable with the name ``CDIST'' is found, then this information will be used as the straight-line connection distance, including the vertical component, between the two cell centers. Both ANGLDEGX and CDIST are required if specific discharge is calculated for either of the groundwater models. +description an array of auxiliary variable names. There is no limit on the number of auxiliary variables that can be provided. Most auxiliary variables will not be used by the GWT-GWT Exchange, but they will be available for use by other parts of the program. If an auxiliary variable with the name ``ANGLDEGX'' is found, then this information will be used as the angle (provided in degrees) between the connection face normal and the x axis, where a value of zero indicates that a normal vector points directly along the positive x axis. The connection face normal is a normal vector on the cell face shared between the cell in model 1 and the cell in model 2 pointing away from the model 1 cell. Additional information on ``ANGLDEGX'' is provided in the description of the DISU Package. ANGLDEGX must be specified if dispersion is simulated in the connected GWT models. block options name boundnames diff --git a/doc/mf6io/mf6ivar/md/mf6ivar.md b/doc/mf6io/mf6ivar/md/mf6ivar.md index a1a6b95f5ac..011c23b068b 100644 --- a/doc/mf6io/mf6ivar/md/mf6ivar.md +++ b/doc/mf6io/mf6ivar/md/mf6ivar.md @@ -29,7 +29,7 @@ | SIM | TDIS | PERIODDATA | PERLEN | DOUBLE PRECISION | is the length of a stress period. | | SIM | TDIS | PERIODDATA | NSTP | INTEGER | is the number of time steps in a stress period. | | SIM | TDIS | PERIODDATA | TSMULT | DOUBLE PRECISION | is the multiplier for the length of successive time steps. The length of a time step is calculated by multiplying the length of the previous time step by TSMULT. The length of the first time step, $\Delta t_1$, is related to PERLEN, NSTP, and TSMULT by the relation $\Delta t_1= perlen \frac{tsmult - 1}{tsmult^{nstp}-1}$. | -| EXG | GWFGWF | OPTIONS | AUXILIARY | STRING (NAUX) | an array of auxiliary variable names. There is no limit on the number of auxiliary variables that can be provided. Most auxiliary variables will not be used by the GWF-GWF Exchange, but they will be available for use by other parts of the program. If an auxiliary variable with the name ``ANGLDEGX'' is found, then this information will be used as the angle (provided in degrees) between the connection face normal and the x axis, where a value of zero indicates that a normal vector points directly along the positive x axis. The connection face normal is a normal vector on the cell face shared between the cell in model 1 and the cell in model 2 pointing away from the model 1 cell. Additional information on ``ANGLDEGX'' is provided in the description of the DISU Package. If an auxiliary variable with the name ``CDIST'' is found, then this information will be used as the straight-line connection distance, including the vertical component, between the two cell centers. Both ANGLDEGX and CDIST are required if specific discharge is calculated for either of the groundwater models. | +| EXG | GWFGWF | OPTIONS | AUXILIARY | STRING (NAUX) | an array of auxiliary variable names. There is no limit on the number of auxiliary variables that can be provided. Most auxiliary variables will not be used by the GWF-GWF Exchange, but they will be available for use by other parts of the program. If an auxiliary variable with the name ``ANGLDEGX'' is found, then this information will be used as the angle (provided in degrees) between the connection face normal and the x axis, where a value of zero indicates that a normal vector points directly along the positive x axis. The connection face normal is a normal vector on the cell face shared between the cell in model 1 and the cell in model 2 pointing away from the model 1 cell. Additional information on ``ANGLDEGX'' and when it is required is provided in the description of the DISU Package. If an auxiliary variable with the name ``CDIST'' is found, then this information will be used in the calculation of specific discharge within model cells connected by the exchange. For a horizontal connection, CDIST should be specified as the horizontal distance between the cell centers, and should not include the vertical component. For vertical connections, CDIST should be specified as the difference in elevation between the two cell centers. Both ANGLDEGX and CDIST are required if specific discharge is calculated for either of the groundwater models. | | EXG | GWFGWF | OPTIONS | BOUNDNAMES | KEYWORD | keyword to indicate that boundary names may be provided with the list of GWF Exchange cells. | | EXG | GWFGWF | OPTIONS | PRINT_INPUT | KEYWORD | keyword to indicate that the list of exchange entries will be echoed to the listing file immediately after it is read. | | EXG | GWFGWF | OPTIONS | PRINT_FLOWS | KEYWORD | keyword to indicate that the list of exchange flow rates will be printed to the listing file for every stress period in which ``SAVE BUDGET'' is specified in Output Control. | @@ -58,7 +58,7 @@ | EXG | GWFGWF | EXCHANGEDATA | BOUNDNAME | STRING | name of the GWF Exchange cell. BOUNDNAME is an ASCII character variable that can contain as many as 40 characters. If BOUNDNAME contains spaces in it, then the entire name must be enclosed within single quotes. | | EXG | GWTGWT | OPTIONS | GWFMODELNAME1 | STRING | keyword to specify name of first corresponding GWF Model. In the simulation name file, the GWT6-GWT6 entry contains names for GWT Models (exgmnamea and exgmnameb). The GWT Model with the name exgmnamea must correspond to the GWF Model with the name gwfmodelname1. | | EXG | GWTGWT | OPTIONS | GWFMODELNAME2 | STRING | keyword to specify name of second corresponding GWF Model. In the simulation name file, the GWT6-GWT6 entry contains names for GWT Models (exgmnamea and exgmnameb). The GWT Model with the name exgmnameb must correspond to the GWF Model with the name gwfmodelname2. | -| EXG | GWTGWT | OPTIONS | AUXILIARY | STRING (NAUX) | an array of auxiliary variable names. There is no limit on the number of auxiliary variables that can be provided. Most auxiliary variables will not be used by the GWF-GWF Exchange, but they will be available for use by other parts of the program. If an auxiliary variable with the name ``ANGLDEGX'' is found, then this information will be used as the angle (provided in degrees) between the connection face normal and the x axis, where a value of zero indicates that a normal vector points directly along the positive x axis. The connection face normal is a normal vector on the cell face shared between the cell in model 1 and the cell in model 2 pointing away from the model 1 cell. Additional information on ``ANGLDEGX'' is provided in the description of the DISU Package. If an auxiliary variable with the name ``CDIST'' is found, then this information will be used as the straight-line connection distance, including the vertical component, between the two cell centers. Both ANGLDEGX and CDIST are required if specific discharge is calculated for either of the groundwater models. | +| EXG | GWTGWT | OPTIONS | AUXILIARY | STRING (NAUX) | an array of auxiliary variable names. There is no limit on the number of auxiliary variables that can be provided. Most auxiliary variables will not be used by the GWT-GWT Exchange, but they will be available for use by other parts of the program. If an auxiliary variable with the name ``ANGLDEGX'' is found, then this information will be used as the angle (provided in degrees) between the connection face normal and the x axis, where a value of zero indicates that a normal vector points directly along the positive x axis. The connection face normal is a normal vector on the cell face shared between the cell in model 1 and the cell in model 2 pointing away from the model 1 cell. Additional information on ``ANGLDEGX'' is provided in the description of the DISU Package. ANGLDEGX must be specified if dispersion is simulated in the connected GWT models. | | EXG | GWTGWT | OPTIONS | BOUNDNAMES | KEYWORD | keyword to indicate that boundary names may be provided with the list of GWT Exchange cells. | | EXG | GWTGWT | OPTIONS | PRINT_INPUT | KEYWORD | keyword to indicate that the list of exchange entries will be echoed to the listing file immediately after it is read. | | EXG | GWTGWT | OPTIONS | PRINT_FLOWS | KEYWORD | keyword to indicate that the list of exchange flow rates will be printed to the listing file for every stress period in which ``SAVE BUDGET'' is specified in Output Control. | diff --git a/doc/mf6io/mf6ivar/tex/exg-gwfgwf-desc.tex b/doc/mf6io/mf6ivar/tex/exg-gwfgwf-desc.tex index 65778b0847b..825d7a89e7a 100644 --- a/doc/mf6io/mf6ivar/tex/exg-gwfgwf-desc.tex +++ b/doc/mf6io/mf6ivar/tex/exg-gwfgwf-desc.tex @@ -3,7 +3,7 @@ \item \textbf{Block: OPTIONS} \begin{description} -\item \texttt{auxiliary}---an array of auxiliary variable names. There is no limit on the number of auxiliary variables that can be provided. Most auxiliary variables will not be used by the GWF-GWF Exchange, but they will be available for use by other parts of the program. If an auxiliary variable with the name ``ANGLDEGX'' is found, then this information will be used as the angle (provided in degrees) between the connection face normal and the x axis, where a value of zero indicates that a normal vector points directly along the positive x axis. The connection face normal is a normal vector on the cell face shared between the cell in model 1 and the cell in model 2 pointing away from the model 1 cell. Additional information on ``ANGLDEGX'' is provided in the description of the DISU Package. If an auxiliary variable with the name ``CDIST'' is found, then this information will be used as the straight-line connection distance, including the vertical component, between the two cell centers. Both ANGLDEGX and CDIST are required if specific discharge is calculated for either of the groundwater models. +\item \texttt{auxiliary}---an array of auxiliary variable names. There is no limit on the number of auxiliary variables that can be provided. Most auxiliary variables will not be used by the GWF-GWF Exchange, but they will be available for use by other parts of the program. If an auxiliary variable with the name ``ANGLDEGX'' is found, then this information will be used as the angle (provided in degrees) between the connection face normal and the x axis, where a value of zero indicates that a normal vector points directly along the positive x axis. The connection face normal is a normal vector on the cell face shared between the cell in model 1 and the cell in model 2 pointing away from the model 1 cell. Additional information on ``ANGLDEGX'' and when it is required is provided in the description of the DISU Package. If an auxiliary variable with the name ``CDIST'' is found, then this information will be used in the calculation of specific discharge within model cells connected by the exchange. For a horizontal connection, CDIST should be specified as the horizontal distance between the cell centers, and should not include the vertical component. For vertical connections, CDIST should be specified as the difference in elevation between the two cell centers. Both ANGLDEGX and CDIST are required if specific discharge is calculated for either of the groundwater models. \item \texttt{BOUNDNAMES}---keyword to indicate that boundary names may be provided with the list of GWF Exchange cells. diff --git a/doc/mf6io/mf6ivar/tex/exg-gwtgwt-desc.tex b/doc/mf6io/mf6ivar/tex/exg-gwtgwt-desc.tex index 85c90ef8aea..d58eb0416e7 100644 --- a/doc/mf6io/mf6ivar/tex/exg-gwtgwt-desc.tex +++ b/doc/mf6io/mf6ivar/tex/exg-gwtgwt-desc.tex @@ -7,7 +7,7 @@ \item \texttt{gwfmodelname2}---keyword to specify name of second corresponding GWF Model. In the simulation name file, the GWT6-GWT6 entry contains names for GWT Models (exgmnamea and exgmnameb). The GWT Model with the name exgmnameb must correspond to the GWF Model with the name gwfmodelname2. -\item \texttt{auxiliary}---an array of auxiliary variable names. There is no limit on the number of auxiliary variables that can be provided. Most auxiliary variables will not be used by the GWF-GWF Exchange, but they will be available for use by other parts of the program. If an auxiliary variable with the name ``ANGLDEGX'' is found, then this information will be used as the angle (provided in degrees) between the connection face normal and the x axis, where a value of zero indicates that a normal vector points directly along the positive x axis. The connection face normal is a normal vector on the cell face shared between the cell in model 1 and the cell in model 2 pointing away from the model 1 cell. Additional information on ``ANGLDEGX'' is provided in the description of the DISU Package. If an auxiliary variable with the name ``CDIST'' is found, then this information will be used as the straight-line connection distance, including the vertical component, between the two cell centers. Both ANGLDEGX and CDIST are required if specific discharge is calculated for either of the groundwater models. +\item \texttt{auxiliary}---an array of auxiliary variable names. There is no limit on the number of auxiliary variables that can be provided. Most auxiliary variables will not be used by the GWT-GWT Exchange, but they will be available for use by other parts of the program. If an auxiliary variable with the name ``ANGLDEGX'' is found, then this information will be used as the angle (provided in degrees) between the connection face normal and the x axis, where a value of zero indicates that a normal vector points directly along the positive x axis. The connection face normal is a normal vector on the cell face shared between the cell in model 1 and the cell in model 2 pointing away from the model 1 cell. Additional information on ``ANGLDEGX'' is provided in the description of the DISU Package. ANGLDEGX must be specified if dispersion is simulated in the connected GWT models. \item \texttt{BOUNDNAMES}---keyword to indicate that boundary names may be provided with the list of GWT Exchange cells. diff --git a/src/Model/GroundWaterFlow/gwf3lak8.f90 b/src/Model/GroundWaterFlow/gwf3lak8.f90 index 3834f640263..bda281b18a6 100644 --- a/src/Model/GroundWaterFlow/gwf3lak8.f90 +++ b/src/Model/GroundWaterFlow/gwf3lak8.f90 @@ -829,7 +829,7 @@ subroutine lak_read_lake_connections(this) 'DNODATA (', DNODATA, ') value.' ! ! -- create deprecation warning - call deprecation_warning('CONNECTIONDATA', 'bedleak=NONE', '6.5.0', & + call deprecation_warning('CONNECTIONDATA', 'bedleak=NONE', '6.4.3', & warnmsg, this%parser%GetUnit()) case default read (keyword, *) rval diff --git a/src/Model/GroundWaterFlow/gwf3sfr8.f90 b/src/Model/GroundWaterFlow/gwf3sfr8.f90 index c9a4141fc9d..dea9390e846 100644 --- a/src/Model/GroundWaterFlow/gwf3sfr8.f90 +++ b/src/Model/GroundWaterFlow/gwf3sfr8.f90 @@ -923,7 +923,7 @@ subroutine sfr_read_packagedata(this) 'of 0 0 0 should be specified for unconnected reaches' ! ! -- create deprecation warning - call deprecation_warning('PACKAGEDATA', 'CELLID=NONE', '6.5.0', & + call deprecation_warning('PACKAGEDATA', 'CELLID=NONE', '6.4.3', & warnmsg, this%parser%GetUnit()) else From 67f189188950b221fa19f8b6f8540748ba663502 Mon Sep 17 00:00:00 2001 From: mjreno Date: Fri, 9 Feb 2024 14:00:16 -0500 Subject: [PATCH 2/2] feat(idm): update TDIS package for IDM (#1579) * integrate sim-tdis with idm * rebuild makefiles * fix comment * rebuild makefiles --------- Co-authored-by: mjreno --- doc/mf6io/framework/processing_of_input.tex | 1 + make/makefile | 125 ++++---- msvs/mf6core.vfproj | 1 + src/SimulationCreate.f90 | 10 +- src/Timing/simtdisidm.f90 | 259 +++++++++++++++ src/Timing/tdis.f90 | 301 ++++++++---------- src/Utilities/Idm/IdmLoad.f90 | 18 ++ src/Utilities/Idm/SourceLoad.F90 | 59 +++- .../Idm/selector/IdmSimDfnSelector.f90 | 11 + src/meson.build | 1 + src/mf6core.f90 | 6 +- utils/idmloader/scripts/dfn2f90.py | 4 + 12 files changed, 549 insertions(+), 247 deletions(-) create mode 100644 src/Timing/simtdisidm.f90 diff --git a/doc/mf6io/framework/processing_of_input.tex b/doc/mf6io/framework/processing_of_input.tex index 6af3f1a933b..b625e2ffece 100644 --- a/doc/mf6io/framework/processing_of_input.tex +++ b/doc/mf6io/framework/processing_of_input.tex @@ -15,6 +15,7 @@ \subsection{Supported Components} \textbf{Component / Subcomponent} & \textbf{File Type} \\ \hline SIM/NAM & mfsim.nam \\ +SIM/TDIS & TDIS6 \\ GWF/NAM & GWF name file \\ GWT/NAM & GWT name file \\ GWF/CHD & CHD6 \\ diff --git a/make/makefile b/make/makefile index 20d30e6d03f..229db4c9bc3 100644 --- a/make/makefile +++ b/make/makefile @@ -5,36 +5,36 @@ include ./makedefaults # Define the source file directories SOURCEDIR1=../src -SOURCEDIR2=../src/Model -SOURCEDIR3=../src/Model/TransportModel -SOURCEDIR4=../src/Model/GroundWaterFlow -SOURCEDIR5=../src/Model/Geometry +SOURCEDIR2=../src/Exchange +SOURCEDIR3=../src/Timing +SOURCEDIR4=../src/Model +SOURCEDIR5=../src/Model/Connection SOURCEDIR6=../src/Model/ModelUtilities -SOURCEDIR7=../src/Model/GroundWaterTransport -SOURCEDIR8=../src/Model/Connection -SOURCEDIR9=../src/Distributed -SOURCEDIR10=../src/Utilities -SOURCEDIR11=../src/Utilities/Idm -SOURCEDIR12=../src/Utilities/Idm/mf6blockfile -SOURCEDIR13=../src/Utilities/Idm/selector -SOURCEDIR14=../src/Utilities/Vector -SOURCEDIR15=../src/Utilities/Matrix -SOURCEDIR16=../src/Utilities/Observation -SOURCEDIR17=../src/Utilities/ArrayRead -SOURCEDIR18=../src/Utilities/OutputControl -SOURCEDIR19=../src/Utilities/Libraries -SOURCEDIR20=../src/Utilities/Libraries/blas -SOURCEDIR21=../src/Utilities/Libraries/rcm -SOURCEDIR22=../src/Utilities/Libraries/sparsekit -SOURCEDIR23=../src/Utilities/Libraries/sparskit2 -SOURCEDIR24=../src/Utilities/Libraries/daglib -SOURCEDIR25=../src/Utilities/Memory -SOURCEDIR26=../src/Utilities/TimeSeries -SOURCEDIR27=../src/Timing -SOURCEDIR28=../src/Solution -SOURCEDIR29=../src/Solution/PETSc -SOURCEDIR30=../src/Solution/LinearMethods -SOURCEDIR31=../src/Exchange +SOURCEDIR7=../src/Model/GroundWaterFlow +SOURCEDIR8=../src/Model/Geometry +SOURCEDIR9=../src/Model/TransportModel +SOURCEDIR10=../src/Model/GroundWaterTransport +SOURCEDIR11=../src/Solution +SOURCEDIR12=../src/Solution/LinearMethods +SOURCEDIR13=../src/Solution/PETSc +SOURCEDIR14=../src/Distributed +SOURCEDIR15=../src/Utilities +SOURCEDIR16=../src/Utilities/TimeSeries +SOURCEDIR17=../src/Utilities/Idm +SOURCEDIR18=../src/Utilities/Idm/selector +SOURCEDIR19=../src/Utilities/Idm/mf6blockfile +SOURCEDIR20=../src/Utilities/ArrayRead +SOURCEDIR21=../src/Utilities/Memory +SOURCEDIR22=../src/Utilities/Matrix +SOURCEDIR23=../src/Utilities/Vector +SOURCEDIR24=../src/Utilities/Observation +SOURCEDIR25=../src/Utilities/OutputControl +SOURCEDIR26=../src/Utilities/Libraries +SOURCEDIR27=../src/Utilities/Libraries/rcm +SOURCEDIR28=../src/Utilities/Libraries/sparskit2 +SOURCEDIR29=../src/Utilities/Libraries/sparsekit +SOURCEDIR30=../src/Utilities/Libraries/blas +SOURCEDIR31=../src/Utilities/Libraries/daglib VPATH = \ ${SOURCEDIR1} \ @@ -88,36 +88,10 @@ $(OBJDIR)/TableTerm.o \ $(OBJDIR)/Table.o \ $(OBJDIR)/MemoryHelper.o \ $(OBJDIR)/CharString.o \ +$(OBJDIR)/InputDefinition.o \ $(OBJDIR)/Memory.o \ $(OBJDIR)/List.o \ -$(OBJDIR)/LongLineReader.o \ -$(OBJDIR)/DevFeature.o \ -$(OBJDIR)/MemoryList.o \ -$(OBJDIR)/TimeSeriesRecord.o \ -$(OBJDIR)/MathUtil.o \ -$(OBJDIR)/BlockParser.o \ -$(OBJDIR)/MemoryManager.o \ -$(OBJDIR)/TimeSeries.o \ -$(OBJDIR)/ats.o \ -$(OBJDIR)/GeomUtil.o \ -$(OBJDIR)/TimeSeriesLink.o \ -$(OBJDIR)/TimeSeriesFileList.o \ -$(OBJDIR)/tdis.o \ -$(OBJDIR)/HashTable.o \ -$(OBJDIR)/VectorBase.o \ -$(OBJDIR)/Sparse.o \ -$(OBJDIR)/DisvGeom.o \ -$(OBJDIR)/ArrayReaders.o \ -$(OBJDIR)/TimeSeriesManager.o \ -$(OBJDIR)/SmoothingFunctions.o \ -$(OBJDIR)/MemoryManagerExt.o \ -$(OBJDIR)/MatrixBase.o \ -$(OBJDIR)/ListReader.o \ -$(OBJDIR)/Connections.o \ -$(OBJDIR)/InputDefinition.o \ -$(OBJDIR)/TimeArray.o \ -$(OBJDIR)/ObsOutput.o \ -$(OBJDIR)/DiscretizationBase.o \ +$(OBJDIR)/simtdisidm.o \ $(OBJDIR)/simnamidm.o \ $(OBJDIR)/gwt1idm.o \ $(OBJDIR)/gwt1ic1idm.o \ @@ -144,18 +118,46 @@ $(OBJDIR)/gwf3chd8idm.o \ $(OBJDIR)/gwtgwtidm.o \ $(OBJDIR)/gwfgwtidm.o \ $(OBJDIR)/gwfgwfidm.o \ -$(OBJDIR)/TimeArraySeries.o \ -$(OBJDIR)/ObsOutputList.o \ -$(OBJDIR)/Observe.o \ +$(OBJDIR)/LongLineReader.o \ +$(OBJDIR)/DevFeature.o \ +$(OBJDIR)/MemoryList.o \ $(OBJDIR)/IdmSimDfnSelector.o \ $(OBJDIR)/IdmGwtDfnSelector.o \ $(OBJDIR)/IdmGwfDfnSelector.o \ $(OBJDIR)/IdmExgDfnSelector.o \ +$(OBJDIR)/TimeSeriesRecord.o \ +$(OBJDIR)/MathUtil.o \ +$(OBJDIR)/BlockParser.o \ +$(OBJDIR)/MemoryManager.o \ +$(OBJDIR)/IdmDfnSelector.o \ +$(OBJDIR)/TimeSeries.o \ +$(OBJDIR)/SourceCommon.o \ +$(OBJDIR)/MemoryManagerExt.o \ +$(OBJDIR)/ats.o \ +$(OBJDIR)/GeomUtil.o \ +$(OBJDIR)/TimeSeriesLink.o \ +$(OBJDIR)/TimeSeriesFileList.o \ +$(OBJDIR)/tdis.o \ +$(OBJDIR)/HashTable.o \ +$(OBJDIR)/VectorBase.o \ +$(OBJDIR)/Sparse.o \ +$(OBJDIR)/DisvGeom.o \ +$(OBJDIR)/ArrayReaders.o \ +$(OBJDIR)/TimeSeriesManager.o \ +$(OBJDIR)/SmoothingFunctions.o \ +$(OBJDIR)/MatrixBase.o \ +$(OBJDIR)/ListReader.o \ +$(OBJDIR)/Connections.o \ +$(OBJDIR)/TimeArray.o \ +$(OBJDIR)/ObsOutput.o \ +$(OBJDIR)/DiscretizationBase.o \ +$(OBJDIR)/TimeArraySeries.o \ +$(OBJDIR)/ObsOutputList.o \ +$(OBJDIR)/Observe.o \ $(OBJDIR)/TimeArraySeriesLink.o \ $(OBJDIR)/ObsUtility.o \ $(OBJDIR)/ObsContainer.o \ $(OBJDIR)/BudgetFileReader.o \ -$(OBJDIR)/IdmDfnSelector.o \ $(OBJDIR)/TimeArraySeriesManager.o \ $(OBJDIR)/PackageMover.o \ $(OBJDIR)/Obs3.o \ @@ -164,7 +166,6 @@ $(OBJDIR)/Budget.o \ $(OBJDIR)/BudgetTerm.o \ $(OBJDIR)/sort.o \ $(OBJDIR)/SfrCrossSectionUtils.o \ -$(OBJDIR)/SourceCommon.o \ $(OBJDIR)/BoundaryPackage.o \ $(OBJDIR)/VirtualBase.o \ $(OBJDIR)/STLVecInt.o \ diff --git a/msvs/mf6core.vfproj b/msvs/mf6core.vfproj index f0a03e6f2da..8d3b1c90737 100644 --- a/msvs/mf6core.vfproj +++ b/msvs/mf6core.vfproj @@ -286,6 +286,7 @@ + diff --git a/src/SimulationCreate.f90 b/src/SimulationCreate.f90 index ce5c0fc1a19..8aebdb1742a 100644 --- a/src/SimulationCreate.f90 +++ b/src/SimulationCreate.f90 @@ -50,14 +50,8 @@ end subroutine simulation_cr subroutine simulation_da() ! -- modules use MemoryManagerModule, only: mem_deallocate - use MemoryManagerExtModule, only: memorylist_remove - use SimVariablesModule, only: idm_context ! -- local ! ------------------------------------------------------------------------------ - ! - ! -- Deallocate input memory - call memorylist_remove('SIM', 'NAM', idm_context) - call memorylist_remove(component='SIM', context=idm_context) ! ! -- variables deallocate (model_names) @@ -183,11 +177,13 @@ subroutine timing_create() ! -- dummy ! -- locals character(len=LENMEMPATH) :: input_mempath + character(len=LENMEMPATH) :: tdis_input_mempath character(len=:), pointer :: tdis6 logical :: terminate = .true. ! ! -- set input memory path input_mempath = create_mem_path('SIM', 'NAM', idm_context) + tdis_input_mempath = create_mem_path('SIM', 'TDIS', idm_context) ! write (iout, '(/1x,a)') 'READING SIMULATION TIMING' ! @@ -196,7 +192,7 @@ subroutine timing_create() ! ! -- create timing if (tdis6 /= '') then - call tdis_cr(tdis6) + call tdis_cr(tdis6, tdis_input_mempath) else call store_error('TIMING block variable TDIS6 is unset'// & ' in simulation control input.', terminate) diff --git a/src/Timing/simtdisidm.f90 b/src/Timing/simtdisidm.f90 new file mode 100644 index 00000000000..e5de3a1787f --- /dev/null +++ b/src/Timing/simtdisidm.f90 @@ -0,0 +1,259 @@ +! ** Do Not Modify! MODFLOW 6 system generated file. ** +module SimTdisInputModule + use ConstantsModule, only: LENVARNAME + use InputDefinitionModule, only: InputParamDefinitionType, & + InputBlockDefinitionType + private + public sim_tdis_param_definitions + public sim_tdis_aggregate_definitions + public sim_tdis_block_definitions + public SimTdisParamFoundType + public sim_tdis_multi_package + + type SimTdisParamFoundType + logical :: time_units = .false. + logical :: start_date_time = .false. + logical :: ats_filerecord = .false. + logical :: ats6 = .false. + logical :: filein = .false. + logical :: ats6_filename = .false. + logical :: nper = .false. + logical :: perlen = .false. + logical :: nstp = .false. + logical :: tsmult = .false. + end type SimTdisParamFoundType + + logical :: sim_tdis_multi_package = .false. + + type(InputParamDefinitionType), parameter :: & + simtdis_time_units = InputParamDefinitionType & + ( & + 'SIM', & ! component + 'TDIS', & ! subcomponent + 'OPTIONS', & ! block + 'TIME_UNITS', & ! tag name + 'TIME_UNITS', & ! fortran variable + 'STRING', & ! type + '', & ! shape + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + simtdis_start_date_time = InputParamDefinitionType & + ( & + 'SIM', & ! component + 'TDIS', & ! subcomponent + 'OPTIONS', & ! block + 'START_DATE_TIME', & ! tag name + 'START_DATE_TIME', & ! fortran variable + 'STRING', & ! type + '', & ! shape + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + simtdis_ats_filerecord = InputParamDefinitionType & + ( & + 'SIM', & ! component + 'TDIS', & ! subcomponent + 'OPTIONS', & ! block + 'ATS_FILERECORD', & ! tag name + 'ATS_FILERECORD', & ! fortran variable + 'RECORD ATS6 FILEIN ATS6_FILENAME', & ! type + '', & ! shape + .false., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + simtdis_ats6 = InputParamDefinitionType & + ( & + 'SIM', & ! component + 'TDIS', & ! subcomponent + 'OPTIONS', & ! block + 'ATS6', & ! tag name + 'ATS6', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + .true., & ! required + .true., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + simtdis_filein = InputParamDefinitionType & + ( & + 'SIM', & ! component + 'TDIS', & ! subcomponent + 'OPTIONS', & ! block + 'FILEIN', & ! tag name + 'FILEIN', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + .true., & ! required + .true., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + simtdis_ats6_filename = InputParamDefinitionType & + ( & + 'SIM', & ! component + 'TDIS', & ! subcomponent + 'OPTIONS', & ! block + 'ATS6_FILENAME', & ! tag name + 'ATS6_FILENAME', & ! fortran variable + 'STRING', & ! type + '', & ! shape + .true., & ! required + .true., & ! multi-record + .true., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + simtdis_nper = InputParamDefinitionType & + ( & + 'SIM', & ! component + 'TDIS', & ! subcomponent + 'DIMENSIONS', & ! block + 'NPER', & ! tag name + 'NPER', & ! fortran variable + 'INTEGER', & ! type + '', & ! shape + .true., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + simtdis_perlen = InputParamDefinitionType & + ( & + 'SIM', & ! component + 'TDIS', & ! subcomponent + 'PERIODDATA', & ! block + 'PERLEN', & ! tag name + 'PERLEN', & ! fortran variable + 'DOUBLE', & ! type + '', & ! shape + .true., & ! required + .true., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + simtdis_nstp = InputParamDefinitionType & + ( & + 'SIM', & ! component + 'TDIS', & ! subcomponent + 'PERIODDATA', & ! block + 'NSTP', & ! tag name + 'NSTP', & ! fortran variable + 'INTEGER', & ! type + '', & ! shape + .true., & ! required + .true., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + simtdis_tsmult = InputParamDefinitionType & + ( & + 'SIM', & ! component + 'TDIS', & ! subcomponent + 'PERIODDATA', & ! block + 'TSMULT', & ! tag name + 'TSMULT', & ! fortran variable + 'DOUBLE', & ! type + '', & ! shape + .true., & ! required + .true., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + sim_tdis_param_definitions(*) = & + [ & + simtdis_time_units, & + simtdis_start_date_time, & + simtdis_ats_filerecord, & + simtdis_ats6, & + simtdis_filein, & + simtdis_ats6_filename, & + simtdis_nper, & + simtdis_perlen, & + simtdis_nstp, & + simtdis_tsmult & + ] + + type(InputParamDefinitionType), parameter :: & + simtdis_perioddata = InputParamDefinitionType & + ( & + 'SIM', & ! component + 'TDIS', & ! subcomponent + 'PERIODDATA', & ! block + 'PERIODDATA', & ! tag name + 'PERIODDATA', & ! fortran variable + 'RECARRAY PERLEN NSTP TSMULT', & ! type + '', & ! shape + .true., & ! required + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + sim_tdis_aggregate_definitions(*) = & + [ & + simtdis_perioddata & + ] + + type(InputBlockDefinitionType), parameter :: & + sim_tdis_block_definitions(*) = & + [ & + InputBlockDefinitionType( & + 'OPTIONS', & ! blockname + .false., & ! required + .false., & ! aggregate + .false. & ! block_variable + ), & + InputBlockDefinitionType( & + 'DIMENSIONS', & ! blockname + .true., & ! required + .false., & ! aggregate + .false. & ! block_variable + ), & + InputBlockDefinitionType( & + 'PERIODDATA', & ! blockname + .true., & ! required + .true., & ! aggregate + .false. & ! block_variable + ) & + ] + +end module SimTdisInputModule diff --git a/src/Timing/tdis.f90 b/src/Timing/tdis.f90 index 0aa32fc93bb..a3cf0bb36b4 100644 --- a/src/Timing/tdis.f90 +++ b/src/Timing/tdis.f90 @@ -6,8 +6,7 @@ module TdisModule use KindModule, only: DP, I4B, LGP use SimVariablesModule, only: iout, isim_level - use BlockParserModule, only: BlockParserType - use ConstantsModule, only: LINELENGTH, LENDATETIME, VALL + use ConstantsModule, only: LINELENGTH, LENDATETIME, LENMEMPATH, VALL ! implicit none ! @@ -40,55 +39,46 @@ module TdisModule integer(I4B), public, dimension(:), pointer, contiguous :: nstp => null() !< number of time steps in each stress period real(DP), public, dimension(:), pointer, contiguous :: tsmult => null() !< time step multiplier for each stress period character(len=LENDATETIME), pointer :: datetime0 => null() !< starting date and time for the simulation + character(len=LENMEMPATH), pointer :: input_mempath => null() !< input context mempath for tdis + character(len=LINELENGTH), pointer :: input_fname => null() !< input filename for tdis ! - type(BlockParserType), private :: parser - contains !> @brief Create temporal discretization !< - subroutine tdis_cr(fname) + subroutine tdis_cr(fname, inmempath) ! -- modules use InputOutputModule, only: getunit, openfile use ConstantsModule, only: LINELENGTH, DZERO use AdaptiveTimeStepModule, only: ats_cr ! -- dummy character(len=*), intent(in) :: fname + character(len=*), intent(in) :: inmempath ! -- local - integer(I4B) :: inunit ! -- formats character(len=*), parameter :: fmtheader = & "(1X,/1X,'TDIS -- TEMPORAL DISCRETIZATION PACKAGE,', / & - &' VERSION 1 : 11/13/2014 - INPUT READ FROM UNIT ',I4)" + &' VERSION 1 : 11/13/2014 - INPUT READ FROM MEMPATH: ', A)" ! ! -- Allocate the scalar variables call tdis_allocate_scalars() ! - ! -- Get a unit number for tdis and open the file if it is not opened - inquire (file=fname, number=inunit) - if (inunit < 0) then - inunit = getunit() - call openfile(inunit, iout, fname, 'TDIS') - end if + ! -- set input context and fname + input_fname = fname + input_mempath = inmempath ! ! -- Identify package - write (iout, fmtheader) inunit - ! - ! -- Initialize block parser - call parser%Initialize(inunit, iout) + write (iout, fmtheader) input_mempath ! - ! -- Read options - call tdis_read_options() + ! -- Source options + call tdis_source_options() ! - ! -- Read dimensions and then allocate arrays - call tdis_read_dimensions() + ! -- Source dimensions and then allocate arrays + call tdis_source_dimensions() call tdis_allocate_arrays() ! - ! -- Read timing - call tdis_read_timing() - ! - ! -- Close the file - call parser%Clear() + ! -- Source timing + call tdis_source_timing() ! if (inats > 0) then call ats_cr(inats, nper) @@ -458,6 +448,8 @@ subroutine tdis_da() ! ! -- strings deallocate (datetime0) + deallocate (input_mempath) + deallocate (input_fname) ! ! -- Arrays call mem_deallocate(perlen) @@ -468,104 +460,83 @@ subroutine tdis_da() return end subroutine tdis_da - !> @brief Read the timing discretization options + !> @brief Source the timing discretization options !< - subroutine tdis_read_options() + subroutine tdis_source_options() ! -- modules use ConstantsModule, only: LINELENGTH - use SimModule, only: store_error use InputOutputModule, only: GetUnit, openfile + use MemoryManagerExtModule, only: mem_set_value + use SourceCommonModule, only: filein_fname + use SimTdisInputModule, only: SimTdisParamFoundType ! -- local - character(len=LINELENGTH) :: errmsg, keyword, fname - integer(I4B) :: ierr - logical :: isfound, endOfBlock - logical :: undspec + type(SimTdisParamFoundType) :: found + character(len=LINELENGTH), dimension(6) :: time_units = & + &[character(len=LINELENGTH) :: 'UNDEFINED', 'SECONDS', 'MINUTES', 'HOURS', & + 'DAYS', 'YEARS'] + character(len=LINELENGTH) :: fname ! -- formats character(len=*), parameter :: fmtitmuni = & &"(4x,'SIMULATION TIME UNIT IS ',A)" character(len=*), parameter :: fmtdatetime0 = & &"(4x,'SIMULATION STARTING DATE AND TIME IS ',A)" - !data ! - ! -- set variables + ! -- initialize time unit to undefined itmuni = 0 - undspec = .false. - ! - ! -- get options block - call parser%GetBlock('OPTIONS', isfound, ierr, & - supportOpenClose=.true., blockRequired=.false.) - ! - ! -- parse options block if detected - if (isfound) then - write (iout, '(1x,a)') 'PROCESSING TDIS OPTIONS' - do - call parser%GetNextLine(endOfBlock) - if (endOfBlock) exit - call parser%GetStringCaps(keyword) - select case (keyword) - case ('TIME_UNITS') - call parser%GetStringCaps(keyword) - select case (keyword) - case ('UNDEFINED') - itmuni = 0 - write (iout, fmtitmuni) 'UNDEFINED' - undspec = .true. - case ('SECONDS') - itmuni = 1 - write (iout, fmtitmuni) 'SECONDS' - case ('MINUTES') - itmuni = 2 - write (iout, fmtitmuni) 'MINUTES' - case ('HOURS') - itmuni = 3 - write (iout, fmtitmuni) 'HOURS' - case ('DAYS') - itmuni = 4 - write (iout, fmtitmuni) 'DAYS' - case ('YEARS') - itmuni = 5 - write (iout, fmtitmuni) 'YEARS' - case default - write (errmsg, '(a,a)') 'Unknown TIME_UNITS: ', & - trim(keyword) - call store_error(errmsg) - call parser%StoreErrorUnit() - end select - case ('START_DATE_TIME') - call parser%GetString(datetime0) - write (iout, fmtdatetime0) datetime0 - case ('ATS6') - call parser%GetStringCaps(keyword) - if (trim(adjustl(keyword)) /= 'FILEIN') then - errmsg = 'ATS6 keyword must be followed by "FILEIN" '// & - 'then by filename.' - call store_error(errmsg) - end if - call parser%GetString(fname) - inats = GetUnit() - call openfile(inats, iout, fname, 'ATS') - case default - write (errmsg, '(a,a)') 'Unknown TDIS option: ', & - trim(keyword) - call store_error(errmsg) - call parser%StoreErrorUnit() - end select - end do - write (iout, '(1x,a)') 'END OF TDIS OPTIONS' + ! + ! -- source options from input context + call mem_set_value(itmuni, 'TIME_UNITS', input_mempath, time_units, & + found%time_units) + call mem_set_value(datetime0, 'START_DATE_TIME', input_mempath, & + found%start_date_time) + ! + if (found%time_units) then + ! + ! -- adjust to 0-based indexing for itmuni + itmuni = itmuni - 1 end if ! - ! -- Set to itmuni to undefined if not specified - if (itmuni == 0) then - if (.not. undspec) then + ! -- enforce 0 or 1 ATS6_FILENAME entries in option block + if (filein_fname(fname, 'ATS6_FILENAME', input_mempath, & + input_fname)) then + inats = GetUnit() + call openfile(inats, iout, fname, 'ATS') + end if + ! + ! -- log values to list file + write (iout, '(1x,a)') 'PROCESSING TDIS OPTIONS' + ! + if (found%time_units) then + select case (itmuni) + case (0) write (iout, fmtitmuni) 'UNDEFINED' - end if + case (1) + write (iout, fmtitmuni) 'SECONDS' + case (2) + write (iout, fmtitmuni) 'MINUTES' + case (3) + write (iout, fmtitmuni) 'HOURS' + case (4) + write (iout, fmtitmuni) 'DAYS' + case (5) + write (iout, fmtitmuni) 'YEARS' + case default + end select + else + write (iout, fmtitmuni) 'UNDEFINED' end if ! + if (found%start_date_time) then + write (iout, fmtdatetime0) datetime0 + end if + ! + write (iout, '(1x,a)') 'END OF TDIS OPTIONS' + ! ! -- Return return - end subroutine tdis_read_options + end subroutine tdis_source_options - !> @brief Read dimension NPER + !> @brief Allocate tdis scalars !< subroutine tdis_allocate_scalars() ! -- modules @@ -593,6 +564,8 @@ subroutine tdis_allocate_scalars() ! ! -- strings allocate (datetime0) + allocate (input_mempath) + allocate (input_fname) ! ! -- Initialize variables nper = 0 @@ -632,64 +605,48 @@ subroutine tdis_allocate_arrays() return end subroutine tdis_allocate_arrays - !> @brief Read dimension NPER + !> @brief Source dimension NPER !< - subroutine tdis_read_dimensions() + subroutine tdis_source_dimensions() ! -- modules use ConstantsModule, only: LINELENGTH - use SimModule, only: store_error + use MemoryManagerExtModule, only: mem_set_value + use SourceCommonModule, only: filein_fname + use SimTdisInputModule, only: SimTdisParamFoundType ! -- local - character(len=LINELENGTH) :: errmsg, keyword - integer(I4B) :: ierr - logical :: isfound, endOfBlock + type(SimTdisParamFoundType) :: found ! -- formats character(len=*), parameter :: fmtnper = & "(1X,I4,' STRESS PERIOD(S) IN SIMULATION')" ! - ! -- get DIMENSIONS block - call parser%GetBlock('DIMENSIONS', isfound, ierr, & - supportOpenClose=.true.) - ! - ! -- parse block if detected - if (isfound) then - write (iout, '(1x,a)') 'PROCESSING TDIS DIMENSIONS' - do - call parser%GetNextLine(endOfBlock) - if (endOfBlock) exit - call parser%GetStringCaps(keyword) - select case (keyword) - case ('NPER') - nper = parser%GetInteger() - write (iout, fmtnper) nper - case default - write (errmsg, '(a,a)') 'Unknown TDIS dimension: ', & - trim(keyword) - call store_error(errmsg) - call parser%StoreErrorUnit() - end select - end do - write (iout, '(1x,a)') 'END OF TDIS DIMENSIONS' - else - write (errmsg, '(a)') 'Required DIMENSIONS block not found.' - call store_error(errmsg) - call parser%StoreErrorUnit() + ! -- source dimensions from input context + call mem_set_value(nper, 'NPER', input_mempath, found%nper) + ! + ! -- log values to list file + write (iout, '(1x,a)') 'PROCESSING TDIS DIMENSIONS' + ! + if (found%nper) then + write (iout, fmtnper) nper end if ! + write (iout, '(1x,a)') 'END OF TDIS DIMENSIONS' + ! ! -- Return return - end subroutine tdis_read_dimensions + end subroutine tdis_source_dimensions - !> @brief Read timing information + !> @brief Source timing information !< - subroutine tdis_read_timing() + subroutine tdis_source_timing() ! -- modules use ConstantsModule, only: LINELENGTH, DZERO - use SimModule, only: store_error, count_errors + use SimModule, only: store_error_filename, count_errors + use MemoryManagerExtModule, only: mem_set_value + use SourceCommonModule, only: filein_fname + use SimTdisInputModule, only: SimTdisParamFoundType ! -- local - character(len=LINELENGTH) :: errmsg - integer(I4B) :: ierr + type(SimTdisParamFoundType) :: found integer(I4B) :: n - logical :: isfound, endOfBlock ! -- formats character(len=*), parameter :: fmtheader = & "(1X,//1X,'STRESS PERIOD LENGTH TIME STEPS', & @@ -697,41 +654,33 @@ subroutine tdis_read_timing() character(len=*), parameter :: fmtrow = & "(1X,I8,1PG21.7,I7,0PF25.3)" ! - ! -- get PERIODDATA block - call parser%GetBlock('PERIODDATA', isfound, ierr, & - supportOpenClose=.true.) - ! - ! -- parse block if detected - if (isfound) then - write (iout, '(1x,a)') 'PROCESSING TDIS PERIODDATA' - write (iout, fmtheader) - do n = 1, nper - call parser%GetNextLine(endOfBlock) - perlen(n) = parser%GetDouble() - nstp(n) = parser%GetInteger() - tsmult(n) = parser%GetDouble() - write (iout, fmtrow) n, perlen(n), nstp(n), tsmult(n) - totalsimtime = totalsimtime + perlen(n) - end do - ! - ! -- Check timing information - call check_tdis_timing(nper, perlen, nstp, tsmult) - call parser%terminateblock() - ! - ! -- Check for errors - if (count_errors() > 0) then - call parser%StoreErrorUnit() - end if - write (iout, '(1x,a)') 'END OF TDIS PERIODDATA' - else - write (errmsg, '(a)') 'Required PERIODDATA block not found.' - call store_error(errmsg) - call parser%StoreErrorUnit() + ! -- source perioddata from input context + call mem_set_value(perlen, 'PERLEN', input_mempath, found%perlen) + call mem_set_value(nstp, 'NSTP', input_mempath, found%nstp) + call mem_set_value(tsmult, 'TSMULT', input_mempath, found%tsmult) + ! + ! -- Check timing information + call check_tdis_timing(nper, perlen, nstp, tsmult) + ! + ! -- Check for errors + if (count_errors() > 0) then + call store_error_filename(input_fname) end if ! + ! -- log timing + write (iout, '(1x,a)') 'PROCESSING TDIS PERIODDATA' + write (iout, fmtheader) + ! + do n = 1, size(perlen) + write (iout, fmtrow) n, perlen(n), nstp(n), tsmult(n) + totalsimtime = totalsimtime + perlen(n) + end do + ! + write (iout, '(1x,a)') 'END OF TDIS PERIODDATA' + ! ! -- Return return - end subroutine tdis_read_timing + end subroutine tdis_source_timing !> @brief Check the tdis timing information !! @@ -742,7 +691,7 @@ end subroutine tdis_read_timing subroutine check_tdis_timing(nper, perlen, nstp, tsmult) ! -- modules use ConstantsModule, only: LINELENGTH, DZERO, DONE - use SimModule, only: store_error, count_errors + use SimModule, only: store_error ! -- dummy integer(I4B), intent(in) :: nper real(DP), dimension(:), contiguous, intent(in) :: perlen diff --git a/src/Utilities/Idm/IdmLoad.f90 b/src/Utilities/Idm/IdmLoad.f90 index b7c95f238dd..26c6aa21973 100644 --- a/src/Utilities/Idm/IdmLoad.f90 +++ b/src/Utilities/Idm/IdmLoad.f90 @@ -21,6 +21,7 @@ module IdmLoadModule implicit none private public :: simnam_load + public :: simtdis_load public :: load_models public :: load_exchanges public :: idm_df @@ -109,6 +110,11 @@ subroutine idm_da(iout) end if end do ! + ! -- deallocate input context SIM paths + call memorylist_remove('SIM', 'TDIS', idm_context) + call memorylist_remove('SIM', 'NAM', idm_context) + call memorylist_remove(component='SIM', context=idm_context) + ! ! -- return return end subroutine idm_da @@ -442,6 +448,18 @@ subroutine simnam_load(paramlog) return end subroutine simnam_load + !> @brief MODFLOW 6 tdis input load routine + !< + subroutine simtdis_load() + use SourceLoadModule, only: load_simtdis + ! + ! -- load sim tdis file + call load_simtdis() + ! + ! --return + return + end subroutine simtdis_load + !> @brief retrieve list of model dynamic loaders !< function dynamic_model_pkgs(modelname, modelfname, iout) & diff --git a/src/Utilities/Idm/SourceLoad.F90 b/src/Utilities/Idm/SourceLoad.F90 index a41a4393464..4339e21697a 100644 --- a/src/Utilities/Idm/SourceLoad.F90 +++ b/src/Utilities/Idm/SourceLoad.F90 @@ -18,7 +18,7 @@ module SourceLoadModule private public :: create_input_loader public :: open_source_file - public :: load_modelnam, load_simnam + public :: load_modelnam, load_simnam, load_simtdis public :: remote_model_ndim contains @@ -174,6 +174,63 @@ subroutine load_simnam() return end subroutine load_simnam + subroutine load_simtdis() + ! -- modules + use SimVariablesModule, only: simfile, iout + use MemoryHelperModule, only: create_mem_path + use MemoryManagerModule, only: mem_setptr + use SimVariablesModule, only: idm_context + use SourceCommonModule, only: package_source_type + use IdmMf6FileModule, only: input_load + ! -- dummy + ! -- locals + character(len=LENMEMPATH) :: input_mempath + type(ModflowInputType) :: mf6_input + character(len=LENPACKAGENAME) :: source_type + character(len=:), pointer :: tdis6 + logical :: lexist + ! + ! -- set input memory path + input_mempath = create_mem_path('SIM', 'NAM', idm_context) + ! + ! -- set pointers to input context timing params + call mem_setptr(tdis6, 'TDIS6', input_mempath) + ! + ! -- create timing + if (tdis6 /= '') then + ! + ! -- set source type + source_type = package_source_type(tdis6) + ! + select case (source_type) + case ('MF6FILE') + ! + inquire (file=trim(adjustl(tdis6)), exist=lexist) + ! + if (lexist) then + ! + ! -- create description of input + mf6_input = getModflowInput('TDIS6', 'SIM', 'TDIS', & + 'SIM', 'TDIS', simfile) + ! + ! -- open namfile and load to input context + call input_load(tdis6, mf6_input, simfile, iout) + ! + else + write (errmsg, '(a)') & + 'Simulation TIMING input file "'//trim(tdis6)// & + '" does not exist.' + call store_error(errmsg) + call store_error_filename(simfile) + end if + case default + end select + end if + ! + ! -- return + return + end subroutine load_simtdis + function remote_model_ndim(mtype, mfname) result(ncelldim) use SourceCommonModule, only: package_source_type use ConstantsModule, only: LINELENGTH diff --git a/src/Utilities/Idm/selector/IdmSimDfnSelector.f90 b/src/Utilities/Idm/selector/IdmSimDfnSelector.f90 index bf18e39f182..d5701798ccb 100644 --- a/src/Utilities/Idm/selector/IdmSimDfnSelector.f90 +++ b/src/Utilities/Idm/selector/IdmSimDfnSelector.f90 @@ -6,6 +6,7 @@ module IdmSimDfnSelectorModule use InputDefinitionModule, only: InputParamDefinitionType, & InputBlockDefinitionType use SimNamInputModule + use SimTdisInputModule implicit none private @@ -36,6 +37,8 @@ function sim_param_definitions(subcomponent) result(input_definition) select case (subcomponent) case ('NAM') call set_param_pointer(input_definition, sim_nam_param_definitions) + case ('TDIS') + call set_param_pointer(input_definition, sim_tdis_param_definitions) case default end select return @@ -48,6 +51,8 @@ function sim_aggregate_definitions(subcomponent) result(input_definition) select case (subcomponent) case ('NAM') call set_param_pointer(input_definition, sim_nam_aggregate_definitions) + case ('TDIS') + call set_param_pointer(input_definition, sim_tdis_aggregate_definitions) case default end select return @@ -60,6 +65,8 @@ function sim_block_definitions(subcomponent) result(input_definition) select case (subcomponent) case ('NAM') call set_block_pointer(input_definition, sim_nam_block_definitions) + case ('TDIS') + call set_block_pointer(input_definition, sim_tdis_block_definitions) case default end select return @@ -71,6 +78,8 @@ function sim_idm_multi_package(subcomponent) result(multi_package) select case (subcomponent) case ('NAM') multi_package = sim_nam_multi_package + case ('TDIS') + multi_package = sim_tdis_multi_package case default call store_error('Idm selector subcomponent not found; '//& &'component="SIM"'//& @@ -86,6 +95,8 @@ function sim_idm_integrated(subcomponent) result(integrated) select case (subcomponent) case ('NAM') integrated = .true. + case ('TDIS') + integrated = .true. case default end select return diff --git a/src/meson.build b/src/meson.build index 8bd2cb66d93..51cc3f51d56 100644 --- a/src/meson.build +++ b/src/meson.build @@ -161,6 +161,7 @@ modflow_sources = files( 'Solution' / 'SolutionFactory.F90', 'Solution' / 'SolutionGroup.f90', 'Timing' / 'ats.f90', + 'Timing' / 'simtdisidm.f90', 'Timing' / 'tdis.f90', 'Utilities' / 'ArrayRead' / 'ArrayReaderBase.f90', 'Utilities' / 'ArrayRead' / 'Double1dReader.f90', diff --git a/src/mf6core.f90 b/src/mf6core.f90 index 814cfe1857d..fd66e15a88a 100644 --- a/src/mf6core.f90 +++ b/src/mf6core.f90 @@ -268,7 +268,8 @@ subroutine static_input_load() ! -- modules use ConstantsModule, only: LENMEMPATH use SimVariablesModule, only: iout - use IdmLoadModule, only: simnam_load, load_models, load_exchanges + use IdmLoadModule, only: simnam_load, simtdis_load, & + load_models, load_exchanges use MemoryHelperModule, only: create_mem_path use MemoryManagerModule, only: mem_setptr, mem_allocate use SimVariablesModule, only: idm_context, iparamlog @@ -282,6 +283,9 @@ subroutine static_input_load() ! -- load simnam input context call simnam_load(iparamlog) ! + ! -- load tdis to input context + call simtdis_load() + ! ! -- allocate model load mask input_mempath = create_mem_path(component='SIM', context=idm_context) call mem_setptr(nummodels, 'NUMMODELS', input_mempath) diff --git a/utils/idmloader/scripts/dfn2f90.py b/utils/idmloader/scripts/dfn2f90.py index 5b5a0c58c99..de1ab63a976 100644 --- a/utils/idmloader/scripts/dfn2f90.py +++ b/utils/idmloader/scripts/dfn2f90.py @@ -962,6 +962,10 @@ def _write_master_component(self, fh=None): DFN_PATH / "sim-nam.dfn", SRC_PATH / "simnamidm.f90", ], + [ + DFN_PATH / "sim-tdis.dfn", + SRC_PATH / "Timing" / "simtdisidm.f90", + ], ] dfn_d = {}