da_transform_xtoy_polaramv.inc

References to this file elsewhere.
1 subroutine da_transform_xtoy_polaramv (xa, iv, xp, y)
2 
3    !----------------------------------------------------------------------
4    ! Purpose: X to Y Transform operator for Polar AMV's               
5    !----------------------------------------------------------------------
6 
7    implicit none
8 
9    type (x_type),  intent(in)   :: xa       ! gridded analysis increment.
10    type (ob_type), intent(in)   :: iv       ! Innovation vector (O-B).
11    type (xpose_type), intent(in):: xp       ! Domain decomposition vars.
12    type (y_type), intent(inout) :: y        ! y = h (xa)
13 
14    integer                      :: n        ! Loop counter.
15    integer                      :: i, j , k ! Index dimension.
16    real                         :: dx, dxm  ! 
17    real                         :: dy, dym  !
18    
19    if (iv%num_polaramv > 0) then
20       do n=iv%ob_numb(iv%current_ob_time-1)%polaramv + 1, &
21          iv%ob_numb(iv%current_ob_time)%polaramv
22          ! xyh
23          ! y%polaramv(n)%u(:) = 0.0
24          ! y%polaramv(n)%v(:) = 0.0
25 
26          k = iv % polaramv(n) % info % levels
27          if (k < 1) cycle
28 
29          i = iv%polaramv(n)%loc%i
30          dy = iv%polaramv(n)%loc%dy
31          dym = iv%polaramv(n)%loc%dym
32          j = iv%polaramv(n)%loc%j
33          dx = iv%polaramv(n)%loc%dx
34          dxm = iv%polaramv(n)%loc%dxm
35 
36          ! Interpolate horizontally:
37 
38          call da_interp_lin_3d(xa % u, xp, i, j, dx, dy, dxm, dym, &
39                             y%polaramv(n)%u, k, iv%polaramv(n)%zk, k)
40          call da_interp_lin_3d(xa % v, xp, i, j, dx, dy, dxm, dym, &
41                             y%polaramv(n)%v, k, iv%polaramv(n)%zk, k)
42       end do
43    end if
44 
45 end subroutine da_transform_xtoy_polaramv
46 
47