1 subroutine da_get_innov_vector_rain( it, num_qcstat_conv, grid, ob, iv, hr_rainc, hr_rainnc)
2 !-----------------------------------------------------------------------
4 !-----------------------------------------------------------------------
8 integer, intent(in) :: it ! External iteration.
9 type(domain), intent(in) :: grid ! first guess state.
10 type(y_type), intent(inout) :: ob ! Observation structure.
11 type(iv_type), intent(inout) :: iv ! O-B structure.
12 integer, intent(inout) :: num_qcstat_conv(:,:,:,:)
13 real, dimension(ims:ime,jms:jme), intent(inout) :: hr_rainc, hr_rainnc
15 integer :: n ! Loop counter.
17 real, allocatable :: model_rainc(:)
18 real, allocatable :: model_rainnc(:)
20 if (trace_use) call da_trace_entry("da_get_innov_vector_rain")
23 do n=iv%info(rain)%n1,iv%info(rain)%n2
24 if (iv%rain(n)%rain%qc == fails_error_max) iv%rain(n)%rain%qc = 0
28 ! [0.0] Get hourly rainfall
30 allocate (model_rainc(iv%info(rain)%n1:iv%info(rain)%n2))
31 allocate (model_rainnc(iv%info(rain)%n1:iv%info(rain)%n2))
35 ! [1.0] horizontal interpolation:
37 call da_interp_lin_2d (hr_rainc, iv%info(rain), 1, model_rainc)
38 call da_interp_lin_2d (hr_rainnc, iv%info(rain), 1, model_rainnc)
40 do n=iv%info(rain)%n1,iv%info(rain)%n2
42 ! [2.0] Initialise components of innovation vector:
44 iv % rain(n) % rain % inv = 0.0
46 ! [3.0] To compute the 'inv':
48 if (ob % rain(n) % rain > missing_r .and. iv % rain(n) % rain % qc >= obs_qc_pointer) then
49 iv % rain(n) % rain % inv = ob % rain(n) % rain - model_rainc(n) - model_rainnc(n)
51 iv % rain(n) % rain % inv = 0.0
56 deallocate(model_rainc)
57 deallocate(model_rainnc)
59 ! -----------------------------------------------------------------------
60 ! [4.0] Perform optional maximum error check:
61 !-----------------------------------------------------------------------
64 call da_check_max_iv_rain(iv,ob, it, num_qcstat_conv)
66 if (trace_use) call da_trace_exit("da_get_innov_vector_rain")
68 end subroutine da_get_innov_vector_rain