da_transform_xtoy_airep.inc

References to this file elsewhere.
1 subroutine da_transform_xtoy_airep (xa, iv, xp, y)
2 
3    !--------------------------------------------------------------------------
4    ! Purpose: TBD
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) (linear)
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_airep > 0) then
20       do n=iv%ob_numb(iv%current_ob_time-1)%airep + 1, iv%ob_numb(iv%current_ob_time)%airep
21          k = iv % airep(n) % info % levels
22          if (k < 1) cycle
23 
24          ! xyh         y%airep(n)%u(:) = 0.0
25          ! xyh         y%airep(n)%v(:) = 0.0
26          ! xyh         y%airep(n)%t(:) = 0.0
27 
28          ! [1.1] Get horizontal interpolation weights:
29 
30          i = iv%airep(n)%loc%i
31          dy = iv%airep(n)%loc%dy
32          dym = iv%airep(n)%loc%dym
33          j = iv%airep(n)%loc%j
34          dx = iv%airep(n)%loc%dx
35          dxm = iv%airep(n)%loc%dxm
36 
37          ![1.2] Interpolate horizontally:
38          call da_interp_lin_3d(xa % u, xp, i, j, dx, dy, dxm, dym, &
39                            y%airep(n)%u, k, iv%airep(n)%zk, k)
40 
41          call da_interp_lin_3d(xa % v, xp, i, j, dx, dy, dxm, dym, &
42                            y%airep(n)%v, k, iv%airep(n)%zk, k)
43 
44          call da_interp_lin_3d(xa % t, xp, i, j, dx, dy, dxm, dym, &
45                            y%airep(n)%t, k, iv%airep(n)%zk, k)
46       end do
47    end if
48 
49 end subroutine da_transform_xtoy_airep
50 
51 
52