summaryrefslogtreecommitdiff
path: root/Utilib/src/RENINS.f
diff options
context:
space:
mode:
Diffstat (limited to 'Utilib/src/RENINS.f')
-rw-r--r--Utilib/src/RENINS.f49
1 files changed, 49 insertions, 0 deletions
diff --git a/Utilib/src/RENINS.f b/Utilib/src/RENINS.f
new file mode 100644
index 0000000..f5a1029
--- /dev/null
+++ b/Utilib/src/RENINS.f
@@ -0,0 +1,49 @@
+*DECK RENINS
+ SUBROUTINE RENINS(SIZE,LEV,DEG)
+*
+*-----------------------------------------------------------------------
+*
+*Purpose:
+* Sort a level by increasing degree using the "Insertion method".
+*
+*Copyright:
+* Copyright (C) 2002 Ecole Polytechnique de Montreal
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation; either
+* version 2.1 of the License, or (at your option) any later version
+*
+*Author(s): R. Le Tellier
+*
+*Parameters: input
+* SIZE number of nodes in the level.
+* LEV level to sort.
+* DEG degrees of the level.
+*
+*-----------------------------------------------------------------------
+*
+ IMPLICIT NONE
+*---
+* SUBROUTINE ARGUMENTS
+*---
+ INTEGER SIZE,LEV(SIZE),DEG(SIZE)
+*---
+* LOCAL VARIABLES
+*---
+ INTEGER I,INDD,INDL,J
+*
+ DO I=2,SIZE
+ INDD=DEG(I)
+ INDL=LEV(I)
+ J=I
+ DO WHILE ((J.GT.1).AND.(DEG(J-1).GT.INDD))
+ DEG(J)=DEG(J-1)
+ LEV(J)=LEV(J-1)
+ J=J-1
+ ENDDO
+ DEG(J)=INDD
+ LEV(J)=INDL
+ ENDDO
+*
+ RETURN
+ END