<div>Hi,<br></div><div><br></div><div>In ex14f.F in KSP, "row" variable is calculated either</div><div><br></div><div>349: do 30 j=ys,ys+ym-1<br>350: ...</div><div>351: do 40 i=xs,xs+xm-1<br>
352: row = i - gxs + (j - gys)*gxm + 1<br></div><div><br></div><div>or</div><div><br></div><div>442: do 50 j=ys,ys+ym-1<br>443: ...<br>444: row = (j - gys)*gxm + xs - gxs<br>445: do 60 i=xs,xs+xm-1<br>
446: row = row + 1<br></div><div><br></div><div>How can I calculate "row" in 3D ? </div><div><br></div><div>I tried this;</div><div><br></div><div>do k=zs,zs+zm-1<br> do j=ys,ys+ym-1<br> do i=xs,xs+xm-1<br>
<br>                  row = i - gxs + (j - gys)*gxm + (k - gzs)*gxm*gym + 1<br><br></div><div>It does not work for certain number of processors.</div><div><br></div><div><br></div><div>Thanks,</div><div><br></div><div>Ilyas</div>