EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
partonx.F
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file partonx.F
1 
2  FUNCTION partonx (IPRTN, X, Q)
3 C
4 C Given the parton distribution function in the array Upd in
5 C COMMON / CtqPar1 / , this routine fetches u(fl, x, q) at any value of
6 C x and q using Mth-order polynomial interpolation for x and Ln(Q/Lambda).
7 C
8  IMPLICIT DOUBLE PRECISION (a-h, o-z)
9 C
10  parameter(mxx = 105, mxq = 25, mxf = 6)
11  parameter(mxpqx = (mxf *2 +2) * mxq * mxx)
12  parameter(m= 2, m1 = m + 1)
13 C
14  Logical first
15  Common
16  > / ctqpar1 / al, xv(0:mxx), ql(0:mxq), upd(mxpqx)
17  > / ctqpar2 / nx, nt, nfmx
18  > / xqrange / qini, qmax, xmin
19 C
20  dimension fq(m1), df(m1)
21 
22  Data first /.true./
23  save first
24 C Work with Log (Q)
25  qg = log(q/al)
26 
27 C Find lower end of interval containing X
28  jl = -1
29  ju = nx+1
30  11 If (ju-jl .GT. 1) Then
31  jm = (ju+jl) / 2
32  If (x .GT. xv(jm)) Then
33  jl = jm
34  Else
35  ju = jm
36  Endif
37  goto 11
38  Endif
39 
40  jx = jl - (m-1)/2
41  If (x .lt. xmin .and. first ) Then
42  first = .false.
43  print '(A, 2(1pE12.4))',
44  > ' WARNING: X < Xmin, extrapolation used; X, Xmin =', x, xmin
45  If (jx .LT. 0) jx = 0
46  Elseif (jx .GT. nx-m) Then
47  jx = nx - m
48  Endif
49 C Find the interval where Q lies
50  jl = -1
51  ju = nt+1
52  12 If (ju-jl .GT. 1) Then
53  jm = (ju+jl) / 2
54  If (qg .GT. ql(jm)) Then
55  jl = jm
56  Else
57  ju = jm
58  Endif
59  goto 12
60  Endif
61 
62  jq = jl - (m-1)/2
63  If (jq .LT. 0) Then
64  jq = 0
65  If (q .lt. qini) print '(A, 2(1pE12.4))',
66  > ' WARNING: Q < Qini, extrapolation used; Q, Qini =', q, qini
67  Elseif (jq .GT. nt-m) Then
68  jq = nt - m
69  If (q .gt. qmax) print '(A, 2(1pE12.4))',
70  > ' WARNING: Q > Qmax, extrapolation used; Q, Qmax =', q, qmax
71  Endif
72 
73  If (iprtn .GE. 3) Then
74  ip = - iprtn
75  Else
76  ip = iprtn
77  EndIf
78 C Find the off-set in the linear array Upd
79  jfl = ip + nfmx
80  j0 = (jfl * (nt+1) + jq) * (nx+1) + jx
81 C
82 C Now interpolate in x for M1 Qs
83  Do 21 iq = 1, m1
84  j1 = j0 + (nx+1)*(iq-1) + 1
85  Call polint(xv(jx), upd(j1), m1, x, fq(iq), df(iq))
86  21 Continue
87 C Finish off by interpolating in Q
88  Call polint(ql(jq), fq(1), m1, qg, ftmp, ddf)
89 
90  partonx = ftmp
91 C
92  RETURN
93 C ****************************
94  END