da_transform_xtoseasfcwind_adj.inc

References to this file elsewhere.
1 subroutine da_transform_xtoseasfcwind_adj(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, var, height
13    integer :: i, j, k, is, js, ie, je
14 
15    if (trace_use) call da_trace_entry("da_transform_xtoseasfcwind_adj")
16 
17    const = log(10./0.0001)
18    k = xb%kts
19 
20    is = xb%its
21    js = xb%jts
22 
23    ie = xb%ite
24    je = xb%jte
25 
26    if (Testing_WRFVAR) then
27       is = xb%its-1
28       js = xb%jts-1
29 
30       ie = xb%ite+1
31       je = xb%jte+1
32 
33       if (is < xb%ids) is = xb%ids
34       if (js < xb%jds) js = xb%jds
35 
36       if (ie > xb%ide) ie = xb%ide
37       if (je > xb%jde) je = xb%jde
38    end if
39 
40 
41    do j=js, je
42       do i=is, ie
43         height = xb%h(i,j,k) - xb%terr(i,j)
44          if( height <= 0.) then
45          print*,i,j,' ht = ',xb%h(i,j,k) ,' terr =  ',xb%terr(i,j)
46          stop
47          endif
48 
49          rgh_fac = const/log(height/0.0001) ! roughness = 0.0001
50 
51          var = rgh_fac*rgh_fac/xb%speed(i,j)
52 
53          xa%u(i,j,k)=xa%u(i,j,k)+var*xa%speed(i,j)*xb%u(i,j,k)
54          xa%v(i,j,k)=xa%v(i,j,k)+var*xa%speed(i,j)*xb%v(i,j,k)
55       end do
56    end do
57 
58    if (trace_use) call da_trace_exit("da_transform_xtoseasfcwind_adj")
59 
60 end subroutine da_transform_xtoseasfcwind_adj
61 
62