1 subroutine da_ao_stats_bogus (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_bogus_type) :: stats
14 integer :: nu, nv, nt, nq, nslp
17 if (trace_use_dull) call da_trace_entry("da_ao_stats_bogus")
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%q = maxmin_type (missing_r, 0, 0)
29 stats%maximum%slp = 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%q = maxmin_type(-missing_r, 0, 0)
34 stats%minimum%slp = maxmin_type(-missing_r, 0, 0)
36 stats%average = residual_bogus1_type(0.0, 0.0, 0.0, 0.0, 0.0)
37 stats%rms_err = stats%average
39 do n=1, iv%info(bogus)%nlocal
40 if (iv%info(bogus)%proc_domain(1,n)) then
41 call da_stats_calculate (n, 0, iv%bogus(n)%slp%qc, &
42 re%bogus(n)%slp, nslp, &
43 stats%minimum%slp, stats%maximum%slp, &
44 stats%average%slp, stats%rms_err%slp)
46 do k=1, iv%info(bogus)%levels(n)
47 call da_stats_calculate (n, k, iv%bogus(n)%u(k)%qc, &
48 re%bogus(n)%u(k), nu, &
49 stats%minimum%u, stats%maximum%u, &
50 stats%average%u, stats%rms_err%u)
51 call da_stats_calculate (n, k, iv%bogus(n)%v(k)%qc, &
52 re%bogus(n)%v(k), nv, &
53 stats%minimum%v, stats%maximum%v, &
54 stats%average%v, stats%rms_err%v)
55 call da_stats_calculate (n, k, iv%bogus(n)%t(k)%qc, &
56 re%bogus(n)%t(k), nt, &
57 stats%minimum%t, stats%maximum%t, &
58 stats%average%t, stats%rms_err%t)
59 call da_stats_calculate (n, k, iv%bogus(n)%q(k)%qc, &
60 re%bogus(n)%q(k), nq, &
61 stats%minimum%q, stats%maximum%q, &
62 stats%average%q, stats%rms_err%q)
67 ! Do inter-processor communication to gather statistics.
68 call da_proc_sum_int (nu)
69 call da_proc_sum_int (nv)
70 call da_proc_sum_int (nt)
71 call da_proc_sum_int (nq)
72 call da_proc_sum_int (nslp)
73 iv%nstats(bogus) = nu + nv + nt + nq + nslp
75 call da_proc_stats_combine(stats%average%u, stats%rms_err%u, &
76 stats%minimum%u%value, stats%maximum%u%value, &
77 stats%minimum%u%n, stats%maximum%u%n, &
78 stats%minimum%u%l, stats%maximum%u%l)
79 call da_proc_stats_combine(stats%average%v, stats%rms_err%v, &
80 stats%minimum%v%value, stats%maximum%v%value, &
81 stats%minimum%v%n, stats%maximum%v%n, &
82 stats%minimum%v%l, stats%maximum%v%l)
83 call da_proc_stats_combine(stats%average%t, stats%rms_err%t, &
84 stats%minimum%t%value, stats%maximum%t%value, &
85 stats%minimum%t%n, stats%maximum%t%n, &
86 stats%minimum%t%l, stats%maximum%t%l)
87 call da_proc_stats_combine(stats%average%q, stats%rms_err%q, &
88 stats%minimum%q%value, stats%maximum%q%value, &
89 stats%minimum%q%n, stats%maximum%q%n, &
90 stats%minimum%q%l, stats%maximum%q%l)
91 call da_proc_stats_combine(stats%average%slp, stats%rms_err%slp, &
92 stats%minimum%slp%value, stats%maximum%slp%value, &
93 stats%minimum%slp%n, stats%maximum%slp%n, &
94 stats%minimum%slp%l, stats%maximum%slp%l)
97 if (nu /= 0 .or. nv /= 0 .or. nt /= 0 .or. nq /= 0 .or. nslp /= 0) then
98 write(unit=stats_unit, fmt='(/a/)') ' Diagnostics of AO for bogus'
99 call da_print_stats_bogus(stats_unit, nu, nv, nt, nq, nslp, stats)
103 if (trace_use_dull) call da_trace_exit("da_ao_stats_bogus")
105 end subroutine da_ao_stats_bogus