Hi<div><br></div><div>I`m running a program including th following subroutine:</div><div><div><font class="Apple-style-span" face="'courier new', monospace">c---------------------SUBROUTINE Particle_Passing Begin Here --------------------------</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>SUBROUTINE Particle_Passing(ions,lecs,xi,yi,zi,xe,ye,ze</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> & ,ui,vi,wi,ue,ve,we,mh,Max_p,buf_size,CRye,CRze,CRue</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> & ,CP_send,CP_recv,CRxi,CRyi,CRzi,CRui,CRvi,CRwi,CRxe</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> & ,CRve,CRwe,CP_Rx,CP_Ry,CP_Rz,CP_Ru,CP_Rv,CP_Rw,CP_Sx</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> & ,CLxi,CLyi,CLzi,CLui,CLvi,CLwi,CLxe,CLye,CLze,CLue</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> & ,CLve,CLwe,CP_Sy,CP_Sz,CP_Su,CP_Sv,CP_Sw,LABEL_p</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> &<span class="Apple-tab-span" style="white-space:pre">        </span> ,ionsR,lecsR,ionsL,lecsL,mpass,kstrt,Nproc,ierr)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br>
</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> <span class="Apple-tab-span" style="white-space:pre">        </span>Integer ions,lecs,mh,mpass</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>REAL xe,ye,ze,ue,ve,we</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> <span class="Apple-tab-span" style="white-space:pre">        </span>REAL xi,yi,zi,ui,vi,wi</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> <span class="Apple-tab-span" style="white-space:pre">        </span>DIMENSION xe(mh),ye(mh),ze(mh),ue(mh),ve(mh),we(mh)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>DIMENSION xi(mh),yi(mh),zi(mh),ui(mh),vi(mh),wi(mh)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br>
</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>Integer MAX_p</font></div><div><font class="Apple-style-span" face="'courier new', monospace">C<span class="Apple-tab-span" style="white-space:pre">        </span>Real MAX_p<span class="Apple-tab-span" style="white-space:pre">        </span></font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br>
</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span> integer::ionsR,lecsR,ionsL,lecsL,buf_size</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span> integer::LABEL_p,CP_send,CP_recv</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> <span class="Apple-tab-span" style="white-space:pre">        </span> REAL,DIMENSION(mpass)::CRxi,CRyi,CRzi,CRui,CRvi,CRwi</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> <span class="Apple-tab-span" style="white-space:pre">        </span> REAL,DIMENSION(mpass)::CRxe,CRye,CRze,CRue,CRve,CRwe</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> <span class="Apple-tab-span" style="white-space:pre">        </span> REAL,DIMENSION(mpass)::CLxi,CLyi,CLzi,CLui,CLvi,CLwi</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> <span class="Apple-tab-span" style="white-space:pre">        </span> REAL,DIMENSION(mpass)::CLxe,CLye,CLze,CLue,CLve,CLwe</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> <span class="Apple-tab-span" style="white-space:pre">        </span> REAL,DIMENSION(buf_size)::CP_Sx,CP_Sy,CP_Sz</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> <span class="Apple-tab-span" style="white-space:pre">        </span> REAL,DIMENSION(buf_size)::CP_Su,CP_Sv,CP_Sw</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> <span class="Apple-tab-span" style="white-space:pre">        </span> REAL,DIMENSION(buf_size)::CP_Rx,CP_Ry,CP_Rz</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> <span class="Apple-tab-span" style="white-space:pre">        </span> REAL,DIMENSION(buf_size)::CP_Ru,CP_Rv,CP_Rw</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace"> <span class="Apple-tab-span" style="white-space:pre">        </span> REAL,DIMENSION(6,buf_size)::CP_S6,CP_R6</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span> integer kstrt, Nproc</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span> integer ierr</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br>
</font></div><div><font class="Apple-style-span" face="'courier new', monospace">c common block for parallel processing</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> integer nprocc, lgrp, lstat, mreal, mint, mcplx, mdouble, lworld</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">c lstat = length of status array</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> parameter(lstat=10)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">c lgrp = current communicator</font></div><div><font class="Apple-style-span" face="'courier new', monospace">c mreal = default datatype for reals</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> common /PPARMS/ nprocc, lgrp, mreal, mint, mcplx, mdouble, lworld</font></div><div><font class="Apple-style-span" face="'courier new', monospace">c local data</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> integer j, ks, moff, kl, kr</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> integer istatus, msid,msid1,msid2,msid3,msid4</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>integer msid5,msid6,msid7</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> dimension istatus(lstat)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>integer nypmx</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">C<span class="Apple-tab-span" style="white-space:pre">        </span>integer status1(10)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> integer, DIMENSION(1):: mypm, iwork1</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">C dimension mypm(1),iwork1(1)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div>
<font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>mypm(1)=ionsR</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br>
</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> call PPIMAX(mypm,iwork1,1)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>nypmx=mypm(1)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>Max_p=nypmx/buf_size+1 </font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">C<span class="Apple-tab-span" style="white-space:pre">        </span>Max_p=MAXVAL(ionsR)/buf_size+1 !change</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>LABEL_p=0</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>do 200 n_p=1,Max_p</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_send=0</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>do i=1,buf_size</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>n=LABEL_p+i</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_Sx(i)=CRXi(n)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_Sy(i)=CRyi(n)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_Sz(i)=CRzi(n)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br>
</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_Su(i)=CRui(n)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_Sv(i)=CRvi(n)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_Sw(i)=CRwi(n)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>end do</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_send=buf_size</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>if(n.gt.ionsR)then</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_send=ionsR - LABEL_p</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>end if</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>LABEL_p=n</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br>
</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>do i=1,buf_size</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_S6(1,i)=CP_Sx(i)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_S6(2,i)=CP_Sy(i)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_S6(3,i)=CP_Sz(i)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_S6(4,i)=CP_Su(i)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_S6(5,i)=CP_Sv(i)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_S6(6,i)=CP_Sw(i)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>end do</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br>
</font></div><div><font class="Apple-style-span" face="'courier new', monospace">C<span class="Apple-tab-span" style="white-space:pre">        </span>CP_Rx=CSHIFT(CP_Sx,-1,2) !change</font></div><div><font class="Apple-style-span" face="'courier new', monospace">C<span class="Apple-tab-span" style="white-space:pre">        </span>CP_Rx=CSHIFT(CP_Sx,-1,2) !change</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">c<span class="Apple-tab-span" style="white-space:pre">        </span>CP_Ry=CSHIFT(CP_Sy,-1,2) !change</font></div><div><font class="Apple-style-span" face="'courier new', monospace">C<span class="Apple-tab-span" style="white-space:pre">        </span>CP_Rz=CSHIFT(CP_Sz,-1,2) !change</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">c<span class="Apple-tab-span" style="white-space:pre">        </span>CP_Ru=CSHIFT(CP_Su,-1,2) !change</font></div><div><font class="Apple-style-span" face="'courier new', monospace">C<span class="Apple-tab-span" style="white-space:pre">        </span>CP_Rv=CSHIFT(CP_Sv,-1,2) !change</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">C<span class="Apple-tab-span" style="white-space:pre">        </span>CP_Rw=CSHIFT(CP_Sw,-1,2) !change</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br>
</font></div><div><font class="Apple-style-span" face="'courier new', monospace">C<span class="Apple-tab-span" style="white-space:pre">        </span>CP_recv=CSHIFT(CP_send,-1,1) !change</font></div><div><font class="Apple-style-span" face="'courier new', monospace">C<span class="Apple-tab-span" style="white-space:pre">        </span>CP_recv=buf_size</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace"> ks = kstrt - 1</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> moff = FZ_strd*mz+2 !my*mz + 2</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">c copy to guard cells</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> kr = ks + 1</font></div><div>
<font class="Apple-style-span" face="'courier new', monospace"> if (kr.ge.Nproc) kr = kr - Nproc</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> kl = ks - 1</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> if (kl.lt.0) kl = kl + Nproc</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div>
<font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br>
</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> call MPI_IRECV(CP_recv,1,mint,kl,1,lgrp,msid</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> & ,ierr)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> call MPI_SEND(CP_send,1,mint,kr,1,lgrp,ierr)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> call MPI_WAIT(msid,istatus,ierr)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>print*,kstrt,lecsR,kr,CP_recv,CP_send,11111113</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> call MPI_IRECV(CP_R6,CP_recv,mreal,kl,2,lgrp,msid1</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> & ,ierr)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> call MPI_SEND(CP_S6,CP_recv,mreal,kr,2,lgrp,ierr)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> call MPI_WAIT(msid1,istatus,ierr)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>if (CP_recv.gt.0) then</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>do n=1,CP_recv</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>ions=ions+1</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>xi(ions)=CP_R6(1,n)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>yi(ions)=CP_R6(2,n)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>zi(ions)=CP_R6(3,n)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>ui(ions)=CP_R6(4,n)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>vi(ions)=CP_R6(5,n)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>wi(ions)=CP_R6(6,n)<span class="Apple-tab-span" style="white-space:pre">        </span></font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>end do</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>End if</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">110 <span class="Apple-tab-span" style="white-space:pre">        </span>continue</font></div><div><font class="Apple-style-span" face="'courier new', monospace">C.......................</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">200<span class="Apple-tab-span" style="white-space:pre">        </span>continue</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br>
</font></div><div><font class="Apple-style-span" face="'courier new', monospace">C------------------------------</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>mypm(1)=lecsR</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> call PPIMAX(mypm,iwork1,1)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>nypmx=mypm(1)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br>
</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>Max_p=nypmx/buf_size+1 </font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">C<span class="Apple-tab-span" style="white-space:pre">        </span>Max_p=MAXVAL(lecsR)/buf_size+1 !change</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br>
</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>LABEL_p=0</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>do 400 n_p=1,Max_p</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_send=0</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>do i=1,buf_size</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>n=LABEL_p+i</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_Sx(i)=CRXe(n)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_Sy(i)=CRye(n)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_Sz(i)=CRze(n)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_Su(i)=CRue(n)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_Sv(i)=CRve(n)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_Sw(i)=CRwe(n)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>end do</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_send=buf_size</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>if(n.gt.lecsR)then</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_send=lecsR - LABEL_p</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>end if</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br>
</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>LABEL_p=n</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br>
</font></div><div><font class="Apple-style-span" face="'courier new', monospace">C<span class="Apple-tab-span" style="white-space:pre">        </span>CP_Rx=CSHIFT(CP_Sx,-1,2) !change</font></div><div><font class="Apple-style-span" face="'courier new', monospace">C<span class="Apple-tab-span" style="white-space:pre">        </span>CP_Rx=CSHIFT(CP_Sx,-1,2) !change</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">C<span class="Apple-tab-span" style="white-space:pre">        </span>CP_Ry=CSHIFT(CP_Sy,-1,2) !change</font></div><div><font class="Apple-style-span" face="'courier new', monospace">C<span class="Apple-tab-span" style="white-space:pre">        </span>CP_Rz=CSHIFT(CP_Sz,-1,2) !change</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">C<span class="Apple-tab-span" style="white-space:pre">        </span>CP_Ru=CSHIFT(CP_Su,-1,2) !change</font></div><div><font class="Apple-style-span" face="'courier new', monospace">C<span class="Apple-tab-span" style="white-space:pre">        </span>CP_Rv=CSHIFT(CP_Sv,-1,2) !change</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">C<span class="Apple-tab-span" style="white-space:pre">        </span>CP_Rw=CSHIFT(CP_Sw,-1,2) !change</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br>
</font></div><div><font class="Apple-style-span" face="'courier new', monospace">C<span class="Apple-tab-span" style="white-space:pre">        </span>CP_recv=CSHIFT(CP_send,-1,1) !change</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br>
</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>do i=1,buf_size</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_S6(1,i)=CP_Sx(i)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_S6(2,i)=CP_Sy(i)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_S6(3,i)=CP_Sz(i)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_S6(4,i)=CP_Su(i)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_S6(5,i)=CP_Sv(i)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_S6(6,i)=CP_Sw(i)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>end do</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br>
</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace"> call MPI_IRECV(CP_recv,1,mint,kl,3,lgrp,msid2</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> & ,ierr)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> call MPI_SEND(CP_send,1,mint,kr,3,lgrp,ierr)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> call MPI_WAIT(msid2,istatus,ierr)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> call MPI_IRECV(CP_R6,CP_recv,mreal,kl,4,lgrp,msid3</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> & ,ierr)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> <span class="Apple-tab-span" style="white-space:pre">        </span>call MPI_SEND(CP_S6,CP_recv,mreal,kr,4,lgrp,ierr)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> call MPI_WAIT(msid3,istatus,ierr)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>if (CP_recv.gt.0) then</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>do n=1,CP_recv</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>lecs=lecs+1</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>xe(lecs)=CP_R6(1,n)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>ye(lecs)=CP_R6(2,n)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>ze(lecs)=CP_R6(3,n)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br>
</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>ue(lecs)=CP_R6(4,n)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>ve(lecs)=CP_R6(5,n)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>we(lecs)=CP_R6(6,n)<span class="Apple-tab-span" style="white-space:pre">        </span></font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>end do</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>End if</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">310 <span class="Apple-tab-span" style="white-space:pre">        </span>continue</font></div><div><font class="Apple-style-span" face="'courier new', monospace">C.......................</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">400<span class="Apple-tab-span" style="white-space:pre">        </span>continue</font></div><div><font class="Apple-style-span" face="'courier new', monospace">C------------------</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>mypm(1)=ionsL</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> call PPIMAX(mypm,iwork1,1)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>nypmx=mypm(1)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>Max_p=nypmx/buf_size+1 </font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">C<span class="Apple-tab-span" style="white-space:pre">        </span>Max_p=MAXVAL(ionsL)/buf_size+1 !change</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>LABEL_p=0</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>do 600 n_p=1,Max_p</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_send=0</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>do i=1,buf_size</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>n=LABEL_p+i</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_Sx(i)=CLXi(n)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_Sy(i)=CLyi(n)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_Sz(i)=CLzi(n)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br>
</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_Su(i)=CLui(n)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_Sv(i)=CLvi(n)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_Sw(i)=CLwi(n)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>end do</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_send=buf_size</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>if(n.gt.ionsL)then</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_send=ionsL - LABEL_p</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>end if</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>LABEL_p=n</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br>
</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>do i=1,buf_size</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_S6(1,i)=CP_Sx(i)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_S6(2,i)=CP_Sy(i)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_S6(3,i)=CP_Sz(i)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_S6(4,i)=CP_Su(i)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_S6(5,i)=CP_Sv(i)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_S6(6,i)=CP_Sw(i)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>end do</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br>
</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace">C<span class="Apple-tab-span" style="white-space:pre">        </span>CP_Rx=CSHIFT(CP_Sx,+1,2) !change</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">C<span class="Apple-tab-span" style="white-space:pre">        </span>CP_Rx=CSHIFT(CP_Sx,+1,2) !change</font></div><div><font class="Apple-style-span" face="'courier new', monospace">C<span class="Apple-tab-span" style="white-space:pre">        </span>CP_Ry=CSHIFT(CP_Sy,+1,2) !change</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">C<span class="Apple-tab-span" style="white-space:pre">        </span>CP_Rz=CSHIFT(CP_Sz,+1,2) !change</font></div><div><font class="Apple-style-span" face="'courier new', monospace">C<span class="Apple-tab-span" style="white-space:pre">        </span>CP_Ru=CSHIFT(CP_Su,+1,2) !change</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">C<span class="Apple-tab-span" style="white-space:pre">        </span>CP_Rv=CSHIFT(CP_Sv,+1,2) !change</font></div><div><font class="Apple-style-span" face="'courier new', monospace">C<span class="Apple-tab-span" style="white-space:pre">        </span>CP_Rw=CSHIFT(CP_Sw,+1,2) !change</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace">C<span class="Apple-tab-span" style="white-space:pre">        </span>CP_recv=CSHIFT(CP_send,+1,1) !change</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace"> call MPI_IRECV(CP_recv,1,mint,kr,5,lgrp,msid4</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> & ,ierr)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> call MPI_SEND(CP_send,1,mint,kl,5,lgrp,ierr)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> call MPI_WAIT(msid4,istatus,ierr)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> call MPI_IRECV(CP_R6,CP_recv,mreal,kr,6,lgrp,msid5</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> & ,ierr)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> call MPI_SEND(CP_S6,CP_recv,mreal,kl,6,lgrp,ierr)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> call MPI_WAIT(msid5,istatus,ierr)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>if (CP_recv.gt.0) then</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>do n=1,CP_recv</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>ions=ions+1</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>xi(ions)=CP_R6(1,n)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>yi(ions)=CP_R6(2,n)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>zi(ions)=CP_R6(3,n)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br>
</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>ui(ions)=CP_R6(4,n)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>vi(ions)=CP_R6(5,n)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>wi(ions)=CP_R6(6,n)<span class="Apple-tab-span" style="white-space:pre">                </span></font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>end do</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>End if</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">510 <span class="Apple-tab-span" style="white-space:pre">        </span>continue</font></div><div><font class="Apple-style-span" face="'courier new', monospace">C.......................</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">600<span class="Apple-tab-span" style="white-space:pre">        </span>continue</font></div><div><font class="Apple-style-span" face="'courier new', monospace">C--------------------</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>mypm(1)=lecsL</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> call PPIMAX(mypm,iwork1,1)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>nypmx=mypm(1)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>Max_p=nypmx/buf_size+1 </font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">C<span class="Apple-tab-span" style="white-space:pre">        </span>Max_p=MAXVAL(lecsL)/buf_size+1 !change</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>LABEL_p=0</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>do 800 n_p=1,Max_p</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_send=0</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>do i=1,buf_size</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>n=LABEL_p+i</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_Sx(i)=CLXe(n)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_Sy(i)=CLye(n)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_Sz(i)=CLze(n)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br>
</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_Su(i)=CLue(n)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_Sv(i)=CLve(n)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_Sw(i)=CLwe(n)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>end do</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_send=buf_size</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>if(n.gt.lecsL)then</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_send=lecsL - LABEL_p</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>end if</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>LABEL_p=n</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br>
</font></div><div><font class="Apple-style-span" face="'courier new', monospace">C<span class="Apple-tab-span" style="white-space:pre">        </span>CP_Rx=CSHIFT(CP_Sx,+1,2) !change</font></div><div><font class="Apple-style-span" face="'courier new', monospace">C<span class="Apple-tab-span" style="white-space:pre">        </span>CP_Rx=CSHIFT(CP_Sx,+1,2) !change</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">C<span class="Apple-tab-span" style="white-space:pre">        </span>CP_Ry=CSHIFT(CP_Sy,+1,2) !change</font></div><div><font class="Apple-style-span" face="'courier new', monospace">C<span class="Apple-tab-span" style="white-space:pre">        </span>CP_Rz=CSHIFT(CP_Sz,+1,2) !change</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">C<span class="Apple-tab-span" style="white-space:pre">        </span>CP_Ru=CSHIFT(CP_Su,+1,2) !change</font></div><div><font class="Apple-style-span" face="'courier new', monospace">C<span class="Apple-tab-span" style="white-space:pre">        </span>CP_Rv=CSHIFT(CP_Sv,+1,2) !change</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">C<span class="Apple-tab-span" style="white-space:pre">        </span>CP_Rw=CSHIFT(CP_Sw,+1,2) !change</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br>
</font></div><div><font class="Apple-style-span" face="'courier new', monospace">C<span class="Apple-tab-span" style="white-space:pre">        </span>CP_recv=CSHIFT(CP_send,-1,1) !change</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br>
</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>do i=1,buf_size</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_S6(1,i)=CP_Sx(i)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_S6(2,i)=CP_Sy(i)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_S6(3,i)=CP_Sz(i)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_S6(4,i)=CP_Su(i)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_S6(5,i)=CP_Sv(i)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>CP_S6(6,i)=CP_Sw(i)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>end do</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br>
</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> call MPI_IRECV(CP_recv,1,mint,kr,7,lgrp,msid6</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> & ,ierr)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> <span class="Apple-tab-span" style="white-space:pre">        </span> call MPI_SEND(CP_send,1,mint,kl,7,lgrp,ierr)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> call MPI_WAIT(msid6,istatus,ierr)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace"> call MPI_IRECV(CP_R6,CP_recv,mreal,kr,8,lgrp,msid7</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> & ,ierr)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> <span class="Apple-tab-span" style="white-space:pre">        </span> call MPI_SEND(CP_S6,CP_recv,mreal,kl,8,lgrp,ierr)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> call MPI_WAIT(msid7,istatus,ierr)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">C<span class="Apple-tab-span" style="white-space:pre">        </span>print*,mreal,mint,lgrp,CP_send,msid,1111114</font></div><div><font class="Apple-style-span" face="'courier new', monospace">C<span class="Apple-tab-span" style="white-space:pre">        </span>print*,kstrt,kl,kr,CP_recv,CP_send,11111113</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>if (CP_recv.gt.0) then</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>do n=1,CP_recv</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>lecs=lecs+1</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>xe(lecs)=CP_R6(1,n)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>ye(lecs)=CP_R6(2,n)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>ze(lecs)=CP_R6(3,n)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br>
</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>ue(lecs)=CP_R6(4,n)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>ve(lecs)=CP_R6(5,n)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>we(lecs)=CP_R6(6,n)<span class="Apple-tab-span" style="white-space:pre">        </span></font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>end do</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>End if</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">710 <span class="Apple-tab-span" style="white-space:pre">        </span>continue</font></div><div><font class="Apple-style-span" face="'courier new', monospace">C.......................</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">800<span class="Apple-tab-span" style="white-space:pre">        </span>continue</font></div><div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="'courier new', monospace">        </font></span></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>End Subroutine</font></div><div><font class="Apple-style-span" face="'courier new', monospace">c---------------------SUBROUTINE Particle_Passing End Here --------------------------</font></div>
<div><font class="Apple-style-span" face="arial, helvetica, sans-serif">And I`m receiving the following error:</font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif"><br></font></div><div><div style="font-family: 'courier new', monospace; ">
[hx001:18110] *** An error occurred in MPI_Wait</div><div style="font-family: 'courier new', monospace; ">[hx001:18110] *** on communicator MPI_COMM_WORLD</div><div style="font-family: 'courier new', monospace; ">
[hx001:18110] *** MPI_ERR_TRUNCATE: message truncated</div><div style="font-family: 'courier new', monospace; ">[hx001:18110] *** MPI_ERRORS_ARE_FATAL (goodbye)</div><div style="font-family: 'courier new', monospace; ">
[hx001:18111] *** An error occurred in MPI_Wait</div><div style="font-family: 'courier new', monospace; ">[hx001:18111] *** on communicator MPI_COMM_WORLD</div><div style="font-family: 'courier new', monospace; ">
[hx001:18111] *** MPI_ERR_TRUNCATE: message truncated</div><div style="font-family: 'courier new', monospace; ">[hx001:18111] *** MPI_ERRORS_ARE_FATAL (goodbye)</div><div style="font-family: 'courier new', monospace; ">
mpirun noticed that job rank 0 with PID 18109 on node hx001 exited on signal 15 (Terminated).</div><div style="font-family: 'courier new', monospace; ">1 additional process aborted (not shown)</div><div style="font-family: 'courier new', monospace; ">
<br></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif">is it possible also to be cause of the following routine:</font></div><div><div><font class="Apple-style-span" face="'courier new', monospace"> call PPIMAX(mypm,iwork1,1)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace"> subroutine PPIMAX(if,ig,nxp)</font></div><div>
<font class="Apple-style-span" face="'courier new', monospace">c this subroutine finds parallel maximum for each element of a vector</font></div><div><font class="Apple-style-span" face="'courier new', monospace">c that is, if(j,k) = maximum as a function of k of if(j,k)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">c at the end, all processors contain the same maximum.</font></div><div><font class="Apple-style-span" face="'courier new', monospace">c if = input and output integer data</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">c ig = scratch integer array</font></div><div><font class="Apple-style-span" face="'courier new', monospace">c nxp = number of data values in vector</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> implicit none</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> integer if, ig</font></div><div>
<font class="Apple-style-span" face="'courier new', monospace"> integer nxp</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> dimension if(nxp), ig(nxp)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">c common block for parallel processing</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> integer nproc, lgrp, lstat, mreal, mint, mcplx, mdouble, lworld</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> integer msum, mmax</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> parameter(lstat=10)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">c lgrp = current communicator</font></div><div><font class="Apple-style-span" face="'courier new', monospace">c mint = default datatype for integers</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> common /PPARMS/ nproc, lgrp, mreal, mint, mcplx, mdouble, lworld</font></div><div><font class="Apple-style-span" face="'courier new', monospace">c mmax = MPI_MAX</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> common /PPARMSX/ msum, mmax</font></div><div><font class="Apple-style-span" face="'courier new', monospace">c local data</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> integer j, ierr</font></div><div><font class="Apple-style-span" face="'courier new', monospace">c find maximum</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> call MPI_ALLREDUCE(if,ig,nxp,mint,mmax,lgrp,ierr)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">c copy output from scratch array</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> do 10 j = 1, nxp</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> if(j) = ig(j)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> 10 continue</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> return</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> end</font></div><div><font class="Apple-style-span" face="'courier new', monospace">c-----------------------------------------------------------------------</font></div>
</div><div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif">BTW, should I have a pre-default of msids (msid,msid1,msid2,...msid7)?</font></div>
<div><font class="Apple-style-span" face="arial, helvetica, sans-serif"><br></font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif">Best Regards</font></div><div><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; ">Sincerely</span></div>
<div><font class="Apple-style-span" face="arial, helvetica, sans-serif">Amin</font></div><div style="font-family: 'courier new', monospace; "><br></div></div><div><br></div></div>