da_add_noise_new.inc

References to this file elsewhere.
1 subroutine da_add_noise_new (qc, error, inv, yo, z)
2 
3    !-----------------------------------------------------------------------
4    ! Purpose: TBD
5    !-----------------------------------------------------------------------
6 
7    implicit none
8 
9    integer, intent(in)              :: qc
10    real, intent(in)                 :: error
11    real, intent(inout)              :: inv
12    real, intent(inout)              :: yo      ! Observation.
13    real, intent(out)                :: z       ! Random number.
14 
15    real                             :: noise
16 
17    if (trace_use) call da_trace_entry("da_add_noise_new")
18 
19    z = missing_r
20 
21    if (qc >= obs_qc_pointer) then
22       ! [1] Calculate scaled Gaussian noise:
23 
24       call da_gauss_noise (z)      
25       noise = error * z
26       
27       ! [3] Recalculate corresponding O and O-B:
28       yo = yo + noise
29       inv = inv + noise
30    end if
31 
32    if (trace_use) call da_trace_exit("da_add_noise_new")
33 
34 end subroutine da_add_noise_new
35 
36