Skip to content
Open
Show file tree
Hide file tree
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
5 changes: 2 additions & 3 deletions source/src/sfincs_continuity.f90
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,8 @@ subroutine compute_water_levels_subgrid(dt,t)
!
nm = nmindsrc(isrc)
!
if ((z_volume(nm) >= 0) .or. ((qtsrc(isrc)<0.0) .and. (z_volume(nm) >= 0))) then
z_volume(nm) = z_volume(nm) + qtsrc(isrc) * dt
endif
! Apply the source/drain volume change and floor at zero
z_volume(nm) = max(z_volume(nm) + qtsrc(isrc) * dt, 0.0)
!
enddo
!$acc end serial
Expand Down
15 changes: 6 additions & 9 deletions source/src/sfincs_discharges.f90
Original file line number Diff line number Diff line change
Expand Up @@ -619,13 +619,7 @@ subroutine update_discharges(t, dt, tloop)
!
end select
!
! Add some relaxation
! structure_relax in seconds => gives ratio between new and old discharge (default 10s)
!
qq = 1.0 / (structure_relax / dt) * qq + (1.0 - (1.0 / (structure_relax / dt))) * -qtsrc(jin)
!
! Limit discharge based on available volume in cell (regular or subgrid)
!
! Limit discharge based on available volume in cell (regular or subgrid).
if (subgrid) then
!
if (qq > 0.0) then
Expand All @@ -643,8 +637,11 @@ subroutine update_discharges(t, dt, tloop)
endif
!
endif
!
qtsrc(jin) = -qq
!
! Add some relaxation (applied LAST, so the applied discharge is a smooth low-pass).
qq = 1.0 / (structure_relax / dt) * qq + (1.0 - (1.0 / (structure_relax / dt))) * -qtsrc(jin)
!
qtsrc(jin) = -qq
qtsrc(jout) = qq
!
endif
Expand Down