updated top-level README and version_decl for V4.5 (#1847)
[WRF.git] / var / da / da_ssmi / da_check_max_iv_ssmt2.inc
blobc7ddf7aa3e8f442c94dd5f30ee859ce5e1f3c653
1 subroutine da_check_max_iv_ssmt2(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
12    type(iv_type), intent(inout) :: iv
13    integer,       intent(in)    :: it     ! outer iteration
14    integer,       intent(inout) :: num_qcstat_conv(:,:,:,:)
17    integer :: k,n, ipr
18    logical :: failed
20    if (trace_use_dull) call da_trace_entry("da_check_max_iv_ssmt2")
23    !---------------------------------------------------------------------------
24    !  [1.0] Perform maximum innovation vector check:
25    !---------------------------------------------------------------------------
27    do n=iv%info(ssmt2)%n1,iv%info(ssmt2)%n2
28       do k = 1, iv%info(ssmt2)%levels(n)
29         call da_get_print_lvl(iv%ssmt2(n)%p(k),ipr)
31         failed = .false.
32         if( iv%ssmt2(n)%rh(k)%qc >= obs_qc_pointer ) then
33         call da_max_error_qc (it, iv%info(ssmt2), n, iv%ssmt2(n)%rh(k), max_error_q, failed)
34         if( iv%info(ssmt2)%proc_domain(k,n) ) then
35         num_qcstat_conv(1,ssmt2,4,ipr) = num_qcstat_conv(1,ssmt2,4,ipr) + 1
36         if(failed)then
37          num_qcstat_conv(2,ssmt2,4,ipr) = num_qcstat_conv(2,ssmt2,4,ipr) + 1
38         if ( write_rej_obs_conv ) then
39         write(qcstat_conv_unit,'(2x,a10,2x,a4,3f12.2)')&
40         'ssmt2',ob_vars(4),iv%info(ssmt2)%lat(k,n),iv%info(ssmt2)%lon(k,n),0.01*iv%ssmt2(n)%p(k)
41         endif
42         endif
43         endif
44         endif
45       end do
46    end do
48    if (trace_use_dull) call da_trace_exit("da_check_max_iv_ssmt2")
50 end subroutine da_check_max_iv_ssmt2