1 subroutine da_transform_xtoy_pseudo(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)
15 integer :: n ! Loop counter.
17 real, allocatable :: u(:,:)
18 real, allocatable :: v(:,:)
19 real, allocatable :: q(:,:)
20 real, allocatable :: p(:,:)
21 real, allocatable :: t(:,:)
22 ! working array for 5 hydrometeor variables
23 real, allocatable :: qw(:,:)
25 if (trace_use_dull) call da_trace_entry("da_transform_xtoy_pseudo")
27 allocate (u(1,iv%info(pseudo)%n1:iv%info(pseudo)%n2))
28 allocate (v(1,iv%info(pseudo)%n1:iv%info(pseudo)%n2))
29 allocate (q(1,iv%info(pseudo)%n1:iv%info(pseudo)%n2))
30 allocate (p(1,iv%info(pseudo)%n1:iv%info(pseudo)%n2))
31 allocate (t(1,iv%info(pseudo)%n1:iv%info(pseudo)%n2))
32 allocate (qw(1,iv%info(pseudo)%n1:iv%info(pseudo)%n2))
35 call da_interp_lin_3d(grid%xa%u, iv%info(pseudo), u,'u')
36 call da_interp_lin_3d(grid%xa%v, iv%info(pseudo), v,'v')
38 call da_interp_lin_3d(grid%xa%u, iv%info(pseudo), u)
39 call da_interp_lin_3d(grid%xa%v, iv%info(pseudo), v)
41 call da_interp_lin_3d(grid%xa%q, iv%info(pseudo), q)
42 call da_interp_lin_3d(grid%xa%p, iv%info(pseudo), p)
43 call da_interp_lin_3d(grid%xa%t, iv%info(pseudo), t)
45 select case(pseudo_var(1:3))
47 call da_interp_lin_3d(grid%xa%qcw, iv%info(pseudo), qw)
49 call da_interp_lin_3d(grid%xa%qci, iv%info(pseudo), qw)
51 call da_interp_lin_3d(grid%xa%qrn, iv%info(pseudo), qw)
53 call da_interp_lin_3d(grid%xa%qsn, iv%info(pseudo), qw)
55 call da_interp_lin_3d(grid%xa%qgr, iv%info(pseudo), qw)
58 do n=iv%info(pseudo)%n1,iv%info(pseudo)%n2
59 y%pseudo(n)%u = u(1,n)
60 y%pseudo(n)%v = v(1,n)
61 y%pseudo(n)%p = p(1,n)
62 y%pseudo(n)%t = t(1,n)
63 if ( len_trim(adjustl(pseudo_var)) == 1 ) then
64 y%pseudo(n)%q = q(1,n)
66 select case(pseudo_var(1:3))
67 case ('qcw', 'QCW','qci', 'QCI','qrn', 'QRN','qsn', 'QSN', 'qgr', 'QGR')
68 y%pseudo(n)%q = qw(1,n)
80 if (trace_use_dull) call da_trace_exit("da_transform_xtoy_pseudo")
82 end subroutine da_transform_xtoy_pseudo