1 subroutine da_cv_to_vv (cv_size, rcv, mzs, vv)
3 !---------------------------------------------------------------------------
4 ! Purpose: Fill (local) vv arrays from 1D (local) cv array.
5 !---------------------------------------------------------------------------
9 integer, intent(in) :: cv_size ! Length of CV array.
10 real, intent(in) :: rcv(1:cv_size) ! Control variables v.
11 integer, intent(in) :: mzs(:) ! Background error structure levels.
12 type (vp_type), intent(inout) :: vv ! Grdipt/EOF cv_array.
14 integer :: is,ie ! Local grid range in y coordinate.
15 integer :: js,je ! Local grid range in x coordinate.
16 integer :: ix,jy ! Local grid horizontal dimensions.
17 integer :: mz ! Max vertical coordinate for v1 through v5 arrays.
18 integer :: ne ! Ensemble size.
19 integer :: cv_s,cv_e ! Starting and ending indices into CV array.
20 integer :: ijm ! Size of interior of v1 through v5 arrays.
21 integer :: ijmn ! Size of interior of alpha cv arrays.
23 if (trace_use) call da_trace_entry("da_cv_to_vv")
33 !--------------------------------------------------------------------------
34 ! [1] Transfer components of Jb control variable:
35 !--------------------------------------------------------------------------
43 vv % v1(is:ie,js:je,1:mz) = RESHAPE(rcv(cv_s:cv_e),(/ix, jy, mz/))
52 vv % v2(is:ie,js:je,1:mz) = RESHAPE(rcv(cv_s:cv_e),(/ix, jy, mz/))
61 vv % v3(is:ie,js:je,1:mz) = RESHAPE(rcv(cv_s:cv_e),(/ix, jy, mz/))
70 vv % v4(is:ie,js:je,1:mz) = RESHAPE(rcv(cv_s:cv_e),(/ix, jy, mz/))
75 if (mz == 1) then ! Can only be 0 or 1 (2D ps_u field)
79 vv % v5(is:ie,js:je,1:mz) = RESHAPE(rcv(cv_s:cv_e),(/ix, jy,mz/))
82 !--------------------------------------------------------------------------
83 ! [2] Transfer components of Je control variable:
84 !--------------------------------------------------------------------------
89 ijmn = ix * jy * mz * ne
91 cv_e = cv_s + ijmn - 1
92 vv % alpha(is:ie,js:je,1:mz,1:ne) = RESHAPE(rcv(cv_s:cv_e),(/ix, jy, mz, ne/))
95 if (trace_use) call da_trace_exit("da_cv_to_vv")
97 end subroutine da_cv_to_vv