da_residual_airep.inc

References to this file elsewhere.
1 subroutine da_residual_airep(oi, y, re,                        &
2                                         np_missing, np_bad_data,          &
3                                         np_obs_used, np_available)
4 
5    !-----------------------------------------------------------------------
6    ! Purpose: TBD
7    !-----------------------------------------------------------------------
8 
9    implicit none
10 
11    type (ob_type), intent(in)        :: oi     ! Innovation vector (O-B).
12    type (y_type) , intent(in)        :: y      ! y = H (xa)
13    type (y_type) , intent(inout)     :: re     ! Residual structure.
14 
15    integer       , intent(inout)     :: np_available, np_obs_used,          &
16                                         np_missing  , np_bad_data
17 
18    type (bad_data_type)              :: n_obs_bad
19    integer                           :: n, k
20 
21    if (oi%num_Airep > 0) then
22       n_obs_bad % u % num = number_type(0, 0, 0)
23       n_obs_bad % v % num = number_type(0, 0, 0)
24       n_obs_bad % t % num = number_type(0, 0, 0)
25 
26       do n=1, oi%num_Airep
27          do k=1, oi%Airep(n)%info%levels
28             np_available = np_available + 3
29             re%Airep(n)%u(k) = da_residual(n, k, y%Airep(n)%u(k), &
30                                     oi%Airep(n)%u(k), n_obs_bad % u)
31             re%Airep(n)%v(k) = da_residual(n, k, y%Airep(n)%v(k), &
32                                     oi%Airep(n)%v(k), n_obs_bad % v)
33             re%Airep(n)%t(k) = da_residual(n, k, y%Airep(n)%t(k), &
34                                     oi%Airep(n)%t(k), n_obs_bad % t)
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 + n_obs_bad % t % num % miss
40       np_bad_data = np_bad_data + n_obs_bad % u % num % bad + &
41                       n_obs_bad % v % num % bad + n_obs_bad % t % num % bad
42       np_obs_used = np_obs_used + n_obs_bad % u % num % use + &
43                      n_obs_bad % v % num % use + n_obs_bad % t % num % use
44 
45    end if
46 
47 end subroutine da_residual_airep
48 
49