~maddevelopers/mg5amcnlo/WWW5_caching

« back to all changes in this revision

Viewing changes to users/mardelcourt/PROC_141512/PROC_141512/Source/PDF/mrs98.f

  • Committer: John Doe
  • Date: 2013-03-25 20:27:02 UTC
  • Revision ID: john.doe@gmail.com-20130325202702-5sk3t1r8h33ca4p4
first clean version

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
      subroutine mrs98(x,q,mode,upv,dnv,usea,dsea,str,chm,bot,glu)
 
2
C****************************************************************C
 
3
C                                                                C
 
4
C     This is a package for the new MRS 1998 parton              C
 
5
C     distributions. The format is similar to the previous       C
 
6
C     (1996) MRS-R series.                                       C
 
7
C                                                                C
 
8
C     As before, x times the parton distribution is returned,    C
 
9
C     q is the scale in GeV, MSbar factorization is assumed,     C
 
10
C     and Lambda(MSbar,nf=4) is given below for each set.        C
 
11
C                                                                C
 
12
C     TEMPORARY NAMING SCHEME:                                   C
 
13
C                                                                C
 
14
C  mode  set    comment             L(4)/MeV  a_s(M_Z)  grid#1   C
 
15
C  ----  ---    -------             --------  -------   ------   C
 
16
C                                                                C
 
17
C  1     FT08A  central gluon, a_s    300      0.1175   0.00561  C
 
18
C  2     FT09A  higher gluon          300      0.1175   0.00510  C
 
19
C  3     FT11A  lower gluon           300      0.1175   0.00408  C
 
20
C  4     FT24A  lower a_s             229      0.1125   0.00586  C
 
21
C  5     FT23A  higher a_s            383      0.1225   0.00410  C
 
22
C                                                                C
 
23
C                                                                C
 
24
C      The corresponding grid files are called ft08a.dat etc.    C
 
25
C                                                                C
 
26
C      The reference is:                                         C
 
27
C      A.D. Martin, R.G. Roberts, W.J. Stirling, R.S Thorne      C
 
28
C      Univ. Durham preprint DTP/98/??, hep-ph/??????? (1998)    C
 
29
C                                                                C
 
30
C      Comments to : W.J.Stirling@durham.ac.uk                   C
 
31
C                                                                C
 
32
C                                                                C
 
33
C****************************************************************C
 
34
      implicit double precision(a-h,o-z)
 
35
      data xmin,xmax,qsqmin,qsqmax/1d-5,1d0,1.25d0,1d7/
 
36
      q2=q*q
 
37
      if(q2.lt.qsqmin.or.q2.gt.qsqmax) print 99
 
38
      if(x.lt.xmin.or.x.gt.xmax)       print 98
 
39
          if(mode.eq.1) then
 
40
        call mrs981(x,q2,upv,dnv,usea,dsea,str,chm,bot,glu) 
 
41
      elseif(mode.eq.2) then
 
42
        call mrs982(x,q2,upv,dnv,usea,dsea,str,chm,bot,glu) 
 
43
      elseif(mode.eq.3) then
 
44
        call mrs983(x,q2,upv,dnv,usea,dsea,str,chm,bot,glu) 
 
45
      elseif(mode.eq.4) then
 
46
        call mrs984(x,q2,upv,dnv,usea,dsea,str,chm,bot,glu) 
 
47
      elseif(mode.eq.5) then
 
48
        call mrs985(x,q2,upv,dnv,usea,dsea,str,chm,bot,glu) 
 
49
      endif 
 
50
  99  format('  WARNING:  Q^2 VALUE IS OUT OF RANGE   ')
 
51
  98  format('  WARNING:   X  VALUE IS OUT OF RANGE   ')
 
52
      return
 
53
      end
 
54
 
 
55
      subroutine mrs981(x,qsq,upv,dnv,usea,dsea,str,chm,bot,glu)
 
56
      implicit double precision(a-h,o-z)
 
57
c-fabio
 
58
      Character Tablefile*40
 
59
      data Tablefile/'ft08a.dat'/
 
60
      integer IU
 
61
      common/IU/IU  !this is set in opendata.f
 
62
c
 
63
      parameter(nx=49,nq=37,ntenth=23,np=8)
 
64
      double precision f(np,nx,nq+1),qq(nq),xx(nx),g(np),n0(np)
 
65
      data xx/1d-5,2d-5,4d-5,6d-5,8d-5,
 
66
     .        1d-4,2d-4,4d-4,6d-4,8d-4,
 
67
     .        1d-3,2d-3,4d-3,6d-3,8d-3,
 
68
     .        1d-2,1.4d-2,2d-2,3d-2,4d-2,6d-2,8d-2,
 
69
     .     .1d0,.125d0,.15d0,.175d0,.2d0,.225d0,.25d0,.275d0,
 
70
     .     .3d0,.325d0,.35d0,.375d0,.4d0,.425d0,.45d0,.475d0,
 
71
     .     .5d0,.525d0,.55d0,.575d0,.6d0,.65d0,.7d0,.75d0,
 
72
     .     .8d0,.9d0,1d0/
 
73
      data qq/1.25d0,1.5d0,2d0,2.5d0,3.2d0,4d0,5d0,6.4d0,8d0,1d1,
 
74
     .        1.2d1,1.8d1,2.6d1,4d1,6.4d1,1d2,
 
75
     .        1.6d2,2.4d2,4d2,6.4d2,1d3,1.8d3,3.2d3,5.6d3,1d4,
 
76
     .        1.8d4,3.2d4,5.6d4,1d5,1.8d5,3.2d5,5.6d5,1d6,
 
77
     .        1.8d6,3.2d6,5.6d6,1d7/
 
78
      data xmin,xmax,qsqmin,qsqmax/1d-5,1d0,1.25d0,1d7/
 
79
      data n0/3,4,5,9,9,9,9,9/
 
80
      data init/0/
 
81
      save
 
82
      xsave=x
 
83
      q2save=qsq
 
84
      if(init.ne.0) goto 10
 
85
c        open(unit=1,file='Pdfdata/ft08a.dat',status='old')
 
86
        call OpenData(Tablefile)
 
87
        do 20 n=1,nx-1
 
88
        do 20 m=1,nq
 
89
        read(IU,50)f(1,n,m),f(2,n,m),f(3,n,m),f(4,n,m),
 
90
     .            f(5,n,m),f(7,n,m),f(6,n,m),f(8,n,m)
 
91
c notation: 1=uval 2=val 3=glue 4=usea 5=chm 6=str 7=btm 8=dsea
 
92
        do 25 i=1,np
 
93
  25     f(i,n,m)=f(i,n,m)/(1d0-xx(n))**n0(i)
 
94
  20  continue
 
95
      do 31 j=1,ntenth-1
 
96
      xx(j)=dlog10(xx(j)/xx(ntenth))+xx(ntenth)
 
97
      do 31 i=1,8
 
98
      if(i.eq.5.or.i.eq.7) goto 31
 
99
      do 30 k=1,nq
 
100
  30  f(i,j,k)=dlog10(f(i,j,k)/f(i,ntenth,k))+f(i,ntenth,k)
 
101
  31  continue
 
102
  50  format(8f10.5)
 
103
      do 40 i=1,np
 
104
      do 40 m=1,nq
 
105
  40  f(i,nx,m)=0d0
 
106
      init=1
 
107
  10  continue
 
108
      if(x.lt.xmin) x=xmin
 
109
      if(x.gt.xmax) x=xmax
 
110
      if(qsq.lt.qsqmin) qsq=qsqmin
 
111
      if(qsq.gt.qsqmax) qsq=qsqmax
 
112
      xxx=x
 
113
      if(x.lt.xx(ntenth)) xxx=dlog10(x/xx(ntenth))+xx(ntenth)
 
114
      n=0
 
115
  70  n=n+1
 
116
      if(xxx.gt.xx(n+1)) goto 70
 
117
      a=(xxx-xx(n))/(xx(n+1)-xx(n))
 
118
      m=0
 
119
  80  m=m+1
 
120
      if(qsq.gt.qq(m+1)) goto 80
 
121
      b=(qsq-qq(m))/(qq(m+1)-qq(m))
 
122
      do 60 i=1,np
 
123
      g(i)= (1d0-a)*(1d0-b)*f(i,n,m)   + (1d0-a)*b*f(i,n,m+1)
 
124
     .    +       a*(1d0-b)*f(i,n+1,m) +       a*b*f(i,n+1,m+1)
 
125
      if(n.ge.ntenth) goto 65
 
126
      if(i.eq.5.or.i.eq.7) goto 65
 
127
          fac=(1d0-b)*f(i,ntenth,m)+b*f(i,ntenth,m+1)
 
128
          g(i)=fac*10d0**(g(i)-fac)
 
129
  65  continue
 
130
      g(i)=g(i)*(1d0-x)**n0(i)
 
131
  60  continue
 
132
      upv=g(1)
 
133
      dnv=g(2)
 
134
      usea=g(4)
 
135
      dsea=g(8)
 
136
      str=g(6)
 
137
      chm=g(5)
 
138
      glu=g(3) 
 
139
      bot=g(7)
 
140
        x=xsave
 
141
        qsq=q2save
 
142
      return
 
143
      end
 
144
      
 
145
      subroutine mrs982(x,qsq,upv,dnv,usea,dsea,str,chm,bot,glu)
 
146
      implicit double precision(a-h,o-z)
 
147
c-fabio
 
148
      Character Tablefile*40
 
149
      data Tablefile/'ft09a.dat'/
 
150
      integer IU
 
151
      common/IU/IU  !this is set in opendata.f
 
152
c
 
153
      parameter(nx=49,nq=37,ntenth=23,np=8)
 
154
      double precision f(np,nx,nq+1),qq(nq),xx(nx),g(np),n0(np)
 
155
      data xx/1d-5,2d-5,4d-5,6d-5,8d-5,
 
156
     .        1d-4,2d-4,4d-4,6d-4,8d-4,
 
157
     .        1d-3,2d-3,4d-3,6d-3,8d-3,
 
158
     .        1d-2,1.4d-2,2d-2,3d-2,4d-2,6d-2,8d-2,
 
159
     .     .1d0,.125d0,.15d0,.175d0,.2d0,.225d0,.25d0,.275d0,
 
160
     .     .3d0,.325d0,.35d0,.375d0,.4d0,.425d0,.45d0,.475d0,
 
161
     .     .5d0,.525d0,.55d0,.575d0,.6d0,.65d0,.7d0,.75d0,
 
162
     .     .8d0,.9d0,1d0/
 
163
      data qq/1.25d0,1.5d0,2d0,2.5d0,3.2d0,4d0,5d0,6.4d0,8d0,1d1,
 
164
     .        1.2d1,1.8d1,2.6d1,4d1,6.4d1,1d2,
 
165
     .        1.6d2,2.4d2,4d2,6.4d2,1d3,1.8d3,3.2d3,5.6d3,1d4,
 
166
     .        1.8d4,3.2d4,5.6d4,1d5,1.8d5,3.2d5,5.6d5,1d6,
 
167
     .        1.8d6,3.2d6,5.6d6,1d7/
 
168
      data xmin,xmax,qsqmin,qsqmax/1d-5,1d0,1.25d0,1d7/
 
169
      data n0/3,4,5,9,9,9,9,9/
 
170
      data init/0/
 
171
      save
 
172
      xsave=x
 
173
      q2save=qsq
 
174
      if(init.ne.0) goto 10
 
175
c        open(unit=1,file='Pdfdata/ft09a.dat',status='old')
 
176
        call OpenData(Tablefile)
 
177
        do 20 n=1,nx-1
 
178
        do 20 m=1,nq
 
179
        read(IU,50)f(1,n,m),f(2,n,m),f(3,n,m),f(4,n,m),
 
180
     .            f(5,n,m),f(7,n,m),f(6,n,m),f(8,n,m)
 
181
c notation: 1=uval 2=val 3=glue 4=usea 5=chm 6=str 7=btm 8=dsea
 
182
        do 25 i=1,np
 
183
  25     f(i,n,m)=f(i,n,m)/(1d0-xx(n))**n0(i)
 
184
  20  continue
 
185
      do 31 j=1,ntenth-1
 
186
      xx(j)=dlog10(xx(j)/xx(ntenth))+xx(ntenth)
 
187
      do 31 i=1,8
 
188
      if(i.eq.5.or.i.eq.7) goto 31
 
189
      do 30 k=1,nq
 
190
  30  f(i,j,k)=dlog10(f(i,j,k)/f(i,ntenth,k))+f(i,ntenth,k)
 
191
  31  continue
 
192
  50  format(8f10.5)
 
193
      do 40 i=1,np
 
194
      do 40 m=1,nq
 
195
  40  f(i,nx,m)=0d0
 
196
      init=1
 
197
  10  continue
 
198
      if(x.lt.xmin) x=xmin
 
199
      if(x.gt.xmax) x=xmax
 
200
      if(qsq.lt.qsqmin) qsq=qsqmin
 
201
      if(qsq.gt.qsqmax) qsq=qsqmax
 
202
      xxx=x
 
203
      if(x.lt.xx(ntenth)) xxx=dlog10(x/xx(ntenth))+xx(ntenth)
 
204
      n=0
 
205
  70  n=n+1
 
206
      if(xxx.gt.xx(n+1)) goto 70
 
207
      a=(xxx-xx(n))/(xx(n+1)-xx(n))
 
208
      m=0
 
209
  80  m=m+1
 
210
      if(qsq.gt.qq(m+1)) goto 80
 
211
      b=(qsq-qq(m))/(qq(m+1)-qq(m))
 
212
      do 60 i=1,np
 
213
      g(i)= (1d0-a)*(1d0-b)*f(i,n,m)   + (1d0-a)*b*f(i,n,m+1)
 
214
     .    +       a*(1d0-b)*f(i,n+1,m) +       a*b*f(i,n+1,m+1)
 
215
      if(n.ge.ntenth) goto 65
 
216
      if(i.eq.5.or.i.eq.7) goto 65
 
217
          fac=(1d0-b)*f(i,ntenth,m)+b*f(i,ntenth,m+1)
 
218
          g(i)=fac*10d0**(g(i)-fac)
 
219
  65  continue
 
220
      g(i)=g(i)*(1d0-x)**n0(i)
 
221
  60  continue
 
222
      upv=g(1)
 
223
      dnv=g(2)
 
224
      usea=g(4)
 
225
      dsea=g(8)
 
226
      str=g(6)
 
227
      chm=g(5)
 
228
      glu=g(3) 
 
229
      bot=g(7)
 
230
        x=xsave
 
231
        qsq=q2save
 
232
      return
 
233
      end
 
234
      
 
235
      subroutine mrs983(x,qsq,upv,dnv,usea,dsea,str,chm,bot,glu)
 
236
      implicit double precision(a-h,o-z)
 
237
c-fabio
 
238
      Character Tablefile*40
 
239
      data Tablefile/'ft11a.dat'/
 
240
      integer IU
 
241
      common/IU/IU  !this is set in opendata.f
 
242
c
 
243
      parameter(nx=49,nq=37,ntenth=23,np=8)
 
244
      double precision f(np,nx,nq+1),qq(nq),xx(nx),g(np),n0(np)
 
245
      data xx/1d-5,2d-5,4d-5,6d-5,8d-5,
 
246
     .        1d-4,2d-4,4d-4,6d-4,8d-4,
 
247
     .        1d-3,2d-3,4d-3,6d-3,8d-3,
 
248
     .        1d-2,1.4d-2,2d-2,3d-2,4d-2,6d-2,8d-2,
 
249
     .     .1d0,.125d0,.15d0,.175d0,.2d0,.225d0,.25d0,.275d0,
 
250
     .     .3d0,.325d0,.35d0,.375d0,.4d0,.425d0,.45d0,.475d0,
 
251
     .     .5d0,.525d0,.55d0,.575d0,.6d0,.65d0,.7d0,.75d0,
 
252
     .     .8d0,.9d0,1d0/
 
253
      data qq/1.25d0,1.5d0,2d0,2.5d0,3.2d0,4d0,5d0,6.4d0,8d0,1d1,
 
254
     .        1.2d1,1.8d1,2.6d1,4d1,6.4d1,1d2,
 
255
     .        1.6d2,2.4d2,4d2,6.4d2,1d3,1.8d3,3.2d3,5.6d3,1d4,
 
256
     .        1.8d4,3.2d4,5.6d4,1d5,1.8d5,3.2d5,5.6d5,1d6,
 
257
     .        1.8d6,3.2d6,5.6d6,1d7/
 
258
      data xmin,xmax,qsqmin,qsqmax/1d-5,1d0,1.25d0,1d7/
 
259
      data n0/3,4,5,9,9,9,9,9/
 
260
      data init/0/
 
261
      save
 
262
      xsave=x
 
263
      q2save=qsq
 
264
      if(init.ne.0) goto 10
 
265
c        open(unit=1,file='Pdfdata/ft11a.dat',status='old')
 
266
        call OpenData(Tablefile)
 
267
        do 20 n=1,nx-1
 
268
        do 20 m=1,nq
 
269
        read(IU,50)f(1,n,m),f(2,n,m),f(3,n,m),f(4,n,m),
 
270
     .            f(5,n,m),f(7,n,m),f(6,n,m),f(8,n,m)
 
271
c notation: 1=uval 2=val 3=glue 4=usea 5=chm 6=str 7=btm 8=dsea
 
272
        do 25 i=1,np
 
273
  25     f(i,n,m)=f(i,n,m)/(1d0-xx(n))**n0(i)
 
274
  20  continue
 
275
      do 31 j=1,ntenth-1
 
276
      xx(j)=dlog10(xx(j)/xx(ntenth))+xx(ntenth)
 
277
      do 31 i=1,8
 
278
      if(i.eq.5.or.i.eq.7) goto 31
 
279
      do 30 k=1,nq
 
280
  30  f(i,j,k)=dlog10(f(i,j,k)/f(i,ntenth,k))+f(i,ntenth,k)
 
281
  31  continue
 
282
  50  format(8f10.5)
 
283
      do 40 i=1,np
 
284
      do 40 m=1,nq
 
285
  40  f(i,nx,m)=0d0
 
286
      init=1
 
287
  10  continue
 
288
      if(x.lt.xmin) x=xmin
 
289
      if(x.gt.xmax) x=xmax
 
290
      if(qsq.lt.qsqmin) qsq=qsqmin
 
291
      if(qsq.gt.qsqmax) qsq=qsqmax
 
292
      xxx=x
 
293
      if(x.lt.xx(ntenth)) xxx=dlog10(x/xx(ntenth))+xx(ntenth)
 
294
      n=0
 
295
  70  n=n+1
 
296
      if(xxx.gt.xx(n+1)) goto 70
 
297
      a=(xxx-xx(n))/(xx(n+1)-xx(n))
 
298
      m=0
 
299
  80  m=m+1
 
300
      if(qsq.gt.qq(m+1)) goto 80
 
301
      b=(qsq-qq(m))/(qq(m+1)-qq(m))
 
302
      do 60 i=1,np
 
303
      g(i)= (1d0-a)*(1d0-b)*f(i,n,m)   + (1d0-a)*b*f(i,n,m+1)
 
304
     .    +       a*(1d0-b)*f(i,n+1,m) +       a*b*f(i,n+1,m+1)
 
305
      if(n.ge.ntenth) goto 65
 
306
      if(i.eq.5.or.i.eq.7) goto 65
 
307
          fac=(1d0-b)*f(i,ntenth,m)+b*f(i,ntenth,m+1)
 
308
          g(i)=fac*10d0**(g(i)-fac)
 
309
  65  continue
 
310
      g(i)=g(i)*(1d0-x)**n0(i)
 
311
  60  continue
 
312
      upv=g(1)
 
313
      dnv=g(2)
 
314
      usea=g(4)
 
315
      dsea=g(8)
 
316
      str=g(6)
 
317
      chm=g(5)
 
318
      glu=g(3) 
 
319
      bot=g(7)
 
320
        x=xsave
 
321
        qsq=q2save
 
322
      return
 
323
      end
 
324
      
 
325
      
 
326
      subroutine mrs984(x,qsq,upv,dnv,usea,dsea,str,chm,bot,glu)
 
327
      implicit double precision(a-h,o-z)
 
328
c-fabio
 
329
      Character Tablefile*40
 
330
      data Tablefile/'ft24a.dat'/
 
331
      integer IU
 
332
      common/IU/IU  !this is set in opendata.f
 
333
c
 
334
      parameter(nx=49,nq=37,ntenth=23,np=8)
 
335
      double precision f(np,nx,nq+1),qq(nq),xx(nx),g(np),n0(np)
 
336
      data xx/1d-5,2d-5,4d-5,6d-5,8d-5,
 
337
     .        1d-4,2d-4,4d-4,6d-4,8d-4,
 
338
     .        1d-3,2d-3,4d-3,6d-3,8d-3,
 
339
     .        1d-2,1.4d-2,2d-2,3d-2,4d-2,6d-2,8d-2,
 
340
     .     .1d0,.125d0,.15d0,.175d0,.2d0,.225d0,.25d0,.275d0,
 
341
     .     .3d0,.325d0,.35d0,.375d0,.4d0,.425d0,.45d0,.475d0,
 
342
     .     .5d0,.525d0,.55d0,.575d0,.6d0,.65d0,.7d0,.75d0,
 
343
     .     .8d0,.9d0,1d0/
 
344
      data qq/1.25d0,1.5d0,2d0,2.5d0,3.2d0,4d0,5d0,6.4d0,8d0,1d1,
 
345
     .        1.2d1,1.8d1,2.6d1,4d1,6.4d1,1d2,
 
346
     .        1.6d2,2.4d2,4d2,6.4d2,1d3,1.8d3,3.2d3,5.6d3,1d4,
 
347
     .        1.8d4,3.2d4,5.6d4,1d5,1.8d5,3.2d5,5.6d5,1d6,
 
348
     .        1.8d6,3.2d6,5.6d6,1d7/
 
349
      data xmin,xmax,qsqmin,qsqmax/1d-5,1d0,1.25d0,1d7/
 
350
      data n0/3,4,5,9,9,9,9,9/
 
351
      data init/0/
 
352
      save
 
353
      xsave=x
 
354
      q2save=qsq
 
355
      if(init.ne.0) goto 10
 
356
c        open(unit=1,file='Pdfdata/ft24a.dat',status='old')
 
357
        call OpenData(Tablefile)
 
358
        do 20 n=1,nx-1
 
359
        do 20 m=1,nq
 
360
        read(IU,50)f(1,n,m),f(2,n,m),f(3,n,m),f(4,n,m),
 
361
     .            f(5,n,m),f(7,n,m),f(6,n,m),f(8,n,m)
 
362
c notation: 1=uval 2=val 3=glue 4=usea 5=chm 6=str 7=btm 8=dsea
 
363
        do 25 i=1,np
 
364
  25     f(i,n,m)=f(i,n,m)/(1d0-xx(n))**n0(i)
 
365
  20  continue
 
366
      do 31 j=1,ntenth-1
 
367
      xx(j)=dlog10(xx(j)/xx(ntenth))+xx(ntenth)
 
368
      do 31 i=1,8
 
369
      if(i.eq.5.or.i.eq.7) goto 31
 
370
      do 30 k=1,nq
 
371
  30  f(i,j,k)=dlog10(f(i,j,k)/f(i,ntenth,k))+f(i,ntenth,k)
 
372
  31  continue
 
373
  50  format(8f10.5)
 
374
      do 40 i=1,np
 
375
      do 40 m=1,nq
 
376
  40  f(i,nx,m)=0d0
 
377
      init=1
 
378
  10  continue
 
379
      if(x.lt.xmin) x=xmin
 
380
      if(x.gt.xmax) x=xmax
 
381
      if(qsq.lt.qsqmin) qsq=qsqmin
 
382
      if(qsq.gt.qsqmax) qsq=qsqmax
 
383
      xxx=x
 
384
      if(x.lt.xx(ntenth)) xxx=dlog10(x/xx(ntenth))+xx(ntenth)
 
385
      n=0
 
386
  70  n=n+1
 
387
      if(xxx.gt.xx(n+1)) goto 70
 
388
      a=(xxx-xx(n))/(xx(n+1)-xx(n))
 
389
      m=0
 
390
  80  m=m+1
 
391
      if(qsq.gt.qq(m+1)) goto 80
 
392
      b=(qsq-qq(m))/(qq(m+1)-qq(m))
 
393
      do 60 i=1,np
 
394
      g(i)= (1d0-a)*(1d0-b)*f(i,n,m)   + (1d0-a)*b*f(i,n,m+1)
 
395
     .    +       a*(1d0-b)*f(i,n+1,m) +       a*b*f(i,n+1,m+1)
 
396
      if(n.ge.ntenth) goto 65
 
397
      if(i.eq.5.or.i.eq.7) goto 65
 
398
          fac=(1d0-b)*f(i,ntenth,m)+b*f(i,ntenth,m+1)
 
399
          g(i)=fac*10d0**(g(i)-fac)
 
400
  65  continue
 
401
      g(i)=g(i)*(1d0-x)**n0(i)
 
402
  60  continue
 
403
      upv=g(1)
 
404
      dnv=g(2)
 
405
      usea=g(4)
 
406
      dsea=g(8)
 
407
      str=g(6)
 
408
      chm=g(5)
 
409
      glu=g(3) 
 
410
      bot=g(7)
 
411
        x=xsave
 
412
        qsq=q2save
 
413
      return
 
414
      end
 
415
      
 
416
      subroutine mrs985(x,qsq,upv,dnv,usea,dsea,str,chm,bot,glu)
 
417
      implicit double precision(a-h,o-z)
 
418
c-fabio
 
419
      Character Tablefile*40
 
420
      data Tablefile/'ft23a.dat'/
 
421
      integer IU
 
422
      common/IU/IU  !this is set in opendata.f
 
423
c
 
424
      parameter(nx=49,nq=37,ntenth=23,np=8)
 
425
      double precision f(np,nx,nq+1),qq(nq),xx(nx),g(np),n0(np)
 
426
      data xx/1d-5,2d-5,4d-5,6d-5,8d-5,
 
427
     .        1d-4,2d-4,4d-4,6d-4,8d-4,
 
428
     .        1d-3,2d-3,4d-3,6d-3,8d-3,
 
429
     .        1d-2,1.4d-2,2d-2,3d-2,4d-2,6d-2,8d-2,
 
430
     .     .1d0,.125d0,.15d0,.175d0,.2d0,.225d0,.25d0,.275d0,
 
431
     .     .3d0,.325d0,.35d0,.375d0,.4d0,.425d0,.45d0,.475d0,
 
432
     .     .5d0,.525d0,.55d0,.575d0,.6d0,.65d0,.7d0,.75d0,
 
433
     .     .8d0,.9d0,1d0/
 
434
      data qq/1.25d0,1.5d0,2d0,2.5d0,3.2d0,4d0,5d0,6.4d0,8d0,1d1,
 
435
     .        1.2d1,1.8d1,2.6d1,4d1,6.4d1,1d2,
 
436
     .        1.6d2,2.4d2,4d2,6.4d2,1d3,1.8d3,3.2d3,5.6d3,1d4,
 
437
     .        1.8d4,3.2d4,5.6d4,1d5,1.8d5,3.2d5,5.6d5,1d6,
 
438
     .        1.8d6,3.2d6,5.6d6,1d7/
 
439
      data xmin,xmax,qsqmin,qsqmax/1d-5,1d0,1.25d0,1d7/
 
440
      data n0/3,4,5,9,9,9,9,9/
 
441
      data init/0/
 
442
      save
 
443
      xsave=x
 
444
      q2save=qsq
 
445
      if(init.ne.0) goto 10
 
446
c        open(unit=1,file='Pdfdata/ft23a.dat',status='old')
 
447
        call OpenData(Tablefile)
 
448
        do 20 n=1,nx-1
 
449
        do 20 m=1,nq
 
450
        read(IU,50)f(1,n,m),f(2,n,m),f(3,n,m),f(4,n,m),
 
451
     .            f(5,n,m),f(7,n,m),f(6,n,m),f(8,n,m)
 
452
c notation: 1=uval 2=val 3=glue 4=usea 5=chm 6=str 7=btm 8=dsea
 
453
        do 25 i=1,np
 
454
  25     f(i,n,m)=f(i,n,m)/(1d0-xx(n))**n0(i)
 
455
  20  continue
 
456
      do 31 j=1,ntenth-1
 
457
      xx(j)=dlog10(xx(j)/xx(ntenth))+xx(ntenth)
 
458
      do 31 i=1,8
 
459
      if(i.eq.5.or.i.eq.7) goto 31
 
460
      do 30 k=1,nq
 
461
  30  f(i,j,k)=dlog10(f(i,j,k)/f(i,ntenth,k))+f(i,ntenth,k)
 
462
  31  continue
 
463
  50  format(8f10.5)
 
464
      do 40 i=1,np
 
465
      do 40 m=1,nq
 
466
  40  f(i,nx,m)=0d0
 
467
      init=1
 
468
  10  continue
 
469
      if(x.lt.xmin) x=xmin
 
470
      if(x.gt.xmax) x=xmax
 
471
      if(qsq.lt.qsqmin) qsq=qsqmin
 
472
      if(qsq.gt.qsqmax) qsq=qsqmax
 
473
      xxx=x
 
474
      if(x.lt.xx(ntenth)) xxx=dlog10(x/xx(ntenth))+xx(ntenth)
 
475
      n=0
 
476
  70  n=n+1
 
477
      if(xxx.gt.xx(n+1)) goto 70
 
478
      a=(xxx-xx(n))/(xx(n+1)-xx(n))
 
479
      m=0
 
480
  80  m=m+1
 
481
      if(qsq.gt.qq(m+1)) goto 80
 
482
      b=(qsq-qq(m))/(qq(m+1)-qq(m))
 
483
      do 60 i=1,np
 
484
      g(i)= (1d0-a)*(1d0-b)*f(i,n,m)   + (1d0-a)*b*f(i,n,m+1)
 
485
     .    +       a*(1d0-b)*f(i,n+1,m) +       a*b*f(i,n+1,m+1)
 
486
      if(n.ge.ntenth) goto 65
 
487
      if(i.eq.5.or.i.eq.7) goto 65
 
488
          fac=(1d0-b)*f(i,ntenth,m)+b*f(i,ntenth,m+1)
 
489
          g(i)=fac*10d0**(g(i)-fac)
 
490
  65  continue
 
491
      g(i)=g(i)*(1d0-x)**n0(i)
 
492
  60  continue
 
493
      upv=g(1)
 
494
      dnv=g(2)
 
495
      usea=g(4)
 
496
      dsea=g(8)
 
497
      str=g(6)
 
498
      chm=g(5)
 
499
      glu=g(3) 
 
500
      bot=g(7)
 
501
        x=xsave
 
502
        qsq=q2save
 
503
      return
 
504
      end
 
505
      
 
506