da_transform_xtoseasfcwind_lin.inc
References to this file elsewhere.
1 subroutine da_transform_xtoseasfcwind_lin(xa, xb)
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 (x_type), intent(inout) :: xa ! model space analysis (local).
10 type (xb_type), intent(in) :: xb ! first guess.
11
12 real :: const, rgh_fac, height
13 integer :: i, j, k
14
15 if (trace_use) call da_trace_entry("da_transform_xtoseasfcwind_lin")
16
17 const = log(10./0.0001)
18 k = xb%kts
19
20 do j=xb%jts,xb%jte
21 do i=xb%its,xb%ite
22
23 height = xb%h(i,j,k) - xb%terr(i,j)
24 if( height <= 0.) then
25 print*,i,j,' ht = ',xb%h(i,j,k) ,' terr = ',xb%terr(i,j)
26 stop
27 endif
28
29 rgh_fac = const/log(height/0.0001) ! roughness = 0.0001
30 xa%speed(i,j) = (xa%u(i,j,k)*xb%u(i,j,k) &
31 + xa%v(i,j,k)*xb%v(i,j,k)) &
32 * rgh_fac*rgh_fac / 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