1 subroutine CTEQ65evolve(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 = 204, MXQ = 25, MXF = 6, MaxVal=3, nhess = 40)
11 PARAMETER (MXPQX = (MXF+1+MaxVal) * 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)
19 common/masses_LHA/cMass,bMass,tMass
21 data pi / 3.141592653589793d0 /
25 call getnmem(iset,imem)
27 U = X * CtLhCtq65Pdf(imem,1,X,Q)
28 D = X * CtLhCtq65Pdf(imem,2,X,Q)
29 USEA = X * CtLhCtq65Pdf(imem,-1,X,Q)
30 DSEA = X * CtLhCtq65Pdf(imem,-2,X,Q)
31 STR = X * CtLhCtq65Pdf(imem,3,X,Q)
32 CHM = X * CtLhCtq65Pdf(imem,-4,X,Q)
33 BOT = X * CtLhCtq65Pdf(imem,-5,X,Q)
34 GLU = X * CtLhCtq65Pdf(imem,0,X,Q)
51 entry CTEQ65cevolve(x,Q,pdf) !like cteq65evolve, but allows c.ne.cbar and s.ne.sbar
54 call getnmem(iset,imem)
56 U = X * CtLhCtq65Pdf(imem,1,X,Q)
57 D = X * CtLhCtq65Pdf(imem,2,X,Q)
58 USEA = X * CtLhCtq65Pdf(imem,-1,X,Q)
59 DSEA = X * CtLhCtq65Pdf(imem,-2,X,Q)
60 STR = X * CtLhCtq65Pdf(imem,3,X,Q)
61 SBAR = X * CtLhCtq65Pdf(imem,-3,X,Q)
62 CHM = X * CtLhCtq65Pdf(imem,4,X,Q)
63 CBAR = X * CtLhCtq65Pdf(imem,-4,X,Q)
64 BOT = X * CtLhCtq65Pdf(imem,5,X,Q)
65 GLU = X * CtLhCtq65Pdf(imem,0,X,Q)
83 entry CTEQ65read(nset)
89 read(1,*)nmem(nset),ndef(nset) !*** nmem+1=number of members; ndef is not used for anything ***
90 if(nmem(nset) .gt. nhess) then
91 print *,'fatal error: nmem=',nmem(nset),' > nhess=',nhess
98 Read (1, *) Dr, Fl, Al, (Amass(I),I=1,6)
108 C This is the .pds (WKT) format
109 Read (1, *) N0, N0, N0, NfMx, N0, N0
111 Read (1, *) NX, NT, N0, N0, N0
112 Read (1, '(A)') (Line,I=1,4)
113 Read (1, *) QINI, QMAX, (aa,TV(I), I =0, NT)
116 Read (1, *) XMIN, aa, (XV(I), I =1, NX)
119 C Since quark = anti-quark for nfl>2 at this stage,
120 C we Read out only the non-redundent data points
121 C No of flavors = NfMx (sea) + 1 (gluon) + 2 (valence)
124 Nblk = (NX+1) * (NT+1)
125 Npts = Nblk * (NfMx+1+MxVal)
127 do ihess = 0,nmem(nset) !*** new version: allows nmem < nhess ***
131 Read (1, *, IOSTAT=IRET) (UPD(ihess,I), I=1,Npts)
136 entry CTEQ65cread(nset) !like CTEQ65read, but c.ne.cbar allowed
141 read(1,*)nmem(nset),ndef(nset) !*** nmem+1=number of members; ndef is not used for anything ***
142 if(nmem(nset) .gt. nhess) then
143 print *,'fatal error: nmem=',nmem(nset),' > nhess=',nhess
147 MxVal = 4 !one more species free
150 Read (1, *) Dr, Fl, Al, (Amass(I),I=1,6)
160 C This is the .pds (WKT) format
161 Read (1, *) N0, N0, N0, NfMx, N0, N0
163 Read (1, *) NX, NT, N0, N0, N0
164 Read (1, '(A)') (Line,I=1,4)
165 Read (1, *) QINI, QMAX, (aa,TV(I), I =0, NT)
168 Read (1, *) XMIN, aa, (XV(I), I =1, NX)
171 C we Read only the non-redundent data points
173 Nblk = (NX+1) * (NT+1)
174 Npts = Nblk * (NfMx+1+MxVal)
176 do ihess = 0,nmem(nset) !*** new version: allows nmem < nhess ***
180 Read (1, *, IOSTAT=IRET) (UPD(ihess,I), I=1,Npts)
185 entry CTEQ65alfa(alfas,Qalfa)
186 alfas = pi*CtLhALPI(Qalfa)
189 entry CTEQ65init(Eorder,Q2fit)
195 call setnmem(iset,mem)
201 Implicit Double Precision (A-H,O-Z)
202 common /ctq65co/ xlast, qlast, nxsave
209 c===========================================================================
210 Function CtLhPartonX65 (iset,IPRTN, XX, QQ)
211 c Given the parton distribution function in the array U in
212 c COMMON / PEVLDT / , this routine interpolates to find
213 c the parton distribution at an arbitray point in x and q.
215 Implicit Double Precision (A-H,O-Z)
217 PARAMETER (MXX = 204, MXQ = 25, MXF = 6, MaxVal=3, nhess = 40)
218 PARAMETER (MXPQX = (MXF+1+MaxVal) * MXQ * MXX)
221 > / CtqPar1nhess / Al, XV(0:MXX), TV(0:MXQ), UPD(0:nhess,MXPQX)
222 > / CtqPar2 / Nx, Nt, NfMx
223 > / XQrange / Qini, Qmax, Xmin
224 common /ctq65co/ xlast,qlast, nxsave
228 Dimension fvec(4), fij(4)
229 Dimension xvpow(0:mxx)
230 Data OneP / 1.00001 /
231 Data xpow / 0.3d0 / !**** choice of interpolation variable
234 save jq, jx, JLx, JLq, ss, sy2, sy3, s23, ty2, ty3
235 save const1 , const2, const3, const4, const5, const6
236 save tt, t13, t12, t23, t34 , t24, tmp1, tmp2, tdet
238 c store the powers used for interpolation on first call...
239 if(nx .ne. nxsave) then
243 xvpow(i) = xv(i)**xpow
250 if((x.lt.xmin).or.(x.gt.1.d0)) print 98,x
251 98 format(' WARNING: X=',e12.5,' OUT OF RANGE')
252 if((q.lt.qini).or.(q.gt.qmax)) print 99,q
253 99 format(' WARNING: Q=',e12.5,' OUT OF RANGE')
255 c skip the initialization in x if same as in the previous call.
256 if(x .eq. xlast) goto 100
259 c ------------- find lower end of interval containing x, i.e.,
260 c get jx such that xv(jx) .le. x .le. xv(jx+1)...
263 11 If (JU-JLx .GT. 1) Then
265 If (X .Ge. XV(JM)) Then
272 C Ix 0 1 2 Jx JLx Nx-2 Nx
273 C |---|---|---|...|---|-x-|---|...|---|---|
276 If (JLx .LE. -1) Then
277 Print '(A,1pE12.4)','Severe error: x <= 0 in CtLhPartonX65 x=',x
279 ElseIf (JLx .Eq. 0) Then
281 Elseif (JLx .LE. Nx-2) Then
283 C For interior points, keep x in the middle, as shown above
285 Elseif (JLx.Eq.Nx-1 .or. x.LT.OneP) Then
287 C We tolerate a slight over-shoot of one (OneP=1.00001),
288 C perhaps due to roundoff or whatever, but not more than that.
289 C Keep at least 4 points >= Jx
292 Print '(A,1pE12.4)','Severe error: x > 1 in CtLhPartonX65 x=',x
295 C ---------- Note: JLx uniquely identifies the x-bin; Jx does not.
297 C This is the variable to be interpolated in
300 If (JLx.Ge.2 .and. JLx.Le.Nx-2) Then
302 c initiation work for "interior bins": store the lattice points in s...
317 c constants needed for interpolating in s at fixed t lattice points...
324 sdet = s12*s34 - s1213*s2434
326 const5 = (s34*sy2-s2434*sy3)*tmp/s12
327 const6 = (s1213*sy2-s12*sy3)*tmp/s34
333 c skip the initialization in q if same as in the previous call.
334 if(q .eq. qlast) goto 110
339 c --------------Now find lower end of interval containing Q, i.e.,
340 c get jq such that qv(jq) .le. q .le. qv(jq+1)...
343 12 If (JU-JLq .GT. 1) Then
345 If (tt .GE. TV(JM)) Then
355 Elseif (JLq .LE. Nt-2) Then
356 C keep q in the middle, as shown above
359 C JLq .GE. Nt-1 case: Keep at least 4 points >= Jq.
363 C This is the interpolation variable in Q
365 If (JLq.GE.1 .and. JLq.LE.Nt-2) Then
366 c store the lattice points in t...
384 tdet = t12*t34 - tmp1*tmp2
390 c get the pdf function values at the lattice points...
391 c In this code, we store 10 flavors: u,ubar,d,dbar,s,sbar,c,cbar,b=bbar,g
392 c hence Iprtn=5 (b) is obtained from -5 (bbar)
394 If (Iprtn .GE. 5) Then
399 jtmp = ((Ip + NfMx)*(NT+1)+(jq-1))*(NX+1)+jx+1
403 J1 = jtmp + it*(NX+1)
406 C For the first 4 x points, interpolate x^2*f(x,Q)
407 C This applies to the two lowest bins JLx = 0, 1
408 C We cannot put the JLx.eq.1 bin into the "interior" section
409 C (as we do for q), since Upd(J1) is undefined.
411 fij(2) = Upd(iset,J1+1) * XV(1)**2
412 fij(3) = Upd(iset,J1+2) * XV(2)**2
413 fij(4) = Upd(iset,J1+3) * XV(3)**2
415 C Use CtLhPolint which allows x to be anywhere w.r.t. the grid
417 Call CtLhPolint4(XVpow(0), Fij(1), 4, ss, Fx, Dfx)
419 If (x .GT. 0D0) fvec(it) = Fx / x**2
420 C Pdf is undefined for x.eq.0
421 ElseIf (JLx .Eq. Nx-1) Then
422 C This is the highest x bin:
424 c** fix allow 4 consecutive elements with iset... mrw 19.9.2005
425 fij(1) = Upd(iset,j1)
426 fij(2) = Upd(iset,j1+1)
427 fij(3) = Upd(iset,j1+2)
428 fij(4) = Upd(iset,j1+3)
429 Call CtLhPolint4 (XVpow(Nx-3), Fij(1), 4, ss, Fx, Dfx)
435 C for all interior points, use Jon's in-line function
436 C This applied to (JLx.Ge.2 .and. JLx.Le.Nx-2)
437 c (This is cubic spline interpolation, as used by cteq; it was
438 c changed to polint in previous Durham releases (jcp).)
442 Fvec(it) = (const5*(Upd(iset,J1)
443 & - sf2*const1 + sf3*const2)
444 & + const6*(Upd(iset,J1+3)
445 & + sf2*const3 - sf3*const4)
446 & + sf2*sy3 - sf3*sy2) / s23
451 C We now have the four values Fvec(1:4)
452 c interpolate in t...
455 C 1st Q-bin, as well as extrapolation to lower Q
456 Call CtLhPolint4(TV(0), Fvec(1), 4, tt, ff, Dfq)
458 ElseIf (JLq .GE. Nt-1) Then
459 C Last Q-bin, as well as extrapolation to higher Q
460 Call CtLhPolint4(TV(Nt-3), Fvec(1), 4, tt, ff, Dfq)
462 C Interrior bins : (JLq.GE.1 .and. JLq.LE.Nt-2)
463 C which include JLq.Eq.1 and JLq.Eq.Nt-2, since Upd is defined for
464 C the full range QV(0:Nt) (in contrast to XV)
468 g1 = ( tf2*t13 - tf3*t12) / t23
469 g4 = (-tf2*t34 + tf3*t24) / t23
471 h00 = ((t34*ty2-tmp2*ty3)*(fvec(1)-g1)/t12
472 & + (tmp1*ty2-t12*ty3)*(fvec(4)-g4)/t34)
474 ff = (h00*ty2*ty3/tdet + tf2*ty3 - tf3*ty2) / t23
481 c===========================================================================
482 Function CtLhCtq65Pdf (iset,Iparton, X, Q)
483 Implicit Double Precision (A-H,O-Z)
486 > / CtqPar2 / Nx, Nt, NfMx
487 > / QCDtable / Alambda, Nfl, Iorder
492 If (X .lt. 0D0 .or. X .gt. 1D0) Then
493 Print *, 'X out of range in CtLhCtq65Pdf: ', X
496 If (Q .lt. Alambda) Then
497 Print *, 'Q out of range in CtLhCtq65Pdf: ', Q
501 c added to force pdf = 0.0 at x=1.0 exactly - mrw
502 if(x .eq. 1.0d0) then
507 If ((Iparton .lt. -NfMx .or. Iparton .gt. NfMx)) Then
509 C put a warning for calling extra flavor.
511 Print *, 'Warning: Iparton out of range in CtLhCtq65Pdf: '
518 CtLhCtq65Pdf = CtLhPartonX65 (iset,Iparton, X, Q)
519 if(CtLhCtq65Pdf.lt.0.D0) CtLhCtq65Pdf = 0.D0
523 C ********************