1 subroutine da_transform_xtowtq (grid)
3 !--------------------------------------------------------------------------
5 !--------------------------------------------------------------------------
9 type (domain), intent(inout) :: grid
14 if (trace_use) call da_trace_entry("da_transform_xtowtq")
16 !------------------------------------------------------------------------
17 ! [1.0] Calculate surface variable(1-m wind, 2-m moisture and temperature)
18 !------------------------------------------------------------------------
20 !------------------------------------------------------------------------
21 ! [2.0] Calculate sfc variable perturbations at the cross point
22 !------------------------------------------------------------------------
26 grid%xa%tgrn(i,j) = 0.0
27 height = grid%xb%h(i,j,kts) - grid%xb%terr(i,j)
28 if (height <= 0.0) then
29 message(1) = "Negative height found"
30 write(unit=message(2),FMT='(2I6,A,F10.2,A,F10.2)') &
31 i,j,' ht = ',grid%xb%h(i,j,kts) ,' terr = ',grid%xb%terr(i,j)
32 call da_error(__FILE__,__LINE__,message(1:2))
34 call da_sfc_wtq_lin(grid%xb%psfc(i,j), grid%xb%tgrn(i,j), &
35 grid%xb%p(i,j,kts), grid%xb%t(i,j,kts), grid%xb%q(i,j,kts), &
36 grid%xb%u(i,j,kts), grid%xb%v(i,j,kts), &
37 grid%xb%regime(i,j), &
38 grid%xa%psfc(i,j), grid%xa%tgrn(i,j), &
39 grid%xa%p(i,j,kts), grid%xa%t(i,j,kts), grid%xa%q(i,j,kts), &
40 grid%xa%u(i,j,kts), grid%xa%v(i,j,kts), &
41 height , grid%xb%rough(i,j), grid%xb%xland(i,j), grid%xb%ds, & ! Modified by Eric Chiang (AUG 2010)
42 grid%xa%u10(i,j), grid%xa%v10(i,j), &
43 grid%xa%t2(i,j), grid%xa%q2(i,j))
47 if (trace_use) call da_trace_exit("da_transform_xtowtq")
49 end subroutine da_transform_xtowtq