1 subroutine da_transform_xtoseasfcwind_adj(grid)
3 !-------------------------------------------------------------------------
4 ! Purpose: Convert (U-V in m/s) components into wind speed (Speed in m/s)
5 !-------------------------------------------------------------------------
9 type (domain), intent(inout) :: grid
11 real :: const, rgh_fac, var, height
12 integer :: i, j, is, js, ie, je
14 if (trace_use) call da_trace_entry("da_transform_xtoseasfcwind_adj")
16 const = log(10./0.0001)
24 if (test_transforms) then
31 if (is < ids) is = ids
32 if (js < jds) js = jds
34 if (ie > ide) ie = ide
35 if (je > jde) je = jde
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))
49 rgh_fac = const/log(height/0.0001) ! roughness = 0.0001
51 var = rgh_fac*rgh_fac/grid%xb%speed(i,j)
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)
58 if (trace_use) call da_trace_exit("da_transform_xtoseasfcwind_adj")
60 end subroutine da_transform_xtoseasfcwind_adj