management_route_transfer Subroutine

public subroutine management_route_transfer(icodes, inum1s, mhyd)

Arguments

Type IntentOptional AttributesName
integer, intent(in), dimension(:):: icodes
integer, intent(in), dimension(:):: inum1s
integer, intent(in) :: mhyd

Called by

proc~~management_route_transfer~~CalledByGraph proc~management_route_transfer management_route_transfer proc~management_initialise management_initialise proc~management_initialise->proc~management_route_transfer proc~initialise initialise proc~initialise->proc~management_initialise program~swim swim program~swim->proc~initialise

Contents


Source Code

  subroutine management_route_transfer(icodes, inum1s, mhyd)
    integer, dimension(:), intent(in) :: icodes
    integer, dimension(:), intent(in) :: inum1s
    integer, intent(in) :: mhyd
    ! identify hydrograph storage locations for water transfer subbasins
    integer :: i, j
    ! identify subbasins where nothing is routed through
    logical, dimension(wam_nWU) :: notRouted_n, notRouted_d

    notRouted_n = .true.
    notRouted_d = .true.

    ! identify hydrograph storage location for each transfer point (subbasin)
    ! identify only those which are subbasins where water is routed through
    do i = 1, mhyd
      if (icodes(i) == 2 ) then ! ROUTE command
        do j = 1, wam_nWU
          if (inum1s(i) == TWU(j) % subs ) then
            bWAMHydrograph(i + 1) = .true. !ihouts(i)
            notRouted_n(j) = .false.
          end if
          if (inum1s(i) == TWU(j) % subd ) then ! check for destination subbasin
            bWAMHydrograph(i + 1) = .true. !ihouts(i)
            notRouted_d(j) = .false.
          end if
        end do
      end if
    end do
    ! Some subbasins will certainly not be captured by the algorithm above.
    ! Normally these are headwater subbasins.
    ! The following loop captures those headwater subbasins.
    do j = 1, wam_nWU
      if (notRouted_n(j) .AND. TWU(j) % subs > 0 ) &
        bWAMHydrograph(TWU(j) % subs) = .true. !TWU(j) % subs
      if (notRouted_d(j) .AND. TWU(j) % subd > 0 ) &
        bWAMHydrograph(TWU(j) % subd) = .true. !TWU(j) % subd
    end do

  end subroutine management_route_transfer