1!
2!     CalculiX - A 3-dimensional finite element program
3!              Copyright (C) 1998-2021 Guido Dhondt
4!
5!     This program is free software; you can redistribute it and/or
6!     modify it under the terms of the GNU General Public License as
7!     published by the Free Software Foundation(version 2);
8!
9!
10!     This program is distributed in the hope that it will be useful,
11!     but WITHOUT ANY WARRANTY; without even the implied warranty of
12!     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13!     GNU General Public License for more details.
14!
15!     You should have received a copy of the GNU General Public License
16!     along with this program; if not, write to the Free Software
17!     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18!
19!
20!     identifies the position id of px in an ordered array
21!     x of characters*80;
22!
23!     id is such that x(id).le.px and x(id+1).gt.px
24!
25      subroutine cident80(x,px,n,id)
26      implicit none
27      character*80 x,px
28      integer n,id,n2,m
29      dimension x(n)
30      id=0
31      if(n.eq.0) return
32      n2=n+1
33      do
34         m=(n2+id)/2
35         if(px.ge.x(m)) then
36            id=m
37         else
38            n2=m
39         endif
40         if((n2-id).eq.1) return
41      enddo
42      end
43