1 subroutine da_jo_and_grady_buoy(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_buoy")
24 do n=1, iv%info(buoy)%nlocal
25 jo_grad_y%buoy(n)%u = -re%buoy(n)%u / (iv%buoy(n)%u%error * iv%buoy(n)%u%error)
26 jo_grad_y%buoy(n)%v = -re%buoy(n)%v / (iv%buoy(n)%v%error * iv%buoy(n)%v%error)
27 jo_grad_y%buoy(n)%t = -re%buoy(n)%t / (iv%buoy(n)%t%error * iv%buoy(n)%t%error)
28 jo_grad_y%buoy(n)%p = -re%buoy(n)%p / (iv%buoy(n)%p%error * iv%buoy(n)%p%error)
29 jo_grad_y%buoy(n)%q = -re%buoy(n)%q / (iv%buoy(n)%q%error * iv%buoy(n)%q%error)
31 if (iv%info(buoy)%proc_domain(1,n)) then
32 jo % buoy_u = jo % buoy_u - re%buoy(n)%u * jo_grad_y%buoy(n)%u
33 jo % buoy_v = jo % buoy_v - re%buoy(n)%v * jo_grad_y%buoy(n)%v
34 jo % buoy_t = jo % buoy_t - re%buoy(n)%t * jo_grad_y%buoy(n)%t
35 jo % buoy_p = jo % buoy_p - re%buoy(n)%p * jo_grad_y%buoy(n)%p
36 jo % buoy_q = jo % buoy_q - re%buoy(n)%q * jo_grad_y%buoy(n)%q
40 jo % buoy_u = 0.5 * jo % buoy_u
41 jo % buoy_v = 0.5 * jo % buoy_v
42 jo % buoy_t = 0.5 * jo % buoy_t
43 jo % buoy_p = 0.5 * jo % buoy_p
44 jo % buoy_q = 0.5 * jo % buoy_q
46 if (trace_use_dull) call da_trace_exit("da_jo_and_grady_buoy")
48 end subroutine da_jo_and_grady_buoy