X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/d12142c9dc382512752775d0cca043bb1aef3f86..4c74bb7b6f2398da81ce462cbdfd9c5a77ffa683:/examples/smpi/NAS/LU/neighbors.f diff --git a/examples/smpi/NAS/LU/neighbors.f b/examples/smpi/NAS/LU/neighbors.f new file mode 100644 index 0000000000..ed8a3126af --- /dev/null +++ b/examples/smpi/NAS/LU/neighbors.f @@ -0,0 +1,48 @@ + +c--------------------------------------------------------------------- +c--------------------------------------------------------------------- + + subroutine neighbors () + +c--------------------------------------------------------------------- +c--------------------------------------------------------------------- + + implicit none + + include 'applu.incl' + +c--------------------------------------------------------------------- +c figure out the neighbors and their wrap numbers for each processor +c--------------------------------------------------------------------- + + south = -1 + east = -1 + north = -1 + west = -1 + + if (row.gt.1) then + north = id -1 + else + north = -1 + end if + + if (row.lt.xdim) then + south = id + 1 + else + south = -1 + end if + + if (col.gt.1) then + west = id- xdim + else + west = -1 + end if + + if (col.lt.ydim) then + east = id + xdim + else + east = -1 + end if + + return + end