1 subroutine da_check_max_iv_ships(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_ships")
23 !---------------------------------------------------------------------------
24 ! [1.0] Perform maximum innovation vector check:
25 !---------------------------------------------------------------------------
27 do n=iv%info(ships)%n1,iv%info(ships)%n2
28 if(.not. qc_rej_both)then
31 if( iv%ships(n)%u%qc >= obs_qc_pointer ) then
32 call da_max_error_qc (it,iv%info(ships), n, iv%ships(n)%u, max_error_spd,failed)
33 if( iv%info(ships)%proc_domain(1,n) ) then
34 num_qcstat_conv(1,ships,1,1) = num_qcstat_conv(1,ships,1,1) + 1
36 num_qcstat_conv(2,ships,1,1) = num_qcstat_conv(2,ships,1,1) + 1
37 if ( write_rej_obs_conv ) then
38 write(qcstat_conv_unit,'(2x,a10,2x,a4,3f12.2)')&
39 'ships',ob_vars(1),iv%info(ships)%lat(1,n),iv%info(ships)%lon(1,n),0.01*ob%ships(n)%p
46 if( iv%ships(n)%v%qc >= obs_qc_pointer ) then
47 call da_max_error_qc (it,iv%info(ships), n, iv%ships(n)%v, max_error_dir,failed)
48 if( iv%info(ships)%proc_domain(1,n) ) then
49 num_qcstat_conv(1,ships,2,1) = num_qcstat_conv(1,ships,2,1) + 1
51 num_qcstat_conv(2,ships,2,1) = num_qcstat_conv(2,ships,2,1) + 1
52 if ( write_rej_obs_conv ) then
53 write(qcstat_conv_unit,'(2x,a10,2x,a4,3f12.2)')&
54 'ships',ob_vars(2),iv%info(ships)%lat(1,n),iv%info(ships)%lon(1,n),0.01*ob%ships(n)%p
63 if( iv%ships(n)%u%qc >= obs_qc_pointer ) then
64 call da_max_error_qc (it,iv%info(ships), n, iv%ships(n)%u, max_error_uv,failed)
65 if( iv%info(ships)%proc_domain(1,n) ) then
66 num_qcstat_conv(1,ships,1,1) = num_qcstat_conv(1,ships,1,1) + 1
68 num_qcstat_conv(2,ships,1,1) = num_qcstat_conv(2,ships,1,1) + 1
69 if ( write_rej_obs_conv ) then
70 write(qcstat_conv_unit,'(2x,a10,2x,a4,3f12.2)')&
71 'ships',ob_vars(1),iv%info(ships)%lat(1,n),iv%info(ships)%lon(1,n),0.01*ob%ships(n)%p
77 if( iv%ships(n)%v%qc >= obs_qc_pointer ) then
78 call da_max_error_qc (it,iv%info(ships), n, iv%ships(n)%v, max_error_uv,failed)
79 if( iv%info(ships)%proc_domain(1,n) ) then
80 num_qcstat_conv(1,ships,2,1) = num_qcstat_conv(1,ships,2,1) + 1
82 num_qcstat_conv(2,ships,2,1) = num_qcstat_conv(2,ships,2,1) + 1
83 if ( write_rej_obs_conv ) then
84 write(qcstat_conv_unit,'(2x,a10,2x,a4,3f12.2)')&
85 'ships',ob_vars(2),iv%info(ships)%lat(1,n),iv%info(ships)%lon(1,n),0.01*ob%ships(n)%p
93 if(iv%ships(n)%u%qc == fails_error_max .or. abs(iv%ships(n)%u%inv) >= max_omb_spd) then
94 iv%ships(n)%u%qc = fails_error_max
95 iv%ships(n)%u%inv = 0.0
97 if(iv%ships(n)%v%qc == fails_error_max .or. abs(iv%ships(n)%v%inv) >= max_omb_dir) then
98 iv%ships(n)%v%qc = fails_error_max
99 iv%ships(n)%v%inv = 0.0
105 if( iv%ships(n)%v%qc >= obs_qc_pointer .or. iv%ships(n)%u%qc >= obs_qc_pointer ) then
106 if(wind_sd_ships)then
107 call da_max_error_qc (it,iv%info(ships), n, iv%ships(n)%u, max_error_spd,failed1)
108 call da_max_error_qc (it,iv%info(ships), n, iv%ships(n)%v, max_error_dir,failed2)
110 call da_max_error_qc (it,iv%info(ships), n, iv%ships(n)%u, max_error_uv,failed1)
111 call da_max_error_qc (it,iv%info(ships), n, iv%ships(n)%v, max_error_uv,failed2)
115 if( iv%info(ships)%proc_domain(1,n) ) then
116 num_qcstat_conv(1,ships,1,1) = num_qcstat_conv(1,ships,1,1) + 1
117 num_qcstat_conv(1,ships,2,1) = num_qcstat_conv(1,ships,2,1) + 1
119 if(failed1 .or. failed2) then
120 num_qcstat_conv(2,ships,1,1) = num_qcstat_conv(2,ships,1,1) + 1
121 if ( write_rej_obs_conv ) then
122 write(qcstat_conv_unit,'(2x,a10,2x,a4,3f12.2)')&
123 'ships',ob_vars(1),iv%info(ships)%lat(1,n),iv%info(ships)%lon(1,n),0.01*ob%ships(n)%p
125 num_qcstat_conv(2,ships,2,1) = num_qcstat_conv(2,ships,2,1) + 1
126 if ( write_rej_obs_conv ) then
127 write(qcstat_conv_unit,'(2x,a10,2x,a4,3f12.2)')&
128 'ships',ob_vars(2),iv%info(ships)%lat(1,n),iv%info(ships)%lon(1,n),0.01*ob%ships(n)%p
133 if(wind_sd_ships)then
134 if(iv%ships(n)%u%qc == fails_error_max .or. iv%ships(n)%v%qc == fails_error_max .or. &
135 abs(iv%ships(n)%v%inv) >= max_omb_dir .or. abs(iv%ships(n)%u%inv) >= max_omb_spd )then
136 iv%ships(n)%u%qc = fails_error_max
137 iv%ships(n)%v%qc = fails_error_max
138 iv%ships(n)%u%inv = 0.0
139 iv%ships(n)%v%inv = 0.0
142 if(iv%ships(n)%u%qc == fails_error_max .or. iv%ships(n)%v%qc == fails_error_max ) then
143 iv%ships(n)%u%qc = fails_error_max
144 iv%ships(n)%v%qc = fails_error_max
145 iv%ships(n)%u%inv = 0.0
146 iv%ships(n)%v%inv = 0.0
152 if( iv%ships(n)%t%qc >= obs_qc_pointer ) then
153 call da_max_error_qc (it, iv%info(ships), n, iv%ships(n)%t, max_error_t , failed)
154 if( iv%info(ships)%proc_domain(1,n) ) then
155 num_qcstat_conv(1,ships,3,1)= num_qcstat_conv(1,ships,3,1) + 1
157 num_qcstat_conv(2,ships,3,1)= num_qcstat_conv(2,ships,3,1) + 1
158 if ( write_rej_obs_conv ) then
159 write(qcstat_conv_unit,'(2x,a10,2x,a4,3f12.2)')&
160 'ships',ob_vars(3),iv%info(ships)%lat(1,n),iv%info(ships)%lon(1,n),0.01*ob%ships(n)%p
167 if( iv%ships(n)%p%qc >= obs_qc_pointer ) then
168 call da_max_error_qc (it, iv%info(ships), n, iv%ships(n)%p, max_error_p , failed)
169 if( iv%info(ships)%proc_domain(1,n) ) then
170 num_qcstat_conv(1,ships,5,1)= num_qcstat_conv(1,ships,5,1) + 1
172 num_qcstat_conv(2,ships,5,1)= num_qcstat_conv(2,ships,5,1) + 1
173 if ( write_rej_obs_conv ) then
174 write(qcstat_conv_unit,'(2x,a10,2x,a4,3f12.2)')&
175 'ships',ob_vars(5),iv%info(ships)%lat(1,n),iv%info(ships)%lon(1,n),0.01*ob%ships(n)%p
182 if( iv%ships(n)%q%qc >= obs_qc_pointer ) then
183 if( iv%ships(n)%t%qc == fails_error_max .or. iv%ships(n)%p%qc == fails_error_max) then
185 iv%ships(n)%q%qc = fails_error_max
186 iv%ships(n)%q%inv = 0.0
188 call da_max_error_qc (it, iv%info(ships), n, iv%ships(n)%q, max_error_q , failed)
190 if( iv%info(ships)%proc_domain(1,n) ) then
191 num_qcstat_conv(1,ships,4,1)= num_qcstat_conv(1,ships,4,1) + 1
193 num_qcstat_conv(2,ships,4,1)= num_qcstat_conv(2,ships,4,1) + 1
194 if ( write_rej_obs_conv ) then
195 write(qcstat_conv_unit,'(2x,a10,2x,a4,3f12.2)')&
196 'ships',ob_vars(4),iv%info(ships)%lat(1,n),iv%info(ships)%lon(1,n),0.01*ob%ships(n)%p
204 if (trace_use_dull) call da_trace_exit("da_check_max_iv_ships")
206 end subroutine da_check_max_iv_ships