da_transform_xtoseasfcwind_lin.inc
References to this file elsewhere.
1 subroutine da_transform_xtoseasfcwind_lin(grid)
2
3 !----------------------------------------------------------------------------
4 ! Purpose: Convert (U-V in m/s) components into wind speed (Speed in m/s)
5 !----------------------------------------------------------------------------
6
7 implicit none
8
9 type (domain), intent(inout) :: grid
10
11 real :: const, rgh_fac, height
12 integer :: i, j, k
13
14 if (trace_use) call da_trace_entry("da_transform_xtoseasfcwind_lin")
15
16 const = log(10.0/0.0001)
17 k = grid%xb%kts
18
19 do j=jts,jte
20 do i=its,ite
21
22 height = grid%xb%h(i,j,k) - grid%xb%terr(i,j)
23 if (height <= 0.0) then
24 message(1) = "Negative height found"
25 write(unit=message(2),FMT='(2I6,A,F10.2,A,F10.2)') &
26 i,j,' ht = ',grid%xb%h(i,j,k) ,' terr = ',grid%xb%terr(i,j)
27 call da_error(__FILE__,__LINE__,message(1:2))
28 end if
29
30 rgh_fac = const/log(height/0.0001) ! roughness = 0.0001
31 grid%xa%speed(i,j) = (grid%xa%u(i,j,k)*grid%xb%u(i,j,k) &
32 + grid%xa%v(i,j,k)*grid%xb%v(i,j,k)) * rgh_fac*rgh_fac / grid%xb%speed(i,j)
33 end do
34 end do
35
36 if (trace_use) call da_trace_exit("da_transform_xtoseasfcwind_lin")
37
38 end subroutine da_transform_xtoseasfcwind_lin
39
40