EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
bsfint.F
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file bsfint.F
1  FUNCTION bsfint(NARG,ARG,NENT,ENT,TABLE)
2 *********************************************************************
3 * *
4 * THE INTERPOLATION ROUTINE (CERN LIBRARY ROUTINE E104) *
5 * *
6 *********************************************************************
7  IMPLICIT DOUBLE PRECISION (a-h, o-z)
8  dimension arg(5),nent(5),ent(10),table(10)
9  dimension d(5),ncomb(5),ient(5)
10  kd=1
11  m=1
12  ja=1
13  DO 5 i=1,narg
14  ncomb(i)=1
15  jb=ja-1+nent(i)
16  DO 2 j=ja,jb
17  IF (arg(i).LE.ent(j)) go to 3
18  2 CONTINUE
19  j=jb
20  3 IF (j.NE.ja) go to 4
21  j=j+1
22  4 jr=j-1
23  d(i)=(ent(j)-arg(i))/(ent(j)-ent(jr))
24  ient(i)=j-ja
25  kd=kd+ient(i)*m
26  m=m*nent(i)
27  5 ja=jb+1
28  bsfint=0.
29  10 fac=1.
30  iadr=kd
31  ifadr=1
32  DO 15 i=1,narg
33  IF (ncomb(i).EQ.0) go to 12
34  fac=fac*(1.-d(i))
35  go to 15
36  12 fac=fac*d(i)
37  iadr=iadr-ifadr
38  15 ifadr=ifadr*nent(i)
39  bsfint=bsfint+fac*table(iadr)
40  il=narg
41  40 IF (ncomb(il).EQ.0) go to 80
42  ncomb(il)=0
43  IF (il.EQ.narg) go to 10
44  il=il+1
45  DO 50 k=il,narg
46  50 ncomb(k)=1
47  go to 10
48  80 il=il-1
49  IF(il.NE.0) go to 40
50  RETURN
51  END