1 subroutine da_ao_stats_airsr (stats_unit, iv, re)
3 !-------------------------------------------------------------------------
4 ! Purpose: Compute analysis increment at AIRS retrieval locations
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_airsr_type) :: stats
17 if (trace_use_dull) call da_trace_entry("da_ao_stats_airsr")
22 stats%maximum%t = maxmin_type (missing_r, 0, 0)
23 stats%maximum%q = maxmin_type (missing_r, 0, 0)
24 stats%minimum%t = maxmin_type(-missing_r, 0, 0)
25 stats%minimum%q = maxmin_type(-missing_r, 0, 0)
27 stats%average = residual_airsr1_type(0.0, 0.0)
28 stats%rms_err = stats%average
30 do n=1, iv%info(airsr)%nlocal
31 if (iv%info(airsr)%proc_domain(1,n)) then
32 do k=1, iv%info(airsr)%levels(n)
33 call da_stats_calculate (n, k, iv%airsr(n)%t(k)%qc, &
34 re%airsr(n)%t(k), nt, &
35 stats%minimum%t, stats%maximum%t, &
36 stats%average%t, stats%rms_err%t)
37 call da_stats_calculate (n, k, iv%airsr(n)%q(k)%qc, &
38 re%airsr(n)%q(k), nq, &
39 stats%minimum%q, stats%maximum%q, &
40 stats%average%q, stats%rms_err%q)
45 ! Do inter-processor communication to gather statistics.
46 call da_proc_sum_int (nt)
47 call da_proc_sum_int (nq)
48 iv%nstats(airsr) = nt + nq
50 call da_proc_stats_combine(stats%average%t, stats%rms_err%t, &
51 stats%minimum%t%value, stats%maximum%t%value, &
52 stats%minimum%t%n, stats%maximum%t%n, &
53 stats%minimum%t%l, stats%maximum%t%l)
54 call da_proc_stats_combine(stats%average%q, stats%rms_err%q, &
55 stats%minimum%q%value, stats%maximum%q%value, &
56 stats%minimum%q%n, stats%maximum%q%n, &
57 stats%minimum%q%l, stats%maximum%q%l)
60 if (nt /= 0 .or. nq /= 0) then
61 write(unit=stats_unit, fmt='(/a/)') ' Diagnostics of AO for airs retrievals'
62 call da_print_stats_airsr(stats_unit, nt, nq, stats)
66 if (trace_use_dull) call da_trace_exit("da_ao_stats_airsr")
68 end subroutine da_ao_stats_airsr