stats_horizontal_speed_at_height Subroutine

private subroutine stats_horizontal_speed_at_height(klo, khi, weight, valid, speed)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: klo
integer, intent(in) :: khi
real, intent(in) :: weight
logical, intent(in) :: valid(ib:ie,jb:je)
real, intent(out) :: speed(ib:ie,jb:je)

Called by

proc~~stats_horizontal_speed_at_height~~CalledByGraph proc~stats_horizontal_speed_at_height stats_horizontal_speed_at_height proc~stats_compute_tavg_pedestrian_wind stats_compute_tavg_pedestrian_wind proc~stats_compute_tavg_pedestrian_wind->proc~stats_horizontal_speed_at_height proc~stats_main stats_main proc~stats_main->proc~stats_compute_tavg_pedestrian_wind program~udales uDALES program~udales->proc~stats_main

Source Code

    subroutine stats_horizontal_speed_at_height(klo, khi, weight, valid, speed)
      implicit none
      integer, intent(in)  :: klo, khi
      real,    intent(in)  :: weight
      logical, intent(in)  :: valid(ib:ie,jb:je)
      real,    intent(out) :: speed(ib:ie,jb:je)
      integer :: i, j
      real    :: uheight, vheight

      speed = 0.
      do j = jb, je
        do i = ib, ie
          if (.not. valid(i,j)) cycle
          if (klo == khi) then
            uheight = uc(i,j,klo)
            vheight = vc(i,j,klo)
          else
            uheight = (1.-weight)*uc(i,j,klo) + weight*uc(i,j,khi)
            vheight = (1.-weight)*vc(i,j,klo) + weight*vc(i,j,khi)
          end if
          speed(i,j) = sqrt(uheight*uheight + vheight*vheight)
        end do
      end do
    end subroutine stats_horizontal_speed_at_height