anchor.diff:    ! send tensor data in elements
     allocate(buffDataTens(nkEle,3,3))
     do i=1,ntransEleTens
  -    buffDataTens(:,:,:)=transEleTens(i)%ptr(smapEle,:,:)
  +    buffDataTens(:,:,:)=transEleTens(i)%ptr(mapEle,:,:)
       do j=1,3
         do l=1,3
           call MPI_send(buffDataTens(:,j,l),nkEle,MPI_double_precision,p,p,MPI_comm_world,errMPI)
  
positive.code:   ! send scaler data in elements
    allocate(buffDataScal(nkEle))
    do i=1,ntransEleScal
      buffDataScal(:)=transEleScal(i)%ptr(smapEle)
      call MPI_send(buffDataScal,nkEle,MPI_double_precision,p,p,MPI_comm_world,errMPI)
    end do
    deallocate(buffDataScal)
    ! send vector data in elements
    allocate(buffDataVect(nkEle,3))
    do i=1,ntransEleVect
      buffDataVect(:,:)=transEleVect(i)%ptr(smapEle,:)
      do j=1,3
        call MPI_send(buffDataVect(:,j),nkEle,MPI_double_precision,p,p,MPI_comm_world,errMPI)
      end do
  
negative.code:   
    integer,intent(out)::p
    integer nkNode,nkEle
    double precision,allocatable::buffDataScal(:),buffDataVect(:,:),buffDataTens(:,:,:)
    
    ! receive auxiliary data
    call MPI_recv(nkNode,1,MPI_integer,MPI_any_source,MPI_any_tag,MPI_comm_world,statMPI,errMPI)
    p=statMPI(MPI_source)
    call MPI_recv(nkEle,1,MPI_integer,p,p,MPI_comm_world,statMPI,errMPI)
    allocate(mapNode(nkNode))
    allocate(mapEle(nkEle))
    call MPI_recv(mapNode,nkNode,MPI_integer,p,p,MPI_comm_world,statMPI,errMPI)
    call MPI_recv(mapEle,nkEle,MPI_integer,p,p,MPI_comm_world,statMPI,errMPI)
      
    allocate(buffDataScal(nNode))
    allocate(buffDataVect(nNode,3))
    allocate(buffDataTens(nNode,3,3))
    ! receive scaler data at nodes
    do i=1,ntransNodeScal
      call MPI_recv(buffDataScal,nkNode,MPI_double_precision,p,p,MPI_comm_world,statMPI,errMPI)
      transNodeScal(i)%ptr(mapNode)=buffDataScal
    end do
    ! receive vector data at nodes
    do i=1,ntransNodeVect
      do j=1,3
        call MPI_recv(buffDataVect(:,j),nkNode,MPI_double_precision,p,p,MPI_comm_world,statMPI,errMPI)
      end do
      transNodeVect(i)%ptr(mapNode,:)=buffDataVect(:,:)
    end do
    ! receive tensor data at nodes
    do i=1,ntransNodeTens
      do j=1,3
        do k=1,3
          call MPI_recv(buffDataTens(:,j,k),nkNode,MPI_double_precision,&
          &             p,p,MPI_comm_world,statMPI,errMPI)
        end do
      end do
      transNodeTens(i)%ptr(mapNode,:,:)=buffDataTens(:,:,:)
    end do
    deallocate(buffDataScal,buffDataVect,buffDataTens)
    
    allocate(buffDataScal(nEle))
    allocate(buffDataVect(nEle,3))
    allocate(buffDataTens(nEle,3,3))
    ! receive scaler data in elements
    do i=1,ntransEleScal
      call MPI_recv(buffDataScal,nkEle,MPI_double_precision,p,p,MPI_comm_world,statMPI,errMPI)
      transEleScal(i)%ptr(mapEle)=buffDataScal
    end do
    ! receive vector data in elements
    do i=1,ntransEleVect
      do j=1,3
        call MPI_recv(buffDataVect(:,j),nkEle,MPI_double_precision,p,p,MPI_comm_world,statMPI,errMPI)
      end do
      transEleVect(i)%ptr(mapEle,:)=buffDataVect(:,:)
    end do
    ! receive tensor data in elements
    do i=1,ntransEleTens
      do j=1,3
        do k=1,3
          call MPI_recv(buffDataTens(:,j,k),nkEle,MPI_double_precision,&
          &             p,p,MPI_comm_world,statMPI,errMPI)
        end do
      end do
      transEleTens(i)%ptr(mapEle,:,:)=buffDataTens(:,:,:)
    end do
    deallocate(buffDataScal,buffDataVect,buffDataTens)
    
    ! clean up
    deallocate(mapNode,mapEle)
  end subroutine
  