1 subroutine da_transform_xtoy_tamdar_sfc (grid, iv, y)
3 !-----------------------------------------------------------------------
5 !-----------------------------------------------------------------------
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)
13 integer :: n ! Loop counter.
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(:)
21 real, allocatable :: ub(:,:)
22 real, allocatable :: vb(:,:)
24 if (trace_use_dull) call da_trace_entry("da_transform_xtoy_tamdar_sfc")
26 if (sfc_assi_options == sfc_assi_options_1) then
27 allocate (model_u(1,iv%info(tamdar_sfc)%n1:iv%info(tamdar_sfc)%n2))
28 allocate (model_v(1,iv%info(tamdar_sfc)%n1:iv%info(tamdar_sfc)%n2))
29 allocate (model_t(1,iv%info(tamdar_sfc)%n1:iv%info(tamdar_sfc)%n2))
30 allocate (model_q(1,iv%info(tamdar_sfc)%n1:iv%info(tamdar_sfc)%n2))
31 allocate (model_psfc(iv%info(tamdar_sfc)%n1:iv%info(tamdar_sfc)%n2))
33 allocate (ub(1,iv%info(tamdar_sfc)%n1:iv%info(tamdar_sfc)%n2))
34 allocate (vb(1,iv%info(tamdar_sfc)%n1:iv%info(tamdar_sfc)%n2))
36 ! [1.2] Interpolate horizontally:
38 call da_interp_lin_3d (grid%xa%u, iv%info(tamdar_sfc), model_u,'u')
39 call da_interp_lin_3d (grid%xa%v, iv%info(tamdar_sfc), model_v,'v')
41 call da_interp_lin_3d (grid%xa%u, iv%info(tamdar_sfc), model_u)
42 call da_interp_lin_3d (grid%xa%v, iv%info(tamdar_sfc), model_v)
44 call da_interp_lin_3d (grid%xa%t, iv%info(tamdar_sfc), model_t)
45 call da_interp_lin_3d (grid%xa%q, iv%info(tamdar_sfc), model_q)
47 call da_interp_lin_2d (grid%xa%psfc, iv%info(tamdar_sfc), 1, model_psfc)
49 call da_interp_lin_3d (grid%xb%u, iv%info(tamdar_sfc), ub)
50 call da_interp_lin_3d (grid%xb%v, iv%info(tamdar_sfc), vb)
52 do n=iv%info(tamdar_sfc)%n1,iv%info(tamdar_sfc)%n2
53 if(wind_sd_tamdar)then
54 call da_uv_to_sd_lin(y%tamdar_sfc(n)%u,y%tamdar_sfc(n)%v,model_u(1,n),model_v(1,n),ub(1,n),vb(1,n))
56 y%tamdar_sfc(n)%u = model_u(1,n)
57 y%tamdar_sfc(n)%v = model_v(1,n)
59 y%tamdar_sfc(n)%t = model_t(1,n)
60 y%tamdar_sfc(n)%q = model_q(1,n)
61 y%tamdar_sfc(n)%p = model_psfc(n)
68 deallocate (model_psfc)
72 else if (sfc_assi_options == sfc_assi_options_2) then
73 call da_transform_xtopsfc(grid, iv, tamdar_sfc, iv%tamdar_sfc(:), y%tamdar_sfc(:))
76 if (trace_use_dull) call da_trace_exit("da_transform_xtoy_tamdar_sfc")
78 end subroutine da_transform_xtoy_tamdar_sfc