1 subroutine da_transform_vtovv_global (cv_size, xbx, be, cv, vv)
3 !--------------------------------------------------------------------------
4 ! Purpose: Control variable transform for global WRF-Var
5 !--------------------------------------------------------------------------
9 integer, intent(in) :: cv_size ! Size of cv array.
10 type(xbx_type), intent(in) :: xbx ! For header & non-grid arrays.
11 type(be_type), intent(in) :: be ! background errors.
12 real, intent(in) :: cv(1:cv_size) ! control variables.
13 type(vp_type), intent(inout) :: vv ! grdipt/eof cv (local).
15 integer :: k, m, n ! Loop counters.
16 integer :: cv_s ! Counter.
17 integer :: cv_e ! Counter.
19 if (trace_use) call da_trace_entry("da_transform_vtovv_global")
21 !-------------------------------------------------------------------------
22 ! [1] Spectral to grid transform for standard control variables:
23 !-------------------------------------------------------------------------
27 cv_e = cv_s + 2 * be % cv % size1c - 1
28 call da_vtovv_spectral(be % v1 % max_wave, be % cv % size1c, &
29 xbx % lenr, xbx % lenwrk, xbx % lensav, &
30 xbx % inc, xbx % alp_size, xbx % alp, &
31 xbx % wsave, be%v1%power(0:be % v1 % max_wave,k), &
32 cv(cv_s:cv_e), vv%v1(its:ite,jts:jte,k))
37 cv_e = cv_s + 2 * be % cv % size2c - 1
38 call da_vtovv_spectral(be % v2 % max_wave, be % cv % size2c, &
39 xbx % lenr, xbx % lenwrk, xbx % lensav, &
40 xbx % inc, xbx % alp_size, xbx % alp, &
41 xbx % wsave, be%v2%power(0:be % v2 % max_wave,k), &
42 cv(cv_s:cv_e), vv%v2(its:ite,jts:jte,k))
47 cv_e = cv_s + 2 * be % cv % size3c - 1
48 call da_vtovv_spectral(be % v3 % max_wave, be % cv % size3c, &
49 xbx % lenr, xbx % lenwrk, xbx % lensav, &
50 xbx % inc, xbx % alp_size, xbx % alp, &
51 xbx % wsave, be%v3%power(0:be % v3 % max_wave,k), &
52 cv(cv_s:cv_e), vv%v3(its:ite,jts:jte,k))
57 cv_e = cv_s + 2 * be % cv % size4c - 1
58 call da_vtovv_spectral(be % v4 % max_wave, be % cv % size4c, &
59 xbx % lenr, xbx % lenwrk, xbx % lensav, &
60 xbx % inc, xbx % alp_size, xbx % alp, &
61 xbx % wsave, be%v4%power(0:be % v4 % max_wave,k), &
62 cv(cv_s:cv_e), vv%v4(its:ite,jts:jte,k))
67 cv_e = cv_s + 2 * be % cv % size5c - 1
68 call da_vtovv_spectral(be % v5 % max_wave, be % cv % size5c, &
69 xbx % lenr, xbx % lenwrk, xbx % lensav, &
70 xbx % inc, xbx % alp_size, xbx % alp, &
71 xbx % wsave, be%v5%power(0:be % v5 % max_wave,k), &
72 cv(cv_s:cv_e), vv%v5(its:ite,jts:jte,kts:kte))
76 !-------------------------------------------------------------------------
77 ! [2] Spectral to grid transform for flow-dependent control variables:
78 !-------------------------------------------------------------------------
81 do m = 1, be % alpha % mz
82 cv_e = cv_s + 2 * be % cv % size_alphac - 1
83 call da_vtovv_spectral(be % alpha % max_wave, be % cv % size_alphac, &
84 xbx % lenr, xbx % lenwrk, xbx % lensav, &
85 xbx % inc, xbx % alp_size, xbx % alp, &
86 xbx % wsave, be % alpha % power(0:be%alpha%max_wave,1), &
87 cv(cv_s:cv_e), vv%alpha(its:ite,jts:jte,m,n))
92 if (trace_use) call da_trace_exit("da_transform_vtovv_global")
94 end subroutine da_transform_vtovv_global