da_random_omb.inc

References to this file elsewhere.
1 subroutine da_random_omb(std_dev, yo, qc_flag, omb)
2 
3    !-----------------------------------------------------------------------
4    ! Purpose: TBD
5    !-----------------------------------------------------------------------
6 
7    implicit none
8    
9    real, intent(in)     :: std_dev      ! Standard deviation scaling.
10    real, intent(inout)  :: yo           ! Observatopn.
11    integer, intent(in)  :: qc_flag      ! Ob QC flag.
12    real, intent(inout)  :: omb          ! O-B.
13 
14    real                 :: xb           ! Background value.
15    real                 :: z            ! Gaussian noise.
16 
17    if (qc_flag >= obs_qc_pointer) then
18 
19       ! [1] Calculate background value from old O, O-B:
20       xb = yo - omb
21    
22       ! [2] Calculate new O-B as scaled Gaussian noise:
23 
24       call da_gauss_noise(z)   
25       omb = set_omb_rand_fac * std_dev * z
26 
27       ! [3] Recalculate corresponding observation:
28       yo = xb + omb
29 
30    end if
31 
32 end subroutine da_random_omb
33 
34