anchor.diff:        endif
       endif
     end subroutine
  -  !(20101207) added by teraim
  -  subroutine show_tempsb
  -    use mod_adm, only : ADM_rgn_nmax
  -    implicit none
  -    integer::i,j
  -    !
  -    write(*,*)"show"
  -    do i=1, ADM_rgn_nmax+2
  -      do j=1, max_size
  -        if(tempsb(i)%val(j) > 0) then
  -          write(*,*)"(i,j)=",i,j," : show_list=(",i,tempsb(i)%col(j),tempsb(i)%val(j),")"
  -        endif
  -      enddo
  -    enddo
  -  end subroutine
  +
     !(20101207) added by teraim
     subroutine get_tempsb(icol, irow, ret)
       implicit none
  
positive.code: 
    !-----------------------------------------------------------------------------
    subroutine COMM_var( &
         var,            & !--- INOUT : variables
         var_pl,         & !--- INOUT : variables at poles
         KNUM,           & !--- IN : number of layers
         NNUM            ) !--- IN : number of variables
      use mod_adm, only :     &
           ADM_gall_pl,       &
           ADM_lall_pl,       &
           ADM_prc_me,        &
           ADM_gall,          &
           ADM_gmin,          &
           ADM_gmax,          &
           ADM_lall,          &
           ADM_gall_1d,       &
           ADM_rgnid_npl_mng, &
           ADM_rgnid_spl_mng, &
           ADM_prc_tab,       &
           ADM_prc_npl,       &
           ADM_prc_spl,       &
           ADM_GSLF_PL,       &
           ADM_NPL,           &
           ADM_SPL,           &
           ADM_COMM_WORLD,&
           ADM_rgn2prc
      !
      implicit none
  
      integer, intent(in) :: KNUM
      integer, intent(in) :: NNUM
      real(8), intent(inout) :: var(ADM_gall,KNUM,ADM_lall,NNUM)
      real(8), intent(inout) :: var_pl(ADM_gall_pl,KNUM,ADM_lall_pl,NNUM)
  
      integer :: ireq(4),istat(MPI_STATUS_SIZE),ierr
      integer :: l
      !
      real(8) :: v_npl(KNUM,NNUM)
      real(8) :: v_spl(KNUM,NNUM)
  !!! FIX 20111024:s
      real(8) :: v_npl_recv(KNUM,NNUM)
      real(8) :: v_spl_recv(KNUM,NNUM)
  !!! FIX 20111024:e
      !
      integer :: rgnid
      !
      integer :: i,j,suf
      suf(i,j) = ADM_gall_1d * ((j)-1) + (i)
      !---------------------------------------------------------------------------
  
negative.code:                        ierr                  )
      enddo
  
      !$acc wait
  
      !---------------------------------------------------
      !  var -> var (region to region copy in same rank)
      !---------------------------------------------------
      !$acc kernels present(var) &
      !$acc& pcopyin(recvlist_r2r,sendlist_r2r,copyinfo_r2r) async(0)
      !$acc loop independent gang
      do m = 1, varmax
      !$acc loop independent gang
      do nc = 1, cur_ncmax_r2r
      !$acc loop independent gang vector(8)
      do k = 1, kmax
      !$acc loop independent vector(32)
      do n = 1, max_cs_r2r
         cs  = copyinfo_r2r(SIZE_COPY      ,nc,1)
         cl  = copyinfo_r2r(LRGNID_COPY    ,nc,1)
         scl = copyinfo_r2r(SRC_LRGNID_COPY,nc,1)
         if ( n <= cs ) then
            var(recvlist_r2r(n,nc,1),k,cl ,m) = var(sendlist_r2r(n,nc,1),k,scl,m)
         endif
      enddo
      enddo
      enddo
      enddo
      !$acc end kernels
  
      !------------------------------------------
      !  var -> var_pl ( data copy in same rank)
      !------------------------------------------
      !$acc kernels present(var,var_pl) &
      !$acc& pcopyin(recvlist_r2p,sendlist_r2p,copyinfo_r2p) async(0)
      !$acc loop independent gang
      do m = 1, varmax
      !$acc loop independent gang
      do nc = 1, cur_ncmax_r2p
      !$acc loop independent gang vector(8)
      do k = 1, kmax
      !$acc loop independent vector(32)
      do n = 1, max_cs_r2p
         cs  = copyinfo_r2p(SIZE_COPY      ,nc,1)
         cl  = copyinfo_r2p(LRGNID_COPY    ,nc,1)
         scl = copyinfo_r2p(SRC_LRGNID_COPY,nc,1)
         if ( n <= cs ) then
            var_pl(recvlist_r2p(n,nc,1),k,cl,m) = var(sendlist_r2p(n,nc,1),k,scl,m)
         endif
      enddo
      enddo
      enddo
      enddo
      !$acc end kernels
  
      !-----------------------------------------
      !  var_pl -> var (data copy in same rank)
      !-----------------------------------------
      !$acc kernels present(var,var_pl) &
      !$acc& pcopyin(recvlist_p2r,sendlist_p2r,copyinfo_p2r) async(0)
      !$acc loop independent gang
      do m = 1, varmax
      !$acc loop independent gang
      do nc = 1, cur_ncmax_p2r
      !$acc loop independent gang vector(8)
      do k = 1, kmax
      !$acc loop independent vector(32)
      do n = 1, max_cs_p2r
         cs  = copyinfo_p2r(SIZE_COPY      ,nc,1)
         cl  = copyinfo_p2r(LRGNID_COPY    ,nc,1)
         scl = copyinfo_p2r(SRC_LRGNID_COPY,nc,1)
         if ( n <= cs ) then
            var(recvlist_p2r(n,nc,1),k,cl,m) = var_pl(sendlist_p2r(n,nc,1),k,scl,m)
         endif
      enddo
      enddo
      enddo
      enddo
      !$acc end kernels
  
      acount = romax(1) + somax(1)
  
  