1 subroutine da_jo_and_grady_rain(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) call da_trace_entry("da_jo_and_grady_rain")
20 do n=1, iv%info(rain)%nlocal
21 jo_grad_y%rain(n)%rain = -re%rain(n)%rain / &
22 (iv%rain(n)%rain%error * iv%rain(n)%rain%error)
24 if (iv%info(rain)%proc_domain(1,n)) then
25 jo % rain_r = jo % rain_r - re%rain(n)%rain * jo_grad_y%rain(n)%rain
29 jo % rain_r = 0.5 * jo % rain_r
31 if (trace_use) call da_trace_exit("da_jo_and_grady_rain")
33 end subroutine da_jo_and_grady_rain