1 subroutine da_jo_and_grady_gpseph( iv, re, jo, jo_grad_y)
3 !-----------------------------------------------------------------------
4 ! Purpose: calculate Jo and Grad_y(Jo) for gpseph obs
5 !-----------------------------------------------------------------------
7 !----------------------------------------------------------------------
8 ! Called by da_minimisation/da_jo_and_grady.inc
9 !----------------------------------------------------------------------
13 type(iv_type), intent(in) :: iv ! Innovation vector.
14 type(y_type), intent(in) :: re ! Residual vector.
15 type(y_type), intent(inout) :: jo_grad_y ! Grad_y(Jo)
16 type(jo_type), intent(inout) :: jo ! Obs cost function.
20 if (trace_use_dull) call da_trace_entry("da_jo_and_grady_gpseph")
24 do n=1, iv%info(gpseph)%nlocal
26 do k=1, iv%info(gpseph)%levels(n)
27 if ( iv%gpseph(n)%eph(k)%qc >= obs_qc_pointer ) then
28 jo_grad_y%gpseph(n)%eph(k) = -re%gpseph(n)%eph(k) / &
29 ( iv%gpseph(n)%eph(k)%error * iv%gpseph(n)%eph(k)%error)
33 if (iv%info(gpseph)%proc_domain(1,n)) then
34 do k=1, iv%info(gpseph)%levels(n)
35 if ( iv%gpseph(n)%eph(k)%qc >= obs_qc_pointer ) then
36 jo % gpseph_eph = jo % gpseph_eph - &
37 re%gpseph(n)%eph(k) * jo_grad_y%gpseph(n)%eph(k)
44 jo % gpseph_eph = 0.5 * jo % gpseph_eph
46 if (trace_use_dull) call da_trace_exit("da_jo_and_grady_gpseph")
48 end subroutine da_jo_and_grady_gpseph