source: PSPA/parmelaPSPA/trunk/search.f @ 418

Last change on this file since 418 was 12, checked in by lemeur, 12 years ago

parmela pspa initial

File size: 818 bytes
Line 
1      subroutine search(y,x,n,i,mf)
2c     searches an ordered increasing table, x, of n elements, to
3c     find y.  if y is found, mf is set to zero and i is set such
4c     that y = x(i).  otherwise, i is returned such that y is
5c     between x(i) and x(i+1).
6c-----------------------------------------------------------------------
7c
8      include 'ucom.h'
9      dimension x(n)
10c-----------------------------------------------------------------------
11c*
12      mf=1
13      if(n)1,1,2
14    1 continue
15      i=0
16      go to 15
17    2 continue
18      do 3 k=2,n
19      j=k
20      if(y.lt.x(k))go to 4
21    3 continue
22      if(y.eq.x(n))mf=0
23      i=n
24      go to 15
25    4 continue
26      i=j-1
27      if(y.eq.x(i))mf=0
28   15 continue
29      return
30      end
31c++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*
Note: See TracBrowser for help on using the repository browser.