diff --git a/route/build/src/irf_route.f90 b/route/build/src/irf_route.f90 index 32a43cef..ac536e6a 100644 --- a/route/build/src/irf_route.f90 +++ b/route/build/src/irf_route.f90 @@ -94,7 +94,7 @@ subroutine irf_route(iEns, & ! input: index of runoff ensemble to be p nTrib=size(river_basin(ix)%branch) ! 1. Route tributary reaches (parallel) -!$OMP PARALLEL default(none) & +!$OMP PARALLEL DO schedule(dynamic,1) & !$OMP private(jSeg, iSeg) & ! private for a given thread !$OMP private(ierr, cmessage) & ! private for a given thread !$OMP shared(river_basin) & ! data structure shared @@ -103,18 +103,15 @@ subroutine irf_route(iEns, & ! input: index of runoff ensemble to be p !$OMP shared(RCHFLX_out) & ! data structure shared !$OMP shared(ix, iEns, ixDesire) & ! indices shared !$OMP firstprivate(nTrib) - -!$OMP DO schedule(dynamic,1) - do iTrib = 1,nTrib - do iSeg=1,river_basin(ix)%branch(iTrib)%nRch + trib:do iTrib = 1,nTrib + seg:do iSeg=1,river_basin(ix)%branch(iTrib)%nRch jSeg = river_basin(ix)%branch(iTrib)%segIndex(iSeg) if (.not. doRoute(jSeg)) cycle call segment_irf(iEns, jSeg, ixDesire, NETOPO_IN, RCHFLX_out, ierr, cmessage) ! if(ierr/=0)then; ixmessage(iTrib)=trim(message)//trim(cmessage); exit; endif - end do - end do -!$OMP END DO -!$OMP END PARALLEL + end do seg + end do trib +!$OMP END PARALLEL DO end do diff --git a/route/build/src/kwt_route.f90 b/route/build/src/kwt_route.f90 index fb666546..e044188c 100644 --- a/route/build/src/kwt_route.f90 +++ b/route/build/src/kwt_route.f90 @@ -100,7 +100,7 @@ SUBROUTINE kwt_route(iens, & ! input: ensemble index nTrib=size(river_basin(ix)%branch) ! 1. Route tributary reaches (parallel) -!$OMP parallel default(none) & +!$OMP PARALLEL DO schedule(dynamic,1) & ! chunk size of 1 !$OMP private(jSeg, iSeg) & ! private for a given thread !$OMP private(ierr, cmessage) & ! private for a given thread !$OMP shared(T0,T1) & ! private for a given thread @@ -113,10 +113,8 @@ SUBROUTINE kwt_route(iens, & ! input: ensemble index !$OMP shared(RCHFLX_out) & ! data structure shared !$OMP shared(ix, iEns, ixDesire) & ! indices shared !$OMP firstprivate(nTrib) - -!$OMP DO schedule(dynamic, 1) ! chunk size of 1 - do iTrib = 1,nTrib - do iSeg=1,river_basin(ix)%branch(iTrib)%nRch + trib:do iTrib = 1,nTrib + seg:do iSeg=1,river_basin(ix)%branch(iTrib)%nRch jSeg = river_basin(ix)%branch(iTrib)%segIndex(iSeg) if (.not. doRoute(jSeg)) cycle ! route kinematic waves through the river network @@ -130,10 +128,9 @@ SUBROUTINE kwt_route(iens, & ! input: ensemble index RCHFLX_out, & ! inout: reach flux data structure ierr,cmessage) ! output: error control !if (ierr/=0)then; message=trim(message)//trim(cmessage); return; endif - end do ! (looping through stream segments) - end do ! (looping through stream segments) -!$OMP END DO -!$OMP END PARALLEL + end do seg + end do trib +!$OMP END PARALLEL DO end do