summaryrefslogtreecommitdiff
path: root/Trivac/src/TRINDX.f
diff options
context:
space:
mode:
authorstainer_t <thomas.stainer@oecd-nea.org>2025-09-08 13:48:49 +0200
committerstainer_t <thomas.stainer@oecd-nea.org>2025-09-08 13:48:49 +0200
commit7dfcc480ba1e19bd3232349fc733caef94034292 (patch)
tree03ee104eb8846d5cc1a981d267687a729185d3f3 /Trivac/src/TRINDX.f
Initial commit from Polytechnique Montreal
Diffstat (limited to 'Trivac/src/TRINDX.f')
-rwxr-xr-xTrivac/src/TRINDX.f43
1 files changed, 43 insertions, 0 deletions
diff --git a/Trivac/src/TRINDX.f b/Trivac/src/TRINDX.f
new file mode 100755
index 0000000..da5ec16
--- /dev/null
+++ b/Trivac/src/TRINDX.f
@@ -0,0 +1,43 @@
+*DECK TRINDX
+ SUBROUTINE TRINDX(I,IP,MAX)
+*
+*-----------------------------------------------------------------------
+*
+*Purpose:
+* Set the perdue storage indices.
+*
+*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): A. Hebert
+*
+*Parameters: input
+* I index of the new information element.
+* IP array of perdue storage indices.
+* MAX size of array IP.
+*
+*Parameters: output
+* IP array of perdue storage indices.
+*
+*-----------------------------------------------------------------------
+*
+*----
+* SUBROUTINE ARGUMENTS
+*----
+ INTEGER I,MAX,IP(MAX)
+*
+ DO 10 I0=1,MAX
+ IF(IP(I0).EQ.I) THEN
+ RETURN
+ ELSE IF(IP(I0).EQ.0) THEN
+ IP(I0)=I
+ RETURN
+ ENDIF
+ 10 CONTINUE
+ CALL XABORT('TRINDX: INDEX SEARCH FAILURE.')
+ RETURN
+ END