da_transform_xtoy_ships.inc

References to this file elsewhere.
1 subroutine da_transform_xtoy_ships (grid, iv, y)
2 
3    !-----------------------------------------------------------------------
4    ! Purpose: TBD
5    !-----------------------------------------------------------------------
6 
7    implicit none
8 
9    type (domain),     intent(inout)  :: grid
10    type (iv_type),    intent(in)     :: iv       ! Innovation vector (O-B).
11    type (y_type),     intent(inout)  :: y        ! y = h (grid%xa) (linear)
12 
13    integer :: n   ! Loop counter.
14 
15    real, allocatable :: model_u(:,:)
16    real, allocatable :: model_v(:,:)
17    real, allocatable :: model_t(:,:)
18    real, allocatable :: model_q(:,:)
19    real, allocatable :: model_psfc(:)
20 
21    if (trace_use_dull) call da_trace_entry("da_transform_xtoy_ships")
22 
23    if (sfc_assi_options == sfc_assi_options_1) then
24       allocate (model_u(1,iv%info(ships)%n1:iv%info(ships)%n2))
25       allocate (model_v(1,iv%info(ships)%n1:iv%info(ships)%n2))
26       allocate (model_t(1,iv%info(ships)%n1:iv%info(ships)%n2))
27       allocate (model_q(1,iv%info(ships)%n1:iv%info(ships)%n2))
28       allocate (model_psfc(iv%info(ships)%n1:iv%info(ships)%n2))
29       ! [1.2] Interpolate horizontally:
30       call da_interp_lin_3d (grid%xa%u, iv%info(ships), model_u)
31       call da_interp_lin_3d (grid%xa%v, iv%info(ships), model_v)
32       call da_interp_lin_3d (grid%xa%t, iv%info(ships), model_t)
33       call da_interp_lin_3d (grid%xa%q, iv%info(ships), model_q)
34 
35       call da_interp_lin_2d (grid%xa%psfc, iv%info(ships), 1, model_psfc)
36 
37       do n=iv%info(ships)%n1,iv%info(ships)%n2
38          y%ships(n)%u = model_u(1,n)
39          y%ships(n)%v = model_v(1,n)
40          y%ships(n)%t = model_t(1,n)
41          y%ships(n)%q = model_q(1,n)
42          y%ships(n)%p = model_psfc(n)
43       end do
44       deallocate (model_u)
45       deallocate (model_v)
46       deallocate (model_t)
47       deallocate (model_q)
48       deallocate (model_psfc)
49    else if (sfc_assi_options == sfc_assi_options_2) then
50       ! [2.0] Surface assmiilation approach 2
51       call da_transform_xtopsfc(grid,iv,ships,iv%ships(:),y%ships(:))
52    end if
53 
54    if (trace_use_dull) call da_trace_exit("da_transform_xtoy_ships")
55 
56 end subroutine da_transform_xtoy_ships
57 
58