42     &                        LBi, UBi, LBj, UBj,                       &
 
   55      integer, 
intent(in) :: ng, tile
 
   56      integer, 
intent(in) :: LBi, UBi, LBj, UBj
 
   59      real(r8), 
intent(inout) :: A(LBi:,LBj:)
 
   61      real(r8), 
intent(inout) :: A(LBi:UBi,LBj:UBj)
 
   68#include "set_bounds.h" 
   75        IF (
domain(ng)%Eastern_Edge(tile)) 
THEN 
   83        IF (
domain(ng)%Western_Edge(tile)) 
THEN 
   97        IF (
domain(ng)%Northern_Edge(tile)) 
THEN 
  100              a(i,jend+1)=a(i,jend)
 
  105        IF (
domain(ng)%Southern_Edge(tile)) 
THEN 
  108              a(i,jstr-1)=a(i,jstr)
 
  119        IF (
domain(ng)%SouthWest_Corner(tile)) 
THEN 
  122            a(istr-1,jstr-1)=0.5_r8*(a(istr  ,jstr-1)+                  &
 
  126        IF (
domain(ng)%SouthEast_Corner(tile)) 
THEN 
  129            a(iend+1,jstr-1)=0.5_r8*(a(iend  ,jstr-1)+                  &
 
  133        IF (
domain(ng)%NorthWest_Corner(tile)) 
THEN 
  136            a(istr-1,jend+1)=0.5_r8*(a(istr-1,jend  )+                  &
 
  140        IF (
domain(ng)%NorthEast_Corner(tile)) 
THEN 
  143            a(iend+1,jend+1)=0.5_r8*(a(iend+1,jend  )+                  &
 
  155     &                          lbi, ubi, lbj, ubj,                     &
 
 
  165     &                        LBi, UBi, LBj, UBj,                       &
 
  179      integer, 
intent(in) :: ng, tile
 
  180      integer, 
intent(in) :: LBi, UBi, LBj, UBj
 
  183      real(r8), 
intent(inout) :: A(LBi:,LBj:)
 
  185      real(r8), 
intent(inout) :: A(LBi:UBi,LBj:UBj)
 
  190      integer :: Imin, Imax
 
  193#include "set_bounds.h" 
  200        IF (
domain(ng)%Eastern_Edge(tile)) 
THEN 
  210                a(iend+1,j)=a(iend,j)
 
  216        IF (
domain(ng)%Western_Edge(tile)) 
THEN 
  226                a(istr,j)=a(istr+1,j)
 
  239        IF (
domain(ng)%Northern_Edge(tile)) 
THEN 
  250                a(i,jend+1)=
gamma2(ng)*a(i,jend)
 
  252                a(i,jend+1)=a(i,jend+1)*
grid(ng)%umask(i,jend+1)
 
  259                a(i,jend+1)=a(i,jend)
 
  265        IF (
domain(ng)%Southern_Edge(tile)) 
THEN 
  276                a(i,jstr-1)=
gamma2(ng)*a(i,jstr)
 
  278                a(i,jstr-1)=a(i,jstr-1)*
grid(ng)%umask(i,jstr-1)
 
  285                a(i,jstr-1)=a(i,jstr)
 
  297        IF (
domain(ng)%SouthWest_Corner(tile)) 
THEN 
  300            a(istr  ,jstr-1)=0.5_r8*(a(istr+1,jstr-1)+                  &
 
  304        IF (
domain(ng)%SouthEast_Corner(tile)) 
THEN 
  307            a(iend+1,jstr-1)=0.5_r8*(a(iend  ,jstr-1)+                  &
 
  311        IF (
domain(ng)%NorthWest_Corner(tile)) 
THEN 
  314            a(istr  ,jend+1)=0.5_r8*(a(istr  ,jend  )+                  &
 
  318        IF (
domain(ng)%NorthEast_Corner(tile)) 
THEN 
  321            a(iend+1,jend+1)=0.5_r8*(a(iend+1,jend  )+                  &
 
  333     &                          lbi, ubi, lbj, ubj,                     &
 
 
  343     &                        LBi, UBi, LBj, UBj,                       &
 
  357      integer, 
intent(in) :: ng, tile
 
  358      integer, 
intent(in) :: LBi, UBi, LBj, UBj
 
  361      real(r8), 
intent(inout) :: A(LBi:,LBj:)
 
  363      real(r8), 
intent(inout) :: A(LBi:UBi,LBj:UBj)
 
  368      integer :: Jmin, Jmax
 
  371#include "set_bounds.h" 
  379        IF (
domain(ng)%Eastern_Edge(tile)) 
THEN 
  390                a(iend+1,j)=
gamma2(ng)*a(iend,j)
 
  392                a(iend+1,j)=a(iend+1,j)*
grid(ng)%vmask(iend+1,j)
 
  399                a(iend+1,j)=a(iend,j)
 
  405        IF (
domain(ng)%Western_Edge(tile)) 
THEN 
  416                a(istr-1,j)=
gamma2(ng)*a(istr,j)
 
  418                a(istr-1,j)=a(istr-1,j)*
grid(ng)%vmask(istr-1,j)
 
  425                a(istr-1,j)=a(istr,j)
 
  437        IF (
domain(ng)%Northern_Edge(tile)) 
THEN 
  447                a(i,jend+1)=a(i,jend)
 
  453        IF (
domain(ng)%Southern_Edge(tile)) 
THEN 
  463                a(i,jstr)=a(i,jstr+1)
 
  475        IF (
domain(ng)%SouthWest_Corner(tile)) 
THEN 
  478            a(istr-1,jstr  )=0.5_r8*(a(istr  ,jstr  )+                  &
 
  482        IF (
domain(ng)%SouthEast_Corner(tile)) 
THEN 
  485            a(iend+1,jstr  )=0.5_r8*(a(iend  ,jstr  )+                  &
 
  489        IF (
domain(ng)%NorthWest_Corner(tile)) 
THEN 
  492            a(istr-1,jend+1)=0.5_r8*(a(istr-1,jend  )+                  &
 
  496        IF (
domain(ng)%NorthEast_Corner(tile)) 
THEN 
  499            a(iend+1,jend+1)=0.5_r8*(a(iend+1,jend  )+                  &
 
  511     &                          lbi, ubi, lbj, ubj,                     &
 
 
  521     &                          LBi, UBi, LBj, UBj,                     &
 
  534      integer, 
intent(in) :: ng, tile
 
  535      integer, 
intent(in) :: LBi, UBi, LBj, UBj
 
  538      real(r8), 
intent(inout) :: A(LBi:,LBj:)
 
  540      real(r8), 
intent(inout) :: A(LBi:UBi,LBj:UBj)
 
  547#include "set_bounds.h" 
  554        IF (
domain(ng)%Eastern_Edge(tile)) 
THEN 
  557              a(iend+1,j)=a(iend,j)
 
  562        IF (
domain(ng)%Western_Edge(tile)) 
THEN 
  565              a(istr-1,j)=a(istr,j)
 
  576        IF (
domain(ng)%Northern_Edge(tile)) 
THEN 
  579              a(i,jend+1)=a(i,jend)
 
  584        IF (
domain(ng)%Southern_Edge(tile)) 
THEN 
  587              a(i,jstr-1)=a(i,jstr)
 
  598        IF (
domain(ng)%SouthWest_Corner(tile)) 
THEN 
  601            a(istr-1,jstr-1)=0.5_r8*(a(istr  ,jstr-1)+                  &
 
  605        IF (
domain(ng)%SouthEast_Corner(tile)) 
THEN 
  608            a(iend+1,jstr-1)=0.5_r8*(a(iend  ,jstr-1)+                  &
 
  612        IF (
domain(ng)%NorthWest_Corner(tile)) 
THEN 
  615            a(istr-1,jend+1)=0.5_r8*(a(istr-1,jend  )+                  &
 
  619        IF (
domain(ng)%NorthEast_Corner(tile)) 
THEN 
  622            a(iend+1,jend+1)=0.5_r8*(a(iend+1,jend  )+                  &
 
  634     &                          lbi, ubi, lbj, ubj,                     &
 
 
  644     &                          LBi, UBi, LBj, UBj,                     &
 
  658      integer, 
intent(in) :: ng, tile
 
  659      integer, 
intent(in) :: LBi, UBi, LBj, UBj
 
  662      real(r8), 
intent(inout) :: A(LBi:,LBj:)
 
  664      real(r8), 
intent(inout) :: A(LBi:UBi,LBj:UBj)
 
  669      integer :: Imin, Imax
 
  672#include "set_bounds.h" 
  679        IF (
domain(ng)%Eastern_Edge(tile)) 
THEN 
  682              a(iend+1,j)=a(iend,j)
 
  687        IF (
domain(ng)%Western_Edge(tile)) 
THEN 
  690              a(istr,j)=a(istr+1,j)
 
  701        IF (
domain(ng)%Northern_Edge(tile)) 
THEN 
  704              a(i,jend+1)=a(i,jend)
 
  709        IF (
domain(ng)%Southern_Edge(tile)) 
THEN 
  712              a(i,jstr-1)=a(i,jstr)
 
  723        IF (
domain(ng)%SouthWest_Corner(tile)) 
THEN 
  726            a(istr  ,jstr-1)=0.5_r8*(a(istr+1,jstr-1)+                  &
 
  730        IF (
domain(ng)%SouthEast_Corner(tile)) 
THEN 
  733            a(iend+1,jstr-1)=0.5_r8*(a(iend  ,jstr-1)+                  &
 
  737        IF (
domain(ng)%NorthWest_Corner(tile)) 
THEN 
  740            a(istr  ,jend+1)=0.5_r8*(a(istr  ,jend  )+                  &
 
  744        IF (
domain(ng)%NorthEast_Corner(tile)) 
THEN 
  747            a(iend+1,jend+1)=0.5_r8*(a(iend+1,jend  )+                  &
 
  759     &                          lbi, ubi, lbj, ubj,                     &
 
 
  769     &                          LBi, UBi, LBj, UBj,                     &
 
  783      integer, 
intent(in) :: ng, tile
 
  784      integer, 
intent(in) :: LBi, UBi, LBj, UBj
 
  787      real(r8), 
intent(inout) :: A(LBi:,LBj:)
 
  789      real(r8), 
intent(inout) :: A(LBi:UBi,LBj:UBj)
 
  794      integer :: Jmin, Jmax
 
  797#include "set_bounds.h" 
  804        IF (
domain(ng)%Eastern_Edge(tile)) 
THEN 
  807              a(iend+1,j)=a(iend,j)
 
  812        IF (
domain(ng)%Western_Edge(tile)) 
THEN 
  815              a(istr-1,j)=a(istr,j)
 
  826        IF (
domain(ng)%Northern_Edge(tile)) 
THEN 
  829              a(i,jend+1)=a(i,jend)
 
  834        IF (
domain(ng)%Southern_Edge(tile)) 
THEN 
  837              a(i,jstr)=a(i,jstr+1)
 
  848        IF (
domain(ng)%SouthWest_Corner(tile)) 
THEN 
  851            a(istr-1,jstr  )=0.5_r8*(a(istr  ,jstr  )+                  &
 
  855        IF (
domain(ng)%SouthEast_Corner(tile)) 
THEN 
  858            a(iend+1,jstr  )=0.5_r8*(a(iend  ,jstr  )+                  &
 
  862        IF (
domain(ng)%NorthWest_Corner(tile)) 
THEN 
  865            a(istr-1,jend+1)=0.5_r8*(a(istr-1,jend  )+                  &
 
  869        IF (
domain(ng)%NorthEast_Corner(tile)) 
THEN 
  872            a(iend+1,jend+1)=0.5_r8*(a(iend+1,jend  )+                  &
 
  884     &                          lbi, ubi, lbj, ubj,                     &
 
 
subroutine bc_r2d_tile(ng, tile, lbi, ubi, lbj, ubj, a)
 
subroutine bc_v2d_tile(ng, tile, lbi, ubi, lbj, ubj, a)
 
subroutine dabc_v2d_tile(ng, tile, lbi, ubi, lbj, ubj, a)
 
subroutine dabc_u2d_tile(ng, tile, lbi, ubi, lbj, ubj, a)
 
subroutine dabc_r2d_tile(ng, tile, lbi, ubi, lbj, ubj, a)
 
subroutine bc_u2d_tile(ng, tile, lbi, ubi, lbj, ubj, a)
 
subroutine exchange_r2d_tile(ng, tile, lbi, ubi, lbj, ubj, a)
 
subroutine exchange_u2d_tile(ng, tile, lbi, ubi, lbj, ubj, a)
 
subroutine exchange_v2d_tile(ng, tile, lbi, ubi, lbj, ubj, a)
 
type(t_apply), dimension(:), allocatable lbc_apply
 
type(t_grid), dimension(:), allocatable grid
 
type(t_lbc), dimension(:,:,:), allocatable lbc
 
type(t_domain), dimension(:), allocatable domain
 
logical, dimension(:), allocatable ewperiodic
 
logical, dimension(:), allocatable nsperiodic
 
real(r8), dimension(:), allocatable gamma2
 
integer, parameter isouth
 
integer, parameter inorth