da_transform_xtotpw.inc

References to this file elsewhere.
1 subroutine da_transform_xtotpw(xa, xb)
2 
3    !---------------------------------------------------------------------
4    ! Purpose: TBD
5    !---------------------------------------------------------------------
6 
7    implicit none
8    
9    type (x_type),  intent(inout) :: xa       ! gridded analysis increment.
10    type (xb_type), intent(in)    :: xb       ! first guess state.
11 
12    integer :: i, j, K
13 
14    real    :: pw
15 
16    ! WEIGHTED SUM OF VERTICAL COLUMN
17    do j=xb%jts, xb%jte
18       do i=xb%its, xb%ite
19          pw = 0.0
20          do k=xb%kts, xb%kte
21             pw = pw + (xb%hf(i,j,k+1)-xb%hf(i,j,k)) &
22                     * (xa%q(i,j,k)*xb%rho(i,j,k) &
23                     +  xb%q(i,j,k)*xa%rho(i,j,k))
24          end do
25  
26          ! To convert the unit of PW to cm:
27          xa%tpw(i,j) = 0.1*pw
28       end do
29    end do
30  
31 end subroutine da_transform_xtotpw
32 
33