1 !***********************************************
5 ! Routine called by LHAPDF package for calculating
6 ! the value of all xpdfs at x and Q from replica KREP
7 ! in a (x,Q) point as called by NNPDF.LHgrid file.
9 ! In 'wrapevolve.f' the package calls:
10 ! IF(NAME(NSET).EQ.'NNPDF20intqed') call NNPDFINT20qedevolve(x,Q,f)
11 ! IF(NAME(NSET).EQ.'NNPDF20intqed') call NNPDFINT20qedread(nset)
12 ! IF(NAME(NSET).EQ.'NNPDF20intqed') call NNPDFINT20qedalfa(alfas,Q)
13 ! IF(NAME(NSET).EQ.'NNPDF20intqed') call NNPDFINT20qedinit(nset,Eorder,Q2fit)
15 !***********************************************
17 subroutine NNPDFINT20qedevolve(XIN,QIN,XPDF,XPHOTON)
20 include 'parmsetup.inc'
21 character*16 name(nmxset)
22 integer nmem(nmxset),ndef(nmxset),mmem
23 common/NAME/name,nmem,ndef,mmem
24 integer nset,iset,pdfmem
27 double precision gridx(nmxgridx),gridq(nmxgridq)
28 integer ngridx,ngridq,jx,jq
31 REAL*8 alfas,alphaNNPDF
32 REAL*8 Eorder,Q2fit,mass
37 common/nnpdf20CNREP/NREP
39 INTEGER NX,NXMAX,NQ2,NPL
40 PARAMETER(NX=100,NXMAX=100,NQ2=50)
43 REAL*8 Q2MIN,Q2MAX,XPDFMIN,XPDFMAX
44 REAL*8 XG(NXMAX,nmxset),Q2G(NQ2,nmxset),XPDFEV(NXMAX,NQ2,-6:7,0:MXREP)
46 ! This common different from NNPDF1.X
47 ! common/nnpdf20CPDFGR/XPDFEV,XG,Q2G,IX,IQ2
48 common/nnpdfallCPDFGR/XPDFEV,XG,Q2G,IX,IQ2
50 INTEGER ipt,imodev,ivfn,itmc
51 ! This common is the same as for NNPDF1.0
52 COMMON/nnpdf10EVFLAGS/ipt,imodev,ivfn,itmc
55 ! This common is the same as for NNPDF1.0
56 COMMON/nnpdf10EVSCALE/q20,q2
57 REAL*8 q2th(4:6),asref,q2ref
58 ! This common is the same as for NNPDF1.0
59 COMMON/nnpdf10vfns/q2th,asref,q2ref
64 REAL*8 X,XIN,Q,QIN,QAS,QQ,Q2,QQ2,XPDF(-6:6),XPHOTON
68 integer m,n,nmax,mmax,minq,maxq,midq,maxx,minx,midx
69 ! order of pol. interpolation
71 parameter(nmax=1e3,mmax=1e3)
72 double precision dy,x1,x2,y,x1a(mmax),x2a(nmax),ya(mmax,nmax)
73 integer ix1a(m),ix2a(n)
76 double precision XPDFMIN_INTER
77 parameter(XPDFMIN_INTER=1d-7)
89 ! Check kinematic point is within allowed range
91 call GetXminM(iset,KREP,XPDFMIN)
92 call GetXmaxM(iset,KREP,XPDFMAX)
93 call GetQ2maxM(iset,KREP,Q2MAX)
94 call GetQ2minM(iset,KREP,Q2MIN)
96 IF ( X.LT.XPDFMIN_INTER .OR. X.GT.XPDFMAX ) THEN
98 2000 FORMAT (2X,'PARTON INTERPOLATION: X OUT OF RANGE -- STOP')
99 IF ( X.LT.XPDFMIN_INTER ) X = XPDFMIN_INTER
100 IF ( X.GT.XPDFMAX ) X = XPDFMAX
101 write(6,*) "X= ",X," XMAX, XMIN = ",XPDFMAX,XPDFMIN
104 IF ( Q2.LT.Q2MIN .OR. Q2.GT.Q2MAX ) THEN
106 2001 FORMAT (2X,'PARTON INTERPOLATION: Q2 OUT OF RANGE -- STOP')
107 write(6,*) "Q2 ,Q2MIN, Q2MAX = ",Q2,Q2MIN,Q2MAX
108 if( Q2.LT.Q2MIN ) Q2 = Q2MIN
109 if( Q2.GT.Q2MAX ) Q2 = Q2MAX
112 ! FIND NEAREST POINTS IN THE GRID
117 IF(X.LT.XG(MIDX,iset)) THEN
122 IF((MAXX-MINX).GT.1) GO TO 10
129 IF(Q2.LT.Q2G(MIDQ,iset)) THEN
134 IF((MAXQ-MINQ).GT.1) GO TO 20
138 ! POLYNOMIAL INTERPOLATION
140 ! uncomment for 3rd order interp.
141 ! IF((IX+(M-1)/2).GT.NX) IX = NX - (M-1)/2
142 ! IF((IX-(M-1)/2).LT.1) IX = (M+1)/2
144 ! DO I = -(M-1)/2,(M-1)/2,1
146 ! IX1A(IDUM) = IX + I
148 ! IF((IQ2+(N-1)/2).GT.NQ2) IQ2 = NQ2 - (N-1)/2
149 ! IF((IQ2-(N-1)/2).LT.1) IQ2 = (N+1)/2
151 ! DO J = -(N-1)/2,(N-1)/2,1
153 ! IX2A(JDUM) = IQ2 + J
156 ! Assign grid for interpolation. M, N -> order of polyN interpolation
158 if(IX.ge.M/2.and.IX.le.(NX-M/2)) IX1A(I) = IX - M/2 + I
159 if(IX.lt.M/2) IX1A(I) = I
160 if(IX.gt.(NX-M/2)) IX1A(I) = (NX - M) + I
163 if(IX1A(I).le.0.or.IX1A(I).gt.NX) then
164 write(6,*) "Error in grids! "
165 write(6,*) "I, IXIA(I) = ",I, IX1A(I)
171 if(IQ2.ge.N/2.and.IQ2.le.(NQ2-N/2)) IX2A(J) = IQ2 - N/2 + J
172 if(IQ2.lt.N/2) IX2A(J) = J
173 if(IQ2.gt.(NQ2-N/2)) IX2A(J) = (NQ2 - N) + J
175 if(IX2A(J).le.0.or.IX2A(J).gt.NQ2) then
176 write(6,*) "Error in grids! "
177 write(6,*) "J, IXIA(J) = ",J,IX2A(J)
182 ! Define points where to evaluate interpolation
183 ! Choose between linear or logarithmic (x,Q2) interpolation
194 ! Choose between linear or logarithmic (x,Q2) interpolation
198 X1A(I)= dlog(XG(IX1A(I),iset))
200 X1A(I)= XG(IX1A(I),iset)
203 X2A(J) = dlog(Q2G(IX2A(J),iset))
204 YA(I,J) = XPDFEV(IX1A(I),IX2A(J),IPDF,KREP+offset)
208 ! 2D polynomial interpolation
209 call lh_polin2(x1a,x2a,ya,m,n,x1,x2,y,dy)
221 !********************************************************
223 !********************************************************
224 entry NNPDFINT20qedgetgrid(nset,ngridx,ngridq,gridx,gridq)
226 gridx(jx)=xg(jx,nset)
229 gridq(jq)=q2g(jq,nset)
234 !********************************************************
237 ENTRY NNPDFINT20qedread(nset)
239 READ(1,*)nmem(nset),ndef(nset)
241 ! Set number of members
242 call setnmem(nset,nmem)
246 IF(NXX.NE.NX)WRITE(*,*)"WARNING CHANGE NX ACCORDING TO .LHgrid"
248 READ(1,*) xg(ix,nset)
251 ! Read the grid in Q2
253 IF(NQQ2.NE.NQ2)WRITE(*,*)"WARNING CHANGE NQ2 ACCORDING TO .LHgrid"
256 READ(1,*) q2g(iq2,nset)
259 ! Read the number of replicas
262 ! Read the evolved xpdf grid for each replica
263 offset = 101*(nset-1)
267 READ(1,*) ( xpdfev(ix,iq2,ipdf,k+offset), ipdf=-6,7,1 )
274 !********************************************************
276 ENTRY NNPDFINT20qedalfa(alfas,QAS)
279 alfas = alphaNNPDF(QQ)
283 !********************************************************
285 ENTRY NNPDFINT20qedinit(nset,Eorder,Q2fit)
291 CALL GetOrderPDFM(nset,order)
294 CALL GetQ2fitM(nset,QQ2)
298 call GetQmassM(nset,4,mass)
300 call GetQmassM(nset,5,mass)
302 call GetQmassM(nset,6,mass)
306 q2th(i) = qth(i)**2d0
309 ! added for filling Fparm->asref
310 call initEVOLVEpdf(nset,mmem)
311 CALL GetAlfas(nset,alfas0,Q0)
317 !********************************************************
319 entry NNPDFINT20qedpdf(nset)
321 IF (pdfmem.LT.0) THEN
322 WRITE(*,*) 'NNPDF set:'
323 WRITE(*,*) 'PDF member out of range:'
324 WRITE(*,*) 'member = ',pdfmem
332 ! THE ROUTINES FOR THE POLYNOMIAL INTERPOLATION ARE INSIDE
333 ! THE wrapNNPDFgrid.f ROUTINE