Skip to content

Commit

Permalink
Update both up and downstrea values of diversion destination
Browse files Browse the repository at this point in the history
  • Loading branch information
rcabell committed Nov 19, 2024
1 parent e1848e2 commit 8338a5f
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/Routing/module_channel_routing.F
Original file line number Diff line number Diff line change
Expand Up @@ -1972,22 +1972,14 @@ subroutine drive_CHANNEL_RSL(did, UDMP_OPT,KT, IXRT,JXRT, &
if (div_src /= 0) then
! remove from upstream
#ifdef HYDRO_D
print free, "DEBUG: diverting", div_src, "of", Quc, "from link id =", LINKID(k), "on processor", my_id
print free, "DEBUG: diverting", div_src, "of", Quc, "from link id =", LINKID(k) !, "on processor", my_id
if (div_src > Quc) &
print free, "DEBUG WARNING: diverted flow (", div_src, ") exceeds total flow, zeroing."
#endif
Quc = max(0.0, Quc - div_src)
Qup = max(0.0, Qup - div_src)
end if

if (div_dst /= 0) then
! apply observed value to downstream
#ifdef HYDRO_D
print free, "DEBUG: diverting", div_dst, "to link id =", LINKID(k), "on processor", my_id
#endif
tmpQLINK(k,2) = div_dst
end if

#ifdef WRF_HYDRO_NUDGING
call nudge_apply_upstream_muskingumCunge( Qup, Quc, nudge(k), k )
#endif
Expand All @@ -1997,6 +1989,14 @@ subroutine drive_CHANNEL_RSL(did, UDMP_OPT,KT, IXRT,JXRT, &
QLateral(k), DTRT_CH, So(k), CHANLEN(k), &
MannN(k), ChSSlp(k), Bw(k), Tw(k), Tw_CC(k), n_CC(k), HLINK(k), ChannK(k) )

if (div_dst /= 0) then
! apply observed value to downstream
#ifdef HYDRO_D
print free, "DEBUG: diverting", div_dst, "to link id =", LINKID(k) !, "on processor", my_id
#endif
tmpQLINK(k,1) = div_dst
tmpQLINK(k,2) = div_dst
end if
else
#ifdef HYDRO_D
print *, " no channel option selected"
Expand Down

0 comments on commit 8338a5f

Please sign in to comment.