1 subroutine CTEQ6evolve(x,Q,pdf)
2 implicit real*8(a-h,o-z)
3 include 'parmsetup.inc'
4 character*16 name(nmxset)
5 integer nmem(nmxset),ndef(nmxset),mmem
6 common/NAME/name,nmem,ndef,mmem
10 PARAMETER (MXX = 96, MXQ = 20, MXF = 5, nhess = 40)
11 PARAMETER (MXPQX = (MXF + 3) * MXQ * MXX)
13 > / CtqPar1nhess / Al, XV(0:MXX), TV(0:MXQ), UPD(0:nhess,MXPQX)
14 > / CtqPar2 / Nx, Nt, NfMx
15 > / XQrange / Qini, Qmax, Xmin
16 > / QCDtable / Alambda, Nfl, Iorder
17 > / Masstbl / Amass(6)
18 common/masses_LHA/cMass,bMass,tMass
19 data pi / 3.141592653589793d0 /
23 call getnmem(iset,imem)
25 U = X * CtLhCtq6Pdf(imem,1,X,Q)
26 D = X * CtLhCtq6Pdf(imem,2,X,Q)
27 USEA = X * CtLhCtq6Pdf(imem,-1,X,Q)
28 DSEA = X * CtLhCtq6Pdf(imem,-2,X,Q)
29 STR = X * CtLhCtq6Pdf(imem,3,X,Q)
30 CHM = X * CtLhCtq6Pdf(imem,4,X,Q)
31 BOT = X * CtLhCtq6Pdf(imem,5,X,Q)
32 GLU = X * CtLhCtq6Pdf(imem,0,X,Q)
57 read(1,*)nmem(nset),ndef(nset) !*** nmem+1=number of members; ndef is not used for anything ***
58 if(nmem(nset) .gt. nhess) then
59 print *,'fatal error: nmem=',nmem(nset),' > nhess=',nhess
64 Read (1, *) Dr, Fl, Al, (Amass(I),I=1,6)
74 Read (1, *) NX, NT, NfMx
77 Read (1, *) QINI, QMAX, (TV(I), I =0, NT)
80 Read (1, *) XMIN, (XV(I), I =0, NX)
83 TV(Iq) = Log(Log (TV(Iq) /Al))
86 C Since quark = anti-quark for nfl>2 at this stage,
87 C we Read out only the non-redundent data points
88 C No of flavors = NfMx (sea) + 1 (gluon) + 2 (valence)
90 Nblk = (NX+1) * (NT+1)
91 Npts = Nblk * (NfMx+3)
93 do ihess = 0,nmem(nset) !*** new version: allows nmem < nhess ***
97 Read (1, *, IOSTAT=IRET) (UPD(ihess,I), I=1,Npts)
102 entry CTEQ6alfa(alfas,Qalfa)
103 alfas = pi*CtLhALPI(Qalfa)
106 entry CTEQ6init(Eorder,Q2fit)
113 call setnmem(iset,mem)
119 Implicit Double Precision (A-H,O-Z)
120 common /ctq6co/ xlast, qlast, nxsave
127 c===========================================================================
128 Function CtLhPartonX6 (iset,IPRTN, XX, QQ)
129 c Given the parton distribution function in the array U in
130 c COMMON / PEVLDT / , this routine interpolates to find
131 c the parton distribution at an arbitray point in x and q.
133 Implicit Double Precision (A-H,O-Z)
135 Parameter (MXX = 96, MXQ = 20, MXF = 5, nhess = 40)
136 Parameter (MXQX= MXQ * MXX, MXPQX = MXQX * (MXF+3))
139 > / CtqPar1nhess / Al, XV(0:MXX), TV(0:MXQ), UPD(0:nhess,MXPQX)
140 > / CtqPar2 / Nx, Nt, NfMx
141 > / XQrange / Qini, Qmax, Xmin
143 common /ctq6co/ xlast, qlast, nxsave
146 Dimension fvec(4), fij(4)
147 Dimension xvpow(0:mxx)
148 Data OneP / 1.00001 /
149 Data xpow / 0.3d0 / !**** choice of interpolation variable
152 save jq, jx, JLx, JLq, ss, sy2, sy3, s23, ty2, ty3
153 save const1 , const2, const3, const4, const5, const6
154 save tt, t13, t12, t23, t34 , t24, tmp1, tmp2, tdet
156 c store the powers used for interpolation on first call...
157 if(nx .ne. nxsave) then
161 xvpow(i) = xv(i)**xpow
168 if((x.lt.xmin).or.(x.gt.1.d0)) print 98,x
169 98 format(' WARNING: X=',e12.5,' OUT OF RANGE')
170 if((q.lt.qini).or.(q.gt.qmax)) print 99,q
171 99 format(' WARNING: Q=',e12.5,' OUT OF RANGE')
173 c skip the initialization in x if same as in the previous call.
174 if(x .eq. xlast) goto 100
177 c ------------- find lower end of interval containing x, i.e.,
178 c get jx such that xv(jx) .le. x .le. xv(jx+1)...
181 11 If (JU-JLx .GT. 1) Then
183 If (X .Ge. XV(JM)) Then
190 C Ix 0 1 2 Jx JLx Nx-2 Nx
191 C |---|---|---|...|---|-x-|---|...|---|---|
194 If (JLx .LE. -1) Then
195 Print '(A,1pE12.4)','Severe error: x <= 0 in CtLhPartonX6 x=',x
197 ElseIf (JLx .Eq. 0) Then
199 Elseif (JLx .LE. Nx-2) Then
201 C For interior points, keep x in the middle, as shown above
203 Elseif (JLx.Eq.Nx-1 .or. x.LT.OneP) Then
205 C We tolerate a slight over-shoot of one (OneP=1.00001),
206 C perhaps due to roundoff or whatever, but not more than that.
207 C Keep at least 4 points >= Jx
210 Print '(A,1pE12.4)','Severe error: x > 1 in CtLhPartonX6 x=',x
213 C ---------- Note: JLx uniquely identifies the x-bin; Jx does not.
215 C This is the variable to be interpolated in
218 If (JLx.Ge.2 .and. JLx.Le.Nx-2) Then
220 c initiation work for "interior bins": store the lattice points in s...
235 c constants needed for interpolating in s at fixed t lattice points...
242 sdet = s12*s34 - s1213*s2434
244 const5 = (s34*sy2-s2434*sy3)*tmp/s12
245 const6 = (s1213*sy2-s12*sy3)*tmp/s34
251 c skip the initialization in q if same as in the previous call.
252 if(q .eq. qlast) goto 110
257 c --------------Now find lower end of interval containing Q, i.e.,
258 c get jq such that qv(jq) .le. q .le. qv(jq+1)...
261 12 If (JU-JLq .GT. 1) Then
263 If (tt .GE. TV(JM)) Then
273 Elseif (JLq .LE. Nt-2) Then
274 C keep q in the middle, as shown above
277 C JLq .GE. Nt-1 case: Keep at least 4 points >= Jq.
281 C This is the interpolation variable in Q
283 If (JLq.GE.1 .and. JLq.LE.Nt-2) Then
284 c store the lattice points in t...
302 tdet = t12*t34 - tmp1*tmp2
308 c get the pdf function values at the lattice points...
309 c In this code, we store 8 flavors: u,ubar,d,dbar,s=sbar,c=cbar,b=bbar,g
310 c hence Iprtn=3,4,5 (s,c,b) are obtained from -3,-4,-5 (sbar,cbar,bbar)
312 If (Iprtn .GE. 3) Then
317 jtmp = ((Ip + NfMx)*(NT+1)+(jq-1))*(NX+1)+jx+1
321 J1 = jtmp + it*(NX+1)
324 C For the first 4 x points, interpolate x^2*f(x,Q)
325 C This applies to the two lowest bins JLx = 0, 1
326 C We cannot put the JLx.eq.1 bin into the "interior" section
327 C (as we do for q), since Upd(J1) is undefined.
329 fij(2) = Upd(iset,J1+1) * XV(1)**2
330 fij(3) = Upd(iset,J1+2) * XV(2)**2
331 fij(4) = Upd(iset,J1+3) * XV(3)**2
333 C Use CtLhPolint which allows x to be anywhere w.r.t. the grid
335 Call CtLhPolint4(XVpow(0), Fij(1), 4, ss, Fx, Dfx)
337 If (x .GT. 0D0) Fvec(it) = Fx / x**2
338 C Pdf is undefined for x.eq.0
339 ElseIf (JLx .Eq. Nx-1) Then
340 C This is the highest x bin:
342 c** fix allow 4 consecutive elements with iset... mrw 19.9.2005
343 fij(1) = Upd(iset,j1)
344 fij(2) = Upd(iset,j1+1)
345 fij(3) = Upd(iset,j1+2)
346 fij(4) = Upd(iset,j1+3)
347 Call CtLhPolint4 (XVpow(Nx-3), Fij(1), 4, ss, Fx, Dfx)
353 C for all interior points, use Jon's in-line function
354 C This applied to (JLx.Ge.2 .and. JLx.Le.Nx-2)
355 c (This is cubic spline interpolation, as used by cteq; it was
356 c changed to polint in previous Durham releases (jcp).)
360 Fvec(it) = (const5*(Upd(iset,J1)
361 & - sf2*const1 + sf3*const2)
362 & + const6*(Upd(iset,J1+3)
363 & + sf2*const3 - sf3*const4)
364 & + sf2*sy3 - sf3*sy2) / s23
369 C We now have the four values Fvec(1:4)
370 c interpolate in t...
373 C 1st Q-bin, as well as extrapolation to lower Q
374 Call CtLhPolint4(TV(0), Fvec(1), 4, tt, ff, Dfq)
376 ElseIf (JLq .GE. Nt-1) Then
377 C Last Q-bin, as well as extrapolation to higher Q
378 Call CtLhPolint4(TV(Nt-3), Fvec(1), 4, tt, ff, Dfq)
380 C Interrior bins : (JLq.GE.1 .and. JLq.LE.Nt-2)
381 C which include JLq.Eq.1 and JLq.Eq.Nt-2, since Upd is defined for
382 C the full range QV(0:Nt) (in contrast to XV)
386 g1 = ( tf2*t13 - tf3*t12) / t23
387 g4 = (-tf2*t34 + tf3*t24) / t23
389 h00 = ((t34*ty2-tmp2*ty3)*(fvec(1)-g1)/t12
390 & + (tmp1*ty2-t12*ty3)*(fvec(4)-g4)/t34)
392 ff = (h00*ty2*ty3/tdet + tf2*ty3 - tf3*ty2) / t23
398 C ********************
400 c===========================================================================
401 Function CtLhCtq6Pdf (iset,Iparton, X, Q)
402 Implicit Double Precision (A-H,O-Z)
405 > / CtqPar2 / Nx, Nt, NfMx
406 > / QCDtable / Alambda, Nfl, Iorder
411 If (X .lt. 0D0 .or. X .gt. 1D0) Then
412 Print *, 'X out of range in CtLhCtq6Pdf: ', X
415 If (Q .lt. Alambda) Then
416 Print *, 'Q out of range in CtLhCtq6Pdf: ', Q
420 c added to force pdf = 0.0 at x=1.0 exactly - mrw
421 if(x .eq. 1.0d0) then
426 If ((Iparton .lt. -NfMx .or. Iparton .gt. NfMx)) Then
428 C put a warning for calling extra flavor.
430 Print *, 'Warning: Iparton out of range in CtLhCtq6Pdf: '
437 CtLhCtq6Pdf = CtLhPartonX6 (iset,Iparton, X, Q)
438 if(CtLhCtq6Pdf.lt.0.D0) CtLhCtq6Pdf = 0.D0
442 C ********************
444 SUBROUTINE CtLhPOLINT4 (XA,YA,N,X,Y,DY)
445 c fast version of polint, valid only for N=4
446 c Have explicitly unrolled the loops.
448 IMPLICIT DOUBLE PRECISION (A-H, O-Z)
451 DIMENSION XA(N),YA(N),C(NMAX),D(NMAX)
454 print *,'fatal CtLhPolint4 call',n
462 IF (DIFT.LT.DIF) THEN
470 IF (DIFT.LT.DIF) THEN
478 IF (DIFT.LT.DIF) THEN
486 IF (DIFT.LT.DIF) THEN
568 SUBROUTINE CTLHPOLINT3 (XA,YA,N,X,Y,DY)
569 c fast version of polint, valid only for N=3
570 c Have explicitly unrolled the loops.
571 IMPLICIT DOUBLE PRECISION (A-H, O-Z)
573 DIMENSION XA(N),YA(N),C(NMAX),D(NMAX)
575 print *,'fatal CtLhPolint3 call',n
581 IF (DIFT.LT.DIF) THEN
588 IF (DIFT.LT.DIF) THEN
595 IF (DIFT.LT.DIF) THEN