1 subroutine da_transform_xtoy_mtgirs_adj(grid, iv, jo_grad_y, jo_grad_x)
3 !-----------------------------------------------------------------------
5 ! Updated for Analysis on Arakawa-C grid
6 ! Author: Syed RH Rizvi, MMM/ESSL/NCAR, Date: 10/22/2008
7 !-----------------------------------------------------------------------
10 type(domain), intent(in) :: grid
11 type (iv_type), intent(in) :: iv ! obs. inc vector (o-b).
12 type (y_type) , intent(in) :: jo_grad_y ! grad_y(jo)
13 type (x_type) , intent(inout) :: jo_grad_x ! grad_x(jo)
17 real, allocatable :: u(:,:)
18 real, allocatable :: v(:,:)
19 real, allocatable :: t(:,:)
20 real, allocatable :: q(:,:)
21 real, allocatable :: ub(:,:)
22 real, allocatable :: vb(:,:)
24 if (trace_use_dull) call da_trace_entry("da_transform_xtoy_mtgirs_adj")
26 allocate (u(iv%info(mtgirs)%max_lev,iv%info(mtgirs)%n1:iv%info(mtgirs)%n2))
27 allocate (v(iv%info(mtgirs)%max_lev,iv%info(mtgirs)%n1:iv%info(mtgirs)%n2))
28 allocate (t(iv%info(mtgirs)%max_lev,iv%info(mtgirs)%n1:iv%info(mtgirs)%n2))
29 allocate (q(iv%info(mtgirs)%max_lev,iv%info(mtgirs)%n1:iv%info(mtgirs)%n2))
31 allocate (ub(iv%info(mtgirs)%max_lev,iv%info(mtgirs)%n1:iv%info(mtgirs)%n2))
32 allocate (vb(iv%info(mtgirs)%max_lev,iv%info(mtgirs)%n1:iv%info(mtgirs)%n2))
33 call da_interp_lin_3d (grid%xb%u, iv%info(mtgirs), ub)
34 call da_interp_lin_3d (grid%xb%v, iv%info(mtgirs), vb)
36 do n=iv%info(mtgirs)%n1,iv%info(mtgirs)%n2
37 do k = 1, iv%info(mtgirs)%levels(n)
38 if(wind_sd_mtgirs) then
39 call da_uv_to_sd_adj(jo_grad_y%mtgirs(n)%u(k), &
40 jo_grad_y%mtgirs(n)%v(k), u(k,n), v(k,n), ub(k,n), vb(k,n))
42 u(k,n) = jo_grad_y%mtgirs(n)%u(k)
43 v(k,n) = jo_grad_y%mtgirs(n)%v(k)
46 t(1:size(jo_grad_y%mtgirs(n)%t),n) = jo_grad_y%mtgirs(n)%t(:)
47 q(1:size(jo_grad_y%mtgirs(n)%q),n) = jo_grad_y%mtgirs(n)%q(:)
51 call da_interp_lin_3d_adj (jo_grad_x%u, iv%info(mtgirs), u,'u')
52 call da_interp_lin_3d_adj (jo_grad_x%v, iv%info(mtgirs), v,'v')
54 call da_interp_lin_3d_adj (jo_grad_x%u, iv%info(mtgirs), u)
55 call da_interp_lin_3d_adj (jo_grad_x%v, iv%info(mtgirs), v)
57 call da_interp_lin_3d_adj (jo_grad_x%t, iv%info(mtgirs), t)
58 call da_interp_lin_3d_adj (jo_grad_x%q, iv%info(mtgirs), q)
59 call da_interp_lin_3d (grid%xb%u, iv%info(mtgirs), ub)
60 call da_interp_lin_3d (grid%xb%v, iv%info(mtgirs), vb)
68 if (trace_use_dull) call da_trace_exit("da_transform_xtoy_mtgirs_adj")
70 end subroutine da_transform_xtoy_mtgirs_adj