da_ao_stats_ssmt1.inc

References to this file elsewhere.
1 subroutine da_ao_stats_ssmt1 (stats_unit, iv, re)
2 
3    !-----------------------------------------------------------------------
4    ! Purpose: TBD
5    !-----------------------------------------------------------------------
6 
7    implicit none
8 
9    integer,        intent (in)      :: stats_unit    ! Output unit for stats.
10    type (ob_type), intent (in)      :: iv            ! OI
11    type  (y_type), intent (in)      :: re            ! O-A
12 
13    type (maxmin_type)               :: minimum
14    type (maxmin_type)               :: maximum
15    integer                          :: nt
16    integer                          :: n, k
17    real                             :: average, rms_err
18 
19    nt = 0
20    num_ssmt1_tot = 0
21 
22    maximum = maxmin_type(-1.0E+20, 0, 0)
23    minimum = maxmin_type (1.0E+20, 0, 0)
24    average = 0.0
25    rms_err = 0.0
26 
27    if (iv%num_ssmt1 > 0) then
28       do n=1, iv%num_ssmt1
29          if (iv%ssmt1(n)%loc%proc_domain) then
30             do k=1, iv%ssmt1(n)%info%levels
31                call da_stats_calculate (n, k, iv%ssmt1(n)%t(k)%qc, & 
32                                      re%ssmt1(n)%t(k), nt, &
33                                      minimum, maximum, &
34                                      average, rms_err)
35             end do
36          end if    ! end if (iv%ssmt1(n)%loc%proc_domain)
37       end do
38    end if
39 
40    ! Do inter-processor communication to gather statistics.
41    call da_proc_sum_int (nt)
42    num_ssmt1_tot = nt
43 
44    call da_proc_stats_combine(average, rms_err, &
45                            minimum%value, maximum%value, &
46                            minimum%n, maximum%n, &
47                            minimum%l, maximum%l)
48    
49    if (rootproc) then
50       if (nt /= 0) then
51    
52       write(unit=stats_unit, fmt='(/a/)') ' Diagnostics of O-A for SSMT1'
53    
54       call da_print_stats_ssmt1 (stats_unit, nt, minimum, maximum, &
55                                  average, rms_err)
56    
57     end if
58    
59    end if
60 
61 end subroutine da_ao_stats_ssmt1
62 
63