1 subroutine da_oi_stats_ssmi_rv(stats_unit, iv)
3 !-----------------------------------------------------------------------
5 !-----------------------------------------------------------------------
9 integer, intent (in) :: stats_unit ! Output unit for stats.
10 type (iv_type), intent (in) :: iv ! iv
12 integer :: ntpw, nspeed, n
13 type (stats_ssmi_rv_type) :: stats
15 if (trace_use) call da_trace_entry("da_oi_stats_ssmi_rv")
20 stats%maximum%tpw = maxmin_type(missing_r, 0, 0)
21 stats%maximum%speed = maxmin_type(missing_r, 0, 0)
22 stats%minimum%tpw = maxmin_type(-missing_r, 0, 0)
23 stats%minimum%speed = maxmin_type(-missing_r, 0, 0)
24 stats%average = residual_ssmi_rv_type(0.0, 0.0)
25 stats%rms_err = stats%average
27 do n=1, iv%info(ssmi_rv)%nlocal
28 if (iv%info(ssmi_rv)%proc_domain(1,n)) then
29 call da_stats_calculate(iv%info(ssmi_rv)%obs_global_index(n), &
30 0, iv%ssmi_rv(n)%tpw%qc, &
31 iv%ssmi_rv(n)%tpw%inv, ntpw, &
36 call da_stats_calculate(iv%info(ssmi_rv)%obs_global_index(n), &
37 0, iv%ssmi_rv(n)%speed%qc, &
38 iv%ssmi_rv(n)%speed%inv, nspeed, &
39 stats%minimum%speed, &
40 stats%maximum%speed, &
41 stats%average%speed, &
46 ! Do inter-processor communication to gather statistics.
47 call da_proc_sum_int(ntpw)
48 call da_proc_sum_int(nspeed)
50 call da_proc_stats_combine(stats%average%tpw, stats%rms_err%tpw, &
51 stats%minimum%tpw%value, stats%maximum%tpw%value, &
52 stats%minimum%tpw%n, stats%maximum%tpw%n, &
53 stats%minimum%tpw%l, stats%maximum%tpw%l)
55 call da_proc_stats_combine(stats%average%speed, stats%rms_err%speed, &
56 stats%minimum%speed%value, stats%maximum%speed%value, &
57 stats%minimum%speed%n, stats%maximum%speed%n, &
58 stats%minimum%speed%l, stats%maximum%speed%l)
62 write(unit=stats_unit, fmt='(/a/)') ' Diagnostics of OI for ssmi_retrieval'
63 write(unit=stats_unit, fmt='(a/)') ' var tpw(cm) n'
64 write(unit=stats_unit, fmt='(a,i14)') ' Number: ', ntpw
65 write(unit=stats_unit, fmt='(a, f12.4,i9)') &
66 ' Minimum(n): ', stats%minimum%tpw%value, stats%minimum%tpw%n , &
67 ' Maximum(n): ', stats%maximum%tpw%value, stats%maximum%tpw%n
68 write(unit=stats_unit, fmt='(a, f12.4,5x)') &
69 ' Average : ', stats%average%tpw/real(ntpw), &
70 ' RMSE : ', sqrt(stats%rms_err%tpw/real(ntpw))
74 write(unit=stats_unit, fmt='(/a/)') ' Diagnostics of OI for ssmi_retrieval'
75 write(unit=stats_unit, fmt='(a/)') ' var speed(m/s) n'
76 write(unit=stats_unit, fmt='(a,i14)') ' Number: ', nspeed
77 write(unit=stats_unit, fmt='(a, f12.4,i9)') &
78 ' Minimum(n): ', stats%minimum%speed%value, stats%minimum%speed%n , &
79 ' Maximum(n): ', stats%maximum%speed%value, stats%maximum%speed%n
80 write(unit=stats_unit, fmt='(a, f12.4,5x)') &
81 ' Average : ', stats%average%speed/real(nspeed), &
82 ' RMSE : ', sqrt(stats%rms_err%speed/real(nspeed))
86 if (trace_use) call da_trace_exit("da_iv_stats_ssmi_rv")
88 end subroutine da_oi_stats_ssmi_rv