4 subroutine CTEQ6evolve(x,Q,pdf)
5 implicit real*8(a-h,o-z)
6 include 'parmsetup.inc'
7 character*16 name(nmxset)
8 integer nmem(nmxset),ndef(nmxset),mmem
9 common/NAME/name,nmem,ndef,mmem
13 PARAMETER (MXX = 96, MXQ = 20, MXF = 5, nhess = 40)
14 PARAMETER (MXPQX = (MXF + 3) * MXQ * MXX)
17 & Al(nmxset), XV(0:MXX,nmxset), TV(0:MXQ,nmxset), &
18 & UPD(0:nhess,MXPQX,nmxset) &
19 & / CtqPar2 / Nx(nmxset), Nt(nmxset), NfMx(nmxset) &
20 & / XQrange / Qini(nmxset), Qmax(nmxset), Xmin(nmxset) &
21 & / QCDtable / Alambda(nmxset), Nfl(nmxset), Iorder(nmxset) &
22 & / Masstbl / Amass(6,nmxset)
23 common/masses_LHA/cMass(nmxset),bMass(nmxset),tMass(nmxset)
24 data pi / 3.141592653589793d0 /
28 call getnmem(iset,imem)
30 U = X * CtLhCtq6Pdf(imem,1,X,Q)
31 D = X * CtLhCtq6Pdf(imem,2,X,Q)
32 USEA = X * CtLhCtq6Pdf(imem,-1,X,Q)
33 DSEA = X * CtLhCtq6Pdf(imem,-2,X,Q)
34 STR = X * CtLhCtq6Pdf(imem,3,X,Q)
35 CHM = X * CtLhCtq6Pdf(imem,4,X,Q)
36 BOT = X * CtLhCtq6Pdf(imem,5,X,Q)
37 GLU = X * CtLhCtq6Pdf(imem,0,X,Q)
61 !*** nmem+1=number of member
62 read(1,*)nmem(nset),ndef(nset)
63 if(nmem(nset) .gt. nhess) then
64 print *,'fatal error: nmem=',nmem(nset),' > nhess=',nhess
69 Read (1, *) Dr, Fl, Al(nset), (Amass(I,nset),I=1,6)
70 Iorder(nset) = Nint(Dr)
72 Alambda(nset) = Al(nset)
74 cMass(nset) = Amass(4,nset)
75 bMass(nset) = Amass(5,nset)
76 tMass(nset) = Amass(6,nset)
79 Read (1, *) NX(nset), NT(nset), NfMx(nset)
83 & QINI(nset), QMAX(nset), (TV(I,nset), I =0, NT(nset))
86 Read (1, *) XMIN(nset), (XV(I,nset), I =0, NX(nset))
88 Do 11 Iq = 0, NT(nset)
89 TV(Iq,nset) = Log(Log (TV(Iq,nset) /Al(nset)))
92 ! Since quark = anti-quark for nfl>2 at this stage,
93 ! we Read out only the non-redundent data points
94 ! No of flavors = NfMx (sea) + 1 (gluon) + 2 (valence)
96 Nblk = (NX(nset)+1) * (NT(nset)+1)
97 Npts = Nblk * (NfMx(nset)+3)
99 !*** new version: allows nm
100 do ihess = 0,nmem(nset)
104 Read (1, *, IOSTAT=IRET) (UPD(ihess,I,nset), I=1,Npts)
109 entry CTEQ6alfa(alfas,Qalfa)
110 alfas = pi*CtLhALPI(Qalfa)
113 entry CTEQ6init(Eorder,Q2fit)
120 call setnmem(iset,mem)
126 Implicit Double Precision (A-H,O-Z)
127 common /ctq6co/ xlast, qlast, nxsave
134 !=======================================================================
135 Function CtLhPartonX6 (imem,IPRTN, XX, QQ)
136 ! Given the parton distribution function in the array U in
137 ! COMMON / PEVLDT / , this routine interpolates to find
138 ! the parton distribution at an arbitray point in x and q.
140 Implicit Double Precision (A-H,O-Z)
142 include 'parmsetup.inc'
143 Parameter (MXX = 96, MXQ = 20, MXF = 5, nhess = 40)
144 Parameter (MXQX= MXQ * MXX, MXPQX = MXQX * (MXF+3))
148 & Al(nmxset), XV(0:MXX,nmxset), TV(0:MXQ,nmxset), &
149 & UPD(0:nhess,MXPQX,nmxset) &
150 & / CtqPar2 / Nx(nmxset), Nt(nmxset), NfMx(nmxset) &
151 & / XQrange / Qini(nmxset), Qmax(nmxset), Xmin(nmxset)
153 common /ctq6co/ xlast, qlast, nxsave
156 Dimension fvec(4), fij(4)
157 Dimension xvpow(0:mxx)
158 Data OneP / 1.00001 /
159 !**** choice of interpolation variable
162 Data ixprint,iqprint/0,0/
165 save jq, jx, JLx, JLq, ss, sy2, sy3, s23, ty2, ty3
166 save const1 , const2, const3, const4, const5, const6
167 save tt, t13, t12, t23, t34 , t24, tmp1, tmp2, tdet
171 call getnmem(iset,imem)
173 ! store the powers used for interpolation on first call...
174 if(nx(iset).ne. nxsave) then
178 xvpow(i) = xv(i,iset)**xpow
185 if((x.lt.xmin(iset)).or.(x.gt.1.d0)) then
187 if(ixprint.lt.11) print 98,x
188 if(ixprint.eq.10) print *, &
189 & 'more warning messages like the last suppressed.'
191 98 format(' WARNING: X=',e12.5,' OUT OF RANGE')
192 if((q.lt.qini(iset)).or.(q.gt.qmax(iset))) then
194 if(iqprint.lt.11) print 99,q
195 if(iqprint.eq.10) print *, &
196 & 'more warning messages like the last suppressed.'
198 99 format(' WARNING: Q=',e12.5,' OUT OF RANGE')
200 ! skip the initialization in x if same as in the previous call.
201 if(x .eq. xlast) goto 100
204 ! ------------- find lower end of interval containing x, i.e.,
205 ! get jx such that xv(jx) .le. x .le. xv(jx+1)...
208 11 If (JU-JLx .GT. 1) Then
210 If (X .Ge. XV(JM,iset)) Then
217 ! Ix 0 1 2 Jx JLx Nx-2 Nx
218 ! |---|---|---|...|---|-x-|---|...|---|---|
221 If (JLx .LE. -1) Then
222 Print '(A,1pE12.4)','Severe error: x <= 0 in CtLhPartonX6 x=',x
224 ElseIf (JLx .Eq. 0) Then
226 Elseif (JLx .LE. Nx(iset)-2) Then
228 ! For interior points, keep x in the middle, as shown abo
230 Elseif (JLx.Eq.Nx(iset)-1 .or. x.LT.OneP) Then
232 ! We tolerate a slight over-shoot of one (OneP=1.00001)
233 ! perhaps due to roundoff or whatever, but not more than th
234 ! Keep at least 4 points >= Jx
237 Print '(A,1pE12.4)','Severe error: x > 1 in CtLhPartonX6 x=',x
240 ! ---------- Note: JLx uniquely identifies the x-bin; Jx does n
242 ! This is the variable to be interpolated in
245 If (JLx.Ge.2 .and. JLx.Le.Nx(iset)-2) Then
247 ! initiation work for "interior bins": store the lattice points in s
262 ! constants needed for interpolating in s at fixed t lattice points...
269 sdet = s12*s34 - s1213*s2434
271 const5 = (s34*sy2-s2434*sy3)*tmp/s12
272 const6 = (s1213*sy2-s12*sy3)*tmp/s34
278 ! skip the initialization in q if same as in the previous call.
279 if(q .eq. qlast) goto 110
282 tt = log(log(Q/Al(iset)))
284 ! --------------Now find lower end of interval containing Q, i.e
285 ! get jq such that qv(jq) .le. q .le. qv(jq+1).
288 12 If (JU-JLq .GT. 1) Then
290 If (tt .GE. TV(JM,iset)) Then
300 Elseif (JLq .LE. Nt(iset)-2) Then
301 ! keep q in the middle, as shown above
304 ! JLq .GE. Nt-1 case: Keep at least 4 points >=
308 ! This is the interpolation variable i
310 If (JLq.GE.1 .and. JLq.LE.Nt(iset)-2) Then
311 ! store the lattice points in t..
313 tvec2 = Tv(jq+1,iset)
314 tvec3 = Tv(jq+2,iset)
315 tvec4 = Tv(jq+3,iset)
329 tdet = t12*t34 - tmp1*tmp2
335 ! get the pdf function values at the lattice points...
336 ! In this code, we store 8 flavors: u,ubar,d,dbar,s=sbar,c=cbar,b=bbar,g
337 ! hence Iprtn=3,4,5 (s,c,b) are obtained from -3,-4,-5 (sbar,cbar,bbar)
339 If (Iprtn .GE. 3) Then
344 jtmp = ((Ip + NfMx(iset))*(NT(iset)+1)+(jq-1))*(NX(iset)+1)+jx+1
348 J1 = jtmp + it*(NX(iset)+1)
351 ! For the first 4 x points, interpolate x^2*f(x
352 ! This applies to the two lowest bins JLx = 0,
353 ! We cannot put the JLx.eq.1 bin into the "interior" section
354 ! (as we do for q), since Upd(J1) is undefined
356 fij(2) = Upd(imem,J1+1,iset) * XV(1,iset)**2
357 fij(3) = Upd(imem,J1+2,iset) * XV(2,iset)**2
358 fij(4) = Upd(imem,J1+3,iset) * XV(3,iset)**2
360 ! Use CtLhPolint which allows x to be anywhere w.r.t. th
362 Call CtLhPolint4(XVpow(0), Fij(1), 4, ss, Fx, Dfx)
364 If (x .GT. 0D0) Fvec(it) = Fx / x**2
365 ! Pdf is undefined for x.eq
366 ElseIf (JLx .Eq. Nx(iset)-1) Then
367 ! This is the highest x b
369 !** fix allow 4 consecutive elements with imem... mrw 19.9.2005
370 fij(1) = Upd(imem,j1,iset)
371 fij(2) = Upd(imem,j1+1,iset)
372 fij(3) = Upd(imem,j1+2,iset)
373 fij(4) = Upd(imem,j1+3,iset)
374 Call CtLhPolint4 (XVpow(Nx(iset)-3), Fij(1), 4, ss, Fx, Dfx)
380 ! for all interior points, use Jon's in-line function
381 ! This applied to (JLx.Ge.2 .and. JLx.Le.Nx-2)
382 ! (This is cubic spline interpolation, as used by cteq; it was
383 ! changed to polint in previous Durham releases (jcp).)
384 sf2 = Upd(imem,J1+1,iset)
385 sf3 = Upd(imem,J1+2,iset)
387 Fvec(it) = (const5*(Upd(imem,J1,iset) &
388 & - sf2*const1 + sf3*const2) &
389 & + const6*(Upd(imem,J1+3,iset) &
390 & + sf2*const3 - sf3*const4) &
391 & + sf2*sy3 - sf3*sy2) / s23
396 ! We now have the four values Fvec(1:4
397 ! interpolate in t...
400 ! 1st Q-bin, as well as extrapolation to lower Q
401 Call CtLhPolint4(TV(0,iset), Fvec(1), 4, tt, ff, Dfq)
403 ElseIf (JLq .GE. Nt(iset)-1) Then
404 ! Last Q-bin, as well as extrapolation to higher
405 Call CtLhPolint4(TV(Nt(iset)-3,iset), Fvec(1), 4, tt, ff, Dfq)
407 ! Interrior bins : (JLq.GE.1 .and. JLq.LE.Nt-2)
408 ! which include JLq.Eq.1 and JLq.Eq.Nt-2, since Upd is defined for
409 ! the full range QV(0:Nt) (in contrast to XV)
413 g1 = ( tf2*t13 - tf3*t12) / t23
414 g4 = (-tf2*t34 + tf3*t24) / t23
416 h00 = ((t34*ty2-tmp2*ty3)*(fvec(1)-g1)/t12 &
417 & + (tmp1*ty2-t12*ty3)*(fvec(4)-g4)/t34)
419 ff = (h00*ty2*ty3/tdet + tf2*ty3 - tf3*ty2) / t23
425 ! ********************
427 !=======================================================================
428 Function CtLhCtq6Pdf (imem,Iparton, X, Q)
429 Implicit Double Precision (A-H,O-Z)
430 include 'parmsetup.inc'
433 & / CtqPar2 / Nx(nmxset), Nt(nmxset), NfMx(nmxset) &
434 & / QCDtable / Alambda(nmxset), Nfl(nmxset), Iorder(nmxset)
441 If (X .lt. 0D0 .or. X .gt. 1D0) Then
442 Print *, 'X out of range in CtLhCtq6Pdf: ', X
445 If (Q .lt. Alambda(iset)) Then
446 Print *, 'Q out of range in CtLhCtq6Pdf: ', Q
450 ! added to force pdf = 0.0 at x=1.0 exactly - mrw
451 if(x .eq. 1.0d0) then
456 If ((Iparton .lt. -NfMx(iset) .or. Iparton .gt. NfMx(iset))) Then
458 ! put a warning for calling extra flavor.
460 Print *, 'Warning: Iparton out of range in CtLhCtq6Pdf: ' &
467 CtLhCtq6Pdf = CtLhPartonX6 (imem,Iparton, X, Q)
468 if(CtLhCtq6Pdf.lt.0.D0) CtLhCtq6Pdf = 0.D0
472 ! ********************
474 SUBROUTINE CtLhPOLINT4 (XA,YA,N,X,Y,DY)
475 ! fast version of polint, valid only for N=4
476 ! Have explicitly unrolled the loops.
478 IMPLICIT DOUBLE PRECISION (A-H, O-Z)
481 DIMENSION XA(N),YA(N),C(NMAX),D(NMAX)
484 print *,'fatal CtLhPolint4 call',n
492 IF (DIFT.LT.DIF) THEN
500 IF (DIFT.LT.DIF) THEN
508 IF (DIFT.LT.DIF) THEN
516 IF (DIFT.LT.DIF) THEN
598 SUBROUTINE CTLHPOLINT3 (XA,YA,N,X,Y,DY)
599 ! fast version of polint, valid only for N=3
600 ! Have explicitly unrolled the loops.
601 IMPLICIT DOUBLE PRECISION (A-H, O-Z)
603 DIMENSION XA(N),YA(N),C(NMAX),D(NMAX)
605 print *,'fatal CtLhPolint3 call',n
611 IF (DIFT.LT.DIF) THEN
618 IF (DIFT.LT.DIF) THEN
625 IF (DIFT.LT.DIF) THEN