diff --git a/make/makefile b/make/makefile index 8a868476077..721c8571989 100644 --- a/make/makefile +++ b/make/makefile @@ -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} \ @@ -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 \ @@ -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 \ @@ -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 \ @@ -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 \ @@ -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 \ @@ -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 \ @@ -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 \ @@ -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 \ diff --git a/msvs/mf6core.vfproj b/msvs/mf6core.vfproj index 16af059b9bc..fc83f1729b4 100644 --- a/msvs/mf6core.vfproj +++ b/msvs/mf6core.vfproj @@ -194,6 +194,7 @@ + diff --git a/src/Model/GroundWaterFlow/gwf3.f90 b/src/Model/GroundWaterFlow/gwf3.f90 index 8871a49cb18..00b44227c06 100644 --- a/src/Model/GroundWaterFlow/gwf3.f90 +++ b/src/Model/GroundWaterFlow/gwf3.f90 @@ -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 @@ -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 @@ -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 @@ -191,7 +221,6 @@ end subroutine gwf_cr !< subroutine gwf_df(this) ! -- modules - use ModelPackageInputsModule, only: NIUNIT_GWF ! -- dummy class(GwfModelType) :: this ! -- local diff --git a/src/Model/GroundWaterFlow/gwf3npf8.f90 b/src/Model/GroundWaterFlow/gwf3npf8.f90 index 8aad85144af..7872edcd030 100644 --- a/src/Model/GroundWaterFlow/gwf3npf8.f90 +++ b/src/Model/GroundWaterFlow/gwf3npf8.f90 @@ -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 diff --git a/src/Model/GroundWaterTransport/gwt1.f90 b/src/Model/GroundWaterTransport/gwt1.f90 index 6f5a1d09755..035b6c17d40 100644 --- a/src/Model/GroundWaterTransport/gwt1.f90 +++ b/src/Model/GroundWaterTransport/gwt1.f90 @@ -9,7 +9,7 @@ module GwtModule use KindModule, only: DP, I4B use ConstantsModule, only: LENFTYPE, LENMEMPATH, DZERO, DONE, & - LENPAKLOC, LENVARNAME + LENPAKLOC, LENVARNAME, LENPACKAGETYPE use VersionModule, only: write_listfile_header use NumericalModelModule, only: NumericalModelType @@ -27,6 +27,8 @@ module GwtModule public :: gwt_cr public :: GwtModelType public :: CastAsGwtModel + public :: GWT_NBASEPKG, GWT_NMULTIPKG + public :: GWT_BASEPKG, GWT_MULTIPKG character(len=LENVARNAME), parameter :: dvt = 'CONCENTRATION ' !< dependent variable type, varies based on model type character(len=LENVARNAME), parameter :: dvu = 'MASS ' !< dependent variable unit of measure, either "mass" or "energy" character(len=LENVARNAME), parameter :: dvua = 'M ' !< abbreviation of the dependent variable unit of measure, either "M" or "E" @@ -62,6 +64,33 @@ module GwtModule end type GwtModelType + !> @brief GWT base package array descriptors + !! + !! GWT6 model base package types. Only listed packages are candidates + !! for input and these will be loaded in the order specified. + !< + integer(I4B), parameter :: GWT_NBASEPKG = 50 + character(len=LENPACKAGETYPE), dimension(GWT_NBASEPKG) :: GWT_BASEPKG + data GWT_BASEPKG/'DIS6 ', 'DISV6', 'DISU6', ' ', ' ', & ! 5 + &'IC6 ', 'FMI6 ', 'MST6 ', 'ADV6 ', ' ', & ! 10 + &'DSP6 ', 'SSM6 ', 'MVT6 ', 'OC6 ', ' ', & ! 15 + &'OBS6 ', ' ', ' ', ' ', ' ', & ! 20 + &30*' '/ ! 50 + + !> @brief GWT multi package array descriptors + !! + !! GWT6 model multi-instance package types. Only listed packages are + !! candidates for input and these will be loaded in the order specified. + !< + integer(I4B), parameter :: GWT_NMULTIPKG = 50 + character(len=LENPACKAGETYPE), dimension(GWT_NMULTIPKG) :: GWT_MULTIPKG + data GWT_MULTIPKG/'CNC6 ', 'SRC6 ', 'LKT6 ', 'IST6 ', ' ', & ! 5 + &'SFT6 ', 'MWT6 ', 'UZT6 ', 'API6 ', ' ', & ! 10 + &40*' '/ ! 50 + + ! -- size of supported model package arrays + integer(I4B), parameter :: NIUNIT_GWT = GWT_NBASEPKG + GWT_NMULTIPKG + contains !> @brief Create a new groundwater transport model object @@ -74,7 +103,7 @@ subroutine gwt_cr(filename, id, modelname) use MemoryHelperModule, only: create_mem_path use MemoryManagerExtModule, only: mem_set_value use SimVariablesModule, only: idm_context - use GwfNamInputModule, only: GwfNamParamFoundType + use GwtNamInputModule, only: GwtNamParamFoundType use BudgetModule, only: budget_cr ! -- dummy character(len=*), intent(in) :: filename @@ -86,7 +115,7 @@ subroutine gwt_cr(filename, id, modelname) class(BaseModelType), pointer :: model character(len=LENMEMPATH) :: input_mempath character(len=LINELENGTH) :: lst_fname - type(GwfNamParamFoundType) :: found + type(GwtNamParamFoundType) :: found ! ! -- Allocate a new GWT Model (this) allocate (this) @@ -146,7 +175,6 @@ end subroutine gwt_cr !< subroutine gwt_df(this) ! -- modules - use ModelPackageInputsModule, only: NIUNIT_GWT use SimModule, only: store_error ! -- dummy class(GwtModelType) :: this diff --git a/src/Model/ModelUtilities/BoundaryPackageExt.f90 b/src/Model/ModelUtilities/BoundaryPackageExt.f90 index 3063311b002..a7e4d2eb504 100644 --- a/src/Model/ModelUtilities/BoundaryPackageExt.f90 +++ b/src/Model/ModelUtilities/BoundaryPackageExt.f90 @@ -268,7 +268,7 @@ subroutine source_options(this) use MemoryManagerExtModule, only: mem_set_value use InputOutputModule, only: GetUnit, openfile use CharacterStringModule, only: CharacterStringType - use IdmLoadModule, only: filein_fname + use SourceCommonModule, only: filein_fname ! -- dummy variables class(BndExtType), intent(inout) :: this !< BndExtType object ! -- local variables diff --git a/src/Model/ModelUtilities/ModelPackageInput.f90 b/src/Model/ModelUtilities/ModelPackageInput.f90 new file mode 100644 index 00000000000..09782fd08d8 --- /dev/null +++ b/src/Model/ModelUtilities/ModelPackageInput.f90 @@ -0,0 +1,99 @@ +!> @brief This module contains the ModelPackageInputModule +!! +!! Add an input model type to routines in this module +!! to integrate the Model with IDM. +!! +!< +module ModelPackageInputModule + + use KindModule, only: DP, I4B, LGP + use SimVariablesModule, only: errmsg + use ConstantsModule, only: LENFTYPE, LENPACKAGETYPE + use SimModule, only: store_error, store_error_filename + use GwfModule, only: GWF_NBASEPKG, GWF_NMULTIPKG, & + GWF_BASEPKG, GWF_MULTIPKG + use GwtModule, only: GWT_NBASEPKG, GWT_NMULTIPKG, & + GWT_BASEPKG, GWT_MULTIPKG + + implicit none + private + public :: supported_model_packages + public :: multi_package_type + +contains + + !> @brief set supported package types for model + !! + !! Allocate a list of package types supported + !! by the model. Base packages should be listed + !! first as list determines load order. + !! + !< + subroutine supported_model_packages(mtype, pkgtypes, numpkgs) + ! -- modules + ! -- dummy + character(len=LENFTYPE), intent(in) :: mtype + character(len=LENPACKAGETYPE), dimension(:), allocatable, & + intent(inout) :: pkgtypes + integer(I4B), intent(inout) :: numpkgs + ! -- local + ! + select case (mtype) + case ('GWF6') + numpkgs = GWF_NBASEPKG + GWF_NMULTIPKG + allocate (pkgtypes(numpkgs)) + pkgtypes = [GWF_BASEPKG, GWF_MULTIPKG] + ! + case ('GWT6') + numpkgs = GWT_NBASEPKG + GWT_NMULTIPKG + allocate (pkgtypes(numpkgs)) + pkgtypes = [GWT_BASEPKG, GWT_MULTIPKG] + ! + case default + end select + ! + ! -- return + return + end subroutine supported_model_packages + + !> @brief Is the package multi-instance + !< + function multi_package_type(mtype_component, ptype_component, pkgtype) & + result(multi_package) + ! -- modules + ! -- dummy + character(len=LENFTYPE), intent(in) :: mtype_component + character(len=LENFTYPE), intent(in) :: ptype_component + character(len=LENFTYPE), intent(in) :: pkgtype + ! -- return + logical(LGP) :: multi_package + ! -- local + integer(I4B) :: n + ! + multi_package = .false. + ! + select case (mtype_component) + case ('GWF') + do n = 1, GWF_NMULTIPKG + if (GWF_MULTIPKG(n) == pkgtype) then + multi_package = .true. + exit + end if + end do + ! + case ('GWT') + do n = 1, GWT_NMULTIPKG + if (GWT_MULTIPKG(n) == pkgtype) then + multi_package = .true. + exit + end if + end do + ! + case default + end select + ! + ! -- return + return + end function multi_package_type + +end module ModelPackageInputModule diff --git a/src/Utilities/Idm/IdmLoad.f90 b/src/Utilities/Idm/IdmLoad.f90 index fe6d5b263e6..63690c9863b 100644 --- a/src/Utilities/Idm/IdmLoad.f90 +++ b/src/Utilities/Idm/IdmLoad.f90 @@ -21,7 +21,6 @@ module IdmLoadModule private public :: simnam_load public :: load_models - public :: filein_fname public :: idm_df public :: idm_rp public :: idm_ad @@ -31,56 +30,6 @@ module IdmLoadModule contains - !> @brief enforce and set a single input filename provided via FILEIN keyword - !! - !! Set a FILEIN filename provided via an OPTIONS block. - !! Only use this function if a maximum of one FILEIN file name - !! string is expected. - !! - !! Return true if single FILEIN file name found and set, return - !! false if FILEIN tag not found. - !! - !< - function filein_fname(filename, tagname, input_mempath, input_fname) & - result(found) - use SimModule, only: store_error, store_error_filename - use MemoryManagerModule, only: mem_setptr, get_isize - use CharacterStringModule, only: CharacterStringType - character(len=*), intent(inout) :: filename - character(len=*), intent(in) :: tagname - character(len=*), intent(in) :: input_mempath - character(len=*), intent(in) :: input_fname - logical(LGP) :: found - type(CharacterStringType), dimension(:), pointer, & - contiguous :: fnames - integer(I4B) :: isize - ! - ! -- initialize - found = .false. - filename = '' - ! - call get_isize(tagname, input_mempath, isize) - ! - if (isize > 0) then - ! - if (isize /= 1) then - errmsg = 'Multiple FILEIN keywords detected for tag "'//trim(tagname)// & - '" in OPTIONS block. Only one entry allowed.' - call store_error(errmsg) - call store_error_filename(input_fname) - end if - ! - call mem_setptr(fnames, tagname, input_mempath) - ! - filename = fnames(1) - found = .true. - ! - end if - ! - ! -- return - return - end function filein_fname - !> @brief advance package dynamic data for period steps !< subroutine idm_df() diff --git a/src/Utilities/Idm/ModelPackageInputs.f90 b/src/Utilities/Idm/ModelPackageInputs.f90 index 07ab590fe05..842cac96b11 100644 --- a/src/Utilities/Idm/ModelPackageInputs.f90 +++ b/src/Utilities/Idm/ModelPackageInputs.f90 @@ -17,46 +17,8 @@ module ModelPackageInputsModule implicit none private - public :: NIUNIT_GWF, NIUNIT_GWT public :: ModelPackageInputsType - ! -- GWF base package types, ordered for memload - 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 - - ! -- GWF multi package types, ordered for memload - 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 - - ! -- GWT base package types, ordered for memload - integer(I4B), parameter :: GWT_NBASEPKG = 50 - character(len=LENPACKAGETYPE), dimension(GWT_NBASEPKG) :: GWT_BASEPKG - data GWT_BASEPKG/'DIS6 ', 'DISV6', 'DISU6', ' ', ' ', & ! 5 - &'IC6 ', 'FMI6 ', 'MST6 ', 'ADV6 ', ' ', & ! 10 - &'DSP6 ', 'SSM6 ', 'MVT6 ', 'OC6 ', ' ', & ! 15 - &'OBS6 ', ' ', ' ', ' ', ' ', & ! 20 - &30*' '/ ! 50 - - ! -- GWT multi package types, ordered for memload - integer(I4B), parameter :: GWT_NMULTIPKG = 50 - character(len=LENPACKAGETYPE), dimension(GWT_NMULTIPKG) :: GWT_MULTIPKG - data GWT_MULTIPKG/'CNC6 ', 'SRC6 ', 'LKT6 ', 'IST6 ', ' ', & ! 5 - &'SFT6 ', 'MWT6 ', 'UZT6 ', 'API6 ', ' ', & ! 10 - &40*' '/ ! 50 - - ! -- size of supported model package arrays - integer(I4B), parameter :: NIUNIT_GWF = GWF_NBASEPKG + GWF_NMULTIPKG - integer(I4B), parameter :: NIUNIT_GWT = GWT_NBASEPKG + GWT_NMULTIPKG - !> @brief derived type for loadable package type !! !! This derived type is used to store package instance @@ -64,9 +26,9 @@ module ModelPackageInputsModule !! !< type :: LoadablePackageType - ! -- package type, e.g. 'DIS6 or CHD6' + ! -- package type, e.g. 'DIS6' or 'CHD6' character(len=LENPACKAGETYPE) :: pkgtype - ! -- component type, e.g. 'DIS or CHD' + ! -- component type, e.g. 'DIS' or 'CHD' character(len=LENFTYPE) :: subcomponent_type ! -- package instance attribute arrays character(len=LINELENGTH), dimension(:), allocatable :: filenames @@ -125,41 +87,13 @@ module ModelPackageInputsModule contains - !> @brief set supported package types for model - !< - subroutine supported_model_packages(mtype, pkgtypes, numpkgs) - ! -- modules - ! -- dummy - character(len=LENFTYPE), intent(in) :: mtype - character(len=LENPACKAGETYPE), dimension(:), allocatable, & - intent(inout) :: pkgtypes - integer(I4B), intent(inout) :: numpkgs - ! -- local - ! - select case (mtype) - case ('GWF6') - numpkgs = GWF_NBASEPKG + GWF_NMULTIPKG - allocate (pkgtypes(numpkgs)) - pkgtypes = [GWF_BASEPKG, GWF_MULTIPKG] - ! - case ('GWT6') - numpkgs = GWT_NBASEPKG + GWT_NMULTIPKG - allocate (pkgtypes(numpkgs)) - pkgtypes = [GWT_BASEPKG, GWT_MULTIPKG] - ! - case default - end select - ! - ! -- return - return - end subroutine supported_model_packages - !> @brief does model support multiple instances of this package type !< function multi_pkg_type(mtype_component, ptype_component, pkgtype) & result(multi_pkg) ! -- modules use IdmDfnSelectorModule, only: idm_integrated, idm_multi_package + use ModelPackageInputModule, only: multi_package_type ! -- dummy character(len=LENFTYPE), intent(in) :: mtype_component character(len=LENFTYPE), intent(in) :: ptype_component @@ -167,35 +101,15 @@ function multi_pkg_type(mtype_component, ptype_component, pkgtype) & ! -- return logical(LGP) :: multi_pkg ! -- local - integer(I4B) :: n ! multi_pkg = .false. ! if (idm_integrated(mtype_component, ptype_component)) then - ! multi_pkg = idm_multi_package(mtype_component, ptype_component) ! else + multi_pkg = multi_package_type(mtype_component, ptype_component, pkgtype) ! - select case (mtype_component) - case ('GWF') - do n = 1, GWF_NMULTIPKG - if (GWF_MULTIPKG(n) == pkgtype) then - multi_pkg = .true. - exit - end if - end do - ! - case ('GWT') - do n = 1, GWT_NMULTIPKG - if (GWT_MULTIPKG(n) == pkgtype) then - multi_pkg = .true. - exit - end if - end do - ! - case default - end select end if ! ! -- return @@ -323,6 +237,7 @@ subroutine modelpkgs_init(this, modeltype, modelfname, modelname, iout) use MemoryManagerModule, only: mem_allocate use SimVariablesModule, only: idm_context use SourceCommonModule, only: idm_component_type + use ModelPackageInputModule, only: supported_model_packages ! -- dummy class(ModelPackageInputsType) :: this character(len=*), intent(in) :: modeltype diff --git a/src/Utilities/Idm/SourceCommon.f90 b/src/Utilities/Idm/SourceCommon.f90 index e16f22ee61a..c070a53555d 100644 --- a/src/Utilities/Idm/SourceCommon.f90 +++ b/src/Utilities/Idm/SourceCommon.f90 @@ -21,6 +21,7 @@ module SourceCommonModule public :: mem_allocate_naux public :: file_ext public :: ifind_charstr + public :: filein_fname contains @@ -377,4 +378,54 @@ function ifind_charstr(array, str) return end function ifind_charstr + !> @brief enforce and set a single input filename provided via FILEIN keyword + !! + !! Set a FILEIN filename provided via an OPTIONS block. + !! Only use this function if a maximum of one FILEIN file name + !! string is expected. + !! + !! Return true if single FILEIN file name found and set, return + !! false if FILEIN tag not found. + !! + !< + function filein_fname(filename, tagname, input_mempath, input_fname) & + result(found) + use SimModule, only: store_error, store_error_filename + use MemoryManagerModule, only: mem_setptr, get_isize + use CharacterStringModule, only: CharacterStringType + character(len=*), intent(inout) :: filename + character(len=*), intent(in) :: tagname + character(len=*), intent(in) :: input_mempath + character(len=*), intent(in) :: input_fname + logical(LGP) :: found + type(CharacterStringType), dimension(:), pointer, & + contiguous :: fnames + integer(I4B) :: isize + ! + ! -- initialize + found = .false. + filename = '' + ! + call get_isize(tagname, input_mempath, isize) + ! + if (isize > 0) then + ! + if (isize /= 1) then + errmsg = 'Multiple FILEIN keywords detected for tag "'//trim(tagname)// & + '" in OPTIONS block. Only one entry allowed.' + call store_error(errmsg) + call store_error_filename(input_fname) + end if + ! + call mem_setptr(fnames, tagname, input_mempath) + ! + filename = fnames(1) + found = .true. + ! + end if + ! + ! -- return + return + end function filein_fname + end module SourceCommonModule diff --git a/src/meson.build b/src/meson.build index f1563b31665..e9a2bb01386 100644 --- a/src/meson.build +++ b/src/meson.build @@ -120,6 +120,7 @@ modflow_sources = files( 'Model' / 'ModelUtilities' / 'GwfVscInputData.f90', 'Model' / 'ModelUtilities' / 'GwtDspOptions.f90', 'Model' / 'ModelUtilities' / 'GwtSpc.f90', + 'Model' / 'ModelUtilities' / 'ModelPackageInput.f90', 'Model' / 'ModelUtilities' / 'Mover.f90', 'Model' / 'ModelUtilities' / 'PackageMover.f90', 'Model' / 'ModelUtilities' / 'SfrCrossSectionManager.f90', diff --git a/utils/mf5to6/make/makefile b/utils/mf5to6/make/makefile index 781a93242a8..bc180329a32 100644 --- a/utils/mf5to6/make/makefile +++ b/utils/mf5to6/make/makefile @@ -5,10 +5,10 @@ include ./makedefaults # Define the source file directories SOURCEDIR1=../src -SOURCEDIR2=../src/NWT -SOURCEDIR3=../src/LGR -SOURCEDIR4=../src/Preproc -SOURCEDIR5=../src/MF2005 +SOURCEDIR2=../src/LGR +SOURCEDIR3=../src/Preproc +SOURCEDIR4=../src/MF2005 +SOURCEDIR5=../src/NWT SOURCEDIR6=../../../src/Utilities/Memory SOURCEDIR7=../../../src/Utilities/TimeSeries SOURCEDIR8=../../../src/Utilities