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)
54 call CtLhbldat1 !this line was missing in previous releases (jcp)
55 call CtLhbldat2 !this line was missing in previous releases (jcp)
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)
69 cMass = Amass(4) !missing in previous releases(jcp)
70 bMass = Amass(5) !missing in previous releases(jcp)
71 tMass = Amass(6) !missing in previous releases(jcp)
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)
94 c ** do ihess = 0,nhess !*** old version ***
95 do ihess = 0,nmem(nset) !*** new version: allows nmem < nhess ***
99 Read (1, *, IOSTAT=IRET) (UPD(ihess,I), I=1,Npts)
104 entry CTEQ6alfa(alfas,Qalfa)
105 alfas = pi*CtLhALPI(Qalfa)
108 entry CTEQ6init(Eorder,Q2fit)
115 call setnmem(iset,mem)
120 SUBROUTINE CtLhPOLINT (XA,YA,N,X,Y,DY)
122 IMPLICIT DOUBLE PRECISION (A-H, O-Z)
123 C Adapted from "Numerical Recipes"
125 DIMENSION XA(N),YA(N),C(NMAX),D(NMAX)
130 IF (DIFT.LT.DIF) THEN
159 c===========================================================================
160 Function CtLhPartonX6 (iset,IPRTN, XX, QQ)
161 c Given the parton distribution function in the array U in
162 c COMMON / PEVLDT / , this routine interpolates to find
163 c the parton distribution at an arbitray point in x and q.
165 Implicit Double Precision (A-H,O-Z)
167 Parameter (MXX = 96, MXQ = 20, MXF = 5, nhess = 40)
168 Parameter (MXQX= MXQ * MXX, MXPQX = MXQX * (MXF+3))
171 > / CtqPar1nhess / Al, XV(0:MXX), TV(0:MXQ), UPD(0:nhess,MXPQX)
172 > / CtqPar2 / Nx, Nt, NfMx
173 > / XQrange / Qini, Qmax, Xmin
177 Dimension fvec(4), fij(4)
178 Dimension xvpow(0:mxx)
179 Data OneP / 1.00001 /
180 Data xpow / 0.3d0 / !**** choice of interpolation variable
185 save jq, jx, JLx, JLq, ss, sy2, sy3, s23, ty2, ty3
186 save const1 , const2, const3, const4, const5, const6
187 save tt, t13, t12, t23, t34 , t24, tmp1, tmp2, tdet
189 c store the powers used for interpolation on first call...
190 if(nx .ne. nxsave) then
194 xvpow(i) = xv(i)**xpow
201 c skip the initialization in x if same as in the previous call.
202 if(x .eq. xlast) goto 100
205 c ------------- find lower end of interval containing x, i.e.,
206 c get jx such that xv(jx) .le. x .le. xv(jx+1)...
209 11 If (JU-JLx .GT. 1) Then
211 If (X .Ge. XV(JM)) Then
218 C Ix 0 1 2 Jx JLx Nx-2 Nx
219 C |---|---|---|...|---|-x-|---|...|---|---|
222 If (JLx .LE. -1) Then
223 Print '(A,1pE12.4)','Severe error: x <= 0 in CtLhPartonX6 x=',x
225 ElseIf (JLx .Eq. 0) Then
227 Elseif (JLx .LE. Nx-2) Then
229 C For interior points, keep x in the middle, as shown above
231 Elseif (JLx.Eq.Nx-1 .or. x.LT.OneP) Then
233 C We tolerate a slight over-shoot of one (OneP=1.00001),
234 C perhaps due to roundoff or whatever, but not more than that.
235 C Keep at least 4 points >= Jx
238 Print '(A,1pE12.4)','Severe error: x > 1 in CtLhPartonX6 x=',x
241 C ---------- Note: JLx uniquely identifies the x-bin; Jx does not.
243 C This is the variable to be interpolated in
246 If (JLx.Ge.2 .and. JLx.Le.Nx-2) Then
248 c initiation work for "interior bins": store the lattice points in s...
263 c constants needed for interpolating in s at fixed t lattice points...
270 sdet = s12*s34 - s1213*s2434
272 const5 = (s34*sy2-s2434*sy3)*tmp/s12
273 const6 = (s1213*sy2-s12*sy3)*tmp/s34
279 c skip the initialization in q if same as in the previous call.
280 if(q .eq. qlast) goto 110
285 c --------------Now find lower end of interval containing Q, i.e.,
286 c get jq such that qv(jq) .le. q .le. qv(jq+1)...
289 12 If (JU-JLq .GT. 1) Then
291 If (tt .GE. TV(JM)) Then
301 Elseif (JLq .LE. Nt-2) Then
302 C keep q in the middle, as shown above
305 C JLq .GE. Nt-1 case: Keep at least 4 points >= Jq.
309 C This is the interpolation variable in Q
311 If (JLq.GE.1 .and. JLq.LE.Nt-2) Then
312 c store the lattice points in t...
330 tdet = t12*t34 - tmp1*tmp2
336 c get the pdf function values at the lattice points...
338 If (Iprtn .GE. 3) Then
343 jtmp = ((Ip + NfMx)*(NT+1)+(jq-1))*(NX+1)+jx+1
347 J1 = jtmp + it*(NX+1)
350 C For the first 4 x points, interpolate x^2*f(x,Q)
351 C This applies to the two lowest bins JLx = 0, 1
352 C We cannot put the JLx.eq.1 bin into the "interior" section
353 C (as we do for q), since Upd(J1) is undefined.
355 fij(2) = Upd(iset,J1+1) * XV(1)**2
356 fij(3) = Upd(iset,J1+2) * XV(2)**2
357 fij(4) = Upd(iset,J1+3) * XV(3)**2
359 C Use CtLhPolint which allows x to be anywhere w.r.t. the grid
361 Call CtLhPolint4(XVpow(0), Fij(1), 4, ss, Fx, Dfx)
363 If (x .GT. 0D0) Fvec(it) = Fx / x**2
364 C Pdf is undefined for x.eq.0
365 ElseIf (JLx .Eq. Nx-1) Then
366 C This is the highest x bin:
368 c** fix allow 4 consecutive elements with iset... mrw 19.9.2005
369 fij(1) = Upd(iset,j1)
370 fij(2) = Upd(iset,j1+1)
371 fij(3) = Upd(iset,j1+2)
372 fij(4) = Upd(iset,j1+3)
373 Call CtLhPolint4 (XVpow(Nx-3), Fij(1), 4, ss, Fx, Dfx)
379 C for all interior points, use Jon's in-line function
380 C This applied to (JLx.Ge.2 .and. JLx.Le.Nx-2)
381 c (This is cubic spline interpolation, as used by cteq; it was
382 c changed to polint in previous Durham releases (jcp).)
386 Fvec(it) = (const5*(Upd(iset,J1)
387 & - sf2*const1 + sf3*const2)
388 & + const6*(Upd(iset,J1+3)
389 & + sf2*const3 - sf3*const4)
390 & + sf2*sy3 - sf3*sy2) / s23
395 C We now have the four values Fvec(1:4)
396 c interpolate in t...
399 C 1st Q-bin, as well as extrapolation to lower Q
400 Call CtLhPolint4(TV(0), Fvec(1), 4, tt, ff, Dfq)
402 ElseIf (JLq .GE. Nt-1) Then
403 C Last Q-bin, as well as extrapolation to higher Q
404 Call CtLhPolint4(TV(Nt-3), Fvec(1), 4, tt, ff, Dfq)
406 C Interrior bins : (JLq.GE.1 .and. JLq.LE.Nt-2)
407 C which include JLq.Eq.1 and JLq.Eq.Nt-2, since Upd is defined for
408 C the full range QV(0:Nt) (in contrast to XV)
412 g1 = ( tf2*t13 - tf3*t12) / t23
413 g4 = (-tf2*t34 + tf3*t24) / t23
415 h00 = ((t34*ty2-tmp2*ty3)*(fvec(1)-g1)/t12
416 & + (tmp1*ty2-t12*ty3)*(fvec(4)-g4)/t34)
418 ff = (h00*ty2*ty3/tdet + tf2*ty3 - tf3*ty2) / t23
424 C ********************
426 c===========================================================================
427 Function CtLhCtq6Pdf (iset,Iparton, X, Q)
428 Implicit Double Precision (A-H,O-Z)
431 > / CtqPar2 / Nx, Nt, NfMx
432 > / QCDtable / Alambda, Nfl, Iorder
437 If (X .lt. 0D0 .or. X .gt. 1D0) Then
438 Print *, 'X out of range in CtLhCtq6Pdf: ', X
441 If (Q .lt. Alambda) Then
442 Print *, 'Q out of range in CtLhCtq6Pdf: ', Q
446 c added to force pdf = 0.0 at x=1.0 exactly - mrw
447 if(x .eq. 1.0d0) then
452 If ((Iparton .lt. -NfMx .or. Iparton .gt. NfMx)) Then
454 C put a warning for calling extra flavor.
456 Print *, 'Warning: Iparton out of range in CtLhCtq6Pdf: '
463 CtLhCtq6Pdf = CtLhPartonX6 (iset,Iparton, X, Q)
464 if(CtLhCtq6Pdf.lt.0.D0) CtLhCtq6Pdf = 0.D0
468 C ********************
470 SUBROUTINE CtLhPOLINT4 (XA,YA,N,X,Y,DY)
471 c fast version of polint, valid only for N=4
472 c Have explicitly unrolled the loops.
474 IMPLICIT DOUBLE PRECISION (A-H, O-Z)
477 DIMENSION XA(N),YA(N),C(NMAX),D(NMAX)
480 print *,'fatal CtLhPolint4 call',n
488 IF (DIFT.LT.DIF) THEN
496 IF (DIFT.LT.DIF) THEN
504 IF (DIFT.LT.DIF) THEN
512 IF (DIFT.LT.DIF) THEN
594 SUBROUTINE CTLHPOLINT3 (XA,YA,N,X,Y,DY)
595 c fast version of polint, valid only for N=3
596 c Have explicitly unrolled the loops.
597 IMPLICIT DOUBLE PRECISION (A-H, O-Z)
599 DIMENSION XA(N),YA(N),C(NMAX),D(NMAX)
601 print *,'fatal CtLhPolint3 call',n
607 IF (DIFT.LT.DIF) THEN
614 IF (DIFT.LT.DIF) THEN
621 IF (DIFT.LT.DIF) THEN