1 subroutine da_residual_radar(iv, y, re, np_missing, np_bad_data, np_obs_used, np_available)
3 !-----------------------------------------------------------------------
4 ! Purpose: Calculate residuals for radar obs
5 !-----------------------------------------------------------------------
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).
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
18 type (bad_data_type) :: n_obs_bad
21 if (trace_use) call da_trace_entry("da_residual_radar")
23 n_obs_bad % rv % num = number_type(0, 0, 0)
24 n_obs_bad % rf % num = number_type(0, 0, 0)
25 n_obs_bad % rrn % num = number_type(0, 0, 0)
26 n_obs_bad % rsn % num = number_type(0, 0, 0)
27 n_obs_bad % rgr % num = number_type(0, 0, 0)
28 n_obs_bad % rqv % num = number_type(0, 0, 0)
30 do n=1, iv%info(radar)%nlocal
31 do k=1, iv%info(radar)%levels(n)
32 if (use_radar_rv) then
33 np_available = np_available + 1
34 re%radar(n)%rv(k) = da_residual(n, k, y%radar(n)%rv(k), iv%radar(n)%rv(k), n_obs_bad % rv)
37 if (use_radar_rf) then
38 np_available = np_available + 1
39 if (.not. use_radar_rhv) then
40 re%radar(n)%rf(k) = da_residual(n, k, y%radar(n)%rf(k), iv%radar(n)%rf(k), n_obs_bad % rf)
44 if (.not.use_radar_rf .and. use_radar_rhv) then
45 re%radar(n)%rrn(k) = da_residual(n, k, y%radar(n)%rrn(k), iv%radar(n)%rrn(k), n_obs_bad % rrn)
46 re%radar(n)%rsn(k) = da_residual(n, k, y%radar(n)%rsn(k), iv%radar(n)%rsn(k), n_obs_bad % rsn)
47 re%radar(n)%rgr(k) = da_residual(n, k, y%radar(n)%rgr(k), iv%radar(n)%rgr(k), n_obs_bad % rgr)
50 if (use_radar_rqv) then
51 re%radar(n)%rqv(k) = da_residual(n, k, y%radar(n)%rqv(k), iv%radar(n)%rqv(k), n_obs_bad % rqv)
56 np_missing = np_missing + n_obs_bad % rv % num % miss + n_obs_bad % rf % num % miss + &
57 n_obs_bad % rrn% num % miss + n_obs_bad % rsn% num % miss + &
58 n_obs_bad % rqv% num % miss + n_obs_bad % rqv% num % miss
59 np_bad_data = np_bad_data + n_obs_bad % rv % num % bad + n_obs_bad % rf % num % bad + &
60 n_obs_bad % rrn% num % bad + n_obs_bad % rsn% num % bad + &
61 n_obs_bad % rgr% num % bad + n_obs_bad % rqv% num % bad
62 np_obs_used = np_obs_used + n_obs_bad % rv % num % use + n_obs_bad % rf % num % use + &
63 n_obs_bad % rrn% num % use + n_obs_bad % rsn% num % use + &
64 n_obs_bad % rgr% num % use + n_obs_bad % rqv% num % use
66 if (trace_use) call da_trace_exit("da_residual_radar")
68 end subroutine da_residual_radar