From 8338a5f4b61529c66fa0eadba71c3ac2b79b1f3e Mon Sep 17 00:00:00 2001 From: Ryan Cabell Date: Tue, 19 Nov 2024 10:05:10 -0700 Subject: [PATCH] Update both up and downstrea values of diversion destination --- src/Routing/module_channel_routing.F | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Routing/module_channel_routing.F b/src/Routing/module_channel_routing.F index ce8b594bf..ae8429d02 100644 --- a/src/Routing/module_channel_routing.F +++ b/src/Routing/module_channel_routing.F @@ -1972,7 +1972,7 @@ 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 @@ -1980,14 +1980,6 @@ subroutine drive_CHANNEL_RSL(did, UDMP_OPT,KT, IXRT,JXRT, & 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 @@ -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"