1 subroutine da_oi_stats_gpsref (stats_unit, iv)
3 ! -------------------------------------------------------------------
5 ! -------------------------------------------------------------------
9 integer, intent (in) :: stats_unit ! Output unit for stats.
10 type (iv_type), intent (in) :: iv ! OI
12 type (stats_gpsref_type) :: stats
16 if (trace_use_dull) call da_trace_entry("da_oi_stats_gpsref")
20 stats%maximum%ref = maxmin_type(missing_r, 0, 0)
21 stats%minimum%ref = maxmin_type(-missing_r, 0, 0)
23 stats%average = residual_gpsref1_type(0.0,0.0,0.0,0.0)
24 stats%rms_err = stats%average
26 do n=1, iv%info(gpsref)%nlocal
27 if (iv%info(gpsref)%proc_domain(1,n)) then
28 do k=1, iv%info(gpsref)%levels(n)
29 call da_stats_calculate(iv%info(gpsref)%obs_global_index(n), &
30 k, iv%gpsref(n)%ref(k)%qc, &
31 iv%gpsref(n)%ref(k)%inv, ngpsref, &
32 stats%minimum%ref, stats%maximum%ref, &
33 stats%average%ref, stats%rms_err%ref)
38 ! do inter-processor communication to gather statistics.
40 call da_proc_sum_int(ngpsref)
42 call da_proc_stats_combine(stats%average%ref, stats%rms_err%ref, &
43 stats%minimum%ref%value, stats%maximum%ref%value, &
44 stats%minimum%ref%n, stats%maximum%ref%n, &
45 stats%minimum%ref%l, stats%maximum%ref%l)
47 if (rootproc .and. (ngpsref > 0)) then
48 write(unit=stats_unit, fmt='(/a/)') ' Diagnostics of OI for gpsref'
49 call da_print_stats_gpsref(stats_unit, ngpsref, stats)
52 if (trace_use_dull) call da_trace_exit("da_oi_stats_gpsref")
54 end subroutine da_oi_stats_gpsref