1 subroutine da_jo_chem_sfc(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_chem_sfc")
19 jo % chemic_surf = 0.0
21 do ichem = PARAM_FIRST_SCALAR, num_chemic_surf
22 do n=1, iv%info(chemic_surf)%nlocal
23 if (iv%info(chemic_surf)%proc_domain(1,n)) then
24 jo % chemic_surf = jo % chemic_surf - re%chemic_surf(n)%chem(ichem) * jo_grad_y%chemic_surf(n)%chem(ichem)
29 if (trace_use_dull) call da_trace_exit("da_jo_chem_sfc")
31 end subroutine da_jo_chem_sfc