1 subroutine da_oi_stats_pseudo (stats_unit, iv)
3 !-----------------------------------------------------------------------
5 !-----------------------------------------------------------------------
9 integer, intent (in) :: stats_unit ! Output unit for stats.
10 type (iv_type), intent (in) :: iv ! O-B
12 type (stats_pseudo_type) :: stats
13 integer :: nu, nv, nt, np, nq
16 if (trace_use_dull) call da_trace_entry("da_oi_stats_pseudo")
24 stats%maximum%u = maxmin_type(missing_r, 0, 0)
25 stats%maximum%v = maxmin_type(missing_r, 0, 0)
26 stats%maximum%t = maxmin_type(missing_r, 0, 0)
27 stats%maximum%p = maxmin_type(missing_r, 0, 0)
28 stats%maximum%q = maxmin_type(missing_r, 0, 0)
29 stats%minimum%u = maxmin_type(-missing_r, 0, 0)
30 stats%minimum%v = maxmin_type(-missing_r, 0, 0)
31 stats%minimum%t = maxmin_type(-missing_r, 0, 0)
32 stats%minimum%p = maxmin_type(-missing_r, 0, 0)
33 stats%minimum%q = maxmin_type(-missing_r, 0, 0)
34 stats%average = residual_pseudo1_type(0.0, 0.0, 0.0, 0.0, 0.0)
35 stats%rms_err = stats%average
37 do n=1, iv%info(pseudo)%nlocal
38 if (iv%info(pseudo)%proc_domain(1,n)) then
39 call da_stats_calculate(n, 0, iv%pseudo(n)%u%qc, &
40 iv%pseudo(n)%u%inv, nu, &
41 stats%minimum%u, stats%maximum%u, &
42 stats%average%u, stats%rms_err%u)
43 call da_stats_calculate(n, 0, iv%pseudo(n)%v%qc, &
44 iv%pseudo(n)%v%inv, nv, &
45 stats%minimum%v, stats%maximum%v, &
46 stats%average%v, stats%rms_err%v)
47 call da_stats_calculate(n, 0, iv%pseudo(n)%t%qc, &
48 iv%pseudo(n)%t%inv, nt, &
49 stats%minimum%t, stats%maximum%t, &
50 stats%average%t, stats%rms_err%t)
51 call da_stats_calculate(n, 0, iv%pseudo(n)%p%qc, &
52 iv%pseudo(n)%p%inv, np, &
53 stats%minimum%p, stats%maximum%p, &
54 stats%average%p, stats%rms_err%p)
55 call da_stats_calculate(n, 0, iv%pseudo(n)%q%qc, &
56 iv%pseudo(n)%q%inv, nq, &
57 stats%minimum%q, stats%maximum%q, &
58 stats%average%q, stats%rms_err%q)
59 end if ! end if (iv%info(pseudo)%proc_domain(1,n))
62 ! Do inter-processor communication to gather statistics.
63 call da_proc_sum_int(nu)
64 call da_proc_sum_int(nv)
65 call da_proc_sum_int(nt)
66 call da_proc_sum_int(np)
67 call da_proc_sum_int(nq)
69 call da_proc_stats_combine(stats%average%u, stats%rms_err%u, &
70 stats%minimum%u%value, stats%maximum%u%value, &
71 stats%minimum%u%n, stats%maximum%u%n, &
72 stats%minimum%u%l, stats%maximum%u%l)
73 call da_proc_stats_combine(stats%average%v, stats%rms_err%v, &
74 stats%minimum%v%value, stats%maximum%v%value, &
75 stats%minimum%v%n, stats%maximum%v%n, &
76 stats%minimum%v%l, stats%maximum%v%l)
77 call da_proc_stats_combine(stats%average%t, stats%rms_err%t, &
78 stats%minimum%t%value, stats%maximum%t%value, &
79 stats%minimum%t%n, stats%maximum%t%n, &
80 stats%minimum%t%l, stats%maximum%t%l)
81 call da_proc_stats_combine(stats%average%p, stats%rms_err%p, &
82 stats%minimum%p%value, stats%maximum%p%value, &
83 stats%minimum%p%n, stats%maximum%p%n, &
84 stats%minimum%p%l, stats%maximum%p%l)
85 call da_proc_stats_combine(stats%average%q, stats%rms_err%q, &
86 stats%minimum%q%value, stats%maximum%q%value, &
87 stats%minimum%q%n, stats%maximum%q%n, &
88 stats%minimum%q%l, stats%maximum%q%l)
91 if (nu /= 0 .or. nv /= 0 .OR. nt /= 0 .or. np /= 0 .OR. nq /= 0) then
92 write(unit=stats_unit, fmt='(/a/)') ' O-B Diagnostics for pseudo'
93 call da_print_stats_pseudo(stats_unit, nu, nv, nt, np, nq, stats)
97 if (trace_use_dull) call da_trace_exit("da_oi_stats_pseudo")
99 end subroutine da_oi_stats_pseudo