da_jo_and_grady_satem.inc

References to this file elsewhere.
1 subroutine da_jo_and_grady_satem(iv, re, jo, jo_grad_y)
2 
3    !-----------------------------------------------------------------------
4    ! Purpose: TBD
5    !-----------------------------------------------------------------------
6 
7    implicit none
8 
9    type (ob_type), intent(in)   :: iv          ! Innovation vector.
10    type (y_type), intent(in)    :: re          ! Residual vector.
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, k
15 
16    jo % satem_thickness = 0.0
17 
18    if (iv%num_Satem > 0) then
19       do n=1, iv%num_Satem
20          do k=1, iv%satem(n)%info%levels
21             jo_grad_y%Satem(n)%thickness(k) = -re%Satem(n)%thickness(k) / &
22                                         (iv%Satem(n)%thickness(k)%error * &
23                                           iv%Satem(n)%thickness(k)%error)
24          end do
25 
26          if (iv%satem(n)%loc%proc_domain) then
27             do k=1, iv%satem(n)%info%levels
28                jo % satem_thickness = jo % satem_thickness - &
29                      re%Satem(n)%thickness(k) * jo_grad_y%Satem(n)%thickness(k)
30             end do
31          end if
32       end do
33 
34       jo % satem_thickness = 0.5 * jo % satem_thickness
35 
36    end if
37 
38 end subroutine da_jo_and_grady_satem
39 
40