OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
local_index.F File Reference
#include "implicit_f.inc"

Go to the source code of this file.

Functions/Subroutines

subroutine local_index (il, ig, nodes, n)

Function/Subroutine Documentation

◆ local_index()

subroutine local_index ( integer, intent(out) il,
integer, intent(in) ig,
integer, dimension(n), intent(in) nodes,
integer, intent(in) n )

Definition at line 36 of file local_index.F.

37C-----------------------------------------------
38C D e s c r i p t i o n
39C-----------------------------------------------
40C Search IL such as NODES(IL)=IG
41C PRECONDITION : NODES(:) MUST BE ORDERED
42C SEARCH ALGORITHM : Dichotomic Search
43C-----------------------------------------------
44C I m p l i c i t T y p e s
45C-----------------------------------------------
46#include "implicit_f.inc"
47C-----------------------------------------------
48C D u m m y A r g u m e n t s
49C-----------------------------------------------
50 INTEGER, INTENT(IN) :: IG, N, NODES(N)
51 INTEGER, INTENT(OUT) :: IL
52C-----------------------------------------------
53C L o c a l V a r i a b l e s
54C-----------------------------------------------
55 INTEGER IMIN, IMAX, K, M
56C-----------------------------------------------
57 imin=0
58 imax=n
59C
60 m=n/2
61 DO WHILE (m > 0)
62 k=m+imin
63 IF(nodes(k) < ig) THEN
64 imin=k
65 m=imax-imin
66 ELSE
67 imax=k
68 ENDIF
69 m=m/2
70 ENDDO
71 il=imax
72C
73 RETURN