20 integer nfl,nx,nq2,mem,rep,lenfilename
21 double precision alphas
22 double precision xgrid(100),logxgrid(100)
23 double precision q2grid(50),logq2grid(50)
24 double precision pdfgrid(0:100,14,100,50)
26 common /nnpdf/nfl,nx,nq2,mem,rep,hasphoton,alphas,xgrid,logxgrid,
27 1 q2grid,logq2grid,pdfgrid
29 character(len=lenfilename) gridfilename
39 write(6,*)
" ****************************************"
41 write(6,*)
" NNPDFDriver version 1.0.3"
42 write(6,*)
" Grid: ", gridfilename
43 write(6,*)
" ****************************************"
53 integer nfl,nx,nq2,mem,rep
54 double precision alphas
55 double precision xgrid(100),logxgrid(100)
56 double precision q2grid(50),logq2grid(50)
57 double precision pdfgrid(0:100,14,100,50)
59 common /nnpdf/nfl,nx,nq2,mem,rep,hasphoton,alphas,xgrid,logxgrid,
60 1 q2grid,logq2grid,pdfgrid
62 if (irep.gt.mem.or.irep.lt.0d0)
then
63 write(6,*)
"Error: replica out of range [0,",mem,
"]"
70 subroutine readpdfset(gridfilename,lenfilename)
72 integer i,ix,iq,fl,imem,lenfilename
73 character(len=lenfilename) gridfilename
74 character(len=100) line
76 integer nfl,nx,nq2,mem,rep
77 double precision alphas
78 double precision xgrid(100),logxgrid(100)
79 double precision q2grid(50),logq2grid(50)
80 double precision pdfgrid(0:100,14,100,50)
82 common /nnpdf/nfl,nx,nq2,mem,rep,hasphoton,alphas,xgrid,logxgrid,
83 1 q2grid,logq2grid,pdfgrid
85 open (20, file=gridfilename, status=
'OLD')
89 if (line(1:14).eq.
'Parameterlist:')
then
90 read(20,*) line, mem, line, alphas
98 if (line(1:13).eq.
'NNPDF20intqed')
then
104 if (line(1:13).eq.
'NNPDF20int')
then
114 logxgrid(ix) = dlog(xgrid(ix))
120 read(20,*) q2grid(iq)
121 logq2grid(iq) = dlog(q2grid(iq))
128 read(20,*) ( pdfgrid(imem,fl,ix,iq), fl=1,nfl,1)
140 integer i,j,ix,iq2,M,N,ipdf,fmax
141 integer minx,maxx,midx
142 integer minq,maxq,midq
143 double precision x,Q,xpdf(-6:7),Q2
144 double precision xmingrid,xch,x2,x1,dy,y
146 parameter(xmingrid=1d-7, xch=1d-1)
149 parameter(nmax=1e3,mmax=1e3)
150 integer ix1a(mmax), ix2a(nmax)
151 double precision x1a(mmax), x2a(nmax)
152 double precision ya(mmax,nmax)
154 integer nfl,nx,nq2,mem,rep
155 double precision alphas
156 double precision xgrid(100),logxgrid(100)
157 double precision q2grid(50),logq2grid(50)
158 double precision pdfgrid(0:100,14,100,50)
160 common /nnpdf/nfl,nx,nq2,mem,rep,hasphoton,alphas,xgrid,logxgrid,
161 1 q2grid,logq2grid,pdfgrid
166 if (x.lt.xmingrid.or.x.lt.xgrid(1).or.x.gt.xgrid(nx))
then
167 write(6,*)
"Parton interpolation: x out of range -- freezed"
168 if (x.lt.xgrid(1)) x = xgrid(1)
169 if (x.lt.xmingrid) x = xmingrid
170 if (x.gt.xgrid(nx))x = xgrid(nx)
172 if (q2.lt.q2grid(1).or.q2.gt.q2grid(nq2))
then
173 write(6,*)
"Parton interpolation: Q2 out of range -- freezed"
174 if (q2.lt.q2grid(1)) q2 = q2grid(1)
175 if (q2.gt.q2grid(nq2)) q2 = q2grid(nq2)
182 if (x.lt.xgrid(midx))
then
187 if ((maxx-minx).gt.1)
go to 10
194 if (q2.lt.q2grid(midq))
then
199 if ((maxq-minq).gt.1)
go to 20
204 if(ix.ge.m/2.and.ix.le.(nx-m/2)) ix1a(i) = ix - m/2 + i
205 if(ix.lt.m/2) ix1a(i) = i
206 if(ix.gt.(nx-m/2)) ix1a(i) = (nx - m) + i
209 if(ix1a(i).le.0.or.ix1a(i).gt.nx)
then
210 write(6,*)
"Error in grids! "
211 write(6,*)
"I, IXIA(I) = ",i, ix1a(i)
217 if(iq2.ge.n/2.and.iq2.le.(nq2-n/2)) ix2a(j) = iq2 - n/2 + j
218 if(iq2.lt.n/2) ix2a(j) = j
219 if(iq2.gt.(nq2-n/2)) ix2a(j) = (nq2 - n) + j
221 if(ix2a(j).le.0.or.ix2a(j).gt.nq2)
then
222 write(6,*)
"Error in grids! "
223 write(6,*)
"J, IXIA(J) = ",j,ix2a(j)
244 if (nfl.eq.14) fmax=7
250 x1a(i)= logxgrid(ix1a(i))
252 x1a(i)= xgrid(ix1a(i))
255 x2a(j) = logq2grid(ix2a(j))
256 ya(i,j) = pdfgrid(rep,ipdf+7,ix1a(i),ix2a(j))
261 call lh_polin2(x1a,x2a,ya,m,n,x1,x2,y,dy)
267 subroutine lh_polin2(x1a,x2a,ya,m,n,x1,x2,y,dy)
270 integer m,n,nmax,mmax
272 parameter(nmax=1e3,mmax=1e3)
274 real(8) dy,x1,x2,y,x1a(mmax),x2a(nmax),ya(mmax,nmax)
275 real(8) ymtmp(nmax),yntmp(nmax)
281 call lh_polint(x2a,yntmp,n,x2,ymtmp(j),dy)
294 real(8) dy,x,y,xa(nmax),ya(nmax)
296 real(8) den,dif,dift,ho,hp,w,c(nmax),d(nmax)
317 write(*,*)
'failure in polint'
324 if(2*ns.lt.(n-m))
then