<HTML> <BODY BGCOLOR=#ccccdd LINK=#0000aa VLINK=#0000ff ALINK=#ff0000 ><BASE TARGET="bottom_target"><PRE>
<A NAME='DA_WDT'><A href='../../html_code/physics/da_wdt.inc.html#DA_WDT' TARGET='top_target'><IMG SRC="../../gif/bar_red.gif" border=0></A>

subroutine da_wdt(h,w,terr,dt),2

   !----------------------------------------------------------------------
   ! Purpose: Calculate DT
   !----------------------------------------------------------------------

   implicit none

   real, intent(in)  :: h(kts:kte)
   real, intent(out) :: dt(kts:kte)
   real, intent(in)  :: w(kts:kte+1)
   real, intent(in)  :: terr

   integer :: k

   if (trace_use) call da_trace_entry("da_wdt")

   do k=kte,kts+1,-1
      if (w(k) &gt;= 0.1) then
         dt(k)=(h(k)-h(k-1))/w(k)
      else
         dt(k)=0.0
      end if
   end do

   if (w(kts) &gt;= 0.1) then
      dt(kts)=(h(kts)-terr)/w(kts)
   else
      dt(kts)=0.0
   end if

   if (trace_use) call da_trace_exit("da_wdt")

end subroutine da_wdt