updated top-level README and version_decl for V4.5 (#1847)
[WRF.git] / var / da / da_tools / da_set_boundary_xa.inc
blob2f8d83c7f920f577b2987058bbe9583a94904722
1 subroutine da_set_boundary_xa(grid)
3    !------------------------------------------------------------------------
4    !  Purpose: 
5    !
6    !  Merge East-West boundary values for the desired grid%xa-type variables
7    !------------------------------------------------------------------------
9    implicit none
11    type (domain),  intent(inout) :: grid
13    integer :: n, j, k
15    if ((its /= ids) .or. (ite /= ide)) return
17    if (trace_use) call da_trace_entry("da_set_boundary_xa")
19    ! 2d
21    k = kte + 1
22    do j=jms, jme
23       do n=1,bdyzone
24          grid%xa%psfc(ids-n,j) = grid%xa%psfc(ide+1-n,j)
25          grid%xa%w(ids-n,j,k) = grid%xa%w(ide+1-n,j,k)
27          grid%xa%psfc(ide+n,j) = grid%xa%psfc(ids-1+n,j)
28          grid%xa%w(ide+n,j,k) = grid%xa%w(ids-1+n,j,k)
29       end do
30    end do
32    ! 3d
34    do k=kts, kte
35       do j=jms, jme
36          do n=1,bdyzone
37             grid%xa%u(ids-n,j,k) = grid%xa%u(ide+1-n,j,k)
38             grid%xa%v(ids-n,j,k) = grid%xa%v(ide+1-n,j,k)
39             grid%xa%t(ids-n,j,k) = grid%xa%t(ide+1-n,j,k)
40             grid%xa%p(ids-n,j,k) = grid%xa%p(ide+1-n,j,k)
41             grid%xa%q(ids-n,j,k) = grid%xa%q(ide+1-n,j,k)
42             grid%xa%w(ids-n,j,k) = grid%xa%w(ide+1-n,j,k)
44             grid%xa%u(ide+n,j,k) = grid%xa%u(ids-1+n,j,k)
45             grid%xa%v(ide+n,j,k) = grid%xa%v(ids-1+n,j,k)
46             grid%xa%t(ide+n,j,k) = grid%xa%t(ids-1+n,j,k)
47             grid%xa%p(ide+n,j,k) = grid%xa%p(ids-1+n,j,k)
48             grid%xa%q(ide+n,j,k) = grid%xa%q(ids-1+n,j,k)
49             grid%xa%w(ide+n,j,k) = grid%xa%w(ids-1+n,j,k)
50          end do
51       end do
52    end do
54    if (trace_use) call da_trace_exit("da_set_boundary_xa")
56 end subroutine da_set_boundary_xa