Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(tsp): Elevate SSM to generalized transport class #1398

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions make/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -181,19 +181,19 @@ $(OBJDIR)/IdmLoad.o \
$(OBJDIR)/BoundaryPackage.o \
$(OBJDIR)/VirtualBase.o \
$(OBJDIR)/BaseModel.o \
$(OBJDIR)/PrintSaveManager.o \
$(OBJDIR)/PackageBudget.o \
$(OBJDIR)/HeadFileReader.o \
$(OBJDIR)/BudgetObject.o \
$(OBJDIR)/PrintSaveManager.o \
$(OBJDIR)/SfrCrossSectionManager.o \
$(OBJDIR)/dag_module.o \
$(OBJDIR)/BoundaryPackageExt.o \
$(OBJDIR)/VirtualDataLists.o \
$(OBJDIR)/VirtualDataContainer.o \
$(OBJDIR)/SimStages.o \
$(OBJDIR)/NumericalModel.o \
$(OBJDIR)/OutputControlData.o \
$(OBJDIR)/FlowModelInterface.o \
$(OBJDIR)/OutputControlData.o \
$(OBJDIR)/Xt3dAlgorithm.o \
$(OBJDIR)/gwf3tvbase8.o \
$(OBJDIR)/gwf3sfr8.o \
Expand All @@ -207,9 +207,10 @@ $(OBJDIR)/gwf3drn8.o \
$(OBJDIR)/IndexMap.o \
$(OBJDIR)/VirtualModel.o \
$(OBJDIR)/BaseExchange.o \
$(OBJDIR)/tsp1fmi1.o \
$(OBJDIR)/GwtSpc.o \
$(OBJDIR)/OutputControl.o \
$(OBJDIR)/gwf3ic8.o \
$(OBJDIR)/tsp1fmi1.o \
$(OBJDIR)/TspAdvOptions.o \
$(OBJDIR)/UzfCellGroup.o \
$(OBJDIR)/Xt3dInterface.o \
Expand All @@ -222,6 +223,7 @@ $(OBJDIR)/ImsLinearSettings.o \
$(OBJDIR)/ConvergenceSummary.o \
$(OBJDIR)/CellWithNbrs.o \
$(OBJDIR)/NumericalExchange.o \
$(OBJDIR)/tsp1ssm1.o \
$(OBJDIR)/tsp1oc1.o \
$(OBJDIR)/tsp1ic1.o \
$(OBJDIR)/tsp1adv1.o \
Expand All @@ -230,7 +232,6 @@ $(OBJDIR)/gwf3disu8.o \
$(OBJDIR)/gwf3dis8.o \
$(OBJDIR)/gwf3uzf8.o \
$(OBJDIR)/gwt1apt1.o \
$(OBJDIR)/GwtSpc.o \
$(OBJDIR)/gwt1mst1.o \
$(OBJDIR)/GwtDspOptions.o \
$(OBJDIR)/gwf3npf8.o \
Expand All @@ -250,7 +251,6 @@ $(OBJDIR)/DisConnExchange.o \
$(OBJDIR)/CsrUtils.o \
$(OBJDIR)/tsp1.o \
$(OBJDIR)/gwt1uzt1.o \
$(OBJDIR)/gwt1ssm1.o \
$(OBJDIR)/gwt1src1.o \
$(OBJDIR)/gwt1sft1.o \
$(OBJDIR)/gwt1obs1.o \
Expand Down
4 changes: 2 additions & 2 deletions msvs/mf6core.vfproj
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@
<File RelativePath="..\src\Model\GroundWaterTransport\gwt1obs1.f90"/>
<File RelativePath="..\src\Model\GroundWaterTransport\gwt1sft1.f90"/>
<File RelativePath="..\src\Model\GroundWaterTransport\gwt1src1.f90"/>
<File RelativePath="..\src\Model\GroundWaterTransport\gwt1ssm1.f90"/>
<File RelativePath="..\src\Model\GroundWaterTransport\gwt1uzt1.f90"/></Filter>
<Filter Name="ModelUtilities">
<File RelativePath="..\src\Model\ModelUtilities\BoundaryPackage.f90"/>
Expand Down Expand Up @@ -208,7 +207,8 @@
<File RelativePath="..\src\Model\TransportModel\tsp1adv1.f90"/>
<File RelativePath="..\src\Model\TransportModel\tsp1fmi1.f90"/>
<File RelativePath="..\src\Model\TransportModel\tsp1ic1.f90"/>
<File RelativePath="..\src\Model\TransportModel\tsp1oc1.f90"/></Filter>
<File RelativePath="..\src\Model\TransportModel\tsp1oc1.f90"/>
<File RelativePath="..\src\Model\TransportModel\tsp1ssm1.f90"/></Filter>
<File RelativePath="..\src\Model\BaseModel.f90"/>
<File RelativePath="..\src\Model\ExplicitModel.f90"/>
<File RelativePath="..\src\Model\NumericalModel.f90"/>
Expand Down
9 changes: 1 addition & 8 deletions src/Model/GroundWaterTransport/gwt1.f90
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module GwtModule
use BaseModelModule, only: BaseModelType
use BndModule, only: BndType, AddBndToList, GetBndFromList
use GwtDspModule, only: GwtDspType
use GwtSsmModule, only: GwtSsmType
use TspSsmModule, only: TspSsmType
use GwtMvtModule, only: GwtMvtType
use GwtMstModule, only: GwtMstType
use GwtObsModule, only: GwtObsType
Expand All @@ -37,13 +37,11 @@ module GwtModule

type(GwtMstType), pointer :: mst => null() ! mass storage and transfer package
type(GwtDspType), pointer :: dsp => null() ! dispersion package
type(GwtSsmType), pointer :: ssm => null() ! source sink mixing package
type(GwtMvtType), pointer :: mvt => null() ! mover transport package
type(GwtObsType), pointer :: obs => null() ! observation package
integer(I4B), pointer :: inmvt => null() ! unit number MVT
integer(I4B), pointer :: inmst => null() ! unit number MST
integer(I4B), pointer :: indsp => null() ! DSP enabled flag
integer(I4B), pointer :: inssm => null() ! unit number SSM
integer(I4B), pointer :: inobs => null() ! unit number OBS

contains
Expand Down Expand Up @@ -878,7 +876,6 @@ subroutine gwt_da(this)
!
! -- Scalars
call mem_deallocate(this%indsp)
call mem_deallocate(this%inssm)
call mem_deallocate(this%inmst)
call mem_deallocate(this%inmvt)
call mem_deallocate(this%inobs)
Expand Down Expand Up @@ -968,13 +965,11 @@ subroutine allocate_scalars(this, modelname)
call mem_allocate(this%inmvt, 'INMVT', this%memoryPath)
call mem_allocate(this%inmst, 'INMST', this%memoryPath)
call mem_allocate(this%indsp, 'INDSP', this%memoryPath)
call mem_allocate(this%inssm, 'INSSM', this%memoryPath)
call mem_allocate(this%inobs, 'INOBS', this%memoryPath)
!
this%inmvt = 0
this%inmst = 0
this%indsp = 0
this%inssm = 0
this%inobs = 0
!
! -- Return
Expand Down Expand Up @@ -1143,7 +1138,6 @@ subroutine create_gwt_packages(this, indis)
use SimVariablesModule, only: idm_context
use GwtMstModule, only: mst_cr
use GwtDspModule, only: dsp_cr
use GwtSsmModule, only: ssm_cr
use GwtMvtModule, only: mvt_cr
use GwtObsModule, only: gwt_obs_cr
! -- dummy
Expand Down Expand Up @@ -1210,7 +1204,6 @@ subroutine create_gwt_packages(this, indis)
call mst_cr(this%mst, this%name, this%inmst, this%iout, this%fmi)
call dsp_cr(this%dsp, this%name, mempathdsp, this%indsp, this%iout, &
this%fmi)
call ssm_cr(this%ssm, this%name, this%inssm, this%iout, this%fmi)
call mvt_cr(this%mvt, this%name, this%inmvt, this%iout, this%fmi)
call gwt_obs_cr(this%obs, this%inobs)
!
Expand Down
12 changes: 12 additions & 0 deletions src/Model/TransportModel/tsp1.f90
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module TransportModelModule
use TspIcModule, only: TspIcType
use TspFmiModule, only: TspFmiType
use TspAdvModule, only: TspAdvType
use TspSsmModule, only: TspSsmType
use TspOcModule, only: TspOcType
use BudgetModule, only: BudgetType
use MatrixBaseModule
Expand All @@ -30,11 +31,14 @@ module TransportModelModule
type(TspAdvType), pointer :: adv => null() !< advection package
type(TspIcType), pointer :: ic => null() !< initial conditions package
type(TspOcType), pointer :: oc => null() !< output control package
type(TspSsmType), pointer :: ssm => null() !< source sink mixing package
type(BudgetType), pointer :: budget => null() !< budget object
integer(I4B), pointer :: infmi => null() ! unit number FMI
integer(I4B), pointer :: inadv => null() !< unit number ADV
integer(I4B), pointer :: inic => null() !< unit number IC
integer(I4B), pointer :: inoc => null() !< unit number OC

integer(I4B), pointer :: inssm => null() !< unit number SSM
real(DP), pointer :: eqnsclfac => null() !< constant factor by which all terms in the model's governing equation are scaled (divided) for formulation and solution
! Labels that will be defined
character(len=LENVARNAME) :: tsptype = '' !< "solute" or "heat"
Expand Down Expand Up @@ -288,12 +292,14 @@ subroutine allocate_tsp_scalars(this, modelname)
call mem_allocate(this%inic, 'INIC', this%memoryPath)
call mem_allocate(this%infmi, 'INFMI', this%memoryPath)
call mem_allocate(this%inadv, 'INADV', this%memoryPath)
call mem_allocate(this%inssm, 'INSSM', this%memoryPath)
call mem_allocate(this%inoc, 'INOC ', this%memoryPath)
call mem_allocate(this%eqnsclfac, 'EQNSCLFAC', this%memoryPath)
!
this%inic = 0
this%infmi = 0
this%inadv = 0
this%inssm = 0
this%inoc = 0
this%eqnsclfac = DZERO
!
Expand Down Expand Up @@ -345,6 +351,7 @@ subroutine tsp_da(this)
call mem_deallocate(this%inic)
call mem_deallocate(this%infmi)
call mem_deallocate(this%inadv)
call mem_deallocate(this%inssm)
call mem_deallocate(this%inoc)
call mem_deallocate(this%eqnsclfac)
!
Expand Down Expand Up @@ -501,6 +508,7 @@ subroutine create_tsp_packages(this, indis)
use TspIcModule, only: ic_cr
use TspFmiModule, only: fmi_cr
use TspAdvModule, only: adv_cr
use TspSsmModule, only: ssm_cr
use TspOcModule, only: oc_cr
! -- dummy
class(TransportModelType) :: this
Expand Down Expand Up @@ -558,6 +566,8 @@ subroutine create_tsp_packages(this, indis)
this%infmi = inunit
case ('ADV6')
this%inadv = inunit
case ('SSM6')
this%inssm = inunit
case ('OC6')
this%inoc = inunit
end select
Expand All @@ -570,6 +580,8 @@ subroutine create_tsp_packages(this, indis)
this%depvartype)
call adv_cr(this%adv, this%name, this%inadv, this%iout, this%fmi, &
this%eqnsclfac)
call ssm_cr(this%ssm, this%name, this%inssm, this%iout, this%fmi, &
this%eqnsclfac, this%depvartype)
call oc_cr(this%oc, this%name, this%inoc, this%iout)

!
Expand Down
Loading