1 subroutine da_transform_xtoy_qscat_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 ! first guess state.
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)
15 integer :: n ! Loop counter.
17 real, allocatable :: u(:,:)
18 real, allocatable :: v(:,:)
19 real, allocatable :: ub(:,:)
20 real, allocatable :: vb(:,:)
22 if (trace_use_dull) call da_trace_entry("da_transform_xtoy_qscat_adj")
24 allocate (u(1,iv%info(qscat)%n1:iv%info(qscat)%n2))
25 allocate (v(1,iv%info(qscat)%n1:iv%info(qscat)%n2))
27 allocate (ub(1,iv%info(qscat)%n1:iv%info(qscat)%n2))
28 allocate (vb(1,iv%info(qscat)%n1:iv%info(qscat)%n2))
30 call da_interp_lin_3d (grid%xb%u, iv%info(qscat), ub)
31 call da_interp_lin_3d (grid%xb%v, iv%info(qscat), vb)
33 do n=iv%info(qscat)%n1,iv%info(qscat)%n2
34 if (wind_sd_qscat) then
35 call da_uv_to_sd_adj(jo_grad_y%qscat(n)%u, &
36 jo_grad_y%qscat(n)%v, u(1,n), v(1,n), ub(1,n), vb(1,n))
38 u(1,n) = jo_grad_y%qscat(n)%u
39 v(1,n) = jo_grad_y%qscat(n)%v
44 call da_interp_lin_3d_adj (jo_grad_x%u, iv%info(qscat), u,'u')
45 call da_interp_lin_3d_adj (jo_grad_x%v, iv%info(qscat), v,'v')
47 call da_interp_lin_3d_adj (jo_grad_x%u, iv%info(qscat), u)
48 call da_interp_lin_3d_adj (jo_grad_x%v, iv%info(qscat), v)
56 if (trace_use_dull) call da_trace_exit("da_transform_xtoy_qscat_adj")
58 end subroutine da_transform_xtoy_qscat_adj