1 subroutine da_check_max_iv_geoamv(iv, it, num_qcstat_conv)
3 !-------------------------------------------------------------------------
4 ! Purpose: Innovation vector check for Geo. AMVs
6 ! Removed Outerloop check as it is done in da_get_innov
7 ! Author: Syed RH Rizvi, MMM/NESL/NCAR, Date: 07/12/2009
8 !-------------------------------------------------------------------------
12 type(iv_type), intent(inout) :: iv
13 integer, intent(in) :: it ! Outer iteration
14 integer, intent(inout) :: num_qcstat_conv(:,:,:,:)
17 logical :: failed,failed1,failed2
19 if (trace_use_dull) call da_trace_entry("da_check_max_iv_geoamv")
21 !---------------------------------------------------------------------------
22 ! [1.0] Perform maximum innovation vector check:
23 !---------------------------------------------------------------------------
25 do n=iv%info(geoamv)%n1,iv%info(geoamv)%n2
26 do k = 1, iv%info(geoamv)%levels(n)
27 call da_get_print_lvl(iv%geoamv(n)%p(k),ipr)
29 if(.not. qc_rej_both)then
30 if(wind_sd_geoamv)then
32 if( iv%geoamv(n)%u(k)%qc >= obs_qc_pointer ) then
33 call da_max_error_qc (it,iv%info(geoamv), n, iv%geoamv(n)%u(k), max_error_spd,failed)
34 if( iv%info(geoamv)%proc_domain(k,n) ) then
35 num_qcstat_conv(1,geoamv,1,ipr) = num_qcstat_conv(1,geoamv,1,ipr) + 1
37 num_qcstat_conv(2,geoamv,1,ipr) = num_qcstat_conv(2,geoamv,1,ipr) + 1
38 if ( write_rej_obs_conv ) then
39 write(qcstat_conv_unit,'(2x,a10,2x,a4,3f12.2)')&
40 'geoamv',ob_vars(1),iv%info(geoamv)%lat(k,n),iv%info(geoamv)%lon(k,n),0.01*iv%geoamv(n)%p(k)
47 if( iv%geoamv(n)%v(k)%qc >= obs_qc_pointer ) then
48 call da_max_error_qc (it,iv%info(geoamv), n, iv%geoamv(n)%v(k), max_error_dir,failed)
49 if( iv%info(geoamv)%proc_domain(k,n) ) then
50 num_qcstat_conv(1,geoamv,2,ipr) = num_qcstat_conv(1,geoamv,2,ipr) + 1
52 num_qcstat_conv(2,geoamv,2,ipr) = num_qcstat_conv(2,geoamv,2,ipr) + 1
53 if ( write_rej_obs_conv ) then
54 write(qcstat_conv_unit,'(2x,a10,2x,a4,3f12.2)')&
55 'geoamv',ob_vars(2),iv%info(geoamv)%lat(k,n),iv%info(geoamv)%lon(k,n),0.01*iv%geoamv(n)%p(k)
64 if( iv%geoamv(n)%u(k)%qc >= obs_qc_pointer ) then
65 call da_max_error_qc (it,iv%info(geoamv), n, iv%geoamv(n)%u(k), max_error_uv,failed)
66 if( iv%info(geoamv)%proc_domain(k,n) ) then
67 num_qcstat_conv(1,geoamv,1,ipr) = num_qcstat_conv(1,geoamv,1,ipr) + 1
69 num_qcstat_conv(2,geoamv,1,ipr) = num_qcstat_conv(2,geoamv,1,ipr) + 1
70 if ( write_rej_obs_conv ) then
71 write(qcstat_conv_unit,'(2x,a10,2x,a4,3f12.2)')&
72 'geoamv',ob_vars(1),iv%info(geoamv)%lat(k,n),iv%info(geoamv)%lon(k,n),0.01*iv%geoamv(n)%p(k)
79 if( iv%geoamv(n)%v(k)%qc >= obs_qc_pointer ) then
80 call da_max_error_qc (it,iv%info(geoamv), n, iv%geoamv(n)%v(k), max_error_uv,failed)
81 if( iv%info(geoamv)%proc_domain(k,n) ) then
82 num_qcstat_conv(1,geoamv,2,ipr) = num_qcstat_conv(1,geoamv,2,ipr) + 1
84 num_qcstat_conv(2,geoamv,2,ipr) = num_qcstat_conv(2,geoamv,2,ipr) + 1
85 if ( write_rej_obs_conv ) then
86 write(qcstat_conv_unit,'(2x,a10,2x,a4,3f12.2)')&
87 'geoamv',ob_vars(2),iv%info(geoamv)%lat(k,n),iv%info(geoamv)%lon(k,n),0.01*iv%geoamv(n)%p(k)
93 if(wind_sd_geoamv)then
94 if(iv%geoamv(n)%u(k)%qc == fails_error_max .or. abs(iv%geoamv(n)%u(k)%inv) >= max_omb_spd) then
95 iv%geoamv(n)%u(k)%qc = fails_error_max
96 iv%geoamv(n)%u(k)%inv = 0.0
98 if(iv%geoamv(n)%v(k)%qc == fails_error_max .or. abs(iv%geoamv(n)%v(k)%inv) >= max_omb_dir) then
99 iv%geoamv(n)%v(k)%qc = fails_error_max
100 iv%geoamv(n)%v(k)%inv = 0.0
108 if( iv%geoamv(n)%v(k)%qc >= obs_qc_pointer .or. iv%geoamv(n)%u(k)%qc >= obs_qc_pointer ) then
109 if(wind_sd_geoamv)then
110 call da_max_error_qc (it,iv%info(geoamv), n, iv%geoamv(n)%u(k), max_error_spd,failed1)
111 call da_max_error_qc (it,iv%info(geoamv), n, iv%geoamv(n)%v(k), max_error_dir,failed2)
113 call da_max_error_qc (it,iv%info(geoamv), n, iv%geoamv(n)%u(k), max_error_uv,failed1)
114 call da_max_error_qc (it,iv%info(geoamv), n, iv%geoamv(n)%v(k), max_error_uv,failed2)
118 if( iv%info(geoamv)%proc_domain(k,n) ) then
119 num_qcstat_conv(1,geoamv,1,ipr) = num_qcstat_conv(1,geoamv,1,ipr) + 1
120 num_qcstat_conv(1,geoamv,2,ipr) = num_qcstat_conv(1,geoamv,2,ipr) + 1
122 if(failed1 .or. failed2) then
123 num_qcstat_conv(2,geoamv,1,ipr) = num_qcstat_conv(2,geoamv,1,ipr) + 1
124 if ( write_rej_obs_conv ) then
125 write(qcstat_conv_unit,'(2x,a10,2x,a4,3f12.2)')&
126 'geoamv',ob_vars(1),iv%info(geoamv)%lat(k,n),iv%info(geoamv)%lon(k,n),0.01*iv%geoamv(n)%p(k)
128 num_qcstat_conv(2,geoamv,2,ipr) = num_qcstat_conv(2,geoamv,2,ipr) + 1
129 if ( write_rej_obs_conv ) then
130 write(qcstat_conv_unit,'(2x,a10,2x,a4,3f12.2)')&
131 'geoamv',ob_vars(2),iv%info(geoamv)%lat(k,n),iv%info(geoamv)%lon(k,n),0.01*iv%geoamv(n)%p(k)
136 if(wind_sd_geoamv)then
137 if(iv%geoamv(n)%u(k)%qc == fails_error_max .or. iv%geoamv(n)%v(k)%qc == fails_error_max .or. &
138 abs(iv%geoamv(n)%v(k)%inv) >= max_omb_dir .or. abs(iv%geoamv(n)%u(k)%inv) >= max_omb_spd )then
139 iv%geoamv(n)%u(k)%qc = fails_error_max
140 iv%geoamv(n)%v(k)%qc = fails_error_max
141 iv%geoamv(n)%u(k)%inv = 0.0
142 iv%geoamv(n)%v(k)%inv = 0.0
145 if(iv%geoamv(n)%u(k)%qc == fails_error_max .or. iv%geoamv(n)%v(k)%qc == fails_error_max ) then
146 iv%geoamv(n)%u(k)%qc = fails_error_max
147 iv%geoamv(n)%v(k)%qc = fails_error_max
148 iv%geoamv(n)%u(k)%inv = 0.0
149 iv%geoamv(n)%v(k)%inv = 0.0
157 if (trace_use_dull) call da_trace_exit("da_check_max_iv_geoamv")
159 end subroutine da_check_max_iv_geoamv