1 subroutine da_oi_stats_ssmt2 (stats_unit, iv)
3 !-----------------------------------------------------------------------
5 !-----------------------------------------------------------------------
9 integer, intent (in) :: stats_unit ! Output unit for stats.
10 type (iv_type), intent (in) :: iv ! O-B
12 type (maxmin_type) :: minimum
13 type (maxmin_type) :: maximum
16 real :: average, rms_err
18 if (trace_use_dull) call da_trace_entry("da_oi_stats_ssmt2")
22 maximum = maxmin_type(-1.0E+20, 0, 0)
23 minimum = maxmin_type(1.0E+20, 0, 0)
27 do n=1, iv%info(ssmt2)%nlocal
28 if (iv%info(ssmt2)%proc_domain(1,n)) then
29 do k=1, iv%info(ssmt2)%levels(n)
30 call da_stats_calculate(n, k, iv%ssmt2(n)%rh(k)%qc, iv%ssmt2(n)%rh(k)%inv, nrh, &
31 minimum, maximum, average, rms_err)
33 end if ! end if (iv%info(ssmt2)%proc_domain(1,n))
36 ! Do inter-processor communication to gather statistics.
37 call da_proc_sum_int(nrh)
39 call da_proc_stats_combine(average, rms_err, minimum%value, maximum%value, &
40 minimum%n, maximum%n, minimum%l, maximum%l)
44 write(unit=stats_unit, fmt='(/a/)') ' Diagnostics of O-B for SSMT2'
45 call da_print_stats_ssmt2(stats_unit, nrh, minimum, maximum, average, rms_err)
49 if (trace_use_dull) call da_trace_exit("da_oi_stats_ssmt2")
51 end subroutine da_oi_stats_ssmt2