da_transform_vtovv_adj.inc

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