~maddevelopers/mg5amcnlo/WWW5_caching

« back to all changes in this revision

Viewing changes to users/mardelcourt/PROC_242195/PROC_242195/Source/PDF/Ctq4Fn.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
C*****Butchered by RKE to remove polint and readtbl which are common to
 
2
C*****Ctq4Fn and Ctq5Pdf
 
3
 
 
4
C============================================================================
 
5
C                CTEQ Parton Distribution Functions: Version 4
 
6
C                          June 21, 1996
 
7
C
 
8
C   By: H.L. Lai, J. Huston, S. Kuhlmann, F. Olness, J. Owens, D. Soper
 
9
C       W.K. Tung, H. Weerts
 
10
C   Ref: MSUHEP-60426, CTEQ-604, e-Print Archive: hep-ph/9606399
 
11
C
 
12
C   This package contains 9 sets of CTEQ4 PDF's. Details are:
 
13
C ---------------------------------------------------------------------------
 
14
C   Iset   PDF      Description             Alpha_s(Mz)  Q0(GeV)  Table_File
 
15
C ---------------------------------------------------------------------------
 
16
C   1      CTEQ4M   Standard MSbar scheme   0.116        1.6      cteq4m.tbl
 
17
C   2      CTEQ4D   Standard DIS scheme     0.116        1.6      cteq4d.tbl
 
18
C   3      CTEQ4L   Leading Order           0.116        1.6      cteq4l.tbl
 
19
C   4      CTEQ4A1  Alpha_s series          0.110        1.6      cteq4a1.tbl
 
20
C   5      CTEQ4A2  Alpha_s series          0.113        1.6      cteq4a2.tbl
 
21
C   6      CTEQ4A3  same as CTEQ4M          0.116        1.6      cteq4m.tbl
 
22
C   7      CTEQ4A4  Alpha_s series          0.119        1.6      cteq4a4.tbl
 
23
C   8      CTEQ4A5  Alpha_s series          0.122        1.6      cteq4a5.tbl
 
24
C   9      CTEQ4HJ  High Jet                0.116        1.6      cteq4hj.tbl
 
25
C   10     CTEQ4LQ  Low Q0                  0.114        0.7      cteq4lq.tbl
 
26
C ---------------------------------------------------------------------------
 
27
C   
 
28
C   The available applied range is 10^-5 < x < 1 and 1.6 < Q < 10,000 (GeV) 
 
29
C   except CTEQ4LQ for which Q starts at a lower value of 0.7 GeV.  
 
30
C   The Table_Files are assumed to be in the working directory.
 
31
C   
 
32
C   The function Ctq4Fn (Iset, Iparton, X, Q)
 
33
C   returns the parton distribution inside the proton for parton [Iparton] 
 
34
C   at [X] Bjorken_X and scale [Q] (GeV) in PDF set [Iset].
 
35
C   Iparton  is the parton label (5, 4, 3, 2, 1, 0, -1, ......, -5)
 
36
C                            for (b, c, s, d, u, g, u_bar, ..., b_bar)
 
37
C   
 
38
C   For detailed information on the parameters used, e.q. quark masses, 
 
39
C   QCD Lambda, ... etc.,  see info lines at the beginning of the 
 
40
C   Table_Files.
 
41
 
 
42
C   These programs, as provided, are in double precision.  By removing the
 
43
C   "Implicit Double Precision" lines, they can also be run in single 
 
44
C   precision.
 
45
C   
 
46
C   If you have detailed questions concerning these CTEQ4 distributions, 
 
47
C   or if you find problems/bugs using this package, direct inquires to 
 
48
C   Hung-Liang Lai(Lai_H@pa.msu.edu) or Wu-Ki Tung(Tung@pa.msu.edu).
 
49
C   
 
50
C===========================================================================
 
51
 
 
52
      Function Ctq4Fn (Iset, Iparton, X, Q)
 
53
      Implicit Double Precision (A-H,O-Z)
 
54
      Character Flnm(10)*11,TableFile*40
 
55
        
 
56
      Common
 
57
     > / CtqPar2 / Nx, Nt, NfMx
 
58
     > / QCDtable /  Alambda, Nfl, Iorder
 
59
      Data (Flnm(I), I=1,10)
 
60
     > / 'cteq4m.tbl ', 'cteq4d.tbl ', 'cteq4l.tbl '
 
61
     > , 'cteq4a1.tbl', 'cteq4a2.tbl', 'cteq4m.tbl ', 'cteq4a4.tbl'
 
62
     > , 'cteq4a5.tbl', 'cteq4hj.tbl', 'cteq4lq.tbl' /
 
63
      Data Isetold, Isetmin, Isetmax / -987, 1, 10 /
 
64
      save
 
65
 
 
66
C             If data file not initialized, do so.
 
67
      If(Iset.ne.Isetold) then
 
68
         If (Iset.lt.Isetmin .or. Iset.gt.Isetmax) Then
 
69
            Print *, 'Invalid Iset number in Ctq4Fn :', Iset
 
70
            Stop
 
71
         Endif
 
72
         IU= NextUt()
 
73
c         Open(IU, File='Pdfdata/'//Flnm(Iset), Status='OLD', Err=100)
 
74
         TableFile=Flnm(Iset)
 
75
            call OpenData(TableFile)
 
76
c       write (*,*) TableFile
 
77
c       write(*,*) 'iu',iu
 
78
         Call ReadTbl (IU)
 
79
         Close (IU)
 
80
         Isetold=Iset
 
81
      Endif
 
82
 
 
83
      If (X .lt. 0D0 .or. X .gt. 1D0) Then
 
84
        Print *, 'X out of range in Ctq4Fn: ', X
 
85
        Stop
 
86
      Endif
 
87
      If (Q .lt. Alambda) Then
 
88
        Print *, 'Q out of range in Ctq4Fn: ', Q
 
89
        Stop
 
90
      Endif
 
91
      If (Iparton .lt. -NfMx .or. Iparton .gt. NfMx) Then
 
92
        Print *, 'Iparton out of range in Ctq4Fn: ', Iparton
 
93
        Stop
 
94
      Endif
 
95
 
 
96
      Ctq4Fn = PartonX (Iparton, X, Q)
 
97
      if(Ctq4Fn.lt.0.D0)  Ctq4Fn = 0.D0
 
98
 
 
99
      Return
 
100
 
 
101
 100  Print *, ' Data file ', Flnm(Iset), ' cannot be opened '
 
102
     >//'in Ctq4Fn!!'
 
103
      Stop
 
104
C                             ********************
 
105
      End
 
106
 
 
107
      Function NextUt()
 
108
C                                 Returns an unallocated FORTRAN i/o unit.
 
109
      Logical EX
 
110
C
 
111
      Do 10 N = 10, 300
 
112
         INQUIRE (UNIT=N, OPENED=EX)
 
113
         If (.NOT. EX) then
 
114
            NextUt = N
 
115
            Return
 
116
         Endif
 
117
 10   Continue
 
118
      Stop ' There is no available I/O unit. '
 
119
C               *************************
 
120
      End
 
121
C
 
122