From 7dfcc480ba1e19bd3232349fc733caef94034292 Mon Sep 17 00:00:00 2001 From: stainer_t Date: Mon, 8 Sep 2025 13:48:49 +0200 Subject: Initial commit from Polytechnique Montreal --- Utilib/src/RENINS.f | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 Utilib/src/RENINS.f (limited to 'Utilib/src/RENINS.f') 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 -- cgit v1.2.3