da_check_max_iv_airsr.inc

References to this file elsewhere.
1 subroutine da_check_max_iv_airsr(it, airsr,itt,ittf,itqv,itqvf)
2 
3    !-------------------------------------------------------------------------
4    ! Purpose: Applies max error check on AIRS retrievals
5    !-------------------------------------------------------------------------
6 
7    implicit none
8 
9    integer,           intent (in)         :: it      ! Outer iteration
10    type (airsr_type), intent(inout)       :: airsr
11    integer, intent(inout)                 :: itt,ittf,itqv,itqvf
12 
13    integer                                :: k
14    logical                                :: failed
15 
16    !---------------------------------------------------------------------------
17    ! [1.0] Open diagnostic file:
18    !---------------------------------------------------------------------------
19 
20    if (rootproc .and. check_max_iv_print) then
21       write (check_max_iv_unit,'(A)')  &
22          '----------------------------------------------------------------'
23       write (unit = check_max_iv_unit, fmt = '(A,/)') 'MAX ERROR TEST QC:'
24 
25       write (unit = check_max_iv_unit, fmt = '(/,9(A,F3.0,/))')  &
26          'Error max test ratio for AIRS_T   = ',max_error_t,  &
27          'Error max test ratio for AIRS_QV  = ',max_error_q
28    end if
29 
30    !---------------------------------------------------------------------------
31    ! [2.0] Perform maximum innovation vector check:
32    !---------------------------------------------------------------------------
33 
34    failed = .false.
35 
36    do k = 1, airsr % info % levels
37       ! Temperature
38       if (airsr % t(k) % qc >= obs_qc_pointer) then
39          call da_max_error_qc (it, airsr % info, airsr % t(k),&
40             max_error_t, itt, ittf, check_max_iv_unit, 'TEMP ', &
41                          failed, check_max_iv_print)
42 
43       end if
44       ! Mixing ratio, same ratio as relative humidity
45       if (airsr % q(k) % qc >= obs_qc_pointer) then
46          call da_max_error_qc (it, airsr % info, airsr % q(k), &
47             max_error_q, itqv, itqvf, check_max_iv_unit, 'QV   ', &
48                          failed, check_max_iv_print)
49       end if
50    end do
51 
52 end subroutine da_check_max_iv_airsr
53 
54