<br>Hi<br><br>I know the basic idea of the guard cells, but for example in the following part of the program, as the charge decomposition is just forward (only nn+q and no nn-1) it uses only 1 guard cell for each processor in y dirrection:<br>
<br>      do 10 j = 1, npp<br>c find interpolation weights<br>      nn = part(1,j)<br>      mm = part(2,j)<br>      dxp = qm*(part(1,j) - real(nn))<br>      dyp = part(2,j) - real(mm)<br>      nn = nn + 1<br>      mm = mm - mnoff<br>
      amx = qm - dxp<br>      mp = mm + 1<br>      amy = 1.0 - dyp<br>      np = nn + 1<br>c deposit charge<br>      q(np,mp) = q(np,mp) + dxp*dyp<br>      q(nn,mp) = q(nn,mp) + amx*dyp<br>      q(np,mm) = q(np,mm) + dxp*amy<br>
      q(nn,mm) = q(nn,mm) + amx*amy<br><br>and I did not understan why for the guard cell why it add the value of the gaurd cell to the first node and then make the gaurd cell value as 0:?<br><br>      do 10 k = 1, myp1<br>
      q(1,k) = q(1,k) + q(nx+1,k)<br>      q(nx+1,k) = 0.0<br>   10 continue<br><br><br><br>PPNAGUARD2L<br>c add guard cells<br>      kr = ks + 1<br>      if (kr.ge.nvp) kr = kr - nvp<br>      kl = ks - 1<br>      if (kl.lt.0) kl = kl + nvp<br>
      ks = nyp + 1<br>c this segment is used for mpi computers<br>      call MPI_IRECV(scr,nxv,mreal,kl,moff,lgrp,msid,ierr)<br>      call MPI_SEND(f(1,ks),nxv,mreal,kr,moff,lgrp,ierr)<br>      call MPI_WAIT(msid,istatus,ierr)<br>
c add up the guard cells<br>      do 20 j = 1, nx1<br>      f(j,1) = f(j,1) + scr(j)<br>      f(j,nyp+1) = 0.0<br>   20 continue<br><br>PPNCGUARD2L<br>         do 10 j = 1, nxv<br>         f(j,nyp+1) = f(j,1)<br>   10    continue<br>
         return<br>      endif<br>      ks = kstrt - 1<br>      moff = nypmx*nvp + 2<br>c copy to guard cells<br>      kr = ks + 1<br>      if (kr.ge.nvp) kr = kr - nvp<br>      kl = ks - 1<br>      if (kl.lt.0)  kl = kl + nvp<br>
      ks = nyp + 1<br>c this segment is used for mpi computers<br>      call MPI_IRECV(f(1,ks),nxv,mreal,kr,moff,lgrp,msid,ierr)<br>      call MPI_SEND(f,nxv,mreal,kl,moff,lgrp,ierr)<br>      call MPI_WAIT(msid,istatus,ierr)<br>
<br>and also if for interpolations if we had also backward (nn and np -1) which cell it is better to choose for gaurd cells:<br>1-(cell 1 and cell nyp+1)?<br>2- (cell nyp+1 and cell nyp+2)?<br><br>Best Regards<br><br>