da_transform_xtoy_sonde_sfc_adj.inc
References to this file elsewhere.
1 subroutine da_transform_xtoy_sonde_sfc_adj(grid, iv, jo_grad_y, jo_grad_x)
2
3 !-----------------------------------------------------------------------
4 ! Purpose: TBD
5 !-----------------------------------------------------------------------
6
7 implicit none
8
9 type (domain), intent(in) :: grid
10 type (iv_type), intent(in) :: iv ! obs. inc vector (o-b).
11 type (y_type) , intent(inout) :: jo_grad_y ! grad_y(jo)
12 type (x_type) , intent(inout) :: jo_grad_x ! grad_x(jo)
13
14 integer :: n ! Loop counter.
15
16 real, allocatable :: model_u(:,:)
17 real, allocatable :: model_v(:,:)
18 real, allocatable :: model_t(:,:)
19 real, allocatable :: model_q(:,:)
20 real, allocatable :: model_psfc(:)
21
22 if (trace_use_dull) call da_trace_entry("da_transform_xtoy_sonde_sfc_adj")
23
24 if (sfc_assi_options == sfc_assi_options_1) then
25
26 allocate (model_u(1,iv%info(sound)%n1:iv%info(sound)%n2))
27 allocate (model_v(1,iv%info(sound)%n1:iv%info(sound)%n2))
28 allocate (model_t(1,iv%info(sound)%n1:iv%info(sound)%n2))
29 allocate (model_q(1,iv%info(sound)%n1:iv%info(sound)%n2))
30 allocate (model_psfc(iv%info(sound)%n1:iv%info(sound)%n2))
31 ! [1.2] Interpolate horizontally:
32 do n=iv%info(sound)%n1,iv%info(sound)%n2
33 model_u(1,n) = jo_grad_y%sonde_sfc(n)%u
34 model_v(1,n) = jo_grad_y%sonde_sfc(n)%v
35 model_t(1,n) = jo_grad_y%sonde_sfc(n)%t
36 model_q(1,n) = jo_grad_y%sonde_sfc(n)%q
37 model_psfc(n) = jo_grad_y%sonde_sfc(n)%p
38 end do
39 call da_interp_lin_3d_adj (jo_grad_x%u, iv%info(sonde_sfc), model_u)
40 call da_interp_lin_3d_adj (jo_grad_x%v, iv%info(sonde_sfc), model_v)
41 call da_interp_lin_3d_adj (jo_grad_x%t, iv%info(sonde_sfc), model_t)
42 call da_interp_lin_3d_adj (jo_grad_x%q, iv%info(sonde_sfc), model_q)
43
44 call da_interp_lin_2d_adj (jo_grad_x%psfc, iv%info(sonde_sfc), 1, model_psfc)
45 deallocate (model_u)
46 deallocate (model_v)
47 deallocate (model_t)
48 deallocate (model_q)
49 deallocate (model_psfc)
50 else if (sfc_assi_options == sfc_assi_options_2) then
51 call da_transform_xtopsfc_adj(grid,iv,sonde_sfc,iv%sonde_sfc(:), jo_grad_y%sonde_sfc(:),jo_grad_x)
52 end if
53
54 if (trace_use_dull) call da_trace_exit("da_transform_xtoy_sonde_sfc_adj")
55
56 end subroutine da_transform_xtoy_sonde_sfc_adj
57
58