Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Improve error message
[simgrid.git] / examples / smpi / NAS / LU / sethyper.f
1
2 c---------------------------------------------------------------------
3 c---------------------------------------------------------------------
4
5       subroutine sethyper
6
7 c---------------------------------------------------------------------
8 c---------------------------------------------------------------------
9
10 c---------------------------------------------------------------------
11 c    for each column in a hyperplane, istart = first row,
12 c---------------------------------------------------------------------
13
14       implicit none
15
16       include 'applu.incl'
17
18 c---------------------------------------------------------------------
19 c  local variables
20 c---------------------------------------------------------------------
21       integer i, j
22       integer iglob, jglob
23       integer kp
24
25 c---------------------------------------------------------------------
26 c compute the pointers for hyperplanes
27 c---------------------------------------------------------------------
28         do kp = 2,nx0+ny0
29           icomms(kp) = .false.
30           icommn(kp) = .false.
31           icomme(kp) = .false.
32           icommw(kp) = .false.
33
34 c---------------------------------------------------------------------
35 c  check to see if comm. to south is required
36 c---------------------------------------------------------------------
37           if (south.ne.-1) then
38             i     = iend
39             iglob = ipt + i
40             jglob = kp - iglob
41             j     = jglob - jpt
42             if (jglob.ge.2.and.jglob.le.ny0-1.and.j.ge.jst.and.
43      >         j.le.jend) icomms(kp) = .true.
44           end if
45
46 c---------------------------------------------------------------------
47 c  check to see if comm. to north is required
48 c---------------------------------------------------------------------
49           if (north.ne.-1) then
50             i     = ist
51             iglob = ipt + i
52             jglob = kp - iglob
53             j     = jglob - jpt
54             if (jglob.ge.2.and.jglob.le.ny0-1.and.j.ge.jst.and.
55      >         j.le.jend) icommn(kp) = .true.
56           end if
57
58 c---------------------------------------------------------------------
59 c  check to see if comm. to east is required
60 c---------------------------------------------------------------------
61           if (east.ne.-1) then
62             j     = jend
63             jglob = jpt + j
64             iglob = kp - jglob
65             i     = iglob - ipt
66             if (iglob.ge.2.and.iglob.le.nx0-1.and.i.ge.ist.and.
67      >         i.le.iend) icomme(kp) = .true.
68           end if
69
70 c---------------------------------------------------------------------
71 c  check to see if comm. to west is required
72 c---------------------------------------------------------------------
73           if (west.ne.-1) then
74             j = jst
75             jglob = jpt + j
76             iglob = kp - jglob
77             i     = iglob - ipt
78             if (iglob.ge.2.and.iglob.le.nx0-1.and.i.ge.ist.and.
79      >         i.le.iend) icommw(kp) = .true.
80           end if
81
82         end do
83
84         icomms(1) = .false.
85         icommn(1) = .false.
86         icomme(1) = .false.
87         icommw(1) = .false.
88         icomms(nx0+ny0+1) = .false.
89         icommn(nx0+ny0+1) = .false.
90         icomme(nx0+ny0+1) = .false.
91         icommw(nx0+ny0+1) = .false.
92
93       return
94       end