1 subroutine da_jo_and_grady_pseudo(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_pseudo")
24 do n=1, iv%info(pseudo)%nlocal
25 jo_grad_y%pseudo(n)%u = -re%pseudo(n)%u / (iv%pseudo(n)%u%error * iv%pseudo(n)%u%error)
26 jo_grad_y%pseudo(n)%v = -re%pseudo(n)%v / (iv%pseudo(n)%v%error * iv%pseudo(n)%v%error)
27 jo_grad_y%pseudo(n)%t = -re%pseudo(n)%t / (iv%pseudo(n)%t%error * iv%pseudo(n)%t%error)
28 jo_grad_y%pseudo(n)%p = -re%pseudo(n)%p / (iv%pseudo(n)%p%error * iv%pseudo(n)%p%error)
29 jo_grad_y%pseudo(n)%q = -re%pseudo(n)%q / (iv%pseudo(n)%q%error * iv%pseudo(n)%q%error)
31 if (iv%info(pseudo)%proc_domain(1,n)) then
32 jo % pseudo_u = jo % pseudo_u - re%pseudo(n)%u * jo_grad_y%pseudo(n)%u
33 jo % pseudo_v = jo % pseudo_v - re%pseudo(n)%v * jo_grad_y%pseudo(n)%v
34 jo % pseudo_t = jo % pseudo_t - re%pseudo(n)%t * jo_grad_y%pseudo(n)%t
35 jo % pseudo_p = jo % pseudo_p - re%pseudo(n)%p * jo_grad_y%pseudo(n)%p
36 jo % pseudo_q = jo % pseudo_q - re%pseudo(n)%q * jo_grad_y%pseudo(n)%q
40 jo % pseudo_u = 0.5 * jo % pseudo_u
41 jo % pseudo_v = 0.5 * jo % pseudo_v
42 jo % pseudo_t = 0.5 * jo % pseudo_t
43 jo % pseudo_p = 0.5 * jo % pseudo_p
44 jo % pseudo_q = 0.5 * jo % pseudo_q
46 if (trace_use_dull) call da_trace_exit("da_jo_and_grady_pseudo")
48 end subroutine da_jo_and_grady_pseudo