1 subroutine da_calc_flow_dependence_xa (xa_ens, ne, ep, vp, nobwin)
3 !-----------------------------------------------------------------------
4 ! Purpose: calculate flow-dependent increments in model space (xa)
5 ! for a certain sub-window
6 !-----------------------------------------------------------------------
10 type (x_subtype), intent(inout) :: xa_ens
11 integer, intent(in) :: ne ! Ensemble size.
12 type (ep_type), intent(in) :: ep ! Ensemble perturbations.
13 type (vp_type), intent(in) :: vp ! CV on grid structure.
14 integer, intent(in), optional :: nobwin
17 integer :: i, j, k, n ! Loop counters.
18 real :: alpha ! Local alpha copy.
20 if (trace_use) call da_trace_entry("da_calc_flow_dependence_xa")
23 if ( present(nobwin) ) then
28 ii = (iobwin-1)*ensdim_alpha + n
34 alpha = vp % alpha(i,j,k,n)
37 xa_ens % u(i,j,k) = xa_ens % u(i,j,k) + alpha * ep % v1(i,j,k,ii) ! v1 = u
40 xa_ens % v(i,j,k) = xa_ens % v(i,j,k) + alpha * ep % v2(i,j,k,ii) ! v2 = v
43 xa_ens % t(i,j,k) = xa_ens % t(i,j,k) + alpha * ep % v3(i,j,k,ii) ! v3 = t
46 xa_ens % q(i,j,k) = xa_ens % q(i,j,k) + alpha * ep % v4(i,j,k,ii) ! v4 = q
52 xa_ens % psfc(its:ite,jts:jte) = xa_ens % psfc(its:ite,jts:jte) + &
53 vp % alpha(its:ite,jts:jte,1,n) * &
54 ep % v5(its:ite,jts:jte,1,ii) ! v5 = ps
56 if ( alpha_hydrometeors ) then
60 alpha = vp % alpha(i,j,k,n)
61 xa_ens%qcw(i,j,k) = xa_ens % qcw(i,j,k) + alpha * ep%cw(i,j,k,ii)
62 xa_ens%qrn(i,j,k) = xa_ens % qrn(i,j,k) + alpha * ep%rn(i,j,k,ii)
63 xa_ens%qci(i,j,k) = xa_ens % qci(i,j,k) + alpha * ep%ci(i,j,k,ii)
64 xa_ens%qsn(i,j,k) = xa_ens % qsn(i,j,k) + alpha * ep%sn(i,j,k,ii)
65 xa_ens%qgr(i,j,k) = xa_ens % qgr(i,j,k) + alpha * ep%gr(i,j,k,ii)
69 end if ! alpha_hydrometeors
73 if (trace_use) call da_trace_exit("da_calc_flow_dependence_xa")
75 end subroutine da_calc_flow_dependence_xa