1 subroutine da_ao_stats_buoy (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_buoy_type) :: stats
14 integer :: nu, nv, nt, np, nq
17 if (trace_use_dull) call da_trace_entry("da_ao_stats_buoy")
25 stats%maximum%u = maxmin_type (missing_r, 0, 0)
26 stats%maximum%v = maxmin_type (missing_r, 0, 0)
27 stats%maximum%t = maxmin_type (missing_r, 0, 0)
28 stats%maximum%p = maxmin_type (missing_r, 0, 0)
29 stats%maximum%q = maxmin_type (missing_r, 0, 0)
30 stats%minimum%u = maxmin_type(-missing_r, 0, 0)
31 stats%minimum%v = maxmin_type(-missing_r, 0, 0)
32 stats%minimum%t = maxmin_type(-missing_r, 0, 0)
33 stats%minimum%p = maxmin_type(-missing_r, 0, 0)
34 stats%minimum%q = maxmin_type(-missing_r, 0, 0)
36 stats%average = residual_buoy1_type(0.0, 0.0, 0.0, 0.0, 0.0)
37 stats%rms_err = stats%average
39 do n=1, iv%info(buoy)%nlocal
40 if (iv%info(buoy)%proc_domain(1,n)) then
41 call da_stats_calculate (n, 0, iv%buoy(n)%u%qc, &
43 stats%minimum%u, stats%maximum%u, &
44 stats%average%u, stats%rms_err%u)
45 call da_stats_calculate (n, 0, iv%buoy(n)%v%qc, &
47 stats%minimum%v, stats%maximum%v, &
48 stats%average%v, stats%rms_err%v)
49 call da_stats_calculate (n, 0, iv%buoy(n)%t%qc, &
51 stats%minimum%t, stats%maximum%t, &
52 stats%average%t, stats%rms_err%t)
53 call da_stats_calculate (n, 0, iv%buoy(n)%p%qc, &
55 stats%minimum%p, stats%maximum%p, &
56 stats%average%p, stats%rms_err%p)
57 call da_stats_calculate (n, 0, iv%buoy(n)%q%qc, &
59 stats%minimum%q, stats%maximum%q, &
60 stats%average%q, stats%rms_err%q)
65 ! Do inter-processor communication to gather statistics.
66 call da_proc_sum_int (nu)
67 call da_proc_sum_int (nv)
68 call da_proc_sum_int (nt)
69 call da_proc_sum_int (np)
70 call da_proc_sum_int (nq)
71 iv%nstats(buoy) = nu + nv + nt + np + nq
73 call da_proc_stats_combine(stats%average%u, stats%rms_err%u, &
74 stats%minimum%u%value, stats%maximum%u%value, &
75 stats%minimum%u%n, stats%maximum%u%n, &
76 stats%minimum%u%l, stats%maximum%u%l)
77 call da_proc_stats_combine(stats%average%v, stats%rms_err%v, &
78 stats%minimum%v%value, stats%maximum%v%value, &
79 stats%minimum%v%n, stats%maximum%v%n, &
80 stats%minimum%v%l, stats%maximum%v%l)
81 call da_proc_stats_combine(stats%average%t, stats%rms_err%t, &
82 stats%minimum%t%value, stats%maximum%t%value, &
83 stats%minimum%t%n, stats%maximum%t%n, &
84 stats%minimum%t%l, stats%maximum%t%l)
85 call da_proc_stats_combine(stats%average%p, stats%rms_err%p, &
86 stats%minimum%p%value, stats%maximum%p%value, &
87 stats%minimum%p%n, stats%maximum%p%n, &
88 stats%minimum%p%l, stats%maximum%p%l)
89 call da_proc_stats_combine(stats%average%q, stats%rms_err%q, &
90 stats%minimum%q%value, stats%maximum%q%value, &
91 stats%minimum%q%n, stats%maximum%q%n, &
92 stats%minimum%q%l, stats%maximum%q%l)
95 if (nu /= 0 .or. nv /= 0 .or. nt /= 0 .or. np /= 0 .or. nq /= 0) then
96 write(unit=stats_unit, fmt='(/a/)') ' Diagnostics of AO for buoy'
97 call da_print_stats_buoy(stats_unit, nu, nv, nt, np, nq, stats)
101 if (trace_use_dull) call da_trace_exit("da_ao_stats_buoy")
103 end subroutine da_ao_stats_buoy