1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
|
subroutine mdp
* (k,ek,tail, v,l, head,last,next, mark)
clll. optimize
c***********************************************************************
c mdp -- purge inactive elements and do mass elimination
c***********************************************************************
integer ek, tail, v(1), l(1), head(1), last(1), next(1),
* mark(1), tag, free, li,vi,lvi,evi, s,ls,es, ilp,ilpmax
c
c----initialize tag
tag = mark(ek)
c
c----for each vertex vi in ek
li = ek
ilpmax = last(ek)
if (ilpmax.le.0) go to 12
do 11 ilp=1,ilpmax
i = li
li = l(i)
vi = v(li)
c
c------remove vi from degree list
if (last(vi).eq.0) go to 3
if (last(vi).gt.0) go to 1
head(-last(vi)) = next(vi)
go to 2
1 next(last(vi)) = next(vi)
2 if (next(vi).gt.0) last(next(vi)) = last(vi)
c
c------remove inactive items from element list of vi
3 ls = vi
4 s = ls
ls = l(s)
if (ls.eq.0) go to 6
es = v(ls)
if (mark(es).lt.tag) go to 5
free = ls
l(s) = l(ls)
ls = s
5 go to 4
c
c------if vi is interior vertex, then remove from list and eliminate
6 lvi = l(vi)
if (lvi.ne.0) go to 7
l(i) = l(li)
li = i
c
k = k+1
next(vi) = -k
last(ek) = last(ek) - 1
go to 11
c
c------else ...
c--------classify vertex vi
7 if (l(lvi).ne.0) go to 9
evi = v(lvi)
if (next(evi).ge.0) go to 9
if (mark(evi).lt.0) go to 8
c
c----------if vi is prototype vertex, then mark as such, initialize
c----------overlap count for corresponding element, and move vi to end
c----------of boundary list
last(vi) = evi
mark(evi) = -1
l(tail) = li
tail = li
l(i) = l(li)
li = i
go to 10
c
c----------else if vi is duplicate vertex, then mark as such and adjust
c----------overlap count for corresponding element
8 last(vi) = 0
mark(evi) = mark(evi) - 1
go to 10
c
c----------else mark vi to compute degree
9 last(vi) = -ek
c
c--------insert ek in element list of vi
10 v(free) = ek
l(free) = l(vi)
l(vi) = free
11 continue
c
c----terminate boundary list
12 l(tail) = 0
c
return
end
|