1 subroutine da_jo_and_grady_pilot(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_pilot")
21 do n=1, iv%info(pilot)%nlocal
22 do k=1, iv%info(pilot)%levels(n)
23 jo_grad_y%pilot(n)%u(k) = -re%pilot(n)%u(k) / (iv%pilot(n)%u(k)%error * iv%pilot(n)%u(k)%error)
24 jo_grad_y%pilot(n)%v(k) = -re%pilot(n)%v(k) / (iv%pilot(n)%v(k)%error * iv%pilot(n)%v(k)%error)
27 if (iv%info(pilot)%proc_domain(1,n)) then
28 do k=1, iv%info(pilot)%levels(n)
29 jo % pilot_u = jo % pilot_u - re%pilot(n)%u(k) * jo_grad_y%pilot(n)%u(k)
30 jo % pilot_v = jo % pilot_v - re%pilot(n)%v(k) * jo_grad_y%pilot(n)%v(k)
35 jo % pilot_u = 0.5 * jo % pilot_u
36 jo % pilot_v = 0.5 * jo % pilot_v
38 if (trace_use_dull) call da_trace_exit("da_jo_and_grady_pilot")
40 end subroutine da_jo_and_grady_pilot