da_transform_xtoy_sound.inc
References to this file elsewhere.
1 subroutine da_transform_xtoy_sound (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_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 !xyh y%sound(n)%u(:) = 0.0
33 !xyh y%sound(n)%v(:) = 0.0
34 !xyh y%sound(n)%t(:) = 0.0
35 !xyh y%sound(n)%q(:) = 0.0
36
37 k = iv % sound(n) % info % levels
38
39 if (k < 1) cycle
40
41 ! [1.2] Interpolate horizontally:
42 call da_interp_lin_3d(xa % u, xp, i, j, dx, dy, dxm, dym, &
43 y%sound(n)%u, k, iv%sound(n)%zk, k)
44 call da_interp_lin_3d(xa % v, xp, i, j, dx, dy, dxm, dym, &
45 y%sound(n)%v, k, iv%sound(n)%zk, k)
46 call da_interp_lin_3d(xa % t, xp, i, j, dx, dy, dxm, dym, &
47 y%sound(n)%t, k, iv%sound(n)%zk, k)
48 call da_interp_lin_3d(xa % q, xp, i, j, dx, dy, dxm, dym, &
49 y%sound(n)%q, k, iv%sound(n)%zk, k)
50 end do
51 end if
52
53 end subroutine da_transform_xtoy_sound
54
55