1 subroutine da_add_noise (fld, yo, z)
3 !-----------------------------------------------------------------------
5 !-----------------------------------------------------------------------
9 type (field_type), intent(inout) :: fld ! O-B sub-type.
10 real, intent(inout) :: yo ! Observation.
11 real, intent(out) :: z ! Random number.
15 if (trace_use) call da_trace_entry("da_add_noise")
19 if (fld % qc >= obs_qc_pointer) then
20 ! [1] Calculate scaled Gaussian noise:
22 call da_gauss_noise (z)
23 noise = fld % error * z
25 ! [3] Recalculate corresponding O and O-B:
27 fld % inv = fld % inv + noise
30 if (trace_use) call da_trace_exit("da_add_noise")
32 end subroutine da_add_noise