1 subroutine da_ao_stats_ssmi_tb (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 integer :: ntb19v,ntb19h,ntb22v,ntb37v,ntb37h, &
16 type (stats_ssmi_tb_type) :: stats
18 if (trace_use) call da_trace_entry("da_ao_stats_ssmi_tb")
28 stats%maximum%tb19v = maxmin_type (missing_r, 0, 0)
29 stats%maximum%tb19h = maxmin_type (missing_r, 0, 0)
30 stats%maximum%tb22v = maxmin_type (missing_r, 0, 0)
31 stats%maximum%tb37v = maxmin_type (missing_r, 0, 0)
32 stats%maximum%tb37h = maxmin_type (missing_r, 0, 0)
33 stats%maximum%tb85v = maxmin_type (missing_r, 0, 0)
34 stats%maximum%tb85h = maxmin_type (missing_r, 0, 0)
35 stats%minimum%tb19v = maxmin_type(-missing_r, 0, 0)
36 stats%minimum%tb19h = maxmin_type(-missing_r, 0, 0)
37 stats%minimum%tb22v = maxmin_type(-missing_r, 0, 0)
38 stats%minimum%tb37v = maxmin_type(-missing_r, 0, 0)
39 stats%minimum%tb37h = maxmin_type(-missing_r, 0, 0)
40 stats%minimum%tb85v = maxmin_type(-missing_r, 0, 0)
41 stats%minimum%tb85h = maxmin_type(-missing_r, 0, 0)
42 stats%average = residual_ssmi_tb_type(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)
43 stats%rms_err = stats%average
45 if (iv%info(ssmi_tb)%nlocal .gt. 0) then
46 do n=1, iv%info(ssmi_tb)%nlocal
47 if (iv%info(ssmi_tb)%proc_domain(1,n)) then
48 call da_stats_calculate (n, 0, iv%ssmi_tb(n)%tb19v%qc, &
49 re%ssmi_tb(n)%tb19v, ntb19v, &
50 stats%minimum%tb19v, stats%maximum%tb19v,&
51 stats%average%tb19v, stats%rms_err%tb19v)
53 call da_stats_calculate (n, 0, iv%ssmi_tb(n)%tb19h%qc, &
54 re%ssmi_tb(n)%tb19h, ntb19h, &
55 stats%minimum%tb19h, stats%maximum%tb19h,&
56 stats%average%tb19h, stats%rms_err%tb19h)
58 call da_stats_calculate (n, 0, iv%ssmi_tb(n)%tb22v%qc, &
59 re%ssmi_tb(n)%tb22v, ntb22v, &
60 stats%minimum%tb22v, stats%maximum%tb22v,&
61 stats%average%tb22v, stats%rms_err%tb22v)
63 call da_stats_calculate (n, 0, iv%ssmi_tb(n)%tb37v%qc, &
64 re%ssmi_tb(n)%tb37v, ntb37v, &
65 stats%minimum%tb37v, stats%maximum%tb37v,&
66 stats%average%tb37v, stats%rms_err%tb37v)
68 call da_stats_calculate (n, 0, iv%ssmi_tb(n)%tb37h%qc, &
69 re%ssmi_tb(n)%tb37h, ntb37h, &
70 stats%minimum%tb37h, stats%maximum%tb37h,&
71 stats%average%tb37h, stats%rms_err%tb37h)
73 call da_stats_calculate (n, 0, iv%ssmi_tb(n)%tb85v%qc, &
74 re%ssmi_tb(n)%tb85v, ntb85v, &
75 stats%minimum%tb85v, stats%maximum%tb85v,&
76 stats%average%tb85v, stats%rms_err%tb85v)
78 call da_stats_calculate (n, 0, iv%ssmi_tb(n)%tb85h%qc, &
79 re%ssmi_tb(n)%tb85h, ntb85h, &
80 stats%minimum%tb85h, stats%maximum%tb85h,&
81 stats%average%tb85h, stats%rms_err%tb85h)
82 end if ! end if (iv%info(ssmi_tb)%proc_domain(1,n))
86 ! Do inter-processor communication to gather statistics.
87 call da_proc_sum_int (ntb19v)
88 call da_proc_sum_int (ntb19h)
89 call da_proc_sum_int (ntb22v)
90 call da_proc_sum_int (ntb37v)
91 call da_proc_sum_int (ntb37h)
92 call da_proc_sum_int (ntb85v)
93 call da_proc_sum_int (ntb85h)
94 iv%nstats(ssmi_tb) = ntb19v + ntb19h + ntb22v + ntb37v + ntb37h + ntb85v + ntb85h
96 call da_proc_stats_combine(stats%average%tb19v, stats%rms_err%tb19v, &
97 stats%minimum%tb19v%value, stats%maximum%tb19v%value, &
98 stats%minimum%tb19v%n, stats%maximum%tb19v%n, &
99 stats%minimum%tb19v%l, stats%maximum%tb19v%l)
101 call da_proc_stats_combine(stats%average%tb19h, stats%rms_err%tb19h, &
102 stats%minimum%tb19h%value, stats%maximum%tb19h%value, &
103 stats%minimum%tb19h%n, stats%maximum%tb19h%n, &
104 stats%minimum%tb19h%l, stats%maximum%tb19h%l)
106 call da_proc_stats_combine(stats%average%tb22v, stats%rms_err%tb22v, &
107 stats%minimum%tb22v%value, stats%maximum%tb22v%value, &
108 stats%minimum%tb22v%n, stats%maximum%tb22v%n, &
109 stats%minimum%tb22v%l, stats%maximum%tb22v%l)
111 call da_proc_stats_combine(stats%average%tb37v, stats%rms_err%tb37v, &
112 stats%minimum%tb37v%value, stats%maximum%tb37v%value, &
113 stats%minimum%tb37v%n, stats%maximum%tb37v%n, &
114 stats%minimum%tb37v%l, stats%maximum%tb37v%l)
116 call da_proc_stats_combine(stats%average%tb37h, stats%rms_err%tb37h, &
117 stats%minimum%tb37h%value, stats%maximum%tb37h%value, &
118 stats%minimum%tb37h%n, stats%maximum%tb37h%n, &
119 stats%minimum%tb37h%l, stats%maximum%tb37h%l)
121 call da_proc_stats_combine(stats%average%tb85v, stats%rms_err%tb85v, &
122 stats%minimum%tb85v%value, stats%maximum%tb85v%value, &
123 stats%minimum%tb85v%n, stats%maximum%tb85v%n, &
124 stats%minimum%tb85v%l, stats%maximum%tb85v%l)
126 call da_proc_stats_combine(stats%average%tb85h, stats%rms_err%tb85h, &
127 stats%minimum%tb85h%value, stats%maximum%tb85h%value, &
128 stats%minimum%tb85h%n, stats%maximum%tb85h%n, &
129 stats%minimum%tb85h%l, stats%maximum%tb85h%l)
132 if (ntb19v /= 0) then
133 write(unit=stats_unit, fmt='(/a/)') ' Diagnostics of AO for ssmi_tb'
135 write(unit=stats_unit, fmt='(a/)') ' var tb19v(m/s) n'
137 write(unit=stats_unit, fmt='(a,i14)') ' Number: ', ntb19v
139 write(unit=stats_unit, fmt='(a, f12.4,i5)') &
140 ' Minimum(n): ', stats%minimum%tb19v%value, stats%minimum%tb19v%n, &
141 ' Maximum(n): ', stats%maximum%tb19v%value, stats%maximum%tb19v%n
142 write(unit=stats_unit, fmt='(a, f12.4,5x)') &
143 ' Average : ', stats%average%tb19v/real(ntb19v), &
144 ' RMSE : ', sqrt(stats%rms_err%tb19v/real(ntb19v))
147 if (ntb19h /= 0) then
148 write(unit=stats_unit, fmt='(/a/)') ' Diagnostics of AO for ssmi_tb'
150 write(unit=stats_unit, fmt='(a/)') ' var tb19h(m/s) n'
152 write(unit=stats_unit, fmt='(a,i14)') ' Number: ', ntb19h
154 write(unit=stats_unit, fmt='(a, f12.4,i5)') &
155 ' Minimum(n): ', stats%minimum%tb19h%value, stats%minimum%tb19h%n, &
156 ' Maximum(n): ', stats%maximum%tb19h%value, stats%maximum%tb19h%n
157 write(unit=stats_unit, fmt='(a, f12.4,5x)') &
158 ' Average : ', stats%average%tb19h/real(ntb19h), &
159 ' RMSE : ', sqrt(stats%rms_err%tb19h/real(ntb19h))
162 if (ntb22v /= 0) then
163 write(unit=stats_unit, fmt='(/a/)') ' Diagnostics of AO for ssmi_tb'
165 write(unit=stats_unit, fmt='(a/)') ' var tb22v(m/s) n'
167 write(unit=stats_unit, fmt='(a,i14)') ' Number: ', ntb22v
169 write(unit=stats_unit, fmt='(a, f12.4,i5)') &
170 ' Minimum(n): ', stats%minimum%tb22v%value, stats%minimum%tb22v%n, &
171 ' Maximum(n): ', stats%maximum%tb22v%value, &
172 stats%maximum%tb22v%n
173 write(unit=stats_unit, fmt='(a, f12.4,5x)') &
174 ' Average : ', stats%average%tb22v/real(ntb22v), &
175 ' RMSE : ', sqrt(stats%rms_err%tb22v/real(ntb22v))
178 if (ntb37v /= 0) then
179 write(unit=stats_unit, fmt='(/a/)') ' Diagnostics of AO for ssmi_tb'
181 write(unit=stats_unit, fmt='(a/)') ' var tb37v(m/s) n'
183 write(unit=stats_unit, fmt='(a,i14)') ' Number: ', ntb37v
185 write(unit=stats_unit, fmt='(a, f12.4,i5)') &
186 ' Minimum(n): ', stats%minimum%tb37v%value, stats%minimum%tb37v%n, &
187 ' Maximum(n): ', stats%maximum%tb37v%value, stats%maximum%tb37v%n
188 write(unit=stats_unit, fmt='(a, f12.4,5x)') &
189 ' Average : ', stats%average%tb37v/real(ntb37v), &
190 ' RMSE : ', sqrt(stats%rms_err%tb37v/real(ntb37v))
193 if (ntb37h /= 0) then
194 write(unit=stats_unit, fmt='(/a/)') ' Diagnostics of AO for ssmi_tb'
196 write(unit=stats_unit, fmt='(a/)') ' var tb37h(m/s) n'
198 write(unit=stats_unit, fmt='(a,i14)') ' Number: ', ntb37h
200 write(unit=stats_unit, fmt='(a, f12.4,i5)') &
201 ' Minimum(n): ', stats%minimum%tb37h%value, stats%minimum%tb37h%n, &
202 ' Maximum(n): ', stats%maximum%tb37h%value, stats%maximum%tb37h%n
203 write(unit=stats_unit, fmt='(a, f12.4,5x)') &
204 ' Average : ', stats%average%tb37h/real(ntb37h), &
205 ' RMSE : ', sqrt(stats%rms_err%tb37h/real(ntb37h))
208 if (ntb85v /= 0) then
209 write(unit=stats_unit, fmt='(/a/)') ' Diagnostics of AO for ssmi_tb'
211 write(unit=stats_unit, fmt='(a/)') ' var tb85v(m/s) n'
213 write(unit=stats_unit, fmt='(a,i14)') ' Number: ', ntb85v
215 write(unit=stats_unit, fmt='(a, f12.4,i5)') &
216 ' Minimum(n): ', stats%minimum%tb85v%value, stats%minimum%tb85v%n, &
217 ' Maximum(n): ', stats%maximum%tb85v%value, stats%maximum%tb85v%n
218 write(unit=stats_unit, fmt='(a, f12.4,5x)') &
219 ' Average : ', stats%average%tb85v/real(ntb85v), &
220 ' RMSE : ', sqrt(stats%rms_err%tb85v/real(ntb85v))
223 if (ntb85h /= 0) then
224 write(unit=stats_unit, fmt='(/a/)') ' Diagnostics of AO for ssmi_tb'
226 write(unit=stats_unit, fmt='(a/)') ' var tb85h(m/s) n'
228 write(unit=stats_unit, fmt='(a,i14)') ' Number: ', ntb85h
230 write(unit=stats_unit, fmt='(a, f12.4,i5)') &
231 ' Minimum(n): ', stats%minimum%tb85h%value, stats%minimum%tb85h%n, &
232 ' Maximum(n): ', stats%maximum%tb85h%value, stats%maximum%tb85h%n
233 write(unit=stats_unit, fmt='(a, f12.4,5x)') &
234 ' Average : ', stats%average%tb85h/real(ntb85h), &
235 ' RMSE : ', sqrt(stats%rms_err%tb85h/real(ntb85h))
239 if (trace_use) call da_trace_exit("da_ao_stats_ssmi_tb")
241 end subroutine da_ao_stats_ssmi_tb