Rev | Line | |
---|
[12] | 1 | subroutine sort(n,x,y) |
---|
| 2 | c----------------------------------------------------------------------- |
---|
| 3 | save |
---|
| 4 | c |
---|
| 5 | include 'param_sz.h' |
---|
| 6 | include 'ucom.h' |
---|
| 7 | c |
---|
| 8 | dimension x(imaa),y(imaa) |
---|
| 9 | c----------------------------------------------------------------------- |
---|
| 10 | c* |
---|
| 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 |
---|
| 40 | c++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++* |
---|
Note: See
TracBrowser
for help on using the repository browser.