da_residual_pilot.inc

References to this file elsewhere.
1 subroutine da_residual_pilot(oi, y, re,                        &
2                                         np_missing, np_bad_data,          &
3                                         np_obs_used, np_available)
4 
5    !-----------------------------------------------------------------------
6    ! Purpose: Calculate residuals for pilots
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_Pilot > 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 
25       do n=1, oi%num_Pilot
26          do k=1, oi%Pilot(n)%info%levels
27             np_available = np_available + 2
28             re%Pilot(n)%u(k) = da_residual(n, k, y%Pilot(n)%u(k), &
29                                   oi%Pilot(n)%u(k), n_obs_bad % u)
30             re%Pilot(n)%v(k) = da_residual(n, k, y%Pilot(n)%v(k), &
31                                   oi%Pilot(n)%v(k), n_obs_bad % v)
32          end do
33       end do
34 
35       np_missing = np_missing + n_obs_bad % u % num % miss + &
36                   n_obs_bad % v % num % miss
37       np_bad_data = np_bad_data + n_obs_bad % u % num % bad + &
38                    n_obs_bad % v % num % bad 
39       np_obs_used = np_obs_used + n_obs_bad % u % num % use + &
40                    n_obs_bad % v % num % use
41    end if
42 
43 end subroutine da_residual_pilot
44 
45