da_residual_rad.inc

References to this file elsewhere.
1 subroutine da_residual_rad(iv, y, re, np_missing, np_bad_data, np_obs_used, np_available)
2 
3    !---------------------------------------------------------------------------
4    ! Purpose: Calculate Obs Residual and counting obs number.
5    !
6    ! Method:  re = (d - H delta_x)
7    !---------------------------------------------------------------------------
8 
9    implicit none
10 
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).
14 
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
19 
20    type (bad_data_type)              :: n_obs_bad
21    integer                           :: i
22 
23    if (trace_use) call da_trace_entry("da_residual_rad")
24 
25    do i = 1, iv%num_inst
26       if (iv%instid(i)%num_rad < 1) cycle
27 
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
32    end do
33 
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 
37 
38    if (trace_use) call da_trace_exit("da_residual_rad")
39    
40 end subroutine da_residual_rad
41 
42