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 (trace_use) call da_trace_entry("da_random_omb")
18 
19    if (qc_flag >= obs_qc_pointer) then
20       ! [1] Calculate background value from old O, O-B:
21       xb = yo - omb
22    
23       ! [2] Calculate new O-B as scaled Gaussian noise:
24 
25       call da_gauss_noise(z)   
26       omb = set_omb_rand_fac * std_dev * z
27 
28       ! [3] Recalculate corresponding observation:
29       yo = xb + omb
30    end if
31 
32    if (trace_use) call da_trace_exit("da_random_omb")
33 
34 end subroutine da_random_omb
35 
36