diff --git a/src/Routing/Noah_distr_routing_overland.F b/src/Routing/Noah_distr_routing_overland.F index db205a0f7..d4193dda2 100644 --- a/src/Routing/Noah_distr_routing_overland.F +++ b/src/Routing/Noah_distr_routing_overland.F @@ -256,9 +256,6 @@ subroutine ov_rtng( & REAL :: DT_FRAC,SUM_INFXS,sum_head !INTEGER SO8RT_D(IXRT,JXRT,3), rt_option - - - !DJG ---------------------------------------------------------------------- ! DJG BEGIN 1-D or 2-D OVERLAND FLOW ROUTING LOOP !DJG --------------------------------------------------------------------- @@ -473,6 +470,7 @@ SUBROUTINE ROUTE_OVERLAND1(dt, & REAL, INTENT(IN), DIMENSION(XX,YY,8) :: SO8RT REAL*8, DIMENSION(XX,YY) :: QBDRY_tmp, DH REAL*8, DIMENSION(XX,YY) :: DH_tmp + REAL, DIMENSION(XX,YY) :: edge_adjust ! mm !!! Declare Local Variables @@ -554,6 +552,7 @@ SUBROUTINE ROUTE_OVERLAND1(dt, & !yw changed as following: tmp_adjust=qqsfc*1000 + if((h(i,j) - tmp_adjust) <0 ) then #ifdef HYDRO_D print*, "Error Warning: surface head is negative: ",i,j,ixx0,jyy0, & @@ -581,10 +580,13 @@ SUBROUTINE ROUTE_OVERLAND1(dt, & QBDRY_tmp(IXX0,JYY0)=QBDRY_tmp(IXX0,JYY0) - qqsfc*1000. QBDRYT=QBDRYT - qqsfc DH_tmp(IXX0,JYY0)= DH_tmp(IXX0,JYY0)-tmp_adjust + end if end if + !! End loop to route sfc water end if + end do end do @@ -603,6 +605,54 @@ SUBROUTINE ROUTE_OVERLAND1(dt, & H = H + DH +!!! Scrape the outermost edges +edge_adjust = 0.0 +do j=1,YY,YY-1 + do i=1,XX +#ifdef MPP_LAND + if( ((i.eq.XX).and.(right_id .lt. 0)) .or. & + ((i.eq.1) .and.(left_id .lt. 0)) .or. & + ((j.eq.1) .and.(down_id .lt. 0)) .or. & + ((j.eq.YY).and.(up_id .lt. 0)) ) then +#else + if ((i.eq.XX).or.(i.eq.1).or.(j.eq.1) & + .or.(j.eq.YY )) then +#endif + if (h(i,j) .GT. retent_dep(i,j)) then + edge_adjust(i,j) = h(i,j) - retent_dep(i,j) ! positive mm + end if + + end if + end do +end do + +do i=1,XX,XX-1 + do j=1,YY +#ifdef MPP_LAND + if( ((i.eq.XX).and.(right_id .lt. 0)) .or. & + ((i.eq.1) .and.(left_id .lt. 0)) .or. & + ((j.eq.1) .and.(down_id .lt. 0)) .or. & + ((j.eq.YY).and.(up_id .lt. 0)) ) then +#else + if ((i.eq.XX).or.(i.eq.1).or.(j.eq.1) & + .or.(j.eq.YY )) then +#endif + if (h(i,j) .GT. retent_dep(i,j)) then + edge_adjust(i,j) = h(i,j) - retent_dep(i,j) ! positive mm + end if + + end if + end do +end do + + +#ifdef MPP_LAND + call MPP_LAND_COM_REAL(edge_adjust,XX,YY,99) +#endif + QBDRY = QBDRY - edge_adjust ! making this negative term more negative + H = H - edge_adjust ! making this positive term less positive +!!! End outermost edge scrape + return !DJG ----------------------------------------------------------------------