1 subroutine da_residual_geoamv(iv, y, re, np_missing, np_bad_data, np_obs_used, np_available)
3 !-------------------------------------------------------------------------
4 ! Purpose: Calculates residual vector for Geo. CMV's
6 !-------------------------------------------------------------------------
10 type (iv_type), intent(in) :: iv ! Innovation vector (O-B).
11 type (y_type) , intent(in) :: y ! y = H (xa)
12 type (y_type) , intent(inout) :: re ! Residual vector (O-A).
14 integer , intent(inout) :: np_available
15 integer , intent(inout) :: np_obs_used
16 integer , intent(inout) :: np_missing
17 integer , intent(inout) :: np_bad_data
19 type (bad_data_type) :: n_obs_bad
22 if (trace_use_dull) call da_trace_entry("da_residual_geoamv")
24 n_obs_bad % u % num = number_type(0, 0, 0)
25 n_obs_bad % v % num = number_type(0, 0, 0)
27 do n=1, iv%info(geoamv)%nlocal
28 do k=1, iv%info(geoamv)%levels(n)
29 np_available = np_available + 2
30 re%geoamv(n)%u(k) = da_residual(n, 0, y%geoamv(n)%u(k), iv%geoamv(n)%u(k), n_obs_bad % u)
31 re%geoamv(n)%v (k)= da_residual(n, 0, y%geoamv(n)%v(k), iv%geoamv(n)%v(k), n_obs_bad % v)
35 np_missing = np_missing + n_obs_bad % u % num % miss + n_obs_bad % v % num % miss
36 np_bad_data = np_bad_data + n_obs_bad % u % num % bad + n_obs_bad % v % num % bad
37 np_obs_used = np_obs_used + n_obs_bad % u % num % use + n_obs_bad % v % num % use
39 if (trace_use_dull) call da_trace_exit("da_residual_geoamv")
41 end subroutine da_residual_geoamv