Skip to content

Commit

Permalink
refactor(idm): relocate model package lists to model modules (#1437)
Browse files Browse the repository at this point in the history
* relocate model package lists to model modules

* rebuild makefiles

---------

Co-authored-by: mjreno <[email protected]>
  • Loading branch information
mjreno and mjreno authored Nov 11, 2023
1 parent 7e45fa9 commit c622cca
Show file tree
Hide file tree
Showing 12 changed files with 308 additions and 234 deletions.
163 changes: 82 additions & 81 deletions make/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,35 @@ include ./makedefaults
# Define the source file directories
SOURCEDIR1=../src
SOURCEDIR2=../src/Exchange
SOURCEDIR3=../src/Distributed
SOURCEDIR4=../src/Solution
SOURCEDIR5=../src/Solution/LinearMethods
SOURCEDIR6=../src/Solution/PETSc
SOURCEDIR7=../src/Timing
SOURCEDIR8=../src/Utilities
SOURCEDIR9=../src/Utilities/Idm
SOURCEDIR10=../src/Utilities/Idm/selector
SOURCEDIR11=../src/Utilities/Idm/mf6blockfile
SOURCEDIR12=../src/Utilities/TimeSeries
SOURCEDIR13=../src/Utilities/Memory
SOURCEDIR14=../src/Utilities/OutputControl
SOURCEDIR15=../src/Utilities/ArrayRead
SOURCEDIR16=../src/Utilities/Libraries
SOURCEDIR17=../src/Utilities/Libraries/rcm
SOURCEDIR18=../src/Utilities/Libraries/blas
SOURCEDIR19=../src/Utilities/Libraries/sparskit2
SOURCEDIR20=../src/Utilities/Libraries/daglib
SOURCEDIR21=../src/Utilities/Libraries/sparsekit
SOURCEDIR22=../src/Utilities/Vector
SOURCEDIR23=../src/Utilities/Matrix
SOURCEDIR24=../src/Utilities/Observation
SOURCEDIR25=../src/Model
SOURCEDIR26=../src/Model/Connection
SOURCEDIR27=../src/Model/GroundWaterTransport
SOURCEDIR28=../src/Model/ModelUtilities
SOURCEDIR29=../src/Model/GroundWaterFlow
SOURCEDIR30=../src/Model/TransportModel
SOURCEDIR31=../src/Model/Geometry
SOURCEDIR3=../src/Model
SOURCEDIR4=../src/Model/Geometry
SOURCEDIR5=../src/Model/TransportModel
SOURCEDIR6=../src/Model/ModelUtilities
SOURCEDIR7=../src/Model/Connection
SOURCEDIR8=../src/Model/GroundWaterTransport
SOURCEDIR9=../src/Model/GroundWaterFlow
SOURCEDIR10=../src/Distributed
SOURCEDIR11=../src/Solution
SOURCEDIR12=../src/Solution/PETSc
SOURCEDIR13=../src/Solution/LinearMethods
SOURCEDIR14=../src/Timing
SOURCEDIR15=../src/Utilities
SOURCEDIR16=../src/Utilities/TimeSeries
SOURCEDIR17=../src/Utilities/Libraries
SOURCEDIR18=../src/Utilities/Libraries/rcm
SOURCEDIR19=../src/Utilities/Libraries/sparsekit
SOURCEDIR20=../src/Utilities/Libraries/sparskit2
SOURCEDIR21=../src/Utilities/Libraries/blas
SOURCEDIR22=../src/Utilities/Libraries/daglib
SOURCEDIR23=../src/Utilities/Idm
SOURCEDIR24=../src/Utilities/Idm/selector
SOURCEDIR25=../src/Utilities/Idm/mf6blockfile
SOURCEDIR26=../src/Utilities/Matrix
SOURCEDIR27=../src/Utilities/Vector
SOURCEDIR28=../src/Utilities/Observation
SOURCEDIR29=../src/Utilities/OutputControl
SOURCEDIR30=../src/Utilities/Memory
SOURCEDIR31=../src/Utilities/ArrayRead

VPATH = \
${SOURCEDIR1} \
Expand Down Expand Up @@ -90,10 +90,32 @@ $(OBJDIR)/MemoryHelper.o \
$(OBJDIR)/CharString.o \
$(OBJDIR)/Memory.o \
$(OBJDIR)/List.o \
$(OBJDIR)/InputDefinition.o \
$(OBJDIR)/LongLineReader.o \
$(OBJDIR)/DevFeature.o \
$(OBJDIR)/MemoryList.o \
$(OBJDIR)/TimeSeriesRecord.o \
$(OBJDIR)/BlockParser.o \
$(OBJDIR)/MemoryManager.o \
$(OBJDIR)/TimeSeries.o \
$(OBJDIR)/ats.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)/simnamidm.o \
$(OBJDIR)/gwt1idm.o \
$(OBJDIR)/gwt1ic1idm.o \
Expand All @@ -117,72 +139,29 @@ $(OBJDIR)/gwf3disv8idm.o \
$(OBJDIR)/gwf3disu8idm.o \
$(OBJDIR)/gwf3dis8idm.o \
$(OBJDIR)/gwf3chd8idm.o \
$(OBJDIR)/TimeSeriesRecord.o \
$(OBJDIR)/BlockParser.o \
$(OBJDIR)/MemoryManager.o \
$(OBJDIR)/TimeArraySeries.o \
$(OBJDIR)/ObsOutputList.o \
$(OBJDIR)/Observe.o \
$(OBJDIR)/IdmSimDfnSelector.o \
$(OBJDIR)/IdmGwtDfnSelector.o \
$(OBJDIR)/IdmGwfDfnSelector.o \
$(OBJDIR)/TimeSeries.o \
$(OBJDIR)/ats.o \
$(OBJDIR)/IdmDfnSelector.o \
$(OBJDIR)/TimeArray.o \
$(OBJDIR)/ArrayReaders.o \
$(OBJDIR)/TimeSeriesLink.o \
$(OBJDIR)/TimeSeriesFileList.o \
$(OBJDIR)/tdis.o \
$(OBJDIR)/HashTable.o \
$(OBJDIR)/VectorBase.o \
$(OBJDIR)/Sparse.o \
$(OBJDIR)/DisvGeom.o \
$(OBJDIR)/ArrayReaderBase.o \
$(OBJDIR)/STLVecInt.o \
$(OBJDIR)/ModflowInput.o \
$(OBJDIR)/MemoryManagerExt.o \
$(OBJDIR)/TimeArraySeries.o \
$(OBJDIR)/TimeSeriesManager.o \
$(OBJDIR)/SmoothingFunctions.o \
$(OBJDIR)/MatrixBase.o \
$(OBJDIR)/ListReader.o \
$(OBJDIR)/Connections.o \
$(OBJDIR)/Integer2dReader.o \
$(OBJDIR)/StructVector.o \
$(OBJDIR)/IdmLogger.o \
$(OBJDIR)/DefinitionSelect.o \
$(OBJDIR)/InputLoadType.o \
$(OBJDIR)/TimeArraySeriesLink.o \
$(OBJDIR)/DiscretizationBase.o \
$(OBJDIR)/Integer1dReader.o \
$(OBJDIR)/Double2dReader.o \
$(OBJDIR)/Double1dReader.o \
$(OBJDIR)/StructArray.o \
$(OBJDIR)/BoundInputContext.o \
$(OBJDIR)/AsciiInputLoadType.o \
$(OBJDIR)/TimeArraySeriesManager.o \
$(OBJDIR)/SourceCommon.o \
$(OBJDIR)/LayeredArrayReader.o \
$(OBJDIR)/ObsOutput.o \
$(OBJDIR)/StressListInput.o \
$(OBJDIR)/StressGridInput.o \
$(OBJDIR)/LoadMf6File.o \
$(OBJDIR)/ObsOutputList.o \
$(OBJDIR)/Observe.o \
$(OBJDIR)/IdmMf6File.o \
$(OBJDIR)/sort.o \
$(OBJDIR)/ObsUtility.o \
$(OBJDIR)/ObsContainer.o \
$(OBJDIR)/BudgetFileReader.o \
$(OBJDIR)/SourceLoad.o \
$(OBJDIR)/ModelPackageInputs.o \
$(OBJDIR)/IdmDfnSelector.o \
$(OBJDIR)/TimeArraySeriesManager.o \
$(OBJDIR)/PackageMover.o \
$(OBJDIR)/Obs3.o \
$(OBJDIR)/NumericalPackage.o \
$(OBJDIR)/Budget.o \
$(OBJDIR)/BudgetTerm.o \
$(OBJDIR)/sort.o \
$(OBJDIR)/SfrCrossSectionUtils.o \
$(OBJDIR)/IdmLoad.o \
$(OBJDIR)/SourceCommon.o \
$(OBJDIR)/BoundaryPackage.o \
$(OBJDIR)/VirtualBase.o \
$(OBJDIR)/STLVecInt.o \
$(OBJDIR)/BaseModel.o \
$(OBJDIR)/PackageBudget.o \
$(OBJDIR)/HeadFileReader.o \
Expand Down Expand Up @@ -225,6 +204,7 @@ $(OBJDIR)/InterfaceMap.o \
$(OBJDIR)/SeqVector.o \
$(OBJDIR)/ImsLinearSettings.o \
$(OBJDIR)/ConvergenceSummary.o \
$(OBJDIR)/ArrayReaderBase.o \
$(OBJDIR)/CellWithNbrs.o \
$(OBJDIR)/NumericalExchange.o \
$(OBJDIR)/tsp1ssm1.o \
Expand All @@ -250,6 +230,8 @@ $(OBJDIR)/VirtualSolution.o \
$(OBJDIR)/SparseMatrix.o \
$(OBJDIR)/LinearSolverBase.o \
$(OBJDIR)/ims8reordering.o \
$(OBJDIR)/ModflowInput.o \
$(OBJDIR)/Integer2dReader.o \
$(OBJDIR)/VirtualExchange.o \
$(OBJDIR)/GridSorting.o \
$(OBJDIR)/DisConnExchange.o \
Expand Down Expand Up @@ -279,6 +261,13 @@ $(OBJDIR)/gwf3chd8.o \
$(OBJDIR)/RouterBase.o \
$(OBJDIR)/ImsLinearSolver.o \
$(OBJDIR)/ims8base.o \
$(OBJDIR)/StructVector.o \
$(OBJDIR)/IdmLogger.o \
$(OBJDIR)/DefinitionSelect.o \
$(OBJDIR)/InputLoadType.o \
$(OBJDIR)/Integer1dReader.o \
$(OBJDIR)/Double2dReader.o \
$(OBJDIR)/Double1dReader.o \
$(OBJDIR)/GridConnection.o \
$(OBJDIR)/DistributedVariable.o \
$(OBJDIR)/gwt1.o \
Expand All @@ -288,6 +277,10 @@ $(OBJDIR)/Timer.o \
$(OBJDIR)/LinearSolverFactory.o \
$(OBJDIR)/ims8linear.o \
$(OBJDIR)/BaseSolution.o \
$(OBJDIR)/StructArray.o \
$(OBJDIR)/BoundInputContext.o \
$(OBJDIR)/AsciiInputLoadType.o \
$(OBJDIR)/LayeredArrayReader.o \
$(OBJDIR)/ExplicitModel.o \
$(OBJDIR)/SpatialModelConnection.o \
$(OBJDIR)/GwtInterfaceModel.o \
Expand All @@ -297,11 +290,16 @@ $(OBJDIR)/GwfGwfExchange.o \
$(OBJDIR)/RouterFactory.o \
$(OBJDIR)/NumericalSolution.o \
$(OBJDIR)/MappedMemory.o \
$(OBJDIR)/StressListInput.o \
$(OBJDIR)/StressGridInput.o \
$(OBJDIR)/LoadMf6File.o \
$(OBJDIR)/ExplicitSolution.o \
$(OBJDIR)/GwtGwtConnection.o \
$(OBJDIR)/GwfGwfConnection.o \
$(OBJDIR)/VirtualDataManager.o \
$(OBJDIR)/Mapper.o \
$(OBJDIR)/IdmMf6File.o \
$(OBJDIR)/ModelPackageInput.o \
$(OBJDIR)/VirtualGwtModel.o \
$(OBJDIR)/VirtualGwtExchange.o \
$(OBJDIR)/VirtualGwfModel.o \
Expand All @@ -310,8 +308,11 @@ $(OBJDIR)/SolutionGroup.o \
$(OBJDIR)/SolutionFactory.o \
$(OBJDIR)/GwfGwtExchange.o \
$(OBJDIR)/RunControl.o \
$(OBJDIR)/SourceLoad.o \
$(OBJDIR)/ModelPackageInputs.o \
$(OBJDIR)/SimulationCreate.o \
$(OBJDIR)/RunControlFactory.o \
$(OBJDIR)/IdmLoad.o \
$(OBJDIR)/ConnectionBuilder.o \
$(OBJDIR)/comarg.o \
$(OBJDIR)/mf6core.o \
Expand Down
1 change: 1 addition & 0 deletions msvs/mf6core.vfproj
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@
<File RelativePath="..\src\Model\ModelUtilities\GwfVscInputData.f90"/>
<File RelativePath="..\src\Model\ModelUtilities\GwtDspOptions.f90"/>
<File RelativePath="..\src\Model\ModelUtilities\GwtSpc.f90"/>
<File RelativePath="..\src\Model\ModelUtilities\ModelPackageInput.f90"/>
<File RelativePath="..\src\Model\ModelUtilities\Mover.f90"/>
<File RelativePath="..\src\Model\ModelUtilities\PackageMover.f90"/>
<File RelativePath="..\src\Model\ModelUtilities\SfrCrossSectionManager.f90"/>
Expand Down
33 changes: 31 additions & 2 deletions src/Model/GroundWaterFlow/gwf3.f90
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module GwfModule
use KindModule, only: DP, I4B
use InputOutputModule, only: ParseLine, upcase, lowcase
use ConstantsModule, only: LENFTYPE, LENMEMPATH, LENPAKLOC, DZERO, &
DEM1, DTEN, DEP20
DEM1, DTEN, DEP20, LENPACKAGETYPE
use VersionModule, only: write_listfile_header
use NumericalModelModule, only: NumericalModelType
use BaseDisModule, only: DisBaseType
Expand Down Expand Up @@ -32,6 +32,8 @@ module GwfModule
public :: gwf_cr
public :: GwfModelType
public :: CastAsGwfModel
public :: GWF_NBASEPKG, GWF_NMULTIPKG
public :: GWF_BASEPKG, GWF_MULTIPKG

type, extends(NumericalModelType) :: GwfModelType

Expand Down Expand Up @@ -99,6 +101,34 @@ module GwfModule
!
end type GwfModelType

!> @brief GWF base package array descriptors
!!
!! GWF6 model base package types. Only listed packages are candidates
!! for input and these will be loaded in the order specified.
!<
integer(I4B), parameter :: GWF_NBASEPKG = 50
character(len=LENPACKAGETYPE), dimension(GWF_NBASEPKG) :: GWF_BASEPKG
data GWF_BASEPKG/'DIS6 ', 'DISV6', 'DISU6', ' ', ' ', & ! 5
&'NPF6 ', 'BUY6 ', 'VSC6 ', 'GNC6 ', ' ', & ! 10
&'HFB6 ', 'STO6 ', 'IC6 ', ' ', ' ', & ! 15
&'MVR6 ', 'OC6 ', 'OBS6 ', ' ', ' ', & ! 20
&30*' '/ ! 50

!> @brief GWF multi package array descriptors
!!
!! GWF6 model multi-instance package types. Only listed packages are
!! candidates for input and these will be loaded in the order specified.
!<
integer(I4B), parameter :: GWF_NMULTIPKG = 50
character(len=LENPACKAGETYPE), dimension(GWF_NMULTIPKG) :: GWF_MULTIPKG
data GWF_MULTIPKG/'WEL6 ', 'DRN6 ', 'RIV6 ', 'GHB6 ', ' ', & ! 5
&'RCH6 ', 'EVT6 ', 'CHD6 ', 'CSUB6', ' ', & ! 10
&'MAW6 ', 'SFR6 ', 'LAK6 ', 'UZF6 ', 'API6 ', & ! 15
&35*' '/ ! 50

! -- size of supported model package arrays
integer(I4B), parameter :: NIUNIT_GWF = GWF_NBASEPKG + GWF_NMULTIPKG

contains

!> @brief Create a new groundwater flow model object
Expand Down Expand Up @@ -191,7 +221,6 @@ end subroutine gwf_cr
!<
subroutine gwf_df(this)
! -- modules
use ModelPackageInputsModule, only: NIUNIT_GWF
! -- dummy
class(GwfModelType) :: this
! -- local
Expand Down
2 changes: 1 addition & 1 deletion src/Model/GroundWaterFlow/gwf3npf8.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1475,7 +1475,7 @@ subroutine source_options(this)
use MemoryManagerExtModule, only: mem_set_value
use CharacterStringModule, only: CharacterStringType
use GwfNpfInputModule, only: GwfNpfParamFoundType
use IdmLoadModule, only: filein_fname
use SourceCommonModule, only: filein_fname
! -- dummy
class(GwfNpftype) :: this
! -- locals
Expand Down
Loading

0 comments on commit c622cca

Please sign in to comment.