da_residual_gpsref.inc
References to this file elsewhere.
1 subroutine da_residual_gpsref(iv, y, re, np_missing, np_bad_data, np_obs_used, np_available)
2
3 !-----------------------------------------------------------------------
4 ! Purpose: Calculate residiual for gpsref obs
5 !-----------------------------------------------------------------------
6
7 implicit none
8
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).
12
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
17
18 type (bad_data_type) :: n_obs_bad
19 integer :: n, k
20
21 if (trace_use_dull) call da_trace_entry("da_residual_gpsref")
22
23 n_obs_bad % gpsref % num = number_type(0, 0, 0)
24
25 do n=1, iv%info(gpsref)%nlocal
26 do k=1, iv%info(gpsref)%levels(n)
27 np_available = np_available + 1
28 re%gpsref(n)%ref(k) = &
29 da_residual(n, k, y%gpsref(n)%ref(k), iv%gpsref(n)%ref(k), n_obs_bad%gpsref)
30 end do
31 end do
32
33 np_missing = np_missing + n_obs_bad % gpsref % num % miss
34 np_bad_data = np_bad_data + n_obs_bad % gpsref % num % bad
35 np_obs_used = np_obs_used + n_obs_bad % gpsref % num % use
36
37 if (trace_use_dull) call da_trace_exit("da_residual_gpsref")
38
39
40 end subroutine da_residual_gpsref
41
42