da_check_max_iv_qscat.inc

References to this file elsewhere.
1 subroutine da_check_max_iv_qscat(iv, it, itu, itvv, ituf, itvvf)
2 
3    !-----------------------------------------------------------------------
4    ! Purpose: TBD
5    !-----------------------------------------------------------------------
6 
7    implicit none
8 
9    type(iv_type), intent(inout) :: iv
10    integer,       intent(in)    :: it
11    integer,       intent(inout) :: itu, itvv, ituf, itvvf
12 
13    logical :: failed
14    integer :: n
15    
16    if (trace_use_dull) call da_trace_entry("da_check_max_iv_qscat")
17 
18    !---------------------------------------------------------------------------
19    ! [1.0] Open diagnostic file:
20    !---------------------------------------------------------------------------
21 
22    if (rootproc .and. check_max_iv_print) then
23       write (check_max_iv_unit,'(A)')  &
24          '----------------------------------------------------------------'
25       write (unit = check_max_iv_unit, fmt = '(A,/)') 'MAX ERROR TEST QC:'
26 
27       write (unit = check_max_iv_unit, fmt = '(/,9(A,F3.0,/))')  &
28          'Error max test ratio for Qscat_U   = ',max_error_uv, &
29          'Error max test ratio for Qscat_V   = ',max_error_uv
30    end if
31 
32    !---------------------------------------------------------------------------
33    ! [2.0] Perform maximum innovation vector check:
34    !---------------------------------------------------------------------------
35 
36    failed = .false.
37 
38    do n=iv%info(qscat)%n1,iv%info(qscat)%n2
39       call da_max_error_qc(it, iv%info(qscat), n, iv%qscat(n)%u, max_error_uv, itu, ituf, check_max_iv_unit, &
40          'U    ', failed, check_max_iv_print)
41       call da_max_error_qc (it, iv%info(qscat), n, iv%qscat(n)%v, max_error_uv, itvv, itvvf, check_max_iv_unit, &
42          'V    ', failed, check_max_iv_print)                           
43    end do
44 
45    !---------------------------------------------------------------------------
46    ! [3.0] Output test failed results:
47    !---------------------------------------------------------------------------
48  
49    if (rootproc .and. check_max_iv_print .and. failed) then
50       write (unit = check_max_iv_unit, fmt = '(/,10(2(A,I6),/))') & 
51          'Number of failed qscat u-wind observations:       ', &
52          ituf,  ' on ',itu,   &
53          'Number of failed qscat v-wind observations:       ', &
54          itvvf,  ' on ',itvv
55    end if
56    
57    if (trace_use_dull) call da_trace_exit("da_check_max_iv_qscat")
58 
59 end subroutine da_check_max_iv_qscat
60 
61