1 subroutine da_transform_xtoy_lightning_adj(grid, iv, jo_grad_y, jo_grad_x)
3 !-----------------------------------------------------------------------
5 ! Authors: Z Chen (zchen@fjnu.edu.cn), Jenny Sun (NCAR), X Qie (IAP)
6 !-----------------------------------------------------------------------
10 type (domain), intent(in) :: grid
11 type (iv_type), intent(in) :: iv ! obs. inc vector (o-b).
12 type (y_type) , intent(inout) :: jo_grad_y ! grad_y(jo)
13 type (x_type) , intent(inout) :: jo_grad_x ! grad_x(jo)
15 integer :: n, k ! Loop counter.
16 integer :: num_levs ! obs vertical levels
18 integer :: i, j ! Index dimension.
22 real :: div(kts:kte) !Model divergence at ob loc
23 real :: ave_div(kts:kte) !Model averaged divergence at ob loc
24 real :: model_q(kts:kte) !Model RH at ob loc
25 real :: model_t(kts:kte) !Model T at ob loc
27 real :: ADJ_div(kts:kte)
29 if (trace_use_dull) call da_trace_entry("da_transform_xtoy_lightning_adj")
31 do n = iv%info(lightning)%n1, iv%info(lightning)%n2
32 num_levs = iv%info(lightning)%levels(n)
34 ! [1.0] Get horizontal interpolation weights:
36 i = iv%info(lightning)%i(1,n)
37 dy = iv%info(lightning)%dy(1,n)
38 dym = iv%info(lightning)%dym(1,n)
39 j = iv%info(lightning)%j(1,n)
40 dx = iv%info(lightning)%dx(1,n)
41 dxm = iv%info(lightning)%dxm(1,n)
46 if(use_lightning_w) then
47 if(iv % lightning(n)%w(k)%qc /= missing_data) then
48 jo_grad_x%w(i,j,k) = jo_grad_x%w(i,j,k) + jo_grad_y%lightning(n)%w(k)
52 if(use_lightning_div) then
53 if(iv % lightning(n)%div(k)%qc /= missing_data) then
54 call da_div_profile_adj(grid, jo_grad_x, iv%info(lightning), n, k, jo_grad_y%lightning(n)%div(k))
58 if(use_lightning_qv) then
59 if(iv % lightning(n)%qv(k)%qc /= missing_data) then
60 jo_grad_x%q(i,j,k) = jo_grad_x%q(i,j,k) + jo_grad_y%lightning(n)%qv(k)
61 jo_grad_x%t(i,j,k) = jo_grad_x%t(i,j,k) + (17.67*243.5/(grid%xb%t(i,j,k)+243.5)**2.0)*grid%xb%q(i,j,k)*jo_grad_y%lightning(n)%qv(k)
69 if (trace_use_dull) call da_trace_exit("da_transform_xtoy_lightning_adj")
71 end subroutine da_transform_xtoy_lightning_adj