1 subroutine da_residual_ssmt2(iv, y, re, np_missing, np_bad_data, np_obs_used, np_available)
3 !-----------------------------------------------------------------------
5 !-----------------------------------------------------------------------
9 type (iv_type), intent(in) :: iv ! Innovation vector (O-B).
10 type (y_type) , intent(in) :: y ! y = H (xa)
11 type (y_type) , intent(inout) :: re ! Residual structure.
13 integer , intent(inout) :: np_available
14 integer , intent(inout) :: np_obs_used
15 integer , intent(inout) :: np_missing
16 integer , intent(inout) :: np_bad_data
18 type (bad_data_type) :: n_obs_bad
21 if (trace_use_dull) call da_trace_entry("da_residual_ssmt2")
23 n_obs_bad % rh % num = number_type(0, 0, 0)
25 do n=1, iv%info(ssmt2)%nlocal
26 do k=1, iv%info(ssmt2)%levels(n)
27 np_available = np_available + 1
28 re%ssmt2(n)%rh(k) = da_residual(n, k, y%ssmt2(n)%rh(k), iv%ssmt2(n)%rh(k), n_obs_bad % rh)
32 np_missing = np_missing + n_obs_bad % rh % num % miss
33 np_bad_data = np_bad_data + n_obs_bad % rh % num % bad
34 np_obs_used = np_obs_used + n_obs_bad % rh % num % use
36 if (trace_use_dull) call da_trace_exit("da_residual_ssmt2")
38 end subroutine da_residual_ssmt2