da_jo_and_grady_ssmi_rv.inc

References to this file elsewhere.
1 subroutine da_jo_and_grady_ssmi_rv(iv, re, jo, jo_grad_y)
2 
3    !-----------------------------------------------------------------------
4    ! Purpose: TBD
5    !-----------------------------------------------------------------------
6 
7    implicit none
8 
9    type (iv_type), intent(in)    :: iv          ! Ob Inc. structure.
10    type (y_type),  intent(in)    :: re          ! Residual structure.
11    type (y_type),  intent(inout) :: jo_grad_y   ! Grad_y(Jo)
12    type (jo_type), intent(inout) :: jo          ! Obs cost function.
13 
14    integer  :: n
15 
16    if (trace_use) call da_trace_entry("da_jo_and_grady_ssmi_rv")
17 
18    jo % ssmir_speed = 0.0
19    jo % ssmir_tpw   = 0.0
20 
21    do n=1, iv%info(ssmi_rv)%nlocal
22       jo_grad_y%ssmi_rv(n)%speed = - re%ssmi_rv(n)%speed / &
23          (iv%ssmi_rv(n)%speed%error * iv%ssmi_rv(n)%speed%error)
24 
25       jo_grad_y%ssmi_rv(n)%tpw = -re%ssmi_rv(n)%tpw / &
26           (iv%ssmi_rv(n)%tpw%error * iv%ssmi_rv(n)%tpw%error)
27 
28       if (iv%info(ssmi_rv)%proc_domain(1,n)) then
29 
30          jo%ssmir_speed = jo%ssmir_speed - re%ssmi_rv(n)%speed * jo_grad_y%ssmi_rv(n)%speed
31          jo%ssmir_tpw   = jo%ssmir_tpw   - re%ssmi_rv(n)%tpw   * jo_grad_y%ssmi_rv(n)%tpw
32       end if
33    end do
34    
35    jo % ssmir_speed = 0.5 * jo % ssmir_speed
36    jo % ssmir_tpw   = 0.5 * jo % ssmir_tpw
37 
38    if (trace_use) call da_trace_exit("da_jo_and_grady_ssmi_rv")
39 
40 end subroutine da_jo_and_grady_ssmi_rv
41 
42