da_transform_xtoseasfcwind_adj.inc
References to this file elsewhere.
1 subroutine da_transform_xtoseasfcwind_adj(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, var, height
12 integer :: i, j, is, js, ie, je
13
14 if (trace_use) call da_trace_entry("da_transform_xtoseasfcwind_adj")
15
16 const = log(10./0.0001)
17
18 is = its
19 js = jts
20
21 ie = ite
22 je = jte
23
24 if (test_transforms) then
25 is = its-1
26 js = jts-1
27
28 ie = ite+1
29 je = jte+1
30
31 if (is < ids) is = ids
32 if (js < jds) js = jds
33
34 if (ie > ide) ie = ide
35 if (je > jde) je = jde
36 end if
37
38
39 do j=js, je
40 do i=is, ie
41 height = grid%xb%h(i,j,kts) - grid%xb%terr(i,j)
42 if (height <= 0.0) then
43 message(1) = "Negative height found"
44 write(unit=message(2),FMT='(2I6,A,F10.2,A,F10.2)') &
45 i,j,' ht = ',grid%xb%h(i,j,kts) ,' terr = ',grid%xb%terr(i,j)
46 call da_error(__FILE__,__LINE__,message(1:2))
47 end if
48
49 rgh_fac = const/log(height/0.0001) ! roughness = 0.0001
50
51 var = rgh_fac*rgh_fac/grid%xb%speed(i,j)
52
53 grid%xa%u(i,j,kts)=grid%xa%u(i,j,kts)+var*grid%xa%speed(i,j)*grid%xb%u(i,j,kts)
54 grid%xa%v(i,j,kts)=grid%xa%v(i,j,kts)+var*grid%xa%speed(i,j)*grid%xb%v(i,j,kts)
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