1 subroutine da_transform_xtoy_ships (grid, iv, y)
3 !-----------------------------------------------------------------------
5 ! Updated for Analysis on Arakawa-C grid
6 ! Author: Syed RH Rizvi, MMM/ESSL/NCAR, Date: 10/22/2008
7 !-----------------------------------------------------------------------
11 type (domain), intent(inout) :: grid
12 type (iv_type), intent(in) :: iv ! Innovation vector (O-B).
13 type (y_type), intent(inout) :: y ! y = h (grid%xa) (linear)
15 integer :: n ! Loop counter.
17 real, allocatable :: model_u(:,:)
18 real, allocatable :: model_v(:,:)
19 real, allocatable :: model_t(:,:)
20 real, allocatable :: model_q(:,:)
21 real, allocatable :: model_psfc(:)
22 real, allocatable :: ub(:,:)
23 real, allocatable :: vb(:,:)
24 if (trace_use_dull) call da_trace_entry("da_transform_xtoy_ships")
26 if (sfc_assi_options == sfc_assi_options_1) then
27 allocate (model_u(1,iv%info(ships)%n1:iv%info(ships)%n2))
28 allocate (model_v(1,iv%info(ships)%n1:iv%info(ships)%n2))
29 allocate (model_t(1,iv%info(ships)%n1:iv%info(ships)%n2))
30 allocate (model_q(1,iv%info(ships)%n1:iv%info(ships)%n2))
31 allocate (model_psfc(iv%info(ships)%n1:iv%info(ships)%n2))
32 allocate (ub(1,iv%info(ships)%n1:iv%info(ships)%n2))
33 allocate (vb(1,iv%info(ships)%n1:iv%info(ships)%n2))
34 ! [1.2] Interpolate horizontally:
36 call da_interp_lin_3d (grid%xa%u, iv%info(ships), model_u,'u')
37 call da_interp_lin_3d (grid%xa%v, iv%info(ships), model_v,'v')
39 call da_interp_lin_3d (grid%xa%u, iv%info(ships), model_u)
40 call da_interp_lin_3d (grid%xa%v, iv%info(ships), model_v)
42 call da_interp_lin_3d (grid%xa%t, iv%info(ships), model_t)
43 call da_interp_lin_3d (grid%xa%q, iv%info(ships), model_q)
45 call da_interp_lin_2d (grid%xa%psfc, iv%info(ships), 1, model_psfc)
47 call da_interp_lin_3d (grid%xb%u, iv%info(ships), ub)
48 call da_interp_lin_3d (grid%xb%v, iv%info(ships), vb)
50 do n=iv%info(ships)%n1,iv%info(ships)%n2
52 call da_uv_to_sd_lin(y%ships(n)%u,y%ships(n)%v,model_u(1,n),model_v(1,n),ub(1,n),vb(1,n))
54 y%ships(n)%u = model_u(1,n)
55 y%ships(n)%v = model_v(1,n)
58 y%ships(n)%t = model_t(1,n)
59 y%ships(n)%q = model_q(1,n)
60 y%ships(n)%p = model_psfc(n)
66 deallocate (model_psfc)
69 else if (sfc_assi_options == sfc_assi_options_2) then
70 ! [2.0] Surface assimilation approach 2
71 call da_transform_xtopsfc(grid,iv,ships,iv%ships(:),y%ships(:))
74 if (trace_use_dull) call da_trace_exit("da_transform_xtoy_ships")
76 end subroutine da_transform_xtoy_ships