Skip to content

Commit

Permalink
try calling check from _ad()
Browse files Browse the repository at this point in the history
  • Loading branch information
emorway-usgs committed Dec 6, 2024
1 parent cc393f4 commit 5049af0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 46 deletions.
24 changes: 3 additions & 21 deletions src/Model/GroundWaterEnergy/gwe-uze.f90
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ module GweUzeModule
procedure :: pak_rp_obs => uze_rp_obs
procedure :: pak_bd_obs => uze_bd_obs
procedure :: pak_set_stressperiod => uze_set_stressperiod
procedure :: apt_chk => uze_chk_aux_area
procedure :: apt_ad_chk => uze_chk_aux_area
procedure :: bnd_ac => uze_ac
procedure :: bnd_mc => uze_mc
procedure :: get_mvr_depvar
Expand Down Expand Up @@ -209,16 +209,6 @@ subroutine find_uze_package(this)
call this%parser%StoreErrorUnit()
end if
!
! When GWE and GWF models are run in separate simulations, determine
! the index of 'gwf' entry in flowbudptr since the variable this%idxbudgwf
! has not been set yet
nbudterm = this%tspapttype%flowbudptr%nbudterm
do idxbudgwf = 1, nbudterm
if (this%flowbudptr%budterm(idxbudgwf)%flowtype == ' GWF') exit
end do
nuz = this%flowbudptr%budterm(idxbudgwf)%maxlist
call this%uzarea_chk(nuz, idxbudgwf)
!
! -- Allocate space for idxbudssm, which indicates whether this is a
! special budget term or one that is a general source and sink
call mem_allocate(this%idxbudssm, nbudterm, 'IDXBUDSSM', this%memoryPath)
Expand Down Expand Up @@ -287,18 +277,10 @@ subroutine uze_chk_aux_area(this)
class(GweUzeType), intent(inout) :: this
! -- local
integer(I4B) :: nuz
integer(I4B) :: idxbudgwf
integer(I4B) :: nbudterm
!
! if discrepancy in areas found, report to user
! Determine index of 'gwf' entry in flowbudptr since the variable
! this%idxbudgwf has not been set yet
nbudterm = this%tspapttype%flowbudptr%nbudterm
do idxbudgwf = 1, nbudterm
if (this%flowbudptr%budterm(idxbudgwf)%flowtype == ' GWF') exit
end do
nuz = this%flowbudptr%budterm(idxbudgwf)%maxlist
call this%uzarea_chk(nuz, idxbudgwf)
nuz = this%flowbudptr%budterm(this%idxbudgwf)%maxlist
call this%uzarea_chk(nuz, this%idxbudgwf)
end subroutine uze_chk_aux_area

!> @brief Add package connection to matrix.
Expand Down
19 changes: 0 additions & 19 deletions src/Model/GroundWaterFlow/gwf-uzf.f90
Original file line number Diff line number Diff line change
Expand Up @@ -649,9 +649,6 @@ subroutine uzf_rp(this)
integer(I4B) :: j
integer(I4B) :: jj
integer(I4B) :: ierr
integer(I4B) :: idxbudgwf
integer(I4B) :: nbudterm
real(DP) :: rval1
real(DP), pointer :: bndElem => null()
! -- table output
character(len=20) :: cellid
Expand Down Expand Up @@ -918,22 +915,6 @@ subroutine uzf_rp(this)
!
! -- Save old ss flag
this%issflagold = this%issflag
!
! -- Update uzf area
if (this%iauxmultcol > 0) then
nbudterm = this%budobj%nbudterm
do idxbudgwf = 1, nbudterm
if (this%budobj%budterm(idxbudgwf)%flowtype == ' GWF') exit
end do

do i = 1, this%nodes
if (this%noupdateauxvar(this%iauxmultcol) /= 0) cycle
this%auxvar(this%iauxmultcol, i) = this%uauxvar(this%iauxmultcol, i)
rval1 = this%uauxvar(this%iauxmultcol, i)
call this%uzfobj%setdatauzfarea(i, rval1)
this%budobj%budterm(idxbudgwf)%auxvar(1, i) = this%uzfobj%uzfarea(i)
end do
end if
end subroutine uzf_rp

!> @brief Advance UZF Package
Expand Down
12 changes: 6 additions & 6 deletions src/Model/TransportModel/tsp-apt.f90
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ module TspAptModule
procedure :: bnd_reset => apt_reset
procedure :: bnd_fc => apt_fc
procedure, public :: apt_fc_expanded ! Made public for uze
procedure, public :: apt_chk ! Made public for uze
procedure, public :: apt_ad_chk
procedure :: pak_fc_expanded
procedure, private :: apt_fc_nonexpanded
procedure, public :: apt_cfupdate ! Made public for uze
Expand Down Expand Up @@ -478,16 +478,13 @@ subroutine apt_rp(this)
igwfnode = this%flowbudptr%budterm(this%idxbudgwf)%id2(n)
this%nodelist(n) = igwfnode
end do
!
! -- run package-specific checks
call this%apt_chk()
end subroutine apt_rp

subroutine apt_chk(this)
subroutine apt_ad_chk(this)
! -- dummy
class(TspAptType), intent(inout) :: this
! function available for override by packages
end subroutine apt_chk
end subroutine apt_ad_chk

!> @brief Advanced package transport set stress period routine.
!!
Expand Down Expand Up @@ -695,6 +692,9 @@ subroutine apt_ad(this)
! simulation time from "current" to "preceding" and reset
! "current" value.
call this%obs%obs_ad()
!
! -- run package-specific checks
call this%apt_ad_chk()
end subroutine apt_ad

!> @brief Override bnd reset for custom mover logic
Expand Down

0 comments on commit 5049af0

Please sign in to comment.