Merge remote-tracking branch 'origin/release-v4.6.1'
[WRF.git] / var / da / da_rain / da_check_max_iv_rain.inc
blob0a6d84c0cafde74bff4dd1a1fcbe1c80b042a688
1 subroutine da_check_max_iv_rain(iv,ob, it, num_qcstat_conv)
3    !-----------------------------------------------------------------------
4    ! Purpose: TBD
5    ! Update:
6    !    Removed Outerloop check as it is done in da_get_innov
7    !-----------------------------------------------------------------------
9    implicit none
11    type(iv_type), intent(inout) :: iv
12    integer,       intent(in)    :: it      ! Outer iteration 
13    integer,       intent(inout) :: num_qcstat_conv(:,:,:,:)
14    type(y_type),  intent(in)    :: ob      ! Observation structure.
16    logical :: failed 
17    integer :: n
18    
19    if (trace_use) call da_trace_entry("da_check_max_iv_rain")       
22    !---------------------------------------------------------------------------
23    ! [1.0] Perform maximum innovation vector check:
24    !---------------------------------------------------------------------------
26    do n=iv%info(rain)%n1,iv%info(rain)%n2
27       failed=.false.
28       if ( iv%rain(n)%rain%qc >= obs_qc_pointer ) then 
29          call da_max_error_qc (it, iv%info(rain), n, iv%rain(n)%rain, max_error_rain, failed)
30          if ( iv%info(rain)%proc_domain(1,n) ) then
31             num_qcstat_conv(1,rain,10,1)= num_qcstat_conv(1,rain,10,1) + 1
32             if (failed) then
33                num_qcstat_conv(2,rain,10,1)= num_qcstat_conv(2,rain,10,1) + 1
34                if ( write_rej_obs_conv ) then
35                write(qcstat_conv_unit,'(2x,a10,2x,a4,2f12.2,a12)')&
36                   'Rainfall','Rain',iv%info(rain)%lat(1,n),iv%info(rain)%lon(1,n),'-8888.88'   
37                end if
38             end if
39          end if
40       end if
41    end do
43    if (trace_use) call da_trace_exit("da_check_max_iv_rain")       
45 end subroutine da_check_max_iv_rain