source: LMDZ5/branches/testing/libf/filtrez/eigen_sort.F @ 5165

Last change on this file since 5165 was 1910, checked in by Laurent Fairhead, 11 years ago

Merged trunk changes r1860:1909 into testing branch

  • Property copyright set to
    Name of program: LMDZ
    Creation date: 1984
    Version: LMDZ5
    License: CeCILL version 2
    Holder: Laboratoire de m\'et\'eorologie dynamique, CNRS, UMR 8539
    See the license file in the root directory
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 538 bytes
Line 
1!
2! $Header$
3!
4          SUBROUTINE eigen_sort(d,v,n,np)
5          INTEGER n,np
6          REAL d(np),v(np,np)
7          INTEGER i,j,k
8          REAL p
9
10       DO i=1,n-1
11          k=i
12          p=d(i)
13        DO j=i+1,n
14           IF(d(j).ge.p) THEN
15            k=j
16            p=d(j)
17           ENDIF
18        ENDDO
19         
20        IF(k.ne.i) THEN
21          d(k)=d(i)
22          d(i)=p
23         DO j=1,n
24          p=v(j,i)
25          v(j,i)=v(j,k)
26          v(j,k)=p
27         ENDDO
28        ENDIF
29       ENDDO
30
31        RETURN
32        END
Note: See TracBrowser for help on using the repository browser.