da_residual_profiler.inc
References to this file elsewhere.
1 subroutine da_residual_profiler(oi, y, re, &
2 np_missing, np_bad_data, &
3 np_obs_used, np_available)
4
5 !-----------------------------------------------------------------------
6 ! Purpose: Calculate residuals for profilers
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_Profiler > 0) then
22
23 n_obs_bad % u % num = number_type(0, 0, 0)
24 n_obs_bad % v % num = number_type(0, 0, 0)
25
26 do n=1, oi%num_Profiler
27
28 do k=1, oi%Profiler(n)%info%levels
29
30 np_available = np_available + 2
31
32 re%Profiler(n)%u(k) = da_residual(n, k, y%Profiler(n)%u(k), &
33 oi%Profiler(n)%u(k), n_obs_bad % u)
34 re%Profiler(n)%v(k) = da_residual(n, k, y%Profiler(n)%v(k), &
35 oi%Profiler(n)%v(k), n_obs_bad % v)
36 end do
37 end do
38
39 np_missing = np_missing + n_obs_bad % u % num % miss + &
40 n_obs_bad % v % num % miss
41 np_bad_data = np_bad_data + n_obs_bad % u % num % bad + &
42 n_obs_bad % v % num % bad
43 np_obs_used = np_obs_used + n_obs_bad % u % num % use + &
44 n_obs_bad % v % num % use
45 end if
46
47 end subroutine da_residual_profiler
48
49