Skip to content

Commit

Permalink
use the input stress package load framework
Browse files Browse the repository at this point in the history
  • Loading branch information
mjreno authored and mjreno committed Aug 30, 2023
1 parent 633610f commit cb6ad7f
Show file tree
Hide file tree
Showing 13 changed files with 1,280 additions and 651 deletions.
77 changes: 39 additions & 38 deletions make/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,33 @@ $(OBJDIR)/SmoothingFunctions.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)/gwt1dsp1idm.o \
$(OBJDIR)/gwt1disv1idm.o \
$(OBJDIR)/gwt1disu1idm.o \
$(OBJDIR)/gwt1dis1idm.o \
$(OBJDIR)/gwf3npf8idm.o \
$(OBJDIR)/gwf3idm.o \
$(OBJDIR)/gwf3disv8idm.o \
$(OBJDIR)/gwf3disu8idm.o \
$(OBJDIR)/gwf3dis8idm.o \
$(OBJDIR)/TimeArraySeries.o \
$(OBJDIR)/ObsOutputList.o \
$(OBJDIR)/Observe.o \
$(OBJDIR)/IdmSimDfnSelector.o \
$(OBJDIR)/IdmGwtDfnSelector.o \
$(OBJDIR)/IdmGwfDfnSelector.o \
$(OBJDIR)/TimeArraySeriesLink.o \
$(OBJDIR)/ObsUtility.o \
$(OBJDIR)/ObsContainer.o \
$(OBJDIR)/BudgetFileReader.o \
$(OBJDIR)/IdmDfnSelector.o \
$(OBJDIR)/ArrayReaderBase.o \
$(OBJDIR)/TimeArraySeriesManager.o \
$(OBJDIR)/PackageMover.o \
$(OBJDIR)/Obs3.o \
Expand All @@ -126,29 +143,27 @@ $(OBJDIR)/Budget.o \
$(OBJDIR)/sort.o \
$(OBJDIR)/SfrCrossSectionUtils.o \
$(OBJDIR)/BudgetTerm.o \
$(OBJDIR)/VirtualBase.o \
$(OBJDIR)/STLVecInt.o \
$(OBJDIR)/ModflowInput.o \
$(OBJDIR)/MemoryManagerExt.o \
$(OBJDIR)/Integer2dReader.o \
$(OBJDIR)/VirtualBase.o \
$(OBJDIR)/BoundaryPackage.o \
$(OBJDIR)/BaseModel.o \
$(OBJDIR)/InputDefinition.o \
$(OBJDIR)/SfrCrossSectionManager.o \
$(OBJDIR)/dag_module.o \
$(OBJDIR)/BudgetObject.o \
$(OBJDIR)/StructVector.o \
$(OBJDIR)/IdmLogger.o \
$(OBJDIR)/DefinitionSelect.o \
$(OBJDIR)/InputLoadType.o \
$(OBJDIR)/Integer1dReader.o \
$(OBJDIR)/Double2dReader.o \
$(OBJDIR)/Double1dReader.o \
$(OBJDIR)/VirtualDataLists.o \
$(OBJDIR)/VirtualDataContainer.o \
$(OBJDIR)/SimStages.o \
$(OBJDIR)/NumericalModel.o \
$(OBJDIR)/simnamidm.o \
$(OBJDIR)/gwt1idm.o \
$(OBJDIR)/gwt1dsp1idm.o \
$(OBJDIR)/gwt1disv1idm.o \
$(OBJDIR)/gwt1disu1idm.o \
$(OBJDIR)/gwt1dis1idm.o \
$(OBJDIR)/gwf3npf8idm.o \
$(OBJDIR)/gwf3idm.o \
$(OBJDIR)/gwf3disv8idm.o \
$(OBJDIR)/gwf3disu8idm.o \
$(OBJDIR)/gwf3dis8idm.o \
$(OBJDIR)/PackageBudget.o \
$(OBJDIR)/HeadFileReader.o \
$(OBJDIR)/PrintSaveManager.o \
Expand All @@ -163,25 +178,28 @@ $(OBJDIR)/GwfVscInputData.o \
$(OBJDIR)/gwf3ghb8.o \
$(OBJDIR)/gwf3drn8.o \
$(OBJDIR)/IndexMap.o \
$(OBJDIR)/StructArray.o \
$(OBJDIR)/BoundInputContext.o \
$(OBJDIR)/AsciiInputLoadType.o \
$(OBJDIR)/SourceCommon.o \
$(OBJDIR)/LayeredArrayReader.o \
$(OBJDIR)/VirtualModel.o \
$(OBJDIR)/BaseExchange.o \
$(OBJDIR)/IdmSimDfnSelector.o \
$(OBJDIR)/IdmGwtDfnSelector.o \
$(OBJDIR)/IdmGwfDfnSelector.o \
$(OBJDIR)/UzfCellGroup.o \
$(OBJDIR)/gwt1fmi1.o \
$(OBJDIR)/OutputControlData.o \
$(OBJDIR)/gwf3ic8.o \
$(OBJDIR)/Xt3dInterface.o \
$(OBJDIR)/gwf3tvk8.o \
$(OBJDIR)/MemoryManagerExt.o \
$(OBJDIR)/gwf3vsc8.o \
$(OBJDIR)/GwfNpfOptions.o \
$(OBJDIR)/InterfaceMap.o \
$(OBJDIR)/SeqVector.o \
$(OBJDIR)/StressListInput.o \
$(OBJDIR)/StressGridInput.o \
$(OBJDIR)/LoadMf6File.o \
$(OBJDIR)/CellWithNbrs.o \
$(OBJDIR)/NumericalExchange.o \
$(OBJDIR)/IdmDfnSelector.o \
$(OBJDIR)/gwf3uzf8.o \
$(OBJDIR)/gwt1apt1.o \
$(OBJDIR)/GwtSpc.o \
Expand All @@ -201,7 +219,7 @@ $(OBJDIR)/VirtualSolution.o \
$(OBJDIR)/SparseMatrix.o \
$(OBJDIR)/LinearSolverBase.o \
$(OBJDIR)/ims8reordering.o \
$(OBJDIR)/ArrayReaderBase.o \
$(OBJDIR)/IdmMf6File.o \
$(OBJDIR)/VirtualExchange.o \
$(OBJDIR)/gwf3disu8.o \
$(OBJDIR)/GridSorting.o \
Expand Down Expand Up @@ -240,7 +258,7 @@ $(OBJDIR)/gwf3chd8.o \
$(OBJDIR)/RouterBase.o \
$(OBJDIR)/ImsLinearSolver.o \
$(OBJDIR)/ims8base.o \
$(OBJDIR)/Integer2dReader.o \
$(OBJDIR)/SourceLoad.o \
$(OBJDIR)/GridConnection.o \
$(OBJDIR)/DistributedVariable.o \
$(OBJDIR)/gwt1.o \
Expand All @@ -249,12 +267,8 @@ $(OBJDIR)/SerialRouter.o \
$(OBJDIR)/Timer.o \
$(OBJDIR)/LinearSolverFactory.o \
$(OBJDIR)/ims8linear.o \
$(OBJDIR)/IdmLoad.o \
$(OBJDIR)/BaseSolution.o \
$(OBJDIR)/StructVector.o \
$(OBJDIR)/IdmLogger.o \
$(OBJDIR)/Integer1dReader.o \
$(OBJDIR)/Double2dReader.o \
$(OBJDIR)/Double1dReader.o \
$(OBJDIR)/ExplicitModel.o \
$(OBJDIR)/SpatialModelConnection.o \
$(OBJDIR)/GwtInterfaceModel.o \
Expand All @@ -264,16 +278,11 @@ $(OBJDIR)/GwfGwfExchange.o \
$(OBJDIR)/RouterFactory.o \
$(OBJDIR)/NumericalSolution.o \
$(OBJDIR)/MappedMemory.o \
$(OBJDIR)/StructArray.o \
$(OBJDIR)/ModflowInput.o \
$(OBJDIR)/LayeredArrayReader.o \
$(OBJDIR)/DefinitionSelect.o \
$(OBJDIR)/ExplicitSolution.o \
$(OBJDIR)/GwtGwtConnection.o \
$(OBJDIR)/GwfGwfConnection.o \
$(OBJDIR)/VirtualDataManager.o \
$(OBJDIR)/Mapper.o \
$(OBJDIR)/LoadMf6File.o \
$(OBJDIR)/VirtualGwtModel.o \
$(OBJDIR)/VirtualGwtExchange.o \
$(OBJDIR)/VirtualGwfModel.o \
Expand All @@ -282,17 +291,11 @@ $(OBJDIR)/SolutionGroup.o \
$(OBJDIR)/SolutionFactory.o \
$(OBJDIR)/GwfGwtExchange.o \
$(OBJDIR)/RunControl.o \
$(OBJDIR)/IdmMf6File.o \
$(OBJDIR)/SimulationCreate.o \
$(OBJDIR)/RunControlFactory.o \
$(OBJDIR)/IdmSimulation.o \
$(OBJDIR)/ConnectionBuilder.o \
$(OBJDIR)/comarg.o \
$(OBJDIR)/InputLoadType.o \
$(OBJDIR)/mf6core.o \
$(OBJDIR)/BoundInputContext.o \
$(OBJDIR)/AsciiInputLoadType.o \
$(OBJDIR)/SourceCommon.o \
$(OBJDIR)/BaseGeometry.o \
$(OBJDIR)/mf6.o \
$(OBJDIR)/StringList.o \
Expand All @@ -302,8 +305,6 @@ $(OBJDIR)/sparsekit.o \
$(OBJDIR)/rcm.o \
$(OBJDIR)/blas1_d.o \
$(OBJDIR)/Iunit.o \
$(OBJDIR)/StressListInput.o \
$(OBJDIR)/StressGridInput.o \
$(OBJDIR)/RectangularGeometry.o \
$(OBJDIR)/CircularGeometry.o

Expand Down
5 changes: 3 additions & 2 deletions msvs/mf6core.vfproj
Original file line number Diff line number Diff line change
Expand Up @@ -280,13 +280,14 @@
<File RelativePath="..\src\Utilities\Idm\selector\IdmSimDfnSelector.f90"/></Filter>
<File RelativePath="..\src\Utilities\Idm\BoundInputContext.f90"/>
<File RelativePath="..\src\Utilities\Idm\DefinitionSelect.f90"/>
<File RelativePath="..\src\Utilities\Idm\IdmSimulation.f90"/>
<File RelativePath="..\src\Utilities\Idm\IdmLoad.f90"/>
<File RelativePath="..\src\Utilities\Idm\IdmLogger.f90"/>
<File RelativePath="..\src\Utilities\Idm\InputDefinition.f90"/>
<File RelativePath="..\src\Utilities\Idm\InputLoadType.f90"/>
<File RelativePath="..\src\Utilities\Idm\ModelPackageInputs.f90"/>
<File RelativePath="..\src\Utilities\Idm\ModflowInput.f90"/>
<File RelativePath="..\src\Utilities\Idm\SourceCommon.f90"/></Filter>
<File RelativePath="..\src\Utilities\Idm\SourceCommon.f90"/>
<File RelativePath="..\src\Utilities\Idm\SourceLoad.F90"/></Filter>
<Filter Name="Libraries">
<File RelativePath="..\src\Utilities\Libraries\blas\blas1_d.f90"/>
<File RelativePath="..\src\Utilities\Libraries\daglib\dag_module.f90"/>
Expand Down
37 changes: 27 additions & 10 deletions src/Model/GroundWaterFlow/gwf3npf8.f90
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module GwfNpfModule
use KindModule, only: DP, I4B
use SimVariablesModule, only: errmsg
use ConstantsModule, only: DZERO, DEM9, DEM8, DEM7, DEM6, DEM2, &
DHALF, DP9, DONE, DTWO, &
DLNLOW, DLNHIGH, &
Expand Down Expand Up @@ -1475,15 +1476,21 @@ subroutine source_options(this)
! SPECIFICATIONS:
! ------------------------------------------------------------------------------
! -- modules
use SimModule, only: store_error, store_error_filename
use MemoryManagerModule, only: mem_setptr, get_isize
use MemoryManagerExtModule, only: mem_set_value
use CharacterStringModule, only: CharacterStringType
use GwfNpfInputModule, only: GwfNpfParamFoundType
! -- dummy
class(GwfNpftype) :: this
! -- locals
character(len=LENVARNAME), dimension(3) :: cellavg_method = &
&[character(len=LENVARNAME) :: 'LOGARITHMIC', 'AMT-LMK', 'AMT-HMK']
type(GwfNpfParamFoundType) :: found
type(CharacterStringType), dimension(:), pointer, &
contiguous :: tvk6_fnames
character(len=LINELENGTH) :: tvk6_filename
integer(I4B) :: tvk6_isize, n
! ------------------------------------------------------------------------------
!
! -- update defaults with idm sourced values
Expand All @@ -1508,8 +1515,6 @@ subroutine source_options(this)
found%ik22overk)
call mem_set_value(this%ik33overk, 'IK33OVERK', this%input_mempath, &
found%ik33overk)
call mem_set_value(tvk6_filename, 'TVK6_FILENAME', this%input_mempath, &
found%tvk6_filename)
call mem_set_value(this%inewton, 'INEWTON', this%input_mempath, found%inewton)
call mem_set_value(this%iusgnrhc, 'IUSGNRHC', this%input_mempath, &
found%iusgnrhc)
Expand All @@ -1531,19 +1536,32 @@ subroutine source_options(this)
! -- save specific discharge active
if (found%isavspdis) this%icalcspdis = this%isavspdis
!
! -- TVK6 subpackage file spec provided
if (found%tvk6_filename) then
this%intvk = GetUnit()
call openfile(this%intvk, this%iout, tvk6_filename, 'TVK')
call tvk_cr(this%tvk, this%name_model, this%intvk, this%iout)
end if
!
! -- no newton specified
if (found%inewton) then
this%inewton = 0
this%iasym = 0
end if
!
call get_isize('TVK6_FILENAME', this%input_mempath, tvk6_isize)
!
if (tvk6_isize > 0) then
!
if (tvk6_isize /= 1) then
errmsg = 'Multiple TVK6 keywords detected in OPTIONS block.'// &
' Only one TVK6 entry allowed.'
call store_error(errmsg)
call store_error_filename(this%input_fname)
end if
!
call mem_setptr(tvk6_fnames, 'TVK6_FILENAME', this%input_mempath)
!
do n = 1, tvk6_isize
tvk6_filename = tvk6_fnames(n)
call openfile(this%intvk, this%iout, tvk6_filename, 'TVK')
call tvk_cr(this%tvk, this%name_model, this%intvk, this%iout)
end do
end if
!
! -- log options
if (this%iout > 0) then
call this%log_options(found)
Expand Down Expand Up @@ -1582,7 +1600,6 @@ subroutine check_options(this)
! -- dummy
class(GwfNpftype) :: this
! -- local
character(len=LINELENGTH) :: errmsg
! ------------------------------------------------------------------------------
! -- check if this%iusgnrhc has been enabled for a model that is not using
! the Newton-Raphson formulation
Expand Down
5 changes: 5 additions & 0 deletions src/Solution/ExplicitSolution.f90
Original file line number Diff line number Diff line change
Expand Up @@ -259,12 +259,17 @@ end subroutine sln_ca
!> @ brief Solution prepare to solve
!<
subroutine prepareSolve(this)
! -- modules
use IdmLoadModule, only: idm_ad
! -- dummy variables
class(ExplicitSolutionType) :: this !< ExplicitSolutionType instance
! -- local variables
integer(I4B) :: im
class(ExplicitModelType), pointer :: mp => null()

! -- IDM advance
call idm_ad()

! -- Model advance
do im = 1, this%modellist%Count()
mp => GetExplicitModelFromList(this%modellist, im)
Expand Down
5 changes: 5 additions & 0 deletions src/Solution/NumericalSolution.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1467,6 +1467,8 @@ end subroutine writePTCInfoToFile
!!
!<
subroutine prepareSolve(this)
! -- modules
use IdmLoadModule, only: idm_ad
! -- dummy variables
class(NumericalSolutionType) :: this !< NumericalSolutionType instance
! -- local variables
Expand All @@ -1478,6 +1480,9 @@ subroutine prepareSolve(this)
! synchronize for AD
call this%synchronize(STG_BFR_EXG_AD, this%synchronize_ctx)

! -- IDM advance
call idm_ad()

! -- Exchange advance
do ic = 1, this%exchangelist%Count()
cp => GetNumericalExchangeFromList(this%exchangelist, ic)
Expand Down
Loading

0 comments on commit cb6ad7f

Please sign in to comment.