5.5 Numerical implementation of PDF Mellin splines
5.5.1 Fortran implementation
The basic functionality of the Fortran implementation is hidden inside the module PdfSplineModule, which should by design not be of interest for the user. However, it also contains some important ‘static’ variables
pdfSpline.f (extract)
module PdfSplineModule
! Module that contains the spline function not to use by the user
! directly and global variables
!---implicit none
! maximum number of grid pointssave integer, parameter :: nmax = 1000
! default values if not specified by user integer :: st_int = 0 ! natural spline integer :: iset_int = 1 ! CT12
integer :: mmhtih_int = 0 ! MMHT central pdfs integer :: dssih_int = 1 ! DSS hadron type: pion integer :: dssic_int = 0 ! DSS hadron charge: average integer :: dssio_int = 1 ! DSS order: NLO
double precision :: q2_int = 1000.d0
character(len=100) :: file_int = 'ct10n.00' ! CT12 central NLO
! Further variables
integer :: ngrid = -1 ! number of grid points
The perhaps most important point in using the Fortran routines is the limitation to 1000 sample points, which we have chosen to be fixed, as it is tedious to allocate memory dynamically. The chosen maximal number should be sufficient for most grids and not too large to stress too much memory. However, if one desires another maximum, it is sufficient to change the parameter nmax. All other values shown are the defaults, that will be explained in the following.
All functionality that a typical user needs is provided in pdfSplineInterface.f
! include to use the functionality of pdfSpline.f interface
subroutine PdfSplineSet(st,iset,mmhtih,dssih,dssic,dssio,q2,
& file)
integer,intent(in),optional :: st,iset,mmhtih,dssih,dssic,
& dssio
double precision,intent(in),optional :: q2 character(len=*),intent(in),optional :: file end subroutine PdfSplineSet
end interface
interface PdfSplineGrid
subroutine PdfSplineGrid_twoarray(xarray,narray) integer,intent(in) :: narray(:)
double precision, intent(in) :: xarray(:) end subroutine PdfSplineGrid_twoarray subroutine PdfSplineGrid_simple(xmin,n)
integer,intent(in) :: n
double precision, intent(in) :: xmin end subroutine PdfSplineGrid_simple subroutine PdfSplineGrid_onearray(xarray)
double precision, intent(in) :: xarray(:) end subroutine PdfSplineGrid_onearray subroutine PdfSplineGrid_onearrayreal(xarray)
real, intent(in) :: xarray(:)
end subroutine PdfSplineGrid_onearrayreal end interface
interface
subroutine PdfSplineGet(iparton,nout,xout,paraout) integer,intent(in) :: iparton
integer,intent(out) :: nout
double precision,intent(out) :: xout(:), paraout(:,:) end subroutine PdfSplineGet
end interface interface
double complex function PdfSplineM(iparton,N) integer,intent(in) :: iparton
double complex,intent(in) :: N end function PdfSplineM
end interface interface
double precision function PdfSplineX(iparton,x) integer,intent(in) :: iparton
double precision, intent(in) :: x end function PdfSplineX
end interface interface
subroutine PdfSplinePara(io)
integer, intent(in),optional :: io end subroutine PdfSplinePara
end interface interface
double precision function PdfSplineAlphas(q2,iord,fr2,mur,
& asmur,mc,mb,mt)
double precision, intent(in) :: q2 integer, intent(in), optional :: iord
double precision, intent(in), optional :: fr2,mur,asmur,
& mc,mb,mt
end function PdfSplineAlphas end interface
which has to be included into a customer program to get access to the spline func-tionality. To initialize the calculation of the parameters of a spline is is mandatory to use the subroutine PdfSplineSet(st, iset, mmhtih, dssih, dssix, dssio, q2, datafile). The first parameter st determines the spline type. st = 0 is the natural spline, st = 1 a fixed spline which uses the underlying PDF interpolation routine to determine the first derivatives (see equations (5.13)) and st = 2 is a fixed spline which uses the grid itself to calculate the derivatives (see equations (5.14)).
The second parameter iset determines the underlying PDF set. Currently three sets are implemented: CT12 [82] (iset = 1), MMHT14 [90] (iset = 2) and DSS07 [258]
(iset = 3), which where the up to date sets of that collaborations at the production time of the spline code. All other parameters are passed to the actual PDF rou-tines, the prefixes indicate to which set they apply. If a parameter does not apply to a set, its value is indifferent. The default values where already given in the first listing of this section. The PdfSplineGrid contains several ways to call a subrou-tine to define the sampling points for the spline. The simplest one is to pass an array, that contains all xi, where the last point has to be equal to one (subroutine PdfSplineGrid(xarray)). As an alternative one can pass the number of grid points n and the smallest point of the grid xmin (subroutine PdfSplineGrid(xmin, n)).
The sampling points will then be distributed logarithmically in the interval xmin, 1 Finally one can use a mixture, passing two arrays. One defines points in x space,. the other defines the number of points sampling the PDF in the intervals defined by the first array (subroutine PdfSplineGrid(xarray, narray)). These will again be distributed logarithmically in the corresponding intervals. If no grid is specified before the first call of PdfSplineSet, the program will use the grid points defined by the PDF collaborations. The remaining functions can be called after a spline has been calculated. The subroutine PdfSplineGet returns the number of sampling points nout, the sampling points xout and the spline coefficients paraout, which are defined
by gm,k/xmk (see equation (5.20)). The latter is two dimensional, the first index mapping to m and the second to k. The function PdfSplineX(iparton, x) returns the value of the spline of a parton at the given longitudinal momentum fraction. The variable iparton maps to the flavours according to the function defined in equation (1.71), but omitting the top quark. The function PdfSplineM(iparton, N) is the equivalent in Mellin space. The subroutine PdfSplinePara(io) is a diagnostic function to print the parameters that determine the spline and also the spline coefficients into the i/o unit io. The argument defaults to io=-5, which is the terminal. Finally the interface offers the function PdfSplineAlphas(q2, iord, fr2, mur, asmur, mc, mb, mt) which selects the appropriate αs routine of the selected PDF set in PdfSplineSet. All arguments are passed to these functions and are indifferent if the underlying set does not use them. They are defaulted to iord=2 (which corresponds to NNLO), fr2=1.d0 (the ratio of the factorization and the renormalization scales squared), mur=1.d0 (the renormalization scale), asmur=0.5d0 (the value of αs at the renormalization scale), mc=1.4d0 (charm mass), mb=4.75d0 (bottom mass) and mt=1.d10 (top mass).
To extend the program to support additional PDF sets one has to add a new case into the subroutine PdfSplineCalc (which is a member of the module PdfSplineModule) to calculate the PDF values at the sampling points. Further one has to extend the subroutine PdfSplineSet with the standard sampling points and possibly new parameters. The same is true for the subroutine PdfSplinePara and function PdfSplineAlphas.