1 subroutine da_jo_and_grady_ssmt2(iv, re, jo, jo_grad_y)
3 !-----------------------------------------------------------------------
5 !-----------------------------------------------------------------------
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.
16 if (trace_use_dull) call da_trace_entry("da_jo_and_grady_ssmt2")
20 do n=1, iv%info(ssmt2)%nlocal
21 do k=1, iv%info(ssmt2)%levels(n)
22 jo_grad_y%ssmt2(n)%rh(k) = -re%ssmt2(n)%rh(k) / &
23 (iv%ssmt2(n)%rh(k)%error * iv%ssmt2(n)%rh(k)%error)
25 jo % ssmt2_rh = jo % ssmt2_rh - re%ssmt2(n)%rh(k) * jo_grad_y%ssmt2(n)%rh(k)
29 jo % ssmt2_rh = 0.5 * jo % ssmt2_rh
31 if (trace_use_dull) call da_trace_exit("da_jo_and_grady_ssmt2")
33 end subroutine da_jo_and_grady_ssmt2