Skip to content

Commit

Permalink
Attemps to fix a number of review comments in MODFLOW-USGS#1306, incl…
Browse files Browse the repository at this point in the history
  • Loading branch information
emorway-usgs committed Aug 17, 2023
1 parent 989fef7 commit 7b2b6cb
Show file tree
Hide file tree
Showing 22 changed files with 213 additions and 313 deletions.
1 change: 0 additions & 1 deletion make/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ $(OBJDIR)/Observe.o \
$(OBJDIR)/TimeArraySeriesLink.o \
$(OBJDIR)/ObsUtility.o \
$(OBJDIR)/ObsContainer.o \
$(OBJDIR)/TspLabels.o \
$(OBJDIR)/BudgetFileReader.o \
$(OBJDIR)/TimeArraySeriesManager.o \
$(OBJDIR)/PackageMover.o \
Expand Down
1 change: 0 additions & 1 deletion msvs/mf6core.vfproj
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@
<File RelativePath="..\src\Model\ModelUtilities\SfrCrossSectionManager.f90"/>
<File RelativePath="..\src\Model\ModelUtilities\SfrCrossSectionUtils.f90"/>
<File RelativePath="..\src\Model\ModelUtilities\TspAdvOptions.f90"/>
<File RelativePath="..\src\Model\ModelUtilities\TspLabels.f90"/>
<File RelativePath="..\src\Model\ModelUtilities\UzfCellGroup.f90"/>
<File RelativePath="..\src\Model\ModelUtilities\Xt3dAlgorithm.f90"/>
<File RelativePath="..\src\Model\ModelUtilities\Xt3dInterface.f90"/></Filter>
Expand Down
4 changes: 2 additions & 2 deletions src/Model/Connection/GwtInterfaceModel.f90
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ 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, this%tsplab, &
this%ieqnsclfac)
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)
Expand Down
37 changes: 19 additions & 18 deletions src/Model/GroundWaterTransport/gwt1.f90
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
module GwtModule

use KindModule, only: DP, I4B
use ConstantsModule, only: LENFTYPE, LENMEMPATH, DZERO, LENPAKLOC, DONE
use ConstantsModule, only: LENFTYPE, LENMEMPATH, DZERO, LENPAKLOC, DONE, &
LENVARNAME
use VersionModule, only: write_listfile_header
use NumericalModelModule, only: NumericalModelType
use BaseModelModule, only: BaseModelType
Expand All @@ -26,6 +27,9 @@ module GwtModule
public :: GwtModelType
public :: CastAsGwtModel
public :: niunit
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 "J"

type, extends(TransportModelType) :: GwtModelType

Expand Down Expand Up @@ -72,7 +76,6 @@ subroutine gwt_cr(filename, id, modelname)
use MemoryManagerExtModule, only: mem_set_value
use GwfNamInputModule, only: GwfNamParamFoundType
use BudgetModule, only: budget_cr
use TspLabelsModule, only: tsplabels_cr
use GwtMstModule, only: mst_cr
use GwtDspModule, only: dsp_cr
! -- dummy
Expand All @@ -94,6 +97,10 @@ subroutine gwt_cr(filename, id, modelname)
this%memoryPath = create_mem_path(modelname)
!
call this%allocate_gwt_scalars(modelname)
!
! -- set labels for transport model - needed by create_packages() below
call this%set_tsp_labels(this%macronym, dvt, dvu, dvua)
!
model => this
call AddBaseModelToList(basemodellist, model)
!
Expand All @@ -116,16 +123,12 @@ end subroutine gwt_cr
subroutine gwt_df(this)
! -- modules
use ModelPackageInputsModule, only: NIUNIT_GWT
use TspLabelsModule, only: setTspLabels
! -- dummy
class(GwtModelType) :: this
! -- local
integer(I4B) :: ip
class(BndType), pointer :: packobj
! ------------------------------------------------------------------------------
!
! -- Set labels to be used with transport model
call this%tsplab%setTspLabels(this%macronym, 'CONCENTRATION', 'MASS', 'M')
!
! -- Define packages and utility objects
call this%dis%dis_df()
Expand All @@ -135,8 +138,8 @@ subroutine gwt_df(this)
if (this%indsp > 0) call this%dsp%dsp_df(this%dis)
if (this%inssm > 0) call this%ssm%ssm_df()
call this%oc%oc_df()
call this%budget%budget_df(niunit, this%tsplab%depvarunit, &
this%tsplab%depvarunitabbrev)
call this%budget%budget_df(niunit, this%depvarunit, &
this%depvarunitabbrev)
!
! -- Assign or point model members to dis members
this%neq = this%dis%nodes
Expand Down Expand Up @@ -257,7 +260,7 @@ subroutine gwt_ar(this)
!call this%dis%dis_ar(this%npf%icelltype)
!
! -- set up output control
call this%oc%oc_ar(this%x, this%dis, DHNOFLO, this%tsplab%depvartype)
call this%oc%oc_ar(this%x, this%dis, DHNOFLO, this%depvartype)
call this%budget%set_ibudcsv(this%oc%ibudcsv)
!
! -- Package input files now open, so allocate and read
Expand Down Expand Up @@ -616,7 +619,6 @@ subroutine gwt_da(this)
call this%budget%budget_da()
call this%oc%oc_da()
call this%obs%obs_da()
call this%tsplab%tsplabels_da()
!
! -- Internal package objects
deallocate (this%dis)
Expand All @@ -630,7 +632,6 @@ subroutine gwt_da(this)
deallocate (this%budget)
deallocate (this%oc)
deallocate (this%obs)
deallocate (this%tsplab)
!
! -- Boundary packages
do ip = 1, this%bndlist%Count()
Expand All @@ -639,7 +640,7 @@ subroutine gwt_da(this)
deallocate (packobj)
end do
!
! -- Scalars
! -- Parent class members
call this%TransportModelType%tsp_da()
!
! -- NumericalModelType
Expand Down Expand Up @@ -770,22 +771,22 @@ subroutine package_create(this, filtyp, ipakid, ipaknum, pakname, inunit, &
select case (filtyp)
case ('CNC6')
call cnc_create(packobj, ipakid, ipaknum, inunit, iout, this%name, &
pakname, this%tsplab, this%eqnsclfac)
pakname, this%eqnsclfac, dvt)
case ('SRC6')
call src_create(packobj, ipakid, ipaknum, inunit, iout, this%name, &
pakname, this%tsplab)
pakname, dvt)
case ('LKT6')
call lkt_create(packobj, ipakid, ipaknum, inunit, iout, this%name, &
pakname, this%fmi, this%tsplab, this%eqnsclfac)
pakname, this%fmi, this%eqnsclfac, dvt, dvu, dvua)
case ('SFT6')
call sft_create(packobj, ipakid, ipaknum, inunit, iout, this%name, &
pakname, this%fmi, this%tsplab, this%eqnsclfac)
pakname, this%fmi, this%eqnsclfac, dvt, dvu, dvua)
case ('MWT6')
call mwt_create(packobj, ipakid, ipaknum, inunit, iout, this%name, &
pakname, this%fmi, this%tsplab, this%eqnsclfac)
pakname, this%fmi, this%eqnsclfac, dvt, dvu, dvua)
case ('UZT6')
call uzt_create(packobj, ipakid, ipaknum, inunit, iout, this%name, &
pakname, this%fmi, this%tsplab, this%eqnsclfac)
pakname, this%fmi, this%eqnsclfac, dvt, dvu, dvua)
case ('IST6')
call ist_create(packobj, ipakid, ipaknum, inunit, iout, this%name, &
pakname, this%fmi, this%mst)
Expand Down
19 changes: 11 additions & 8 deletions src/Model/GroundWaterTransport/gwt1lkt1.f90
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,14 @@
module GwtLktModule

use KindModule, only: DP, I4B
use ConstantsModule, only: DZERO, DONE, LINELENGTH
use ConstantsModule, only: DZERO, DONE, LINELENGTH, LENVARNAME
use SimModule, only: store_error
use BndModule, only: BndType, GetBndFromList
use TspFmiModule, only: TspFmiType
use LakModule, only: LakType
use ObserveModule, only: ObserveType
use TspAptModule, only: TspAptType, apt_process_obsID, &
apt_process_obsID12
use TspLabelsModule, only: TspLabelsType
use MatrixBaseModule

implicit none
Expand Down Expand Up @@ -96,7 +95,8 @@ module GwtLktModule
!> @brief Create a new lkt package
!<
subroutine lkt_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, &
fmi, tsplab, eqnsclfac)
fmi, eqnsclfac, depvartype, depvarunit, &
depvarunitabbrev)
! -- dummy
class(BndType), pointer :: packobj
integer(I4B), intent(in) :: id
Expand All @@ -106,8 +106,10 @@ subroutine lkt_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, &
character(len=*), intent(in) :: namemodel
character(len=*), intent(in) :: pakname
type(TspFmiType), pointer :: fmi
type(TspLabelsType), pointer :: tsplab
real(DP), intent(in), pointer :: eqnsclfac !< governing equation scale factor
character(len=LENVARNAME), intent(in) :: depvartype
character(len=LENVARNAME), intent(in) :: depvarunit
character(len=LENVARNAME), intent(in) :: depvarunitabbrev
! -- local
type(GwtLktType), pointer :: lktobj
! ------------------------------------------------------------------------------
Expand All @@ -132,15 +134,16 @@ subroutine lkt_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, &
packobj%ibcnum = ibcnum
packobj%ncolbnd = 1
packobj%iscloc = 1

!
! -- Store pointer to flow model interface. When the GwfGwt exchange is
! created, it sets fmi%bndlist so that the GWT model has access to all
! the flow packages
lktobj%fmi => fmi
!
! -- Store pointer to the labels module for dynamic setting of
! concentration vs temperature
lktobj%tsplab => tsplab
! -- Store labels for dynamic setting of concentration vs temperature
lktobj%depvartype = depvartype
lktobj%depvarunit = depvarunit
lktobj%depvarunitabbrev = depvarunitabbrev
!
! -- Store pointer to governing equation scale factor
lktobj%eqnsclfac => eqnsclfac
Expand Down
17 changes: 10 additions & 7 deletions src/Model/GroundWaterTransport/gwt1mwt1.f90
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,14 @@
module GwtMwtModule

use KindModule, only: DP, I4B
use ConstantsModule, only: DZERO, LINELENGTH
use ConstantsModule, only: DZERO, LINELENGTH, LENVARNAME
use SimModule, only: store_error
use BndModule, only: BndType, GetBndFromList
use TspFmiModule, only: TspFmiType
use MawModule, only: MawType
use ObserveModule, only: ObserveType
use TspAptModule, only: TspAptType, apt_process_obsID, &
apt_process_obsID12
use TspLabelsModule, only: TspLabelsType
use MatrixBaseModule

implicit none
Expand Down Expand Up @@ -89,7 +88,8 @@ module GwtMwtModule
!> Create new MWT package
!<
subroutine mwt_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, &
fmi, tsplab, eqnsclfac)
fmi, eqnsclfac, depvartype, depvarunit, &
depvarunitabbrev)
! -- dummy
class(BndType), pointer :: packobj
integer(I4B), intent(in) :: id
Expand All @@ -99,8 +99,10 @@ subroutine mwt_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, &
character(len=*), intent(in) :: namemodel
character(len=*), intent(in) :: pakname
type(TspFmiType), pointer :: fmi
type(TspLabelsType), pointer :: tsplab
real(DP), intent(in), pointer :: eqnsclfac !< governing equation scale factor
character(len=LENVARNAME), intent(in) :: depvartype
character(len=LENVARNAME), intent(in) :: depvarunit
character(len=LENVARNAME), intent(in) :: depvarunitabbrev
! -- local
type(GwtMwtType), pointer :: mwtobj
! ------------------------------------------------------------------------------
Expand Down Expand Up @@ -131,9 +133,10 @@ subroutine mwt_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, &
! the flow packages
mwtobj%fmi => fmi
!
! -- Store pointer to the labels module for dynamic setting of
! concentration vs temperature
mwtobj%tsplab => tsplab
! -- Store labels for dynamic setting of concentration vs temperature
mwtobj%depvartype = depvartype
mwtobj%depvarunit = depvarunit
mwtobj%depvarunitabbrev = depvarunitabbrev
!
! -- Store pointer to governing equation scale factor
mwtobj%eqnsclfac => eqnsclfac
Expand Down
17 changes: 10 additions & 7 deletions src/Model/GroundWaterTransport/gwt1sft1.f90
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,14 @@
module GwtSftModule

use KindModule, only: DP, I4B
use ConstantsModule, only: DZERO, DONE, LINELENGTH
use ConstantsModule, only: DZERO, DONE, LINELENGTH, LENVARNAME
use SimModule, only: store_error
use BndModule, only: BndType, GetBndFromList
use TspFmiModule, only: TspFmiType
use SfrModule, only: SfrType
use ObserveModule, only: ObserveType
use TspAptModule, only: TspAptType, apt_process_obsID, &
apt_process_obsID12
use TspLabelsModule, only: TspLabelsType
use MatrixBaseModule

implicit none
Expand Down Expand Up @@ -93,7 +92,8 @@ module GwtSftModule
!> @brief Create a new sft package
!<
subroutine sft_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, &
fmi, tsplab, eqnsclfac)
fmi, eqnsclfac, depvartype, depvarunit, &
depvarunitabbrev)
! -- dummy
class(BndType), pointer :: packobj
integer(I4B), intent(in) :: id
Expand All @@ -103,8 +103,10 @@ subroutine sft_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, &
character(len=*), intent(in) :: namemodel
character(len=*), intent(in) :: pakname
type(TspFmiType), pointer :: fmi
type(TspLabelsType), pointer :: tsplab
real(DP), intent(in), pointer :: eqnsclfac !< governing equation scale factor
character(len=LENVARNAME), intent(in) :: depvartype
character(len=LENVARNAME), intent(in) :: depvarunit
character(len=LENVARNAME), intent(in) :: depvarunitabbrev
! -- local
type(GwtSftType), pointer :: sftobj
! ------------------------------------------------------------------------------
Expand Down Expand Up @@ -138,9 +140,10 @@ subroutine sft_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, &
! -- Store pointer to governing equation scale factor
sftobj%eqnsclfac => eqnsclfac
!
! -- Store pointer to the labels module for dynamic setting of
! concentration vs temperature
sftobj%tsplab => tsplab
! -- Store labels for dynamic setting of concentration vs temperature
sftobj%depvartype = depvartype
sftobj%depvarunit = depvarunit
sftobj%depvarunitabbrev = depvarunitabbrev
!
! -- Return
return
Expand Down
17 changes: 10 additions & 7 deletions src/Model/GroundWaterTransport/gwt1src1.f90
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
module GwtSrcModule
!
use KindModule, only: DP, I4B
use ConstantsModule, only: DZERO, DEM1, DONE, LENFTYPE
use ConstantsModule, only: DZERO, DEM1, DONE, LENFTYPE, LENVARNAME
use BndModule, only: BndType
use TspLabelsModule, only: TspLabelsType
use ObsModule, only: DefaultObsIdProcessor
use TimeSeriesLinkModule, only: TimeSeriesLinkType, &
GetTimeSeriesLinkFromList
Expand All @@ -19,7 +18,11 @@ module GwtSrcModule
character(len=16) :: text = ' SRC'
!
type, extends(BndType) :: GwtSrcType

character(len=LENVARNAME) :: depvartype = '' !< stores string of dependent variable type, depending on model type

contains

procedure :: allocate_scalars => src_allocate_scalars
procedure :: bnd_cf => src_cf
procedure :: bnd_fc => src_fc
Expand All @@ -30,6 +33,7 @@ module GwtSrcModule
procedure, public :: bnd_df_obs => src_df_obs
! -- methods for time series
procedure, public :: bnd_rp_ts => src_rp_ts

end type GwtSrcType

contains
Expand All @@ -39,7 +43,7 @@ module GwtSrcModule
!! This subroutine points bndobj to the newly created package
!<
subroutine src_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, &
tsplab)
depvartype)
! -- dummy
class(BndType), pointer :: packobj
integer(I4B), intent(in) :: id
Expand All @@ -48,7 +52,7 @@ subroutine src_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, &
integer(I4B), intent(in) :: iout
character(len=*), intent(in) :: namemodel
character(len=*), intent(in) :: pakname
type(TspLabelsType), pointer :: tsplab
character(len=LENVARNAME), intent(in) :: depvartype
! -- local
type(GwtSrcType), pointer :: srcobj
! ------------------------------------------------------------------------------
Expand All @@ -74,9 +78,8 @@ subroutine src_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, &
packobj%ncolbnd = 1
packobj%iscloc = 1
!
! -- Store pointer to labels associated with the current model so that the
! package has access to the assigned labels
packobj%tsplab => tsplab
! -- Store the appropriate label based on the dependent variable
srcobj%depvartype = depvartype
!
! -- Return
return
Expand Down
Loading

0 comments on commit 7b2b6cb

Please sign in to comment.