1 subroutine da_oi_stats_rain (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_rain_type) :: stats
16 if (trace_use) call da_trace_entry("da_oi_stats_rain")
20 stats%maximum%rain = maxmin_type(missing_r, 0, 0)
21 stats%minimum%rain = maxmin_type(-missing_r, 0, 0)
23 stats%average = residual_rain1_type(0.0)
24 stats%rms_err = stats%average
26 do n=1, iv%info(rain)%nlocal
27 if (iv%info(rain)%proc_domain(1,n)) then
28 call da_stats_calculate(iv%info(rain)%obs_global_index(n), &
29 0, iv%rain(n)%rain%qc, &
30 iv%rain(n)%rain%inv, nrain, &
31 stats%minimum%rain, stats%maximum%rain, &
32 stats%average%rain, stats%rms_err%rain)
36 ! Do inter-processor communication to gather statistics.
38 call da_proc_sum_int(nrain)
39 call da_proc_stats_combine(stats%average%rain, stats%rms_err%rain, &
40 stats%minimum%rain%value, stats%maximum%rain%value, &
41 stats%minimum%rain%n, stats%maximum%rain%n, &
42 stats%minimum%rain%l, stats%maximum%rain%l)
46 write(unit=stats_unit, fmt='(/a/)') ' Diagnostics of OI for rainfall'
47 call da_print_stats_rain(stats_unit, nrain, stats)
51 if (trace_use) call da_trace_exit("da_oi_stats_rain")
53 end subroutine da_oi_stats_rain