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 (iv_type), intent (inout) :: 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 if (trace_use_dull) call da_trace_entry("da_ao_stats_ssmt1")
20
21 nt = 0
22
23 maximum = maxmin_type(-1.0E+20, 0, 0)
24 minimum = maxmin_type (1.0E+20, 0, 0)
25 average = 0.0
26 rms_err = 0.0
27
28 if (iv%info(ssmt1)%nlocal > 0) then
29 do n=1, iv%info(ssmt1)%nlocal
30 if (iv%info(ssmt1)%proc_domain(1,n)) then
31 do k=1, iv%info(ssmt1)%levels(n)
32 call da_stats_calculate (n, k, iv%ssmt1(n)%t(k)%qc, re%ssmt1(n)%t(k), nt, &
33 minimum, maximum, average, rms_err)
34 end do
35 end if ! end if (iv%info(ssmt1)%proc_domain(1,n))
36 end do
37 end if
38
39 ! Do inter-processor communication to gather statistics.
40 call da_proc_sum_int (nt)
41 iv%nstats(ssmt1) = nt
42
43 call da_proc_stats_combine(average, rms_err, minimum%value, maximum%value, &
44 minimum%n, maximum%n, minimum%l, maximum%l)
45
46 if (rootproc) then
47 if (nt /= 0) then
48 write(unit=stats_unit, fmt='(/a/)') ' Diagnostics of O-A for SSMT1'
49 call da_print_stats_ssmt1 (stats_unit, nt, minimum, maximum, average, rms_err)
50 end if
51 end if
52
53 if (trace_use_dull) call da_trace_exit("da_ao_stats_ssmt1")
54
55 end subroutine da_ao_stats_ssmt1
56
57