Skip to content

Commit

Permalink
breakthrough
Browse files Browse the repository at this point in the history
  • Loading branch information
emorway-usgs committed Dec 2, 2024
1 parent cdf1643 commit 26ae1a9
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 0 deletions.
44 changes: 44 additions & 0 deletions src/Model/GroundWaterEnergy/gwe-uze.f90
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +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_aux_area => uze_chk_aux_area
procedure :: bnd_ac => uze_ac
procedure :: bnd_mc => uze_mc
procedure :: get_mvr_depvar
Expand Down Expand Up @@ -279,6 +280,49 @@ subroutine find_uze_package(this)
this%idxbudtheq = this%flowbudptr%nbudterm + 1
end subroutine find_uze_package

subroutine uze_rp(this)
! -- dummy
class(GweUzeType), intent(inout) :: this
! -- local
integer(I4B) :: nuz
integer(I4B) :: idxbudgwf
integer(I4B) :: nbudterm
!
! Check for multiple UZF objects per cell, if 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)
!
! -- call parent _rp routines
call this%TspAptType%bnd_rp()
end subroutine uze_rp

!> @brief Check to ensure auxillary areas equal respective cell areas
!<
subroutine uze_chk_aux_area(this)
! -- dummy
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)
end subroutine uze_chk_aux_area

!> @brief Add package connection to matrix.
!!
!! Overrides apt_ac to fold the UZE heat balance terms into the row
Expand Down
19 changes: 19 additions & 0 deletions src/Model/GroundWaterFlow/gwf-uzf.f90
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,9 @@ 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 @@ -915,6 +918,22 @@ 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
10 changes: 10 additions & 0 deletions src/Model/TransportModel/tsp-apt.f90
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +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_aux_area ! Made public for uze
procedure :: pak_fc_expanded
procedure, private :: apt_fc_nonexpanded
procedure, public :: apt_cfupdate ! Made public for uze
Expand Down Expand Up @@ -383,6 +384,9 @@ subroutine apt_rp(this)
character(len=*), parameter :: fmtlsp = &
&"(1X,/1X,'REUSING ',A,'S FROM LAST STRESS PERIOD')"
!
! -- run aux area check (for uze)
call this%apt_chk_aux_area()
!
! -- set nbound to maxbound
this%nbound = this%maxbound
!
Expand Down Expand Up @@ -479,6 +483,12 @@ subroutine apt_rp(this)
end do
end subroutine apt_rp

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

!> @brief Advanced package transport set stress period routine.
!!
!! Set a stress period attribute for an advanced transport package feature
Expand Down

0 comments on commit 26ae1a9

Please sign in to comment.