wrf svn trunk commit r4103
[wrffire.git] / wrfv2_fire / var / da / da_geoamv / da_check_max_iv_geoamv.inc
blob9c3fbe0860803bbb66f57cccbd5d94943e0f721c
1 subroutine da_check_max_iv_geoamv(iv, it, num_qcstat_conv)    
3    !-------------------------------------------------------------------------
4    ! Purpose: Innovation vector check for Geo. AMVs               
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(:,:,:,:)
16    integer :: k,n, ipr
17    logical :: failed
19    if (trace_use_dull) call da_trace_entry("da_check_max_iv_geoamv")
21    !---------------------------------------------------------------------------
22    ! [1.0] Perform maximum innovation vector check:
23    !---------------------------------------------------------------------------
25    do n=iv%info(geoamv)%n1,iv%info(geoamv)%n2
26       do k = 1, iv%info(geoamv)%levels(n)
27          call da_get_print_lvl(iv%geoamv(n)%p(k),ipr)
29          failed=.false.
30          if( iv%geoamv(n)%u(k)%qc >= obs_qc_pointer ) &    
31          call da_max_error_qc(it, iv%info(geoamv), n, iv%geoamv(n)%u(k), max_error_uv,failed)
32          if( iv%info(geoamv)%proc_domain(k,n) ) then
33              num_qcstat_conv(1,geoamv,1,ipr) = num_qcstat_conv(1,geoamv,1,ipr) + 1
34          if(failed) then
35           num_qcstat_conv(2,geoamv,1,ipr) = num_qcstat_conv(2,geoamv,1,ipr) + 1
36            write(qcstat_conv_unit,'(2x,a10,2x,a4,3f12.2)')&
37            'geoamv',ob_vars(1),iv%info(geoamv)%lat(k,n),iv%info(geoamv)%lon(k,n),0.01*iv%geoamv(n)%p(k)
38          end if
39          end if
41          failed=.false.
42          if( iv%geoamv(n)%v(k)%qc >= obs_qc_pointer ) &    
43          call da_max_error_qc(it, iv%info(geoamv), n, iv%geoamv(n)%v(k), max_error_uv,failed)
44          if( iv%info(geoamv)%proc_domain(k,n) ) then
45              num_qcstat_conv(1,geoamv,2,ipr) = num_qcstat_conv(1,geoamv,2,ipr) + 1
46          if(failed)then
47           num_qcstat_conv(2,geoamv,2,ipr) = num_qcstat_conv(2,geoamv,2,ipr) + 1
48            write(qcstat_conv_unit,'(2x,a10,2x,a4,3f12.2)')&
49            'geoamv',ob_vars(2),iv%info(geoamv)%lat(k,n),iv%info(geoamv)%lon(k,n),0.01*iv%geoamv(n)%p(k)
50          end if
51          end if
52       end do
53    end do
55    if (trace_use_dull) call da_trace_exit("da_check_max_iv_geoamv")
57 end subroutine da_check_max_iv_geoamv