da_residual_geoamv.inc

References to this file elsewhere.
1 subroutine da_residual_geoamv(oi, y, re,                        &
2                                         np_missing, np_bad_data,          &
3                                         np_obs_used, np_available)
4 
5    !-------------------------------------------------------------------------
6    ! Purpose: Calculates residual vector for Geo. CMV's
7    !               
8    !-------------------------------------------------------------------------
9 
10    implicit none
11 
12    type (ob_type), intent(in)        :: oi     ! Innovation vector (O-B).
13    type (y_type) , intent(in)        :: y      ! y = H (xa)
14    type (y_type) , intent(inout)     :: re     ! Residual vector (O-A).
15 
16    integer       , intent(inout)     :: np_available, np_obs_used,          &
17                                         np_missing  , np_bad_data
18 
19    type (bad_data_type)              :: n_obs_bad
20    integer                           :: n, k
21 
22    if (oi%num_geoamv > 0) then
23 
24       n_obs_bad % u % num = number_type(0, 0, 0)
25       n_obs_bad % v % num = number_type(0, 0, 0)
26 
27       do n=1, oi%num_geoamv
28          do k=1, oi%geoamv(n)%info%levels
29             np_available = np_available + 2
30 
31             re%geoamv(n)%u(k) = da_residual(n, 0, y%geoamv(n)%u(k), &
32                                           oi%geoamv(n)%u(k), n_obs_bad % u)
33             re%geoamv(n)%v (k)= da_residual(n, 0, y%geoamv(n)%v(k), &
34                                        oi%geoamv(n)%v(k), n_obs_bad % v)
35          end do
36       end do
37       
38       np_missing = np_missing + n_obs_bad % u % num % miss + &
39                    n_obs_bad % v % num % miss
40       np_bad_data = np_bad_data + n_obs_bad % u % num % bad + &
41                     n_obs_bad % v % num % bad
42       np_obs_used = np_obs_used + n_obs_bad % u % num % use + &
43                     n_obs_bad % v % num % use
44 
45    end if
46 
47 end subroutine da_residual_geoamv
48 
49