1 subroutine da_jo_and_grady_qscat(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_qscat")
21 do n=1, iv%info(qscat)%nlocal
22 jo_grad_y%qscat(n)%u = -re%qscat(n)%u / &
23 (iv%qscat(n)%u%error * iv%qscat(n)%u%error)
24 jo_grad_y%qscat(n)%v = -re%qscat(n)%v / &
25 (iv%qscat(n)%v%error * iv%qscat(n)%v%error)
27 if (iv%info(qscat)%proc_domain(1,n)) then
28 jo % qscat_u = jo % qscat_u - re%qscat(n)%u * jo_grad_y%qscat(n)%u
29 jo % qscat_v = jo % qscat_v - re%qscat(n)%v * jo_grad_y%qscat(n)%v
33 jo % qscat_u = 0.5 * jo % qscat_u
34 jo % qscat_v = 0.5 * jo % qscat_v
36 if (trace_use_dull) call da_trace_exit("da_jo_and_grady_qscat")
39 end subroutine da_jo_and_grady_qscat