1 subroutine da_transform_xtoy_pilot_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)
15 integer :: n, k ! Loop counter.
17 real, allocatable :: model_u(:,:)
18 real, allocatable :: model_v(:,:)
19 real, allocatable :: ub(:,:)
20 real, allocatable :: vb(:,:)
22 if (trace_use_dull) call da_trace_entry("da_transform_xtoy_pilot_adj")
24 allocate (model_u(iv%info(pilot)%max_lev,iv%info(pilot)%n1:iv%info(pilot)%n2))
25 allocate (model_v(iv%info(pilot)%max_lev,iv%info(pilot)%n1:iv%info(pilot)%n2))
26 allocate (ub(iv%info(pilot)%max_lev,iv%info(pilot)%n1:iv%info(pilot)%n2))
27 allocate (vb(iv%info(pilot)%max_lev,iv%info(pilot)%n1:iv%info(pilot)%n2))
28 call da_interp_lin_3d (grid%xb%u, iv%info(pilot), ub)
29 call da_interp_lin_3d (grid%xb%v, iv%info(pilot), vb)
31 do n=iv%info(pilot)%n1,iv%info(pilot)%n2
32 do k = 1, iv%info(pilot)%levels(n)
34 if(wind_sd_pilot) then
35 call da_uv_to_sd_adj(jo_grad_y%pilot(n)%u(k), &
36 jo_grad_y%pilot(n)%v(k), model_u(k,n), model_v(k,n), ub(k,n), vb(k,n))
38 model_u(k,n) = jo_grad_y%pilot(n)%u(k)
39 model_v(k,n) = jo_grad_y%pilot(n)%v(k)
47 call da_interp_lin_3d_adj (jo_grad_x%u, iv%info(pilot), model_u,'u')
48 call da_interp_lin_3d_adj (jo_grad_x%v, iv%info(pilot), model_v,'v')
50 call da_interp_lin_3d_adj (jo_grad_x%u, iv%info(pilot), model_u)
51 call da_interp_lin_3d_adj (jo_grad_x%v, iv%info(pilot), model_v)
53 call da_interp_lin_3d (grid%xb%u, iv%info(pilot), ub)
54 call da_interp_lin_3d (grid%xb%v, iv%info(pilot), vb)
60 if (trace_use_dull) call da_trace_exit("da_transform_xtoy_pilot_adj")
62 end subroutine da_transform_xtoy_pilot_adj