1 subroutine da_residual_airsr(iv, y, re, np_missing, np_bad_data, np_obs_used, np_available)
3 !----------------------------------------------------------------------
4 ! Purpose: Calculates residual at AIRS retrieval locations
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 vector (O-A).
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_airsr")
23 n_obs_bad % t % num = number_type(0, 0, 0)
24 n_obs_bad % q % num = number_type(0, 0, 0)
26 do n=1, iv%info(airsr)%nlocal
27 do k=1, iv%info(airsr)%levels(n)
28 np_available = np_available + 4
29 re%airsr(n)%t(k) = da_residual(n, k, y%airsr(n)%t(k), iv%airsr(n)%t(k), n_obs_bad % t)
30 re%airsr(n)%q(k) = da_residual(n, k, y%airsr(n)%q(k), iv%airsr(n)%q(k), n_obs_bad % q)
34 np_missing = np_missing + n_obs_bad % t % num % miss + n_obs_bad % q % num % miss
35 np_bad_data = np_bad_data + n_obs_bad % t % num % bad + n_obs_bad % q % num % bad
36 np_obs_used = np_obs_used + n_obs_bad % t % num % use + n_obs_bad % q % num % use
38 if (trace_use_dull) call da_trace_exit("da_residual_airsr")
40 end subroutine da_residual_airsr