1 subroutine da_residual_rad(iv, y, re, np_missing, np_bad_data, np_obs_used, np_available)
3 !---------------------------------------------------------------------------
4 ! Purpose: Calculate Obs Residual and counting obs number.
6 ! Method: re = (d - H delta_x)
7 !---------------------------------------------------------------------------
11 type (iv_type), intent(in) :: iv ! Innovation vector (O-B).
12 type (y_type) , intent(in) :: y ! y = H (xa)
13 type (y_type) , intent(inout) :: re ! Residual vector (O-A).
15 integer , intent(inout) :: np_available
16 integer , intent(inout) :: np_obs_used
17 integer , intent(inout) :: np_missing
18 integer , intent(inout) :: np_bad_data
20 type (bad_data_type) :: n_obs_bad
23 if (trace_use) call da_trace_entry("da_residual_rad")
26 if (iv%instid(i)%num_rad < 1) cycle
28 n_obs_bad % rad % num = number_type(0, 0, 0)
29 call da_residual_new(y%instid(i)%tb(:,:), iv%instid(i)%tb_qc(:,:), &
30 iv%instid(i)%tb_inv(:,:), re%instid(i)%tb(:,:))
31 np_available = iv%instid(i)%nchan*iv%instid(i)%num_rad
34 np_missing = np_missing + n_obs_bad % rad % num % miss
35 np_bad_data = np_bad_data + n_obs_bad % rad % num % bad
36 np_obs_used = np_obs_used + n_obs_bad % rad % num % use
38 if (trace_use) call da_trace_exit("da_residual_rad")
40 end subroutine da_residual_rad