da_residual_airep.inc
References to this file elsewhere.
1 subroutine da_residual_airep(iv, y, re, np_missing, np_bad_data,np_obs_used, np_available)
2
3 !-----------------------------------------------------------------------
4 ! Purpose: TBD
5 !-----------------------------------------------------------------------
6
7 implicit none
8
9 type (iv_type), intent(in) :: iv ! Innovation vector (O-B).
10 type (y_type) , intent(in) :: y ! y = H (xa)
11 type (y_type) , intent(inout) :: re ! Residual vector (O-A).
12
13 integer , intent(inout) :: np_available
14 integer , intent(inout) :: np_obs_used
15 integer , intent(inout) :: np_missing
16 integer , intent(inout) :: np_bad_data
17
18 type (bad_data_type) :: n_obs_bad
19 integer :: n, k
20
21 if (trace_use_dull) call da_trace_entry("da_residual_airep")
22
23 n_obs_bad % u % num = number_type(0, 0, 0)
24 n_obs_bad % v % num = number_type(0, 0, 0)
25 n_obs_bad % t % num = number_type(0, 0, 0)
26
27 do n=1, iv%info(airep)%nlocal
28 do k=1, iv%info(airep)%levels(n)
29 np_available = np_available + 3
30 re%airep(n)%u(k) = da_residual(n, k, y%airep(n)%u(k), iv%airep(n)%u(k), n_obs_bad % u)
31 re%airep(n)%v(k) = da_residual(n, k, y%airep(n)%v(k), iv%airep(n)%v(k), n_obs_bad % v)
32 re%airep(n)%t(k) = da_residual(n, k, y%airep(n)%t(k), iv%airep(n)%t(k), n_obs_bad % t)
33 end do
34 end do
35
36 np_missing = np_missing + n_obs_bad % u % num % miss + &
37 n_obs_bad % v % num % miss + n_obs_bad % t % num % miss
38 np_bad_data = np_bad_data + n_obs_bad % u % num % bad + &
39 n_obs_bad % v % num % bad + n_obs_bad % t % num % bad
40 np_obs_used = np_obs_used + n_obs_bad % u % num % use + &
41 n_obs_bad % v % num % use + n_obs_bad % t % num % use
42
43 if (trace_use_dull) call da_trace_exit("da_residual_airep")
44
45 end subroutine da_residual_airep
46
47