wrf svn trunk commit r4103
[wrffire.git] / wrfv2_fire / var / da / da_qscat / da_transform_xtoy_qscat_adj.inc
blob0fbe38f5335fd9e066d938f5eb64b02e41c23d82
1 subroutine da_transform_xtoy_qscat_adj(iv, jo_grad_y, jo_grad_x)
3    !-----------------------------------------------------------------------
4    ! Purpose: TBD
5    !    Updated for Analysis on Arakawa-C grid
6    !    Author: Syed RH Rizvi,  MMM/ESSL/NCAR,  Date: 10/22/2008
7    !-----------------------------------------------------------------------
9    implicit none
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(:,:)
20    if (trace_use_dull) call da_trace_entry("da_transform_xtoy_qscat_adj")
22    allocate (u(1,iv%info(qscat)%n1:iv%info(qscat)%n2))
23    allocate (v(1,iv%info(qscat)%n1:iv%info(qscat)%n2))
25    do n=iv%info(qscat)%n1,iv%info(qscat)%n2
26       u(1,n) = jo_grad_y%qscat(n)%u
27       v(1,n) = jo_grad_y%qscat(n)%v
28    end do
30 #ifdef A2C
31    call da_interp_lin_3d_adj (jo_grad_x%u, iv%info(qscat), u,'u')
32    call da_interp_lin_3d_adj (jo_grad_x%v, iv%info(qscat), v,'v')
33 #else
34    call da_interp_lin_3d_adj (jo_grad_x%u, iv%info(qscat), u)
35    call da_interp_lin_3d_adj (jo_grad_x%v, iv%info(qscat), v)
36 #endif
38    deallocate (u)
39    deallocate (v)
41    if (trace_use_dull) call da_trace_exit("da_transform_xtoy_qscat_adj")
43 end subroutine da_transform_xtoy_qscat_adj