da_transform_xtotpw_adj.inc

References to this file elsewhere.
1 subroutine da_transform_xtotpw_adj(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, is, js, ie, je
13 
14    real    :: pw, dzpw
15 
16    if (trace_use) call da_trace_entry("da_transform_xtotpw_adj")
17 
18    is = xb%its
19    js = xb%jts
20 
21    ie = xb%ite
22    je = xb%jte
23 
24    if (Testing_WRFVAR) then
25       is = xb%its-1
26       js = xb%jts-1
27 
28       ie = xb%ite+1
29       je = xb%jte+1
30 
31       if (is < xb%ids) is = xb%ids
32       if (js < xb%jds) js = xb%jds
33 
34       if (ie > xb%ide) ie = xb%ide
35       if (je > xb%jde) je = xb%jde
36    end if
37 
38    do j=js, je
39       do i=is, ie
40          pw = 0.1*xa%tpw(i,j)
41 
42          do k=xb%kts, xb%kte
43             dzpw = (xb%hf(i,j,k+1)-xb%hf(i,j,k))*pw
44 
45             xa%  q(i,j,k)=xa%  q(i,j,k)+dzpw*xb%rho(i,j,k)
46             xa%rho(i,j,k)=xa%rho(i,j,k)+dzpw*xb%  q(i,j,k)
47          end do
48       end do
49    end do
50 
51    if (trace_use) call da_trace_exit("da_transform_xtotpw_adj")
52  
53 end subroutine da_transform_xtotpw_adj
54 
55