2 subroutine da_oi_stats_gpspw (stats_unit, iv)
4 !-----------------------------------------------------------------------
6 !-----------------------------------------------------------------------
10 integer, intent (in) :: stats_unit ! Output unit for stats.
11 type (iv_type), intent (in) :: iv ! OI
13 type (stats_gpspw_type) :: stats
17 if (trace_use_dull) call da_trace_entry("da_oi_stats_gpspw")
21 stats%maximum%tpw = maxmin_type(missing_r, 0, 0)
22 stats%minimum%tpw = maxmin_type(-missing_r, 0, 0)
24 stats%average = residual_gpspw1_type(0.0)
25 stats%rms_err = stats%average
26 do n=1, iv%info(gpspw)%nlocal
27 if (iv%info(gpspw)%proc_domain(1,n)) then
28 call da_stats_calculate(iv%info(gpspw)%obs_global_index(n), &
29 0, iv%gpspw(n)%tpw%qc, &
30 iv%gpspw(n)%tpw%inv, ntpw, &
31 stats%minimum%tpw , stats%maximum%tpw, &
32 stats%average%tpw , stats%rms_err%tpw)
34 end if ! end if (iv%info(gpspw)%proc_domain(1,n))
37 ! do inter-processor communication to gather statistics.
39 call da_proc_sum_int(ntpw)
41 call da_proc_stats_combine(stats%average%tpw, stats%rms_err%tpw, &
42 stats%minimum%tpw%value, stats%maximum%tpw%value, &
43 stats%minimum%tpw%n, stats%maximum%tpw%n, &
44 stats%minimum%tpw%l, stats%maximum%tpw%l)
48 if (use_gpspwObs) then
49 write(unit=stats_unit, fmt='(/a/)') ' Diagnostics of OI for gpspw'
50 else if (use_gpsztdObs) then
51 write(unit=stats_unit, fmt='(/a/)') ' Diagnostics of OI for gpsztd'
54 call da_print_stats_gpspw(stats_unit, ntpw, stats)
58 if (trace_use_dull) call da_trace_exit("da_oi_stats_gpspw")
60 end subroutine da_oi_stats_gpspw