da_residual.inc

References to this file elsewhere.
1 function da_residual(n, k, yy, ox, n_bad) result (rr)
2 
3    !-----------------------------------------------------------------------
4    ! Purpose: TBD
5    !-----------------------------------------------------------------------
6 
7    implicit none
8 
9    integer,              intent(in)    :: n, k
10    type (field_type),    intent(in)    :: ox
11    real,                 intent(in)    :: yy
12    type (bad_info_type), intent(inout) :: n_bad
13 
14    real :: rr
15 
16    if (trace_use_frequent) call da_trace_entry("da_residual")
17 
18    ! WHY?
19    if (k ==0 .OR. n==0) then
20    end if
21 
22    rr = 0.0
23 
24    if (ox % qc >= obs_qc_pointer) then
25       ! WHY?
26       ! n_bad % num % use = n_bad % num % use + 1
27       rr = ox % inv - yy
28       ! else
29       !    if (ox % qc /= -88) then
30       !       n_bad % num % bad = n_bad % num % bad + 1
31       !       n_bad % nn(n_bad % num % bad) = n
32       !       n_bad % kk(n_bad % num % bad) = k
33       !     else
34       !       n_bad % num % miss = n_bad % num % miss + 1
35       !    end if
36    end if
37 
38    if (trace_use_frequent) call da_trace_exit("da_residual")
39 
40 end function da_residual
41 
42