Merge remote-tracking branch 'origin/release-v4.6.1'
[WRF.git] / var / da / da_test / da_check_xtoy_adjoint_ssmi_rv.inc
blob37e12356036a3a0a10499929e0411d9ce7b7517c
1 subroutine da_check_xtoy_adjoint_ssmi_rv(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_rv")
18    if (iv%info(ssmi_rv)%nlocal > 0) then
19       do n=iv%info(ssmi_rv)%n1, iv%info(ssmi_rv)%n2
20          y%ssmi_rv(n)%speed = y%ssmi_rv(n)%speed/typical_speed_rms
21          y%ssmi_rv(n)%tpw   = y%ssmi_rv(n)%tpw/typical_tpw_rms
23          var = (y%ssmi_rv(n)%speed) ** 2 + (y%ssmi_rv(n)%tpw) ** 2
25          pertile_lhs = pertile_lhs + var
27          if (iv%info(ssmi_rv)%proc_domain(1,n)) then
28             adjtest_lhs = adjtest_lhs + var
29          end if
31          y%ssmi_rv(n)%speed = y%ssmi_rv(n)%speed/typical_speed_rms
32          y%ssmi_rv(n)%tpw   = y%ssmi_rv(n)%tpw/typical_tpw_rms
33       end do
34    end if
36    if (trace_use) call da_trace_exit("da_check_xtoy_adjoint_ssmi_rv")
38 end subroutine da_check_xtoy_adjoint_ssmi_rv