Skip to content

Commit

Permalink
refactor(tsp): Elevate FMI to generalized transport class
Browse files Browse the repository at this point in the history
  • Loading branch information
emorway-usgs committed Oct 4, 2023
1 parent 4896d5b commit 391c4f5
Show file tree
Hide file tree
Showing 18 changed files with 771 additions and 295 deletions.
7 changes: 3 additions & 4 deletions msvs/mf6core.vfproj
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@
<File RelativePath="..\src\Model\GroundWaterTransport\gwt1disv1idm.f90"/>
<File RelativePath="..\src\Model\GroundWaterTransport\gwt1dsp1.f90"/>
<File RelativePath="..\src\Model\GroundWaterTransport\gwt1dsp1idm.f90"/>
<File RelativePath="..\src\Model\GroundWaterTransport\gwt1fmi1.f90"/>
<File RelativePath="..\src\Model\GroundWaterTransport\gwt1ic1.f90"/>
<File RelativePath="..\src\Model\GroundWaterTransport\gwt1idm.f90"/>
<File RelativePath="..\src\Model\GroundWaterTransport\gwt1ist1.f90"/>
Expand All @@ -184,8 +183,7 @@
<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"/>
<File RelativePath="..\src\Model\TransportModel\tsp1.f90"/></Filter>
<File RelativePath="..\src\Model\GroundWaterTransport\gwt1uzt1.f90"/></Filter>
<Filter Name="ModelUtilities">
<File RelativePath="..\src\Model\ModelUtilities\BoundaryPackage.f90"/>
<File RelativePath="..\src\Model\ModelUtilities\BoundaryPackageExt.f90"/>
Expand All @@ -209,7 +207,8 @@
<File RelativePath="..\src\Model\ModelUtilities\Xt3dAlgorithm.f90"/>
<File RelativePath="..\src\Model\ModelUtilities\Xt3dInterface.f90"/></Filter>
<Filter Name="TransportModel">
<File RelativePath="..\src\Model\TransportModel\tsp1.f90"/></Filter>
<File RelativePath="..\src\Model\TransportModel\tsp1.f90"/>
<File RelativePath="..\src\Model\TransportModel\tsp1fmi1.f90"/></Filter>
<File RelativePath="..\src\Model\BaseModel.f90"/>
<File RelativePath="..\src\Model\ExplicitModel.f90"/>
<File RelativePath="..\src\Model\NumericalModel.f90"/>
Expand Down
14 changes: 11 additions & 3 deletions src/Model/Connection/GwtInterfaceModel.f90
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
module GwtInterfaceModelModule
use KindModule, only: I4B, DP
use ConstantsModule, only: DONE
use MemoryManagerModule, only: mem_allocate, mem_deallocate, mem_reallocate
use MemoryHelperModule, only: create_mem_path
use NumericalModelModule, only: NumericalModelType
use GwtModule, only: GwtModelType, CastAsGwtModel
use GwfDisuModule, only: disu_cr, CastAsDisuType
use GwtFmiModule, only: fmi_cr, GwtFmiType
use TspFmiModule, only: fmi_cr, TspFmiType
use GwtAdvModule, only: adv_cr, GwtAdvType
use GwtAdvOptionsModule, only: GwtAdvOptionsType
use GwtDspModule, only: dsp_cr, GwtDspType
Expand All @@ -25,6 +26,7 @@ module GwtInterfaceModelModule

integer(i4B), pointer :: iAdvScheme => null() !< the advection scheme: 0 = up, 1 = central, 2 = tvd
integer(i4B), pointer :: ixt3d => null() !< xt3d setting: 0 = off, 1 = lhs, 2 = rhs
real(DP), pointer :: ieqnsclfac => null() !< governing eqn scaling factor: 1: GWT, >1: GWE

class(GridConnectionType), pointer :: gridConnection => null() !< The grid connection class will provide the interface grid
class(GwtModelType), private, pointer :: owner => null() !< the real GWT model for which the exchange coefficients
Expand Down Expand Up @@ -59,6 +61,7 @@ subroutine gwtifmod_cr(this, name, iout, gridConn)
! defaults
this%iAdvScheme = 0
this%ixt3d = 0
this%ieqnsclfac = DONE

this%iout = iout
this%gridConnection => gridConn
Expand All @@ -79,8 +82,10 @@ subroutine gwtifmod_cr(this, name, iout, gridConn)

! create dis and packages
call disu_cr(this%dis, this%name, '', -1, this%iout)
call fmi_cr(this%fmi, this%name, 0, this%iout)
call adv_cr(this%adv, this%name, adv_unit, this%iout, this%fmi)
call fmi_cr(this%fmi, this%name, 0, this%iout, this%ieqnsclfac, &
this%depvartype)
call adv_cr(this%adv, this%name, adv_unit, this%iout, this%fmi, &
this%ieqnsclfac)
call dsp_cr(this%dsp, this%name, '', -dsp_unit, this%iout, this%fmi)
call gwt_obs_cr(this%obs, inobs)

Expand All @@ -94,6 +99,7 @@ subroutine allocate_scalars(this, modelname)

call mem_allocate(this%iAdvScheme, 'ADVSCHEME', this%memoryPath)
call mem_allocate(this%ixt3d, 'IXT3D', this%memoryPath)
call mem_allocate(this%ieqnsclfac, 'IEQNSCLFAC', this%memoryPath)

end subroutine allocate_scalars

Expand Down Expand Up @@ -192,6 +198,7 @@ subroutine gwtifmod_da(this)
! this
call mem_deallocate(this%iAdvScheme)
call mem_deallocate(this%ixt3d)
call mem_deallocate(this%ieqnsclfac)

! gwt packages
call this%dis%dis_da()
Expand Down Expand Up @@ -219,6 +226,7 @@ subroutine gwtifmod_da(this)
call mem_deallocate(this%inmvt)
call mem_deallocate(this%inoc)
call mem_deallocate(this%inobs)


! base
call this%NumericalModelType%model_da()
Expand Down
Loading

0 comments on commit 391c4f5

Please sign in to comment.