1 subroutine da_oi_stats_geoamv(stats_unit, iv, ob)
3 !-------------------------------------------------------------------------
4 ! Purpose: Calculates (Obs - Analysis) statistics for Geo. AMV's
5 !-------------------------------------------------------------------------
9 integer, intent (in) :: stats_unit ! Output unit for stats.
10 type (iv_type), intent (in) :: iv ! OI
11 type(y_type), intent (in) :: ob ! Observation structure.
13 type (stats_geoamv_type) :: stats
16 real :: u_inv, v_inv, u_obs, v_obs
18 if (trace_use_dull) call da_trace_entry("da_oi_stats_geoamv")
23 stats%maximum%u = maxmin_type(missing_r, 0, 0)
24 stats%maximum%v = maxmin_type(missing_r, 0, 0)
25 stats%minimum%u = maxmin_type(-missing_r, 0, 0)
26 stats%minimum%v = maxmin_type(-missing_r, 0, 0)
28 stats%average = residual_geoamv1_type(0.0, 0.0)
29 stats%rms_err = stats%average
31 do n=1, iv%info(geoamv)%nlocal
32 if (iv%info(geoamv)%proc_domain(1,n)) then
33 do k=1, iv%info(geoamv)%levels(n)
35 u_inv = iv%geoamv(n)%u(k)%inv
36 v_inv = iv%geoamv(n)%v(k)%inv
37 u_obs = ob%geoamv(n)%u(k)
38 v_obs = ob%geoamv(n)%v(k)
40 if (.not. wind_sd_geoamv .and. wind_stats_sd) &
41 call da_ffdduv_diagnose(u_obs, u_inv, u_obs, v_obs, v_inv, v_obs, &
42 iv%geoamv(n)%u(k)%qc, iv%geoamv(n)%v(k)%qc, convert_uv2fd)
43 if (wind_sd_geoamv .and. .not. wind_stats_sd) &
44 call da_ffdduv_diagnose(u_obs, u_inv, u_obs, v_obs, v_inv, v_obs, &
45 iv%geoamv(n)%u(k)%qc, iv%geoamv(n)%v(k)%qc, convert_fd2uv)
47 call da_stats_calculate(iv%info(geoamv)%obs_global_index(n), &
48 0, iv%geoamv(n)%u(k)%qc, &
50 stats%minimum%u, stats%maximum%u, &
51 stats%average%u, stats%rms_err%u)
52 call da_stats_calculate(iv%info(geoamv)%obs_global_index(n), &
53 0, iv%geoamv(n)%v(k)%qc, &
55 stats%minimum%v, stats%maximum%v, &
56 stats%average%v, stats%rms_err%v)
61 ! Do inter-processor communication to gather statistics.
62 call da_proc_sum_int(nu)
63 call da_proc_sum_int(nv)
64 call da_proc_stats_combine(stats%average%u, stats%rms_err%u, &
65 stats%minimum%u%value, stats%maximum%u%value, &
66 stats%minimum%u%n, stats%maximum%u%n, &
67 stats%minimum%u%l, stats%maximum%u%l)
68 call da_proc_stats_combine(stats%average%v, stats%rms_err%v, &
69 stats%minimum%v%value, stats%maximum%v%value, &
70 stats%minimum%v%n, stats%maximum%v%n, &
71 stats%minimum%v%l, stats%maximum%v%l)
74 if (nu /= 0 .or. nv /= 0) then
75 write(unit=stats_unit, fmt='(/a/)') ' Diagnostics of OI for geoamv'
76 call da_print_stats_geoamv(stats_unit, nu, nv, stats)
80 if (trace_use_dull) call da_trace_exit("da_oi_stats_geoamv")
82 end subroutine da_oi_stats_geoamv