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

feat(swf-evp): add new evaporation package for surface water models #2168

Merged
merged 4 commits into from
Jan 30, 2025
Merged
Changes from 1 commit
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
Prev Previous commit
add flow reduction variables
langevin-usgs committed Jan 30, 2025
commit d80e441b1c41709785424c270e878cc36ebccc27
18 changes: 11 additions & 7 deletions src/Model/SurfaceWaterFlow/swf-evp.f90
Original file line number Diff line number Diff line change
@@ -9,6 +9,7 @@ module SwfEvpModule
use ConstantsModule, only: DZERO, LENFTYPE, LENPACKAGENAME, MAXCHARLEN, &
LINELENGTH, DONE, DHALF, DEM6, DPREC
use MemoryHelperModule, only: create_mem_path
use MemoryManagerModule, only: mem_allocate, mem_deallocate
use BndModule, only: BndType
use BndExtModule, only: BndExtType
use SimModule, only: store_error, store_error_filename, count_errors
@@ -37,6 +38,8 @@ module SwfEvpModule

type, extends(BndExtType) :: SwfEvpType
real(DP), dimension(:), pointer, contiguous :: evaporation => null() !< boundary evaporation array
integer(I4B), pointer :: iflowred => null() !< flag that indicates evaporation will be shut off when depth is less than reduction depth
real(DP), pointer :: reduction_depth => null() !< depth below which evaporation is reduced
logical, pointer, private :: read_as_arrays

! pointers to other objects
@@ -129,9 +132,13 @@ subroutine evp_allocate_scalars(this)
call this%BndExtType%allocate_scalars()

! allocate internal members
call mem_allocate(this%iflowred, 'IFLOWRED', this%memoryPath)
call mem_allocate(this%reduction_depth, 'REDUCTION_DEPTH', this%memoryPath)
allocate (this%read_as_arrays)

! Set values
this%iflowred = 1
this%reduction_depth = DEM6
this%read_as_arrays = .false.
end subroutine evp_allocate_scalars

@@ -459,15 +466,11 @@ function get_evap_reduce_mult(this, stage, bottom) result(qmult)
! return
real(DP) :: qmult
! local
integer(I4B) :: iflowred
real(DP) :: evap_depth
real(DP) :: tp

iflowred = 1
qmult = DONE
if (iflowred == 1) then
evap_depth = DEM6
tp = bottom + evap_depth
if (this%iflowred == 1) then
tp = bottom + this%reduction_depth
qmult = sQSaturation(tp, bottom, stage)
end if

@@ -499,14 +502,15 @@ end subroutine evp_fc
!<
subroutine evp_da(this)
! modules
use MemoryManagerModule, only: mem_deallocate
! dummy
class(SwfEvpType) :: this

! Deallocate parent package
call this%BndExtType%bnd_da()

! scalars
call mem_deallocate(this%iflowred)
call mem_deallocate(this%reduction_depth)
deallocate (this%read_as_arrays)

! arrays