]> git.uio.no Git - u/mrichter/AliRoot.git/blob - LHAPDF/lhapdf5.3.1/wrapmrst98.f
end-of-line normalization
[u/mrichter/AliRoot.git] / LHAPDF / lhapdf5.3.1 / wrapmrst98.f
1       subroutine MRST98evolve(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       integer nset
7       common/NAME/name,nmem,ndef,mmem
8       parameter(nx=49,nq=37,ntenth=23,np=8,members=5)
9       real*8 pdf(-6:6)
10       real*8 f(0:members,np,nx,nq+1)
11       real*8 qq(nq),xx(nx),xxin(nx),g(np),n0(np)
12       data xxin/1d-5,2d-5,4d-5,6d-5,8d-5,
13      .        1d-4,2d-4,4d-4,6d-4,8d-4,
14      .        1d-3,2d-3,4d-3,6d-3,8d-3,
15      .        1d-2,1.4d-2,2d-2,3d-2,4d-2,6d-2,8d-2,
16      .     .1d0,.125d0,.15d0,.175d0,.2d0,.225d0,.25d0,.275d0,
17      .     .3d0,.325d0,.35d0,.375d0,.4d0,.425d0,.45d0,.475d0,
18      .     .5d0,.525d0,.55d0,.575d0,.6d0,.65d0,.7d0,.75d0,
19      .     .8d0,.9d0,1d0/
20       data qq/1.25d0,1.5d0,2d0,2.5d0,3.2d0,4d0,5d0,6.4d0,8d0,1d1,
21      .        1.2d1,1.8d1,2.6d1,4d1,6.4d1,1d2,
22      .        1.6d2,2.4d2,4d2,6.4d2,1d3,1.8d3,3.2d3,5.6d3,1d4,
23      .        1.8d4,3.2d4,5.6d4,1d5,1.8d5,3.2d5,5.6d5,1d6,
24      .        1.8d6,3.2d6,5.6d6,1d7/
25       data xmin,xmax,qsqmin,qsqmax/1d-5,1d0,1.25d0,1d7/
26       data n0/3,4,5,9,9,9,9,9/
27       save
28 c
29       xsave=x
30       qsq = q*q
31       q2save=qsq
32 c
33       if(x.lt.xmin) x=xmin
34       if(x.gt.xmax) x=xmax
35       if(qsq.lt.qsqmin) qsq=qsqmin
36       if(qsq.gt.qsqmax) qsq=qsqmax
37 c
38       xxx=x
39       if(x.lt.xx(ntenth)) xxx=dlog10(x/xx(ntenth))+xx(ntenth)
40       n=0
41   70  n=n+1
42       if(xxx.gt.xx(n+1)) goto 70
43       a=(xxx-xx(n))/(xx(n+1)-xx(n))
44       m=0
45   80  m=m+1
46       if(qsq.gt.qq(m+1)) goto 80
47       b=(qsq-qq(m))/(qq(m+1)-qq(m))
48       do 60 i=1,np
49       g(i)= (1d0-a)*(1d0-b)*f(imem,i,n,m)+(1d0-a)*b*f(imem,i,n,m+1)
50      .    +       a*(1d0-b)*f(imem,i,n+1,m)+a*b*f(imem,i,n+1,m+1)
51       if(n.ge.ntenth) goto 65
52       if(i.eq.5.or.i.eq.7) goto 65
53           fac=(1d0-b)*f(imem,i,ntenth,m)+b*f(imem,i,ntenth,m+1)
54           g(i)=fac*10d0**(g(i)-fac)
55   65  continue
56       g(i)=g(i)*(1d0-x)**n0(i)
57   60  continue
58       upv=g(1)
59       dnv=g(2)
60       usea=g(4)
61       dsea=g(8)
62       str=g(6)
63       chm=g(5)
64       glu=g(3) 
65       bot=g(7)
66 c
67       pdf(0)  = glu
68       pdf(1)  = dnv+dsea
69       pdf(-1) = dsea
70       pdf(2)  = upv+usea
71       pdf(-2) = usea
72       pdf(3)  = str
73       pdf(-3) = str
74       pdf(4)  = chm
75       pdf(-4) = chm
76       pdf(5)  = bot
77       pdf(-5) = bot
78       pdf(6)  = 0.0d0
79       pdf(-6) = 0.0d0
80       
81       x=xsave
82       qsq=q2save
83       return
84 *
85       entry MRST98read(nset)
86       read(1,*)nmem(nset),ndef(nset)
87 c - first resotre the xx array
88       do j=1,nx
89         xx(j)=xxin(j)
90       enddo
91 c - next read in the data points
92       do nm = 0,nmem(nset)
93         do 20 n=1,nx-1
94         do 20 m=1,nq
95         read(1,50)f(nm,1,n,m),f(nm,2,n,m),f(nm,3,n,m),f(nm,4,n,m),
96      .            f(nm,5,n,m),f(nm,7,n,m),f(nm,6,n,m),f(nm,8,n,m)
97 c notation: 1=uval 2=val 3=glue 4=usea 5=chm 6=str 7=btm 8=dsea
98         do 25 i=1,np
99   25     f(nm,i,n,m)=f(nm,i,n,m)/(1d0-xx(n))**n0(i)
100   20    continue
101 c        write(*,*)'PDF set ',nm,' first element ',f(nm,1,1,1)
102         do 31 j=1,ntenth-1
103 c        xx(j)=dlog10(xx(j)/xx(ntenth))+xx(ntenth)
104         do 31 i=1,8
105         if(i.eq.5.or.i.eq.7) goto 31
106         do 30 k=1,nq
107   30    f(nm,i,j,k)=dlog10(f(nm,i,j,k)/f(nm,i,ntenth,k))
108      .              +f(nm,i,ntenth,k)
109   31    continue
110   50    format(8f10.5)
111         do 40 i=1,np
112         do 40 m=1,nq
113   40  f(nm,i,nx,m)=0d0
114        enddo
115       do 32 j=1,ntenth-1
116         xx(j)=dlog10(xx(j)/xx(ntenth))+xx(ntenth)
117   32  continue
118       return
119 *
120       entry MRST98alfa(alfas,Qalfa)
121         call alphamrs(5,alfas,Qalfa)
122       return
123 *
124       entry MRST98init(Eorder,Q2fit)
125       return
126 *
127       entry MRST98pdf(mem)
128 c      if(mem.eq.0) mem=ndef
129       imem = mem
130 c      print *,imem
131
132       return
133 c
134       end
135