Merge remote-tracking branch 'origin/release-v4.5.2'
[WRF.git] / var / da / da_ssmi / da_transform_xtozrhoq_lin.inc
blob7f511ce5568a1e95d74ea330fda7d8a3046d839f
1 subroutine da_transform_xtozrhoq_lin(xb, xa, i, j, zh, zf, tgl_zrhom)
3    !-----------------------------------------------------------------------
4    ! Purpose: TBD
5    !-----------------------------------------------------------------------
7    implicit none
8    
9    integer,        intent(in)      :: i, j
10    type (xb_type), intent(in)      :: xb         ! first guess state.
11    type (x_type) , intent(in)      :: xa         ! increment
12    real,           intent(out)     :: TGL_zrhom  ! gridded height weighted moisture
13    real,           intent(in)      :: zh(mkz)
14    real,           intent(in)      :: zf(mkz+1)
16    integer                         :: k
18    if (trace_use) call da_trace_entry("da_transform_xtozrhoq_lin")
20    TGL_zrhom = 0.0
22    do k = 1,mkz
23       TGL_zrhom = (zf(k)-zf(k+1))*zh(k)*(xb%q(i,j,k)*xa%rho(i,j,k) + &
24                                          xa%q(i,j,k)*xb%rho(i,j,k)   &
25                                        ) + TGL_zrhom
26    end do
28    if (trace_use) call da_trace_exit("da_transform_xtozrhoq_lin")
30 end subroutine da_transform_xtozrhoq_lin