DO WHILE (err > tol)
-
CALL MPI_SEND(u(1,1),nyblock,MPI_REAL,nbrleft,0,comm2d)
-
CALL MPI_RECV(u(nxlocal,1),nyblock,MPI_REAL,nbrright,0,comm2d)
-
CALL MPI_SEND(u(nxlocal-1,1),nyblock,MPI_REAL, nbrright,1,comm2d)
-
CALL MPI_RECV(u(0,1),nyblock,MPI_REAL,nbrleft,1,comm2d)
-
CALL MPI_SEND(u(1,1),1,rowtype,nbrtop,2,comm2d)
-
CALL MPI_RECV(u(1,nylocal),1,rowtype,nbrbottom,2,comm2d)
-
CALL MPI_SEND(u(nxlocal-1,1),1,rowtype,nbrbottom,3,comm2d)
-
CALL MPI_RECV(u(1,0),1,rowtype,nbrtop,3,comm2d)
-
myerr = 0.0
-
DO j=1, nylocal-1
-
DO i = 1, nxlocal-1
-
unew(i,j) = (u(i-1,j)+u(i+1,j)+u(i,j-1)+u(i,j+1)+f(i,j))/4
-
myerr = max(err, ABS(unew(i,j)-u(i,j)))
-
END DO
-
END DO
-
CALL MPI_ALLREDUCE(myerr,err,1,MPI_REAL,MPI_MAX,MPI_COMM_WORLD,ierr)
-
DO j=1, nylocal-1
-
DO i = 1, nxlocal-1
-
END DO
-
END DO
|