da_transform_xtoy_pseudo.inc

References to this file elsewhere.
1 subroutine da_transform_xtoy_pseudo(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)
13 
14    integer                      :: n        ! Loop counter.
15    integer                      :: i, j     ! Index dimension.
16    real                         :: dx, dxm  ! 
17    real                         :: dy, dym  !
18    
19    if (iv%num_pseudo > 0) then
20       ! xyh
21       ! y%pseudo(:)%u = 0.0
22       ! y%pseudo(:)%v = 0.0
23       ! y%pseudo(:)%t = 0.0
24       ! y%pseudo(:)%p = 0.0
25       ! y%pseudo(:)%q = 0.0
26 
27       do n=iv%ob_numb(iv%current_ob_time-1)%pseudo + 1, &
28          iv%ob_numb(iv%current_ob_time)%pseudo
29  
30          ! [1.1] Get horizontal interpolation weights:
31 
32          i = iv%pseudo(n)%loc%i
33          dy = iv%pseudo(n)%loc%dy
34          dym = iv%pseudo(n)%loc%dym
35          j = iv%pseudo(n)%loc%j
36          dx = iv%pseudo(n)%loc%dx
37          dxm = iv%pseudo(n)%loc%dxm
38 
39          ! [1.2] Interpolate horizontally:
40          call da_interp_obs_lin_2d(xa % u, xp, i, j, dx, dy, dxm, dym, &
41                                 y%pseudo(n)%u, iv%pseudo(n)%zk)
42          call da_interp_obs_lin_2d(xa % v, xp, i, j, dx, dy, dxm, dym, &
43                                 y%pseudo(n)%v, iv%pseudo(n)%zk)
44          call da_interp_obs_lin_2d(xa % t, xp, i, j, dx, dy, dxm, dym, &
45                                 y%pseudo(n)%t, iv%pseudo(n)%zk)
46          call da_interp_obs_lin_2d(xa % p, xp, i, j, dx, dy, dxm, dym, &
47                                 y%pseudo(n)%p, iv%pseudo(n)%zk)
48          call da_interp_obs_lin_2d(xa % q, xp, i, j, dx, dy, dxm, dym, &
49                                 y%pseudo(n)%q, iv%pseudo(n)%zk)
50       end do
51    end if
52 
53 end subroutine da_transform_xtoy_pseudo
54 
55