1 subroutine da_transform_xtoy_tamdar_adj(grid, iv, jo_grad_y, jo_grad_x)
3 !-----------------------------------------------------------------------
5 !-----------------------------------------------------------------------
8 type (domain), intent(in) :: grid
9 type (iv_type), intent(in) :: iv ! obs. inc vector (o-b).
10 type (y_type) , intent(in) :: jo_grad_y ! grad_y(jo)
11 type (x_type) , intent(inout) :: jo_grad_x ! grad_x(jo)
15 real, allocatable :: u(:,:)
16 real, allocatable :: v(:,:)
17 real, allocatable :: t(:,:)
18 real, allocatable :: q(:,:)
20 real, allocatable :: ub(:,:)
21 real, allocatable :: vb(:,:)
24 if (trace_use_dull) call da_trace_entry("da_transform_xtoy_tamdar_adj")
26 allocate (u(iv%info(tamdar)%max_lev,iv%info(tamdar)%n1:iv%info(tamdar)%n2))
27 allocate (v(iv%info(tamdar)%max_lev,iv%info(tamdar)%n1:iv%info(tamdar)%n2))
28 allocate (t(iv%info(tamdar)%max_lev,iv%info(tamdar)%n1:iv%info(tamdar)%n2))
29 allocate (q(iv%info(tamdar)%max_lev,iv%info(tamdar)%n1:iv%info(tamdar)%n2))
31 allocate (ub(iv%info(tamdar)%max_lev,iv%info(tamdar)%n1:iv%info(tamdar)%n2))
32 allocate (vb(iv%info(tamdar)%max_lev,iv%info(tamdar)%n1:iv%info(tamdar)%n2))
34 call da_interp_lin_3d (grid%xb%u, iv%info(tamdar), ub)
35 call da_interp_lin_3d (grid%xb%v, iv%info(tamdar), vb)
37 do n=iv%info(tamdar)%n1,iv%info(tamdar)%n2
38 do k = 1, iv%info(tamdar)%levels(n)
39 if(wind_sd_tamdar) then
40 call da_uv_to_sd_adj(jo_grad_y%tamdar(n)%u(k), &
41 jo_grad_y%tamdar(n)%v(k), u(k,n), v(k,n), ub(k,n), vb(k,n))
43 u(k,n) = jo_grad_y%tamdar(n)%u(k)
44 v(k,n) = jo_grad_y%tamdar(n)%v(k)
47 t(1:size(jo_grad_y%tamdar(n)%t),n) = jo_grad_y%tamdar(n)%t(:)
48 q(1:size(jo_grad_y%tamdar(n)%q),n) = jo_grad_y%tamdar(n)%q(:)
52 call da_interp_lin_3d (jo_grad_x%u, iv%info(tamdar), u, 'u')
53 call da_interp_lin_3d (jo_grad_x%v, iv%info(tamdar), v, 'v')
55 call da_interp_lin_3d_adj (jo_grad_x%u, iv%info(tamdar), u)
56 call da_interp_lin_3d_adj (jo_grad_x%v, iv%info(tamdar), v)
58 call da_interp_lin_3d_adj (jo_grad_x%t, iv%info(tamdar), t)
59 call da_interp_lin_3d_adj (jo_grad_x%q, iv%info(tamdar), q)
68 if (trace_use_dull) call da_trace_exit("da_transform_xtoy_tamdar_adj")
70 end subroutine da_transform_xtoy_tamdar_adj