da_transform_xtoy_ssmt2.inc

References to this file elsewhere.
1 subroutine da_transform_xtoy_ssmt2 (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 
20    if (iv%num_ssmt2 > 0) then
21       do n=1, iv % num_ssmt2
22          y%ssmt2(n)%rh(:) = 0.0
23 
24          k = iv % ssmt2(n) % info % levels
25 
26          ! [1.1] Get horizontal interpolation weights:
27 
28          i = iv%ssmt2(n)%loc%i
29          dy = iv%ssmt2(n)%loc%dy
30          dym = iv%ssmt2(n)%loc%dym
31          j = iv%ssmt2(n)%loc%j
32          dx = iv%ssmt2(n)%loc%dx
33          dxm = iv%ssmt2(n)%loc%dxm
34 
35          ! [1.2] Interpolate horizontally:
36          call da_interp_lin_3d(xa % rh, xp, i, j, dx, dy, dxm, dym, &
37                             y%ssmt2(n)%rh, k, iv%ssmt2(n)%zk, k)
38        end do
39    end if
40 
41 end subroutine da_transform_xtoy_ssmt2
42 
43