source: PSPA/parmelaPSPA/trunk/sort.f @ 436

Last change on this file since 436 was 12, checked in by lemeur, 12 years ago

parmela pspa initial

File size: 804 bytes
Line 
1      subroutine sort(n,x,y)
2c-----------------------------------------------------------------------
3      save
4c
5      include 'param_sz.h'
6      include 'ucom.h'
7c
8      dimension x(imaa),y(imaa)
9c-----------------------------------------------------------------------
10c*
11      if(x(2).ge.x(1))go to 2
12      r=x(2)
13      s=y(2)
14      x(2)=x(1)
15      y(2)=y(1)
16      x(1)=r
17      y(1)=s
18    2 continue
19      do 10 i=3,n
20      l=i-1
21      if(x(i).ge.x(l))go to 10
22      r=x(i)
23      s=y(i)
24      x(i)=x(l)
25      y(i)=y(l)
26      do 4 j=2,l
27      k=i-j
28      if(r.ge.x(k))go to 6
29      x(k+1)=x(k)
30      y(k+1)=y(k)
31    4 continue
32      k=0
33    6 continue
34      j=k+1
35      x(j)=r
36      y(j)=s
37   10 continue
38      return
39      end
40c++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*
Note: See TracBrowser for help on using the repository browser.