OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
mindex.F
Go to the documentation of this file.
1Copyright> OpenRadioss
2Copyright> Copyright (C) 1986-2025 Altair Engineering Inc.
3Copyright>
4Copyright> This program is free software: you can redistribute it and/or modify
5Copyright> it under the terms of the GNU Affero General Public License as published by
6Copyright> the Free Software Foundation, either version 3 of the License, or
7Copyright> (at your option) any later version.
8Copyright>
9Copyright> This program is distributed in the hope that it will be useful,
10Copyright> but WITHOUT ANY WARRANTY; without even the implied warranty of
11Copyright> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12Copyright> GNU Affero General Public License for more details.
13Copyright>
14Copyright> You should have received a copy of the GNU Affero General Public License
15Copyright> along with this program. If not, see <https://www.gnu.org/licenses/>.
16Copyright>
17Copyright>
18Copyright> Commercial Alternative: Altair Radioss Software
19Copyright>
20Copyright> As an alternative to this open-source version, Altair also offers Altair Radioss
21Copyright> software under a commercial license. Contact Altair to discuss further if the
22Copyright> commercial version may interest you: https://www.altair.com/radioss/.
23C
24!||====================================================================
25!|| mindex ../starter/source/materials/mat/mat026/mindex.F
26!||====================================================================
27 INTEGER FUNCTION mindex(AA,NI,NJ,A)
28C RECHERCHE D'INDEX
29C-----------------------------------------------
30C I m p l i c i t T y p e s
31C-----------------------------------------------
32#include "implicit_f.inc"
33C-----------------------------------------------
34C D u m m y A r g u m e n t s
35C-----------------------------------------------
36 INTEGER ni, nj
37C REAL
39 . aa(ni,nj), a
40C-----------------------------------------------
41C L o c a l V a r i a b l e s
42C-----------------------------------------------
43 INTEGER i1, i2, i3
44C REAL
46 . a1, a2, a3
47 i1 = 1
48 i2 = nj
49 a1 = aa(1,i1)
50 a2 = aa(1,i2)
51 IF(a2>=a1)THEN
52 1 CONTINUE
53 i3 = (i1 + i2)/2
54 a3 = aa(1,i3)
55 IF(a3>=a)THEN
56 i2 = i3
57 a2 = a3
58 ELSE
59 i1 = i3
60 a1 = a3
61 ENDIF
62 IF(i2-i1>1) GOTO 1
63 ELSE
64 2 CONTINUE
65 i3 = (i1 + i2)/2
66 a3 = aa(1,i3)
67 IF(a3<a)THEN
68 i2 = i3
69 a2 = a3
70 ELSE
71 i1 = i3
72 a1 = a3
73 ENDIF
74 IF(i2-i1>1) GOTO 2
75 ENDIF
76C
77 mindex=i1
78 RETURN
79 END
#define my_real
Definition cppsort.cpp:32
integer function mindex(aa, ni, nj, a)
Definition mindex.F:28