da_jo_and_grady_ssmt1.inc

References to this file elsewhere.
1 subroutine da_jo_and_grady_ssmt1(iv, re, jo, jo_grad_y)
2 
3    !-----------------------------------------------------------------------
4    ! Purpose: TBD
5    !-----------------------------------------------------------------------
6 
7    implicit none
8 
9    type (iv_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    if (trace_use_dull) call da_trace_entry("da_jo_and_grady_ssmt1")
17 
18    jo % ssmt1_t = 0.0
19 
20    do n=1, iv%info(ssmt1)%nlocal
21       do k=1, iv%info(ssmt1)%levels(n)
22          jo_grad_y%ssmt1(n)%t(k) = -re%ssmt1(n)%t(k) / (iv%ssmt1(n)%t(k)%error * iv%ssmt1(n)%t(k)%error)
23 
24          jo % ssmt1_t = jo % ssmt1_t - re%ssmt1(n)%t(k) * jo_grad_y%ssmt1(n)%t(k)
25       end do
26    end do
27 
28    jo % ssmt1_t = 0.5 * jo % ssmt1_t
29 
30    if (trace_use_dull) call da_trace_exit("da_jo_and_grady_ssmt1")
31 
32 end subroutine da_jo_and_grady_ssmt1
33 
34