1 subroutine da_random_omb(std_dev, yo, qc_flag, omb)
3 !-----------------------------------------------------------------------
5 !-----------------------------------------------------------------------
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.
14 real :: xb ! Background value.
15 real :: z ! Gaussian noise.
17 if (trace_use) call da_trace_entry("da_random_omb")
19 if (qc_flag >= obs_qc_pointer) then
20 ! [1] Calculate background value from old O, O-B:
23 ! [2] Calculate new O-B as scaled Gaussian noise:
25 call da_gauss_noise(z)
26 omb = set_omb_rand_fac * std_dev * z
28 ! [3] Recalculate corresponding observation:
32 if (trace_use) call da_trace_exit("da_random_omb")
34 end subroutine da_random_omb