1 subroutine da_check_max_iv_tamdar_sfc(iv,ob, it, num_qcstat_conv)
3 !-----------------------------------------------------------------------
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(:,:,:,:)
15 type(y_type), intent(in) :: ob ! Observation structure.
18 logical :: failed,failed1,failed2
21 if (trace_use_dull) call da_trace_entry("da_check_max_iv_tamdar_sfc")
24 !---------------------------------------------------------------------------
25 ! [1.0] Perform maximum innovation vector check:
26 !---------------------------------------------------------------------------
28 do n=iv%info(tamdar_sfc)%n1,iv%info(tamdar_sfc)%n2
29 if(.not. qc_rej_both)then
30 if(wind_sd_tamdar)then
32 if( iv%tamdar_sfc(n)%u%qc >= obs_qc_pointer ) then
33 call da_max_error_qc (it,iv%info(tamdar_sfc), n, iv%tamdar_sfc(n)%u, max_error_spd,failed)
34 if( iv%info(tamdar_sfc)%proc_domain(1,n) ) then
35 num_qcstat_conv(1,tamdar_sfc,1,1) = num_qcstat_conv(1,tamdar_sfc,1,1) + 1
37 num_qcstat_conv(2,tamdar_sfc,1,1) = num_qcstat_conv(2,tamdar_sfc,1,1) + 1
38 if ( write_rej_obs_conv ) then
39 write(qcstat_conv_unit,'(2x,a10,2x,a4,3f12.2)')&
40 'tamdar_sfc',ob_vars(1),iv%info(tamdar_sfc)%lat(1,n),iv%info(tamdar_sfc)%lon(1,n),0.01*ob%tamdar_sfc(n)%p
47 if( iv%tamdar_sfc(n)%v%qc >= obs_qc_pointer ) then
48 call da_max_error_qc (it,iv%info(tamdar_sfc), n, iv%tamdar_sfc(n)%v, max_error_dir,failed)
49 if( iv%info(tamdar_sfc)%proc_domain(1,n) ) then
50 num_qcstat_conv(1,tamdar_sfc,2,1) = num_qcstat_conv(1,tamdar_sfc,2,1) + 1
52 num_qcstat_conv(2,tamdar_sfc,2,1) = num_qcstat_conv(2,tamdar_sfc,2,1) + 1
53 if ( write_rej_obs_conv ) then
54 write(qcstat_conv_unit,'(2x,a10,2x,a4,3f12.2)')&
55 'tamdar_sfc',ob_vars(2),iv%info(tamdar_sfc)%lat(1,n),iv%info(tamdar_sfc)%lon(1,n),0.01*ob%tamdar_sfc(n)%p
62 if( iv%tamdar_sfc(n)%u%qc >= obs_qc_pointer ) then
63 call da_max_error_qc (it,iv%info(tamdar_sfc), n, iv%tamdar_sfc(n)%u, max_error_uv,failed)
64 if( iv%info(tamdar_sfc)%proc_domain(1,n) ) then
65 num_qcstat_conv(1,tamdar_sfc,1,1) = num_qcstat_conv(1,tamdar_sfc,1,1) + 1
67 num_qcstat_conv(2,tamdar_sfc,1,1) = num_qcstat_conv(2,tamdar_sfc,1,1) + 1
68 if ( write_rej_obs_conv ) then
69 write(qcstat_conv_unit,'(2x,a10,2x,a4,3f12.2)')&
70 'tamdar_sfc',ob_vars(1),iv%info(tamdar_sfc)%lat(1,n),iv%info(tamdar_sfc)%lon(1,n),0.01*ob%tamdar_sfc(n)%p
77 if( iv%tamdar_sfc(n)%v%qc >= obs_qc_pointer ) then
78 call da_max_error_qc (it,iv%info(tamdar_sfc), n, iv%tamdar_sfc(n)%v, max_error_uv,failed)
79 if( iv%info(tamdar_sfc)%proc_domain(1,n) ) then
80 num_qcstat_conv(1,tamdar_sfc,2,1) = num_qcstat_conv(1,tamdar_sfc,2,1) + 1
82 num_qcstat_conv(2,tamdar_sfc,2,1) = num_qcstat_conv(2,tamdar_sfc,2,1) + 1
83 if ( write_rej_obs_conv ) then
84 write(qcstat_conv_unit,'(2x,a10,2x,a4,3f12.2)')&
85 'tamdar_sfc',ob_vars(2),iv%info(tamdar_sfc)%lat(1,n),iv%info(tamdar_sfc)%lon(1,n),0.01*ob%tamdar_sfc(n)%p
92 if(wind_sd_tamdar)then
93 if(iv%tamdar_sfc(n)%u%qc == fails_error_max .or. abs(iv%tamdar_sfc(n)%u%inv) >= max_omb_spd) then
94 iv%tamdar_sfc(n)%u%qc = fails_error_max
95 iv%tamdar_sfc(n)%u%inv = 0.0
97 if(iv%tamdar_sfc(n)%v%qc == fails_error_max .or. abs(iv%tamdar_sfc(n)%v%inv) >= max_omb_dir) then
98 iv%tamdar_sfc(n)%v%qc = fails_error_max
99 iv%tamdar_sfc(n)%v%inv = 0.0
106 if( iv%tamdar_sfc(n)%v%qc >= obs_qc_pointer .or. iv%tamdar_sfc(n)%u%qc >= obs_qc_pointer ) then
107 if(wind_sd_tamdar)then
108 call da_max_error_qc (it,iv%info(tamdar_sfc), n, iv%tamdar_sfc(n)%u, max_error_spd,failed1)
109 call da_max_error_qc (it,iv%info(tamdar_sfc), n, iv%tamdar_sfc(n)%v, max_error_dir,failed2)
111 call da_max_error_qc (it,iv%info(tamdar_sfc), n, iv%tamdar_sfc(n)%u, max_error_uv,failed1)
112 call da_max_error_qc (it,iv%info(tamdar_sfc), n, iv%tamdar_sfc(n)%v, max_error_uv,failed2)
116 if( iv%info(tamdar_sfc)%proc_domain(1,n) ) then
117 num_qcstat_conv(1,tamdar_sfc,1,1) = num_qcstat_conv(1,tamdar_sfc,1,1) + 1
118 num_qcstat_conv(1,tamdar_sfc,2,1) = num_qcstat_conv(1,tamdar_sfc,2,1) + 1
120 if(failed1 .or. failed2) then
121 num_qcstat_conv(2,tamdar_sfc,1,1) = num_qcstat_conv(2,tamdar_sfc,1,1) + 1
122 if ( write_rej_obs_conv ) then
123 write(qcstat_conv_unit,'(2x,a10,2x,a4,3f12.2)')&
124 'tamdar_sfc',ob_vars(1),iv%info(tamdar_sfc)%lat(1,n),iv%info(tamdar_sfc)%lon(1,n),0.01*ob%tamdar_sfc(n)%p
126 num_qcstat_conv(2,tamdar_sfc,2,1) = num_qcstat_conv(2,tamdar_sfc,2,1) + 1
127 if ( write_rej_obs_conv ) then
128 write(qcstat_conv_unit,'(2x,a10,2x,a4,3f12.2)')&
129 'tamdar_sfc',ob_vars(2),iv%info(tamdar_sfc)%lat(1,n),iv%info(tamdar_sfc)%lon(1,n),0.01*ob%tamdar_sfc(n)%p
134 if(wind_sd_tamdar)then
135 if(iv%tamdar_sfc(n)%u%qc == fails_error_max .or. iv%tamdar_sfc(n)%v%qc == fails_error_max .or. &
136 abs(iv%tamdar_sfc(n)%v%inv) >= max_omb_dir .or. abs(iv%tamdar_sfc(n)%u%inv) >= max_omb_spd )then
137 iv%tamdar_sfc(n)%u%qc = fails_error_max
138 iv%tamdar_sfc(n)%v%qc = fails_error_max
139 iv%tamdar_sfc(n)%u%inv = 0.0
140 iv%tamdar_sfc(n)%v%inv = 0.0
143 if(iv%tamdar_sfc(n)%u%qc == fails_error_max .or. iv%tamdar_sfc(n)%v%qc == fails_error_max ) then
144 iv%tamdar_sfc(n)%u%qc = fails_error_max
145 iv%tamdar_sfc(n)%v%qc = fails_error_max
146 iv%tamdar_sfc(n)%u%inv = 0.0
147 iv%tamdar_sfc(n)%v%inv = 0.0
153 if( iv%tamdar_sfc(n)%t%qc >= obs_qc_pointer ) then
154 call da_max_error_qc (it, iv%info(tamdar_sfc), n, iv%tamdar_sfc(n)%t, max_error_t , failed)
155 if( iv%info(tamdar_sfc)%proc_domain(1,n) ) then
156 num_qcstat_conv(1,tamdar_sfc,3,1)= num_qcstat_conv(1,tamdar_sfc,3,1) + 1
158 num_qcstat_conv(2,tamdar_sfc,3,1)= num_qcstat_conv(2,tamdar_sfc,3,1) + 1
159 if ( write_rej_obs_conv ) then
160 write(qcstat_conv_unit,'(2x,a10,2x,a4,3f12.2)')&
161 'tamdar_sfc',ob_vars(3),iv%info(tamdar_sfc)%lat(1,n),iv%info(tamdar_sfc)%lon(1,n),0.01*ob%tamdar_sfc(n)%p
168 if( iv%tamdar_sfc(n)%p%qc >= obs_qc_pointer ) then
169 call da_max_error_qc (it, iv%info(tamdar_sfc), n, iv%tamdar_sfc(n)%p, max_error_p , failed)
170 if( iv%info(tamdar_sfc)%proc_domain(1,n) ) then
171 num_qcstat_conv(1,tamdar_sfc,5,1)= num_qcstat_conv(1,tamdar_sfc,5,1) + 1
173 num_qcstat_conv(2,tamdar_sfc,5,1)= num_qcstat_conv(2,tamdar_sfc,5,1) + 1
174 if ( write_rej_obs_conv ) then
175 write(qcstat_conv_unit,'(2x,a10,2x,a4,3f12.2)')&
176 'tamdar_sfc',ob_vars(5),iv%info(tamdar_sfc)%lat(1,n),iv%info(tamdar_sfc)%lon(1,n),0.01*ob%tamdar_sfc(n)%p
183 if( iv%tamdar_sfc(n)%q%qc >= obs_qc_pointer ) then
184 if( iv%tamdar_sfc(n)%t%qc == fails_error_max .or. iv%tamdar_sfc(n)%p%qc == fails_error_max) then
186 iv%tamdar_sfc(n)%q%qc = fails_error_max
187 iv%tamdar_sfc(n)%q%inv = 0.0
189 call da_max_error_qc (it, iv%info(tamdar_sfc), n, iv%tamdar_sfc(n)%q, max_error_q , failed)
191 if( iv%info(tamdar_sfc)%proc_domain(1,n) ) then
192 num_qcstat_conv(1,tamdar_sfc,4,1)= num_qcstat_conv(1,tamdar_sfc,4,1) + 1
194 num_qcstat_conv(2,tamdar_sfc,4,1)= num_qcstat_conv(2,tamdar_sfc,4,1) + 1
195 if ( write_rej_obs_conv ) then
196 write(qcstat_conv_unit,'(2x,a10,2x,a4,3f12.2)')&
197 'tamdar_sfc',ob_vars(4),iv%info(tamdar_sfc)%lat(1,n),iv%info(tamdar_sfc)%lon(1,n),0.01*ob%tamdar_sfc(n)%p
205 if (trace_use_dull) call da_trace_exit("da_check_max_iv_tamdar_sfc")
207 end subroutine da_check_max_iv_tamdar_sfc