1 subroutine da_fill_obs_structures_lightning(iv, ob)
3 !----------------------------------------------------------------------------
4 ! Purpose: Allocates observation structure and fills it from iv.
5 ! Authors: Z Chen (zchen@fjnu.edu.cn), Jenny Sun (NCAR), X Qie (IAP)
6 !----------------------------------------------------------------------------
10 type (iv_type), intent(inout) :: iv ! Obs and header structure.
11 type (y_type), intent(out) :: ob ! (Smaller) observation structure.
13 integer :: n, k ! Loop counters.
16 if (trace_use) call da_trace_entry("da_fill_obs_structures_lightning")
18 !---------------------------------------------------------------------------
19 ! Initialise obs error factors (which will be overwritten in use_obs_errfac)
20 !---------------------------------------------------------------------------
22 iv % lightning_ef_w = 1.0
23 iv % lightning_ef_div = 1.0
24 iv % lightning_ef_qv = 1.0
25 !----------------------------------------------------------------------
26 ! [1.0] Allocate innovation vector and observation structures:
27 !----------------------------------------------------------------------
28 call da_allocate_y_lightning(iv, ob)
30 !----------------------------------------------------------------------
31 ! [2.0] Transfer observations:
32 !----------------------------------------------------------------------
34 ! [2.20] Transfer lightning obs:
36 if (iv%info(lightning)%nlocal > 0) then
37 do n = 1, iv%info(lightning)%nlocal
38 do k = 1, iv%info(lightning)%levels(n)
39 ob%lightning(n)%w(k) = iv%lightning(n)%w(k)%inv
40 ob%lightning(n)%div(k) = iv%lightning(n)%div(k)%inv
41 ob%lightning(n)%qv(k) = iv%lightning(n)%qv(k)%inv
46 if (trace_use) call da_trace_exit("da_fill_obs_structures_lightning")
48 end subroutine da_fill_obs_structures_lightning