OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
iparti.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/.
23!||====================================================================
24!|| iparti ../common_source/tools/sort/iparti.F
25!||--- called by ------------------------------------------------------
26!|| trirap ../common_source/tools/sort/trirap.F
27!||--- calls -----------------------------------------------------
28!|| echang ../common_source/tools/sort/echang.F
29!|| icompc ../common_source/tools/sort/icompc.F
30!||====================================================================
31 INTEGER FUNCTION iparti(I,J,TAB,N2)
32C-----------------------------------------------
33C I m p l i c i t T y p e s
34C-----------------------------------------------
35#include "implicit_f.inc"
36C-----------------------------------------------
37C D u m m y A r g u m e n t s
38C-----------------------------------------------
39 INTEGER i, j, n2
40C REAL
42 . tab(*)
43C-----------------------------------------------
44C L o c a l V a r i a b l e s
45C-----------------------------------------------
46 INTEGER milieu, u, v
47C-----------------------------------------------
48C E x t e r n a l F u n c t i o n s
49C-----------------------------------------------
50 INTEGER icompc
51 iparti=i
52 IF(j>i) THEN
53 milieu=(i+j)/2
54 u=i
55 v=j+1
56C
57 IF(icompc(j,milieu,tab)<0) THEN
58 CALL echang(j,milieu,tab)
59 CALL echang(n2+j,n2+milieu,tab)
60 ENDIF
61 IF(icompc(j,i,tab)<0) THEN
62 CALL echang(j,i,tab)
63 CALL echang(n2+j,n2+i,tab)
64 ENDIF
65 IF(icompc(i,milieu,tab)<0) THEN
66 CALL echang(i,milieu,tab)
67 CALL echang(n2+i,n2+milieu,tab)
68 ENDIF
69C
70 1000 IF(u<v) THEN
71C
72 1100 CONTINUE
73 u=u+1
74 IF(icompc(u,i,tab)<0) GO TO 1100
75C
76 1200 CONTINUE
77 v=v-1
78 IF(icompc(v,i,tab)>0) GO TO 1200
79C
80 CALL echang(u,v,tab)
81 CALL echang(n2+u,n2+v,tab)
82 GO TO 1000
83 ENDIF
84 IF(u>v) CALL echang(u,v,tab)
85 IF(u>v) CALL echang(n2+u,n2+v,tab)
86 u=min0(u,v)
87 CALL echang(i,u,tab)
88 CALL echang(n2+i,n2+u,tab)
89 iparti=u
90 ENDIF
91 RETURN
92 END
#define my_real
Definition cppsort.cpp:32
subroutine echang(i, j, tab)
Definition echang.F:31
integer function icompc(i, j, tab)
Definition icompc.F:31
integer function iparti(i, j, tab, n2)
Definition iparti.F:32