1 subroutine da_jo_and_grady_gpspw(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_gpspw")
20 if (iv%info(gpspw)%nlocal > 0) then
21 do n=1, iv%info(gpspw)%nlocal
22 jo_grad_y%gpspw(n)%tpw = -re%gpspw(n)%tpw / (iv%gpspw(n)%tpw%error * iv%gpspw(n)%tpw%error)
24 if (iv%info(gpspw)%proc_domain(1,n)) then
25 jo % gpspw_tpw = jo % gpspw_tpw - re%gpspw(n)%tpw * jo_grad_y%gpspw(n)%tpw
29 jo % gpspw_tpw = 0.5 * jo % gpspw_tpw
32 if (trace_use_dull) call da_trace_exit("da_jo_and_grady_gpspw")
34 end subroutine da_jo_and_grady_gpspw