1 subroutine da_ao_stats_rain (stats_unit, iv, re)
3 !-----------------------------------------------------------------------
5 !-----------------------------------------------------------------------
9 integer, intent(in) :: stats_unit ! Output unit for stats.
10 type (iv_type), intent(inout) :: iv ! iv
11 type (y_type), intent(in) :: re ! A - O
13 type (stats_rain_type) :: stats
17 if (trace_use) call da_trace_entry("da_ao_stats_rain")
21 stats%maximum%rain = maxmin_type (missing_r, 0, 0)
22 stats%minimum%rain = maxmin_type(-missing_r, 0, 0)
24 stats%average = residual_rain1_type(0.0)
25 stats%rms_err = stats%average
27 do n=1, iv%info(rain)%nlocal
28 if (iv%info(rain)%proc_domain(1,n)) then
29 call da_stats_calculate (n, 0, iv%rain(n)%rain%qc, &
30 re%rain(n)%rain, nrain, &
31 stats%minimum%rain, stats%maximum%rain, &
32 stats%average%rain, stats%rms_err%rain)
36 ! Do inter-processor communication to gather statistics.
37 call da_proc_sum_int (nrain)
38 iv%nstats(rain) = nrain
40 call da_proc_stats_combine(stats%average%rain, stats%rms_err%rain, &
41 stats%minimum%rain%value, stats%maximum%rain%value, &
42 stats%minimum%rain%n, stats%maximum%rain%n, &
43 stats%minimum%rain%l, stats%maximum%rain%l)
46 write(unit=stats_unit, fmt='(/a/)') ' Diagnostics of AO for rainfall'
47 call da_print_stats_rain(stats_unit, nrain, stats)
51 if (trace_use) call da_trace_exit("da_ao_stats_rain")
53 end subroutine da_ao_stats_rain