Last change
on this file since 931 was
402,
checked in by (none), 22 years ago
|
This commit was manufactured by cvs2svn to create tag 'IPSL-CM4_v1'.
|
-
Property svn:eol-style set to
native
-
Property svn:executable set to
*
-
Property svn:keywords set to
Author Date Id Revision
|
File size:
631 bytes
|
Line | |
---|
1 | C |
---|
2 | C $Header$ |
---|
3 | C |
---|
4 | SUBROUTINE sort(n,d) |
---|
5 | c |
---|
6 | c P.Le Van |
---|
7 | c |
---|
8 | c... cette routine met le tableau d dans l'ordre croissant .... |
---|
9 | cc ( pour avoir l'ordre decroissant,il suffit de remplacer l'instruc |
---|
10 | c tion situee + bas IF(d(j).LE.p) THEN par |
---|
11 | c IF(d(j).GE.p) THEN |
---|
12 | c |
---|
13 | |
---|
14 | INTEGER n |
---|
15 | REAL d(n) , p |
---|
16 | INTEGER i,j,k |
---|
17 | |
---|
18 | DO i=1,n-1 |
---|
19 | k=i |
---|
20 | p=d(i) |
---|
21 | DO j=i+1,n |
---|
22 | IF(d(j).LE.p) THEN |
---|
23 | k=j |
---|
24 | p=d(j) |
---|
25 | ENDIF |
---|
26 | ENDDO |
---|
27 | |
---|
28 | IF(k.ne.i) THEN |
---|
29 | d(k)=d(i) |
---|
30 | d(i)=p |
---|
31 | ENDIF |
---|
32 | ENDDO |
---|
33 | |
---|
34 | RETURN |
---|
35 | END |
---|
Note: See
TracBrowser
for help on using the repository browser.