1 subroutine da_jo_mtgirs_uvtq (iv, re, jo_grad_y, jo)
3 !-----------------------------------------------------------------------
4 ! Purpose: Ensures that exactly the same code is used for both
5 ! serial and parallel computations when testing_dm_bitwise_exact is set.
6 !-----------------------------------------------------------------------
10 type (iv_type), intent(in) :: iv ! Innovation vector.
11 type (y_type), intent(in) :: re ! Residual vector.
12 type (y_type), intent(inout) :: jo_grad_y ! Grad_y(Jo)
13 type (jo_type), intent(inout) :: jo ! Obs cost function.
17 if (trace_use_dull) call da_trace_entry("da_jo_mtgirs_uvtq")
19 do n=1, iv%info(mtgirs)%nlocal
20 do k=1, iv%info(mtgirs)%levels(n)
21 if (iv%info(mtgirs)%proc_domain(1,n)) then
22 jo % mtgirs_u = jo % mtgirs_u - re%mtgirs(n)%u(k) * jo_grad_y%mtgirs(n)%u(k)
23 jo % mtgirs_v = jo % mtgirs_v - re%mtgirs(n)%v(k) * jo_grad_y%mtgirs(n)%v(k)
24 jo % mtgirs_t = jo % mtgirs_t - re%mtgirs(n)%t(k) * jo_grad_y%mtgirs(n)%t(k)
25 jo % mtgirs_q = jo % mtgirs_q - re%mtgirs(n)%q(k) * jo_grad_y%mtgirs(n)%q(k)
30 if (trace_use_dull) call da_trace_exit("da_jo_mtgirs_uvtq")
32 end subroutine da_jo_mtgirs_uvtq