Merge remote-tracking branch 'origin/release-v4.6.1'
[WRF.git] / var / da / da_gpspw / da_check_max_iv_gpspw.inc
blob6be539a3efa14b8d95c96a1cda9dfb6d09c1bbdf
1 subroutine da_check_max_iv_gpspw(iv, it, num_qcstat_conv) 
3    !-------------------------------------------------------------------------
4    ! Purpose: TBD
5    ! Update:
6    !    Removed Outerloop check as it is done in da_get_innov
7    !    Author: Syed RH Rizvi,  MMM/NESL/NCAR,  Date: 07/12/2009
8    !-------------------------------------------------------------------------
10    implicit none
13    type(iv_type), intent(inout) :: iv
14    integer,       intent(in)    :: it      ! Outer iteration
15    integer,       intent(inout) :: num_qcstat_conv(:,:,:,:)
17    logical :: failed 
18    integer :: n
20    if (trace_use_dull) call da_trace_entry("da_check_max_iv_gpspw")
22    ! TPW:
24    do n=iv%info(gpspw)%n1,iv%info(gpspw)%n2
26       failed=.false.
27       if( iv%gpspw(n)%tpw%qc >= obs_qc_pointer ) then 
28       call da_max_error_qc(it, iv%info(gpspw), n, iv%gpspw(n)%tpw, max_error_pw,failed)
29       if( iv%info(gpspw)%proc_domain(1,n) ) then
30        num_qcstat_conv(1,gpspw,7,1) = num_qcstat_conv(1,gpspw,7,1) + 1
31       if(failed) then
32        num_qcstat_conv(2,gpspw,7,1) = num_qcstat_conv(2,gpspw,7,1) + 1
33        if ( write_rej_obs_conv ) then
34        write(qcstat_conv_unit,'(2x,a10,2x,a4,2f12.2,a12)')&
35        'gpspw',ob_vars(7),iv%info(gpspw)%lat(1,n),iv%info(gpspw)%lon(1,n),'1013.25'                     
36        end if
37       end if
38       end if
39       end if
40    end do
42    if (trace_use_dull) call da_trace_exit("da_check_max_iv_gpspw")
44 end subroutine da_check_max_iv_gpspw