Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid
[simgrid.git] / examples / smpi / NAS / LU / neighbors.f
1
2 c---------------------------------------------------------------------
3 c---------------------------------------------------------------------
4
5       subroutine neighbors ()
6
7 c---------------------------------------------------------------------
8 c---------------------------------------------------------------------
9
10       implicit none
11
12       include 'applu.incl'
13
14 c---------------------------------------------------------------------
15 c     figure out the neighbors and their wrap numbers for each processor
16 c---------------------------------------------------------------------
17
18         south = -1
19         east  = -1
20         north = -1
21         west  = -1
22
23       if (row.gt.1) then
24               north = id -1
25       else
26               north = -1
27       end if
28
29       if (row.lt.xdim) then
30               south = id + 1
31       else
32               south = -1
33       end if
34
35       if (col.gt.1) then
36               west = id- xdim
37       else
38               west = -1
39       end if
40
41       if (col.lt.ydim) then
42               east = id + xdim
43       else 
44               east = -1
45       end if
46
47       return
48       end