da_transform_xtoy_sound_adj.inc

References to this file elsewhere.
1 subroutine da_transform_xtoy_sound_adj(iv, xp, jo_grad_y, jo_grad_x)
2 
3    !-----------------------------------------------------------------------
4    ! Purpose: TBD
5    !-----------------------------------------------------------------------
6 
7   implicit none
8 
9   type (ob_type), intent(in)    :: iv          ! obs. inc vector (o-b).
10   type (xpose_type), intent(in) :: xp          ! Domain decomposition vars.
11   type (y_type) , intent(in)    :: jo_grad_y   ! grad_y(jo)
12   type (x_type) , intent(inout) :: jo_grad_x   ! grad_x(jo)
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_sound > 0) then
21       do n=iv%ob_numb(iv%current_ob_time-1)%sound + 1, iv%ob_numb(iv%current_ob_time)%sound
22 
23          ! [1.1] Get horizontal interpolation weights:
24 
25          i = iv%sound(n)%loc%i
26          j = iv%sound(n)%loc%j
27          dx = iv%sound(n)%loc%dx
28          dy = iv%sound(n)%loc%dy
29          dxm = iv%sound(n)%loc%dxm
30          dym = iv%sound(n)%loc%dym
31 
32          k = iv % sound(n) % info % levels
33 
34          if (k < 1) cycle
35 
36          ! [1.2] Interpolate horizontally:
37          call da_interp_lin_3d_adj(jo_grad_x % u, xp, i, j, dx, dy, dxm, dym, &
38                                  jo_grad_y%sound(n)%u, k, iv%sound(n)%zk, k)
39          call da_interp_lin_3d_adj(jo_grad_x % v, xp, i, j, dx, dy, dxm, dym, &
40                                  jo_grad_y%sound(n)%v, k, iv%sound(n)%zk, k)
41          call da_interp_lin_3d_adj(jo_grad_x % q, xp, i, j, dx, dy, dxm, dym, &
42                                  jo_grad_y%sound(n)%q, k, iv%sound(n)%zk, k)
43          call da_interp_lin_3d_adj(jo_grad_x % t, xp, i, j, dx, dy, dxm, dym, &
44                                  jo_grad_y%sound(n)%t, k, iv%sound(n)%zk, k)
45       end do
46    end if
47 
48 end subroutine da_transform_xtoy_sound_adj
49 
50