1 subroutine da_check_xtoy_adjoint_gpseph(iv, y, adjtest_lhs, pertile_lhs)
3 !-----------------------------------------------------------------------
4 ! Purpose: calculate gpseph <y, y>
5 !-----------------------------------------------------------------------
9 type (iv_type), intent(in) :: iv ! obs. inc. vector (o-b).
10 type (y_type) , intent(inout) :: y ! y = h (xa)
11 real , intent(inout) :: adjtest_lhs, pertile_lhs
13 integer :: n, k ! Loop counter.
15 if (trace_use_dull) call da_trace_entry("da_check_xtoy_adjoint_gpseph")
17 do n=1, iv%info(gpseph)%nlocal
18 if (iv%info(gpseph)%proc_domain(1,n)) then
19 if ( iv%info(gpseph)%levels(n) < 1 ) cycle
20 !do k=1, iv%info(gpseph)%levels(n)
21 do k=iv%gpseph(n)%level1, iv%gpseph(n)%level2
22 if ( y%gpseph(n)%eph(k) /= missing_r ) then
23 adjtest_lhs = adjtest_lhs + (y%gpseph(n)%eph(k) / typical_eph_rms)**2
28 !do k=1, iv%info(gpseph)%levels(n)
29 do k=iv%gpseph(n)%level1, iv%gpseph(n)%level2
30 ! Because nonlocal things are calculated globally, so we have to exclude the obs. not on tile.
31 if (.not. iv%info(gpseph)%proc_domain(1,n)) y%gpseph(n)%eph(k) = 0.0
32 if ( y%gpseph(n)%eph(k) /= missing_r ) then
33 pertile_lhs = pertile_lhs + (y%gpseph(n)%eph(k) / typical_eph_rms)**2
34 y%gpseph(n)%eph(k) = y%gpseph(n)%eph(k) / typical_eph_rms ** 2
39 if (trace_use_dull) call da_trace_exit("da_check_xtoy_adjoint_gpseph")
41 end subroutine da_check_xtoy_adjoint_gpseph