updated top-level README and version_decl for V4.5 (#1847)
[WRF.git] / var / da / da_test / da_check_xtoy_adjoint_ssmi_tb.inc
blobdf623e6c8d7d57f325d4f3f1011042a004a14c73
1 subroutine da_check_xtoy_adjoint_ssmi_tb (iv, y, adjtest_lhs, pertile_lhs)
3    !-----------------------------------------------------------------------
4    ! Purpose: TBD
5    !-----------------------------------------------------------------------
7    implicit none
9    type (iv_type), intent(in)     :: iv            ! obs. inc. vector (o-b).
10    type (y_type) , intent(inout)  :: y             ! y = h (xa)
11    real          , intent(inout)  :: adjtest_lhs, pertile_lhs   
13    integer :: n             ! loop counter.
14    real    :: var
16    if (trace_use) call da_trace_entry("da_check_xtoy_adjoint_ssmi_tb")
18    do n=iv%info(ssmi_tb)%n1, iv%info(ssmi_tb)%n2
19       y%ssmi_tb(n)%tb19v = y%ssmi_tb(n)%tb19v/typical_tb19v_rms
20       y%ssmi_tb(n)%tb19h = y%ssmi_tb(n)%tb19h/typical_tb19h_rms
21       y%ssmi_tb(n)%tb22v = y%ssmi_tb(n)%tb22v/typical_tb22v_rms
22       y%ssmi_tb(n)%tb37v = y%ssmi_tb(n)%tb37v/typical_tb37v_rms
23       y%ssmi_tb(n)%tb37h = y%ssmi_tb(n)%tb37h/typical_tb37h_rms
24       y%ssmi_tb(n)%tb85v = y%ssmi_tb(n)%tb85v/typical_tb85v_rms
25       y%ssmi_tb(n)%tb85h = y%ssmi_tb(n)%tb85h/typical_tb85h_rms
27        var = (y%ssmi_tb(n)%tb19v) ** 2 &
28            + (y%ssmi_tb(n)%tb19h) ** 2 &
29            + (y%ssmi_tb(n)%tb22v) ** 2 &
30            + (y%ssmi_tb(n)%tb37v) ** 2 &
31            + (y%ssmi_tb(n)%tb37h) ** 2 &
32            + (y%ssmi_tb(n)%tb85v) ** 2 &
33            + (y%ssmi_tb(n)%tb85h) ** 2 
35       pertile_lhs = pertile_lhs + var
37       if (iv%info(ssmi_tb)%proc_domain(1,n)) then
38          adjtest_lhs = adjtest_lhs + var
39       end if
40       y%ssmi_tb(n)%tb19v = y%ssmi_tb(n)%tb19v/typical_tb19v_rms
41       y%ssmi_tb(n)%tb19h = y%ssmi_tb(n)%tb19h/typical_tb19h_rms
42       y%ssmi_tb(n)%tb22v = y%ssmi_tb(n)%tb22v/typical_tb22v_rms
43       y%ssmi_tb(n)%tb37v = y%ssmi_tb(n)%tb37v/typical_tb37v_rms
44       y%ssmi_tb(n)%tb37h = y%ssmi_tb(n)%tb37h/typical_tb37h_rms
45       y%ssmi_tb(n)%tb85v = y%ssmi_tb(n)%tb85v/typical_tb85v_rms
46       y%ssmi_tb(n)%tb85h = y%ssmi_tb(n)%tb85h/typical_tb85h_rms
47    end do
49    if (trace_use) call da_trace_exit("da_check_xtoy_adjoint_ssmi_tb")
51 end subroutine da_check_xtoy_adjoint_ssmi_tb