4
subroutine heapsort(iflg)
8
c This routine sorts either the locally owned particles (iflg=0) or
9
c the particles stored in the buffer arrays (iflg=1) so that they are
10
c arranged in order of increasing index
12
double precision rr1(3,6),rmss
13
double precision tbeg,wraptime
16
integer iflg,jj,kk,iat,idx
18
if (iflg.eq.1) go to 1000
19
if ( antot .eq. 0 ) return
20
if ( antot .eq. 1 ) return
32
rr1(jj,kk) = ra(l,jj,kk)
41
rr1(jj,kk) = ra(ir,jj,kk)
50
ra(ir,jj,kk) = ra(1,jj,kk)
60
ra(1,jj,kk) = rr1(jj,kk)
66
tmstat(9) = tmstat(9) + wraptime() - tbeg
72
tmstat(9) = tmstat(9) + wraptime() - tbeg
81
if ( aidx(j) .lt. aidx(j+1)) j = j+1
83
if ( idx .lt. aidx(j)) then
86
ra(i,jj,kk) = ra(j,jj,kk)
101
ra(i,jj,kk) = rr1(jj,kk)
109
1000 if ( btot .eq. 0 ) return
110
if ( btot .eq. 1 ) return
153
if ( ir .eq. 1 ) then
164
tmstat(10) = tmstat(10) + wraptime() - tbeg
169
if ( ir .eq. 1 ) then
170
tmstat(10) = tmstat(10) + wraptime() - tbeg
177
if ( j .le. ir ) then
178
if ( j .lt. ir ) then
179
if ( bidx(j) .lt. bidx(j+1)) j = j+1
181
if ( idx .lt. bidx(j)) then