summaryrefslogtreecommitdiff
path: root/Trivac/src/TRINDX.f
blob: da5ec16f527fe137c7617346d7d18200c60c2709 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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