1 subroutine da_transform_xtoy_sound (grid, iv, y)
3 !-----------------------------------------------------------------------
5 ! Updated for Analysis on Arakawa-C grid
6 ! Author: Syed RH Rizvi, MMM/ESSL/NCAR, Date: 10/22/2008
7 !-----------------------------------------------------------------------
11 type (domain), intent(in) :: grid
12 type (iv_type), intent(in) :: iv ! Innovation vector (O-B).
13 type (y_type), intent(inout) :: y ! y = h (grid%xa) (linear)
15 real, allocatable :: u(:,:)
16 real, allocatable :: v(:,:)
17 real, allocatable :: t(:,:)
18 real, allocatable :: q(:,:)
20 real, allocatable :: ub(:,:)
21 real, allocatable :: vb(:,:)
25 if (trace_use_dull) call da_trace_entry("da_transform_xtoy_sound")
27 allocate (u(iv%info(sound)%max_lev,iv%info(sound)%n1:iv%info(sound)%n2))
28 allocate (v(iv%info(sound)%max_lev,iv%info(sound)%n1:iv%info(sound)%n2))
29 allocate (t(iv%info(sound)%max_lev,iv%info(sound)%n1:iv%info(sound)%n2))
30 allocate (q(iv%info(sound)%max_lev,iv%info(sound)%n1:iv%info(sound)%n2))
32 allocate (ub(iv%info(sound)%max_lev,iv%info(sound)%n1:iv%info(sound)%n2))
33 allocate (vb(iv%info(sound)%max_lev,iv%info(sound)%n1:iv%info(sound)%n2))
36 call da_interp_lin_3d (grid%xa%u, iv%info(sound), u,'u')
37 call da_interp_lin_3d (grid%xa%v, iv%info(sound), v,'v')
39 call da_interp_lin_3d (grid%xa%u, iv%info(sound), u)
40 call da_interp_lin_3d (grid%xa%v, iv%info(sound), v)
42 call da_interp_lin_3d (grid%xa%t, iv%info(sound), t)
43 call da_interp_lin_3d (grid%xa%q, iv%info(sound), q)
45 call da_interp_lin_3d (grid%xb%u, iv%info(sound), ub)
46 call da_interp_lin_3d (grid%xb%v, iv%info(sound), vb)
49 do n=iv%info(sound)%n1,iv%info(sound)%n2
50 do k = 1, iv%info(sound)%levels(n)
51 if(wind_sd_sound) then
52 call da_uv_to_sd_lin(y%sound(n)%u(k),y%sound(n)%v(k),u(k,n),v(k,n),ub(k,n),vb(k,n))
54 y%sound(n)%u(k) = u(k,n)
55 y%sound(n)%v(k) = v(k,n)
58 y%sound(n)%t(:) = t(1:size(y%sound(n)%t),n)
59 y%sound(n)%q(:) = q(1:size(y%sound(n)%q),n)
69 if (trace_use_dull) call da_trace_exit("da_transform_xtoy_sound")
71 end subroutine da_transform_xtoy_sound