1 subroutine da_ao_stats_ssmt2 (stats_unit, iv, re)
3 !-----------------------------------------------------------------------
5 !-----------------------------------------------------------------------
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
13 type (maxmin_type) :: minimum
14 type (maxmin_type) :: maximum
17 real :: average, rms_err
19 if (trace_use_dull) call da_trace_entry("da_ao_stats_ssmt2")
23 maximum = maxmin_type(-1.0E+20, 0, 0)
24 minimum = maxmin_type (1.0E+20, 0, 0)
28 if (iv%info(ssmt2)%nlocal > 0) then
29 do n=1, iv%info(ssmt2)%nlocal
30 if (iv%info(ssmt2)%proc_domain(1,n)) then
31 do k=1, iv%info(ssmt2)%levels(n)
32 call da_stats_calculate (n, k, iv%ssmt2(n)%rh(k)%qc, re%ssmt2(n)%rh(k), nrh, &
33 minimum, maximum, average, rms_err)
36 end if ! end if (iv%info(ssmt2)%proc_domain(1,n))
40 ! Do inter-processor communication to gather statistics.
41 call da_proc_sum_int (nrh)
42 iv%nstats(ssmt2) = nrh
44 call da_proc_stats_combine(average, rms_err, minimum%value, maximum%value, &
45 minimum%n, maximum%n, minimum%l, maximum%l)
49 write(unit=stats_unit, fmt='(/a/)') ' Diagnostics of O-A for SSMT2'
50 call da_print_stats_ssmt2 (stats_unit, nrh, minimum, maximum, average, rms_err)
54 if (trace_use_dull) call da_trace_exit("da_ao_stats_ssmt2")
56 end subroutine da_ao_stats_ssmt2