da_transform_vtovv.inc

References to this file elsewhere.
1 subroutine da_transform_vtovv(grid, cv_size, be, cv, vv)
2 
3    !-----------------------------------------------------------------------
4    ! Purpose: TBD
5    !-----------------------------------------------------------------------
6 
7    implicit none
8 
9    type(domain),  intent(inout) :: grid
10    integer,       intent(in)    :: cv_size ! Size of cv array.
11    type(be_type), intent(in)    :: be   ! Background error structure.
12    real,          intent(in)    :: cv(1:cv_size)   ! control variables.
13    type(vp_type), intent(inout) :: vv   ! Grid point/EOF equivalent.
14 
15    integer :: mz   ! Vertical truncation.
16 
17    if (trace_use) call da_trace_entry("da_transform_vtovv")
18 
19    !-------------------------------------------------------------------------
20    ! [1.0] Fill vv arrays from 1-dimensional cv array.
21    !-------------------------------------------------------------------------
22 
23    call da_cv_to_vv(cv_size, cv, (/ be%v1%mz, be%v2%mz, be%v3%mz, be%v4%mz, be%v5%mz, be%ne /), vv)
24 
25    !-------------------------------------------------------------------------
26    ! [2.0] Perform VToVV Transform:
27    !-------------------------------------------------------------------------
28 
29    ! [2.1] Transform 1st control variable:
30 
31    mz = be % v1 % mz
32    if (mz > 0) then
33       call da_transform_through_rf(grid,mz, be % v1 % rf_alpha, be % v1 % val, vv % v1)
34    end if
35 
36    ! [2.2] Transform 2nd control variable:
37 
38    mz = be % v2 % mz
39    if (mz > 0) then
40       call da_transform_through_rf(grid, mz, be % v2 % rf_alpha, be % v2 % val, vv % v2)
41    end if
42 
43    ! [2.3] Transform 3rd control variable
44 
45    mz = be % v3 % mz
46    if (mz > 0) then
47       call da_transform_through_rf(grid, mz, be % v3 % rf_alpha,be % v3 % val, vv % v3)
48    end if
49 
50    ! [2.4] Transform 4th control variable
51       
52    mz = be % v4 % mz
53    if (mz > 0) then
54       call da_transform_through_rf(grid, mz, be % v4 % rf_alpha, be % v4 % val, vv % v4)
55    end if
56 
57    ! [2.5] Transform 5th control variable
58 
59    mz = be % v5 % mz
60    if (mz > 0) then
61       call da_transform_through_rf(grid, mz, be % v5 % rf_alpha, be % v5 % val, vv % v5)
62    end if
63 
64    ! [2.6] Transform alpha control variable
65 
66    mz = be % alpha % mz
67    if (mz > 0) then
68       call da_transform_through_rf(grid, mz, be % alpha % rf_alpha, be % alpha % val, vv % alpha)
69    end if
70 
71    if (trace_use) call da_trace_exit("da_transform_vtovv")
72 
73 end subroutine da_transform_vtovv
74 
75