da_transform_xtoy_synop.inc

References to this file elsewhere.
1 subroutine da_transform_xtoy_synop (xa, xb, iv, xp, y)
2 
3    !-----------------------------------------------------------------------
4    ! Purpose: TBD
5    !-----------------------------------------------------------------------
6 
7    implicit none
8 
9    type (x_type),  intent(inoUT) :: xa       ! gridded analysis increment.
10    type (xb_type), intent(in)    :: xb       ! first guess state.
11    type (ob_type), intent(in)    :: iv       ! Innovation vector (O-B).
12    type (xpose_type), intent(in) :: xp       ! Domain decomposition vars.
13    type (y_type), intent(inout)  :: y        ! y = h (xa) (linear)
14 
15    integer                      :: n        ! Loop counter.
16    integer                      :: i, j     ! Index dimension.
17    real                         :: dx, dxm  ! 
18    real                         :: dy, dym  !
19 
20    if (iv%num_synop > 0) then
21 
22       ! WHY
23       ! xyh
24       ! y%synop(:)%u = 0.0
25       ! y%synop(:)%v = 0.0
26       ! y%synop(:)%t = 0.0
27       ! y%synop(:)%p = 0.0
28       ! y%synop(:)%q = 0.0
29 
30       if (sfc_assi_options == 1) then
31          do n=iv%ob_numb(iv%current_ob_time-1)%synop + 1, iv%ob_numb(iv%current_ob_time)%synop
32 
33             ! [1.1] Get horizontal interpolation weights:
34 
35             i = iv%synop(n)%loc%i
36             j = iv%synop(n)%loc%j
37             dx = iv%synop(n)%loc%dx
38             dy = iv%synop(n)%loc%dy
39             dxm = iv%synop(n)%loc%dxm
40             dym = iv%synop(n)%loc%dym
41 
42             ! [1.2] Interpolate horizontally:
43             call da_interp_obs_lin_2d(xa % u, xp, i, j, dx, dy, dxm, dym, &
44                                     y%synop(n)%u, iv%synop(n)%zk)
45             call da_interp_obs_lin_2d(xa % v, xp, i, j, dx, dy, dxm, dym, &
46                                     y%synop(n)%v, iv%synop(n)%zk)
47             call da_interp_obs_lin_2d(xa % t, xp, i, j, dx, dy, dxm, dym, &
48                                     y%synop(n)%t, iv%synop(n)%zk)
49             call da_interp_obs_lin_2d(xa % q, xp, i, j, dx, dy, dxm, dym, &
50                                     y%synop(n)%q, iv%synop(n)%zk)
51 
52             call da_interp_lin_2d(xa % psfc, xp%ims, xp%ime, xp%jms, xp%jme, &
53                                 i, j, dx, dy, dxm, dym, y%synop(n)%p)
54          end do
55       else if (sfc_assi_options == 2) then
56          do n=iv%ob_numb(iv%current_ob_time-1)%synop + 1, &
57             iv%ob_numb(iv%current_ob_time)%synop
58             call da_transform_xtopsfc(xb, xa, xp, iv%synop(n), y%synop(n))
59          end do
60       end if
61    end if
62 
63 end subroutine da_transform_xtoy_synop
64 
65