1 subroutine da_transform_xtoy_airep_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(:,:)
22 real, allocatable :: ub(:,:)
23 real, allocatable :: vb(:,:)
25 if (trace_use_dull) call da_trace_entry("da_transform_xtoy_airep_adj")
27 allocate (u(iv%info(airep)%max_lev,iv%info(airep)%n1:iv%info(airep)%n2))
28 allocate (v(iv%info(airep)%max_lev,iv%info(airep)%n1:iv%info(airep)%n2))
29 allocate (t(iv%info(airep)%max_lev,iv%info(airep)%n1:iv%info(airep)%n2))
30 allocate (q(iv%info(airep)%max_lev,iv%info(airep)%n1:iv%info(airep)%n2))
32 allocate (ub(iv%info(airep)%max_lev,iv%info(airep)%n1:iv%info(airep)%n2))
33 allocate (vb(iv%info(airep)%max_lev,iv%info(airep)%n1:iv%info(airep)%n2))
35 call da_interp_lin_3d (grid%xb%u, iv%info(airep), ub)
36 call da_interp_lin_3d (grid%xb%v, iv%info(airep), vb)
38 do n=iv%info(airep)%n1,iv%info(airep)%n2
39 do k = 1, iv%info(airep)%levels(n)
40 if(wind_sd_airep) then
41 call da_uv_to_sd_adj(jo_grad_y%airep(n)%u(k), &
42 jo_grad_y%airep(n)%v(k), u(k,n), v(k,n), ub(k,n), vb(k,n))
44 u(k,n) = jo_grad_y%airep(n)%u(k)
45 v(k,n) = jo_grad_y%airep(n)%v(k)
48 t(1:size(jo_grad_y%airep(n)%t),n) = jo_grad_y%airep(n)%t(:)
49 q(1:size(jo_grad_y%airep(n)%q),n) = jo_grad_y%airep(n)%q(:)
53 call da_interp_lin_3d_adj(jo_grad_x%u, iv%info(airep), u,'u')
54 call da_interp_lin_3d_adj(jo_grad_x%v, iv%info(airep), v,'v')
56 call da_interp_lin_3d_adj(jo_grad_x%u, iv%info(airep), u)
57 call da_interp_lin_3d_adj(jo_grad_x%v, iv%info(airep), v)
59 call da_interp_lin_3d_adj(jo_grad_x%t, iv%info(airep), t)
60 call da_interp_lin_3d_adj(jo_grad_x%q, iv%info(airep), q)
69 if (trace_use_dull) call da_trace_exit("da_transform_xtoy_airep_adj")
71 end subroutine da_transform_xtoy_airep_adj