LHAPDF veraion 5.9.1
authormorsch <andreas.morsch@cern.ch>
Mon, 13 Oct 2014 09:05:49 +0000 (11:05 +0200)
committermorsch <andreas.morsch@cern.ch>
Mon, 13 Oct 2014 09:05:49 +0000 (11:05 +0200)
https://alice.its.cern.ch/jira/browse/ALIROOT-5648

111 files changed:
LHAPDF/AliStructFuncType.cxx
LHAPDF/AliStructFuncType.h
LHAPDF/CMakeliblhapdf5_9_1.pkg [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/include/LHAPDF/FortranWrappers.h [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/include/LHAPDF/FortranWrappers.h.in [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/include/LHAPDF/LHAPDF.h [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/include/LHAPDF/LHAPDFConfig.h [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/include/LHAPDF/LHAPDFConfig.h.in [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/include/LHAPDF/LHAPDFWrap.h [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/include/LHAPDF/LHAPDFfw.h [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/include/LHAPDF/Makefile.am [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/include/LHAPDF/Makefile.in [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/include/Makefile.am [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/include/Makefile.in [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/EVLCTEQ.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/EVLNNPDF.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/LHpdflib.F [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/Makefile.am [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/Makefile.in [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/QCDNUM.F [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/QCDparams.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/Smrst-lite.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/Smrst.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/Sqcdnum.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/Szeus.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/alphas.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/binreloc.c [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/binreloc.cxx [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/binreloc.h [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/common.inc [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/commoninit.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/commonlhacontrol.inc [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/commonlhaglsta.inc [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/commonlhapdf.inc [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/commonlhapdfc.inc [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/commonlhasets.inc [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/description.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/eks98.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/eksarp.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/eps08.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/eps09.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/evolution.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/getdatapath.cxx [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/inputPDF.F [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/lhaglue.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/parameter.F [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/parmsetup.inc [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/parmsetup.inc.in [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/uncertainties.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/version.cxx [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapEVLCTEQ.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapNNPDF.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapNNPDF20grid-lite.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapNNPDF20grid.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapNNPDF20qedgrid-lite.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapNNPDF20qedgrid.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapNNPDFgrid-lite.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapNNPDFgrid.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapQCDNUM.F [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapQCDNUM3.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapQCDNUM4.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapUSER.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapXNN.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapa02m-lite.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapa02m.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapabfkwpi.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapabkm09-lite.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapabkm09.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapabm11-lite.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapabm11.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapacfgpg.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapct12.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapcteq5.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapcteq6-lite.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapcteq6.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapcteq65-lite.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapcteq65.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapcteq6lg.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapdgg.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapdog.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapevolve.F [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapgjr-lite.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapgjr.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapgrv.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapgrvg.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapgrvpi.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapgsg.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapgsg96.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wraph1-lite.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wraph1.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wraphera.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapheragrid-lite.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapheragrid.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wraphkn-lite.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wraphkn.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wraplacg.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapmrst-lite.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapmrst.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapmrst2006-lite.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapmrst2006.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapmrst98.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapmrstqed-lite.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapmrstqed.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapmstw-lite.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapmstw.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapowpi.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapsasg.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapsmrspi.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapusergrid.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapwhitg.f [new file with mode: 0644]
LHAPDF/lhapdf-5.9.1/src/wrapzeus.f [new file with mode: 0644]

index 105aa7c..eee5013 100644 (file)
@@ -63,7 +63,7 @@ void AliStructFuncType::StructA(Double_t xx, Double_t qq, Double_t a,
 Int_t AliStructFuncType::PDFsetIndex(StrucFunc_t pdf)
 {
 // PDF set index
-    Int_t pdfSetNumber[10] = {
+    Int_t pdfSetNumber[12] = {
        19170,
        19150,
        19070,
@@ -73,7 +73,9 @@ Int_t AliStructFuncType::PDFsetIndex(StrucFunc_t pdf)
        10100,
        10050,
        10041,
-       10042
+       10042,
+        10800,
+       11000
     };
     return pdfSetNumber[pdf];
 }
@@ -81,7 +83,7 @@ Int_t AliStructFuncType::PDFsetIndex(StrucFunc_t pdf)
 TString AliStructFuncType::PDFsetName(StrucFunc_t pdf)
 {
 // PDF Set Name
-    TString pdfsetName[10]   = {
+    TString pdfsetName[12]   = {
        "cteq4l.LHgrid",
        "cteq4m.LHgrid",   
        "cteq5l.LHgrid",
@@ -91,7 +93,9 @@ TString AliStructFuncType::PDFsetName(StrucFunc_t pdf)
        "cteq61.LHpdf",
        "cteq6m.LHpdf",
        "cteq6l.LHpdf", 
-       "cteq6ll.LHpdf"
+       "cteq6ll.LHpdf",
+       "CT10.LHgrid", 
+       "CT10nlo.LHgrid"
     };
     return pdfsetName[pdf];
 }
index 983ef48..4b61db5 100644 (file)
@@ -22,7 +22,9 @@ typedef enum
     kCTEQ61,  // cteq61.LHpdf
     kCTEQ6m,  // cteq6m.LHpdf
     kCTEQ6l,  // cteq6l.LHpdf 
-    kCTEQ6ll  // cteq6ll.LHpdf
+    kCTEQ6ll, // cteq6ll.LHpdf
+    kCT10,    // CT10.LHgrid
+    kCT10nlo  // CT10nlo.LHgrid
 }
 StrucFunc_t;
 
diff --git a/LHAPDF/CMakeliblhapdf5_9_1.pkg b/LHAPDF/CMakeliblhapdf5_9_1.pkg
new file mode 100644 (file)
index 0000000..e14399c
--- /dev/null
@@ -0,0 +1,128 @@
+# -*- mode: cmake -*-
+
+#--------------------------------------------------------------------------------#
+# Package File for lhapdf                                                        #
+# Author : Johny Jose (johny.jose@cern.ch)                                       #
+# Variables Defined :                                                            #
+#                                                                                #
+# SRCS - C++ source files                                                        #
+# HDRS - C++ header files                                                        #
+# DHDR - ROOT Dictionary Linkdef header file                                     #
+# CSRCS - C source files                                                         #
+# CHDRS - C header files                                                         #
+# EINCLUDE - Include directories                                                 #
+# EDEFINE - Compiler definitions                                                 #
+# ELIBS - Extra libraries to link                                                #
+# ELIBSDIR - Extra library directories                                           #
+# PACKFFLAGS - Fortran compiler flags for package                                #
+# PACKCXXFLAGS - C++ compiler flags for package                                  #
+# PACKCFLAGS - C compiler flags for package                                      #
+# PACKSOFLAGS - Shared library linking flags                                     #
+# PACKLDFLAGS - Module linker flags                                              #
+# PACKBLIBS - Libraries to link (Executables only)                               #
+# EXPORT - Header files to be exported                                           #
+# CINTHDRS - Dictionary header files                                             #
+# CINTAUTOLINK - Set automatic dictionary generation                             #
+# ARLIBS - Archive Libraries and objects for linking (Executables only)          #
+# SHLIBS - Shared Libraries and objects for linking (Executables only)           #
+#--------------------------------------------------------------------------------#
+
+set ( SRCS AliStructFuncType.cxx lhapdf-5.9.1/src/version.cxx  lhapdf-5.9.1/src/getdatapath.cxx)
+
+set ( HDRS  AliStructFuncType.h)
+
+set ( DHDR lhapdfLinkDef.h)
+
+set ( EINCLUDE  LHAPDF/lhapdf-5.9.1 LHAPDF/lhapdf-5.9.1/include  LHAPDF/lhapdf-5.9.1/src)
+
+set ( CSRCS  lhapdf-5.9.1/src/binreloc.c )
+
+set ( FSRCS  
+ lhapdf-5.9.1/src/alphas.f 
+ lhapdf-5.9.1/src/commoninit.f 
+ lhapdf-5.9.1/src/description.f 
+ lhapdf-5.9.1/src/eks98.f 
+ lhapdf-5.9.1/src/eksarp.f 
+ lhapdf-5.9.1/src/eps08.f  
+ lhapdf-5.9.1/src/eps09.f 
+ lhapdf-5.9.1/src/EVLCTEQ.f 
+ lhapdf-5.9.1/src/EVLNNPDF.f 
+ lhapdf-5.9.1/src/evolution.f 
+ lhapdf-5.9.1/src/inputPDF.f 
+ lhapdf-5.9.1/src/LHpdflib.F 
+ lhapdf-5.9.1/src/parameter.f
+ lhapdf-5.9.1/src/QCDNUM.f
+ lhapdf-5.9.1/src/QCDparams.f
+ lhapdf-5.9.1/src/Smrst.f 
+ lhapdf-5.9.1/src/Sqcdnum.f
+ lhapdf-5.9.1/src/Szeus.f
+ lhapdf-5.9.1/src/uncertainties.f
+ lhapdf-5.9.1/src/wrapNNPDF.f
+ lhapdf-5.9.1/src/wrapNNPDF20grid.f
+ lhapdf-5.9.1/src/wrapNNPDF20qedgrid.f
+ lhapdf-5.9.1/src/wrapNNPDFgrid.f
+ lhapdf-5.9.1/src/wrapa02m.f 
+ lhapdf-5.9.1/src/wrapabfkwpi.f
+ lhapdf-5.9.1/src/wrapabkm09.f
+ lhapdf-5.9.1/src/wrapabm11.f
+ lhapdf-5.9.1/src/wrapacfgpg.f
+ lhapdf-5.9.1/src/wrapct12.f
+ lhapdf-5.9.1/src/wrapcteq5.f 
+ lhapdf-5.9.1/src/wrapcteq6.f 
+ lhapdf-5.9.1/src/wrapcteq65.f 
+ lhapdf-5.9.1/src/wrapcteq6lg.f 
+ lhapdf-5.9.1/src/wrapdgg.f
+ lhapdf-5.9.1/src/wrapdog.f
+ lhapdf-5.9.1/src/wrapEVLCTEQ.f 
+ lhapdf-5.9.1/src/wrapevolve.f
+ lhapdf-5.9.1/src/wrapgjr.f  
+ lhapdf-5.9.1/src/wrapgrv.f 
+ lhapdf-5.9.1/src/wrapgrvg.f 
+ lhapdf-5.9.1/src/wrapgrvpi.f
+ lhapdf-5.9.1/src/wrapgsg96.f
+ lhapdf-5.9.1/src/wrapgsg.f 
+ lhapdf-5.9.1/src/wraph1.f 
+ lhapdf-5.9.1/src/wraphera.f 
+ lhapdf-5.9.1/src/wrapheragrid.f
+ lhapdf-5.9.1/src/wraphkn.f 
+ lhapdf-5.9.1/src/wraplacg.f
+ lhapdf-5.9.1/src/wrapowpi.f
+ lhapdf-5.9.1/src/wrapmrst.f 
+ lhapdf-5.9.1/src/wrapmrst2006.f 
+ lhapdf-5.9.1/src/wrapmrst98.f 
+ lhapdf-5.9.1/src/wrapmrstqed.f 
+ lhapdf-5.9.1/src/wrapQCDNUM3.f 
+ lhapdf-5.9.1/src/wrapQCDNUM4.f 
+ lhapdf-5.9.1/src/wrapQCDNUM.f 
+ lhapdf-5.9.1/src/wrapsasg.f 
+ lhapdf-5.9.1/src/wrapmstw.f 
+ lhapdf-5.9.1/src/wrapowpi.f 
+ lhapdf-5.9.1/src/wrapsmrspi.f 
+ lhapdf-5.9.1/src/wrapwhitg.f 
+ lhapdf-5.9.1/src/wrapzeus.f 
+ lhapdf-5.9.1/src/lhaglue.f 
+ lhapdf-5.9.1/src/wrapUSER.f
+ lhapdf-5.9.1/src/wrapXNN.f
+)
+
+if( ALICE_TARGET STREQUAL "solarisCC5")
+         set ( PACKFFLAGS "${FFLAGS} -free")
+elseif( ALICE_TARGET STREQUAL "linuxx8664icc")
+               set ( PACKFFLAGS "${FFLAGS} -nofixed" )
+else()
+               set ( PACKFFLAGS "${FFLAGS} -cpp -ffree-form -DCTEQ")
+endif( ALICE_TARGET STREQUAL "solarisCC5")
+
+set( PACKCXXFLAGS "${CXXFLAGS} -DDEFAULTPREFIXPATH=\\\"NONE\\\" -DDEFAULTLHAPATH=\\\"${ALICE_ROOT}/LHAPDF/PDFsets\\\"" )
+
+
+set ( EXPORT AliStructFuncType.h)
+
+#--------------------------------------------------------------------------------#
+# install PDF data 
+install ( DIRECTORY PDFsets
+  DESTINATION LHAPDF
+  PATTERN ".svn" EXCLUDE
+  PATTERN ".d"  EXCLUDE 
+  PATTERN ".so" EXCLUDE)
+
diff --git a/LHAPDF/lhapdf-5.9.1/include/LHAPDF/FortranWrappers.h b/LHAPDF/lhapdf-5.9.1/include/LHAPDF/FortranWrappers.h
new file mode 100644 (file)
index 0000000..b704933
--- /dev/null
@@ -0,0 +1,39 @@
+//#ifndef LHAPDF_FORTRANWRAPPERS_H
+//#define LHAPDF_FORTRANWRAPPERS_H
+
+/* Define to dummy `main' function (if any) required to link to the Fortran
+   libraries. */
+//#undef FC_DUMMY_MAIN
+
+/* Define if F77 and FC dummy `main' functions are identical. */
+//#undef FC_DUMMY_MAIN_EQ_F77
+
+/* Define to a macro mangling the given C identifier (in lower and upper
+   case), which must not contain underscores, for linking with Fortran. */
+//#undef FC_FUNC
+
+/* As FC_FUNC, but for C identifiers containing underscores. */
+//#undef FC_FUNC_
+
+//#endif
+
+/* include/LHAPDF/FortranWrappers.h.  Generated from FortranWrappers.h.in by configure.  */
+/* Define to dummy `main' function (if any) required to link to the Fortran
+   libraries. */
+/* #undef FC_DUMMY_MAIN */
+
+/* Define if F77 and FC dummy `main' functions are identical. */
+/* #undef FC_DUMMY_MAIN_EQ_F77 */
+
+/* Define to a macro mangling the given C identifier (in lower and upper
+   case), which must not contain underscores, for linking with Fortran. */
+#define FC_FUNC(name,NAME) name ## _
+
+/* As FC_FUNC, but for C identifiers containing underscores. */
+#define FC_FUNC_(name,NAME) name ## _
+
+/* As FC_FUNC, but for C identifiers containing underscores. */
+#define FC_FUNC_(name,NAME) name ## _
+
+/* LHAPDF version string */
+#define PACKAGE_VERSION "5.9.1"
diff --git a/LHAPDF/lhapdf-5.9.1/include/LHAPDF/FortranWrappers.h.in b/LHAPDF/lhapdf-5.9.1/include/LHAPDF/FortranWrappers.h.in
new file mode 100644 (file)
index 0000000..ff8525a
--- /dev/null
@@ -0,0 +1,18 @@
+#ifndef LHAPDF_FORTRANWRAPPERS_H
+#define LHAPDF_FORTRANWRAPPERS_H
+
+/* Define to dummy `main' function (if any) required to link to the Fortran
+   libraries. */
+#undef FC_DUMMY_MAIN
+
+/* Define if F77 and FC dummy `main' functions are identical. */
+#undef FC_DUMMY_MAIN_EQ_F77
+
+/* Define to a macro mangling the given C identifier (in lower and upper
+   case), which must not contain underscores, for linking with Fortran. */
+#undef FC_FUNC
+
+/* As FC_FUNC, but for C identifiers containing underscores. */
+#undef FC_FUNC_
+
+#endif
diff --git a/LHAPDF/lhapdf-5.9.1/include/LHAPDF/LHAPDF.h b/LHAPDF/lhapdf-5.9.1/include/LHAPDF/LHAPDF.h
new file mode 100644 (file)
index 0000000..4fd79e4
--- /dev/null
@@ -0,0 +1,581 @@
+#ifndef LHAPDF_H
+#define LHAPDF_H
+
+#include "LHAPDF/LHAPDFConfig.h"
+
+#include <string>
+#include <vector>
+#include <iostream>
+#include <sstream>
+
+/**
+ * @mainpage A C++ wrapper for the LHAPDF library
+ *
+ * @section intro Introduction
+ * The LHAPDF library provides a set of C++ wrapper functions
+ * for its Fortran subroutines. New users should browse this
+ * documentation and take a look at the @c CCTest1.cc and
+ * @c CCTest2.cc example program source files, which are good
+ * examples of how the wrapper is used.
+ *
+ * @section changes Recent changes
+ * The LHAPDF wrapper has been improved in several ways for
+ * the LHAPDF v5.4 release:
+ *
+ * @li String passing to the Fortran functions from C++ now
+ *  correctly passes the hidden length argument, fixing problems
+ *  on 64 bit systems;
+ * @li The @c LHAPDFWrap class has been deprecated in favour of
+ *  a set of wrapper functions in the @c LHAPDF namespace. The
+ *  class interface was misleading, since no persistent state
+ *  was involved and two class instances would not have been
+ *  independent;
+ * @li Proper C++ @c std::string arguments can now be used for
+ *  set names: @c char* string arguments can still be passed, due
+ *  to implicit conversion via the string(char*) constructor.
+ *
+ * @section credits Credits
+ *
+ * @li Originally by Stefan Gieseke.
+ * @li Adapted for LHAPDFv4 by Mike Whalley.
+ * @li Adapted for LHAPDFv5 by Craig Group/Mike Whalley.
+ * @li v5.4: Fortran portability, tidying, extensions
+ *  and conversion to namespaced functions by Andy Buckley.
+ * @li v5.4.1: Rationalised init functions and deprecated "M"
+ *  functions by Andy Buckley.
+ * @li v5.5.1: Added PDFSetInfo set metadata struct, and
+ *  associated querying based on reading the PDFsets.index file.
+ *
+ * @example ../examples/CCTest1.cc
+ * This is an example of a program using the recommended C++
+ * interface to LHAPDF.
+ *
+ * @example ../examples/CCTest2.cc
+ * An example of a program using the C++ interface to LHAPDF to
+ * calculate PDF errors.
+ */
+
+
+// Compatibility preprocessing of deprecated "M" function names
+#define initPDFSetM initPDFSet
+#define initPDFSetByNameM initPDFSetByName
+#define initPDFM initPDF
+#define initPDFByNameM initPDFByName
+#define getDescriptionM getDescription
+#define xfxM xfx
+#define xfxpM xfxp
+#define xfxaM xfxa
+#define xfxphotonM xfxphoton
+#define numberPDFM numberPDF
+#define alphasPDFM alphasPDF
+#define getOrderPDFM getOrderPDF
+#define getOrderAlphaSM getOrderAlphaS
+#define getQMassM getQMass
+#define getThresholdM getThreshold
+#define getNfM getNf
+#define getLam4M getLam4
+#define getLam5M getLam5
+#define getXminM getXmin
+#define getXmaxM getXmax
+#define getQ2minM getQ2min
+#define getQ2maxM getQ2max
+
+
+/// Namespace containing all the LHAPDF wrapper functions.
+namespace LHAPDF {
+
+  /// @brief Enum of flavours which map to LHAPDF integer codes.
+  /// Useful for improving readability of client code. Note that these codes
+  /// can't be used to access elements of returned @c vector<double>, which
+  /// don't use the LHAPDF scheme (they use "LHAPDF code + 6").
+  enum Flavour {
+    TBAR= -6, BBAR = -5, CBAR = -4, SBAR = -3, UBAR = -2, DBAR = -1,
+    GLUON = 0,
+    DOWN = 1, UP = 2, STRANGE = 3, CHARM = 4, BOTTOM = 5, TOP= 6,
+    PHOTON = 7
+  };
+
+  /// @brief Distinction between evolution or interpolation PDF sets.
+  /// Enum to choose whether evolution (i.e. @c LHpdf data file) or
+  /// interpolation (i.e. @c LHgrid data file) is used.
+  enum SetType {
+    EVOLVE = 0, LHPDF = 0,
+    INTERPOLATE = 1, LHGRID = 1
+  };
+
+  /// Level of noisiness.
+  enum Verbosity { SILENT=0, LOWKEY=1, DEFAULT=2 };
+
+
+  /// @name Global functions
+  //@{
+
+  /// Get LHAPDF version string.
+  std::string getVersion();
+
+  /// Get max allowed number of concurrent sets.
+  int getMaxNumSets();
+
+  /// Global initialisation.
+  void initLHAPDF();
+
+  /// Choose level of noisiness.
+  void setVerbosity(Verbosity noiselevel);
+
+  /// Extrapolate beyond grid edges.
+  void extrapolate(bool extrapolate=true);
+
+  /// Set the LHAPATH variable (the location of the PDF sets directory).
+  void setPDFPath(const std::string& path);
+
+  /// Set a steering parameter (direct map to Fortran @c setlhaparm(parm) function).
+  void setParameter(const std::string& parm);
+
+  //@}
+
+
+  /// @name Set metadata
+  //@{
+
+  /// Structure containing metadata about a PDF set.
+  class PDFSetInfo {
+  public:
+    std::string file;
+    std::string description;
+    int id;
+    int pdflibNType, pdflibNGroup, pdflibNSet;
+    int memberId;
+    double lowx, highx;
+    double lowQ2, highQ2;
+
+    /// Render a standard representation of a PDF set's metadata.
+    std::string toString() const {
+      std::ostringstream os;
+      os << "PDF set #" << id
+         << " {"
+         << " file='" << file << "',"
+         << " description='" << description << "',"
+         << " x = ["  << lowx  << ", " << highx << "],"
+         << " Q2 = [" << lowQ2 << ", " << highQ2 << "]"
+         << " }";
+      return os.str();
+    }
+  };
+
+
+  inline std::ostream& operator<<(std::ostream& os, const PDFSetInfo& info) {
+    os << info.toString();
+    return os;
+  }
+
+  /// Get a PDF set info object by filename and member number.
+  PDFSetInfo getPDFSetInfo(const std::string& filename, int memid);
+
+  /// Get a PDF set info object by the LHAPDF ID number.
+  PDFSetInfo getPDFSetInfo(int id);
+
+  /// Get a vector of PDF set info objects for all known sets.
+  std::vector<PDFSetInfo> getAllPDFSetInfo();
+  //@}
+
+
+  /// @name Path info functions
+  //@{
+
+  /// Get path to LHAPDF installation (the "prefix" path).
+  std::string prefixPath();
+
+  /// Get path to LHAPDF PDF sets directory.
+  std::string pdfsetsPath();
+
+  /// Get path to LHAPDF PDF sets index file.
+  std::string pdfsetsIndexPath();
+
+  //@}
+
+
+  /// @name Initialisation functions
+  /// LHAPDF functions for initialising PDF sets. If you need to use
+  /// more than one set simultaneously, use the multi-set functions, which
+  /// have a integer @c nset first argument.
+  //@{
+
+  /// Initialise @a member in PDF set @a setid.
+  void initPDFSet(int setid, int member);
+  /// Initialise @a member in PDF set @a setid (multi-set version).
+  void initPDFSet(int nset, int setid, int member); // can't have a default 3rd arg
+
+  /// Initialise @a member in PDF set @a name, of type @a type.
+  void initPDFSet(const std::string& name, SetType type, int member=0);
+  /// Initialise @a member in PDF set @a name, of type @a type (multi-set version).
+  void initPDFSet(int nset, const std::string& name, SetType type, int member=0);
+
+  /// @brief Initialise @a member in PDF set file @a filename.
+  /// If @a filename contains a "/" character, it will be used as a path,
+  /// otherwise it will be assumed to be a PDF file in the LHAPDF @c PDFsets directory.
+  void initPDFSet(const std::string& filename, int member=0);
+  /// @brief Initialise @a member in PDF set file @a filename (multi-set version).
+  /// If @a filename contains a "/" character, it will be used as a path,
+  /// otherwise it will be assumed to be a PDF file in the LHAPDF @c PDFsets directory.
+  void initPDFSet(int nset, const std::string& filename, int member=0);
+
+  /// @brief Use @a member in current PDF set.
+  /// This operation is computationally cheap.
+  void usePDFMember(int member);
+  /// @brief Use @a member in PDF set @a nset (multi-set version).
+  /// This operation is computationally cheap.
+  void usePDFMember(int nset, int member);
+  //@}
+
+
+  /// @name PDF set information
+  //@{
+
+  /// Prints a brief description of the current PDF set to stdout.
+  void getDescription();
+  /// Prints a brief description of the current PDF set to stdout.
+  void getDescription(int nset);
+
+  /// Does the current set have a photon member?
+  bool hasPhoton();
+
+  /// Number of members available in the current set.
+  int numberPDF();
+  /// Number of members available in the current set.
+  int numberPDF(int nset);
+
+  /// \f$ \alpha_\mathrm{s} \f$ used by the current PDF.
+  double alphasPDF(double Q);
+  /// \f$ \alpha_\mathrm{s} \f$ used by the current PDF.
+  double alphasPDF(int nset, double Q);
+
+  /// Get order at which the PDF was fitted.
+  int getOrderPDF();
+  /// Get order at which the PDF was fitted.
+  int getOrderPDF(int nset);
+
+  /// Perturbative order of parton evolution and \f$ \alpha_\mathrm{s} \f$ respectively.
+  int getOrderAlphaS();
+  /// Perturbative order of parton evolution and \f$ \alpha_\mathrm{s} \f$ respectively.
+  int getOrderAlphaS(int nset);
+
+  /// Quark mass used for flavour @a f.
+  double getQMass(int f);
+  /// Quark mass used for flavour @a f.
+  double getQMass(int nset, int f);
+
+  /// Threshold for flavour @a f.
+  double getThreshold(int f);
+  /// Threshold for flavour @a f.
+  double getThreshold(int nset, int f);
+
+  /// Number of flavours used in the current PDF set.
+  int getNf();
+  /// Number of flavours used in the current PDF set.
+  int getNf(int nset);
+
+  /// Value of QCD \f$ \lambda_4 \f$ for member @a m.
+  double getLam4(int m);
+  /// Value of QCD \f$ \lambda_4 \f$ for member @a m.
+  double getLam4(int nset, int m);
+
+  /// Value of QCD \f$ \lambda_5 \f$ for member @a m.
+  double getLam5(int m);
+  /// Value of QCD \f$ \lambda_5 \f$ for member @a m.
+  double getLam5(int nset, int m);
+
+  /// Minimum \f$ x \f$ value considered valid for this set, as specified by the set authors.
+  double getXmin(int m);
+  /// Minimum \f$ x \f$ value considered valid for this set, as specified by the set authors.
+  double getXmin(int nset, int m);
+
+  /// Maximum \f$ x \f$ value considered valid for this set, as specified by the set authors.
+  double getXmax(int m);
+  /// Maximum \f$ x \f$ value considered valid for this set, as specified by the set authors.
+  double getXmax(int nset, int m);
+
+  /// Minimum \f$ Q^2 \f$ value considered valid for this set, as specified by the set authors.
+  double getQ2min(int m);
+  /// Minimum \f$ Q^2 \f$ value considered valid for this set, as specified by the set authors.
+  double getQ2min(int nset, int m);
+
+  /// Maximum \f$ Q^2 \f$ value considered valid for this set, as specified by the set authors.
+  double getQ2max(int m);
+  /// Maximum \f$ Q^2 \f$ value considered valid for this set, as specified by the set authors.
+  double getQ2max(int nset, int m);
+  //@}
+
+
+  /// @name Nucleon PDFs
+  /// These PDFs are defined for protons --- neutron PDFs are usually obtained by
+  /// isospin conjugation.
+  //@{
+
+  /// Nucleon PDF: returns a vector \f$ x f_i(x, Q) \f$ with index \f$ 0 < i < 12 \f$.
+  /// @arg 0..5 = \f$ \bar{t} \f$, ..., \f$ \bar{u} \f$, \f$ \bar{d} \f$;
+  /// @arg 6 = \f$ g \f$;
+  /// @arg 7..12 = \f$ d \f$, \f$ u \f$, ..., \f$ t \f$.
+  std::vector<double> xfx(double x, double Q);
+  /// Nucleon PDF: returns a vector @c x f_i(x, Q) with index \f$ 0 < i < 12 \f$.
+  /// @arg 0..5 = \f$ \bar{t} \f$, ..., \f$ \bar{u} \f$, \f$ \bar{d} \f$;
+  /// @arg 6 = \f$ g \f$;
+  /// @arg 7..12 = \f$ d \f$, \f$ u \f$, ..., \f$ t \f$.
+  std::vector<double> xfx(int nset, double x, double Q);
+
+  /// Nucleon PDF: fills primitive 13 element array pointed at by @a results with
+  /// \f$ x f(x, Q) \f$ with index \f$ 0 < i < 12 \f$.
+  /// @arg 0..5 = \f$ \bar{t} \f$, ..., \f$ \bar{u} \f$, \f$ \bar{d} \f$;
+  /// @arg 6 = \f$ g \f$;
+  /// @arg 7..12 = \f$ d \f$, \f$ u \f$, ..., \f$ t \f$.
+  void xfx(double x, double Q, double* results);
+  /// Nucleon PDF: fills primitive 13 element array pointed at by @a results with
+  /// \f$ x f(x, Q) \f$ with index \f$ 0 < i < 12 \f$.
+  /// @arg 0..5 = \f$ \bar{t} \f$, ..., \f$ \bar{u} \f$, \f$ \bar{d} \f$;
+  /// @arg 6 = \f$ g \f$;
+  /// @arg 7..12 = \f$ d \f$, \f$ u \f$, ..., \f$ t \f$.
+  void xfx(int nset, double x, double Q, double* results);
+
+
+  /// Nucleon PDF: returns \f$ x f(x, Q) \f$ for flavour @a fl - this time the flavour encoding
+  /// is as in the LHAPDF manual.
+  /// @arg -6..-1 = \f$ \bar{t} \f$, ..., \f$ \bar{u} \f$, \f$ \bar{d} \f$;
+  /// @arg 0 = \f$ g \f$
+  /// @arg 1..6 = \f$ d \f$, \f$ u \f$, ..., \f$ t \f$.
+  double xfx(double x, double Q, int fl);
+  /// Nucleon PDF: returns @c x f(x, Q) for flavour @a fl - this time the flavour encoding
+  /// is as in the LHAPDF manual.
+  /// @arg -6..-1 = \f$ \bar{t} \f$, ..., \f$ \bar{u} \f$, \f$ \bar{d} \f$;
+  /// @arg 0 = \f$ g \f$
+  /// @arg 1..6 = \f$ d \f$, \f$ u \f$, ..., \f$ t \f$.
+  double xfx(int nset, double x, double Q, int fl);
+  //@}
+
+
+  /// @name Photon PDFs
+  //@{
+
+  /// Photon PDF: returns a vector \f$ x f_i(x, Q) \f$ with index \f$ 0 < i < 12 \f$.
+  /// @arg 0..5 = \f$ \bar{t} \f$, ..., \f$ \bar{u} \f$, \f$ \bar{d} \f$;
+  /// @arg 6 = \f$ g \f$;
+  /// @arg 7..12 = \f$ d \f$, \f$ u \f$, ..., \f$ t \f$.
+  ///
+  /// NB. Extra @a P2 and @a ip params.
+  std::vector<double> xfxp(double x, double Q, double P2, int ip);
+  /// Photon PDF: returns a vector \f$ x f_i(x, Q) \f$ with index \f$ 0 < i < 12 \f$.
+  /// @arg 0..5 = \f$ \bar{t} \f$, ..., \f$ \bar{u} \f$, \f$ \bar{d} \f$;
+  /// @arg 6 = \f$ g \f$;
+  /// @arg 7..12 = \f$ d \f$, \f$ u \f$, ..., \f$ t \f$.
+  ///
+  /// NB. Extra @a P2 and @a ip params.
+  std::vector<double> xfxp(int nset, double x, double Q, double P2, int ip);
+
+  /// Photon PDF: fills primitive 13 element array pointed at by @a results with
+  /// \f$ x f(x, Q) \f$ with index \f$ 0 < i < 12 \f$.
+  /// @arg 0..5 = \f$ \bar{t} \f$, ..., \f$ \bar{u} \f$, \f$ \bar{d} \f$;
+  /// @arg 6 = \f$ g \f$;
+  /// @arg 7..12 = \f$ d \f$, \f$ u \f$, ..., \f$ t \f$.
+  ///
+  /// NB. Extra @a P2 and @a ip params.
+  void xfxp(double x, double Q, double P2, int ip, double* results);
+  /// Photon PDF: fills primitive 13 element array pointed at by @a results with
+  /// \f$ x f(x, Q) \f$ with index \f$ 0 < i < 12 \f$.
+  /// @arg 0..5 = \f$ \bar{t} \f$, ..., \f$ \bar{u} \f$, \f$ \bar{d} \f$;
+  /// @arg 6 = \f$ g \f$;
+  /// @arg 7..12 = \f$ d \f$, \f$ u \f$, ..., \f$ t \f$.
+  ///
+  /// NB. Extra @a P2 and @a ip params.
+  void xfxp(int nset, double x, double Q, double P2, int ip, double* results);
+
+
+  /// Photon PDF: returns \f$ x f(x, Q) \f$ for flavour @a fl - this time the flavour encoding
+  /// is as in the LHAPDF manual.
+  /// @arg -6..-1 = \f$ \bar{t} \f$, ..., \f$ \bar{u} \f$, \f$ \bar{d} \f$;
+  /// @arg 0 = \f$ g \f$
+  /// @arg 1..6 = \f$ d \f$, \f$ u \f$, ..., \f$ t \f$.
+  ///
+  /// NB. Extra @a P2 and @a ip params.
+  double xfxp(double x, double Q, double P2, int ip, int fl);
+  /// Photon PDF: returns \f$ x f(x, Q) \f$ for flavour @a fl - this time the flavour encoding
+  /// is as in the LHAPDF manual.
+  /// @arg -6..-1 = \f$ \bar{t} \f$, ..., \f$ \bar{u} \f$, \f$ \bar{d} \f$;
+  /// @arg 0 = \f$ g \f$
+  /// @arg 1..6 = \f$ d \f$, \f$ u \f$, ..., \f$ t \f$.
+  ///
+  /// NB. Extra @a P2 and @a ip params.
+  double xfxp(int nset, double x, double Q, double P2, int ip, int fl);
+  //@}
+
+
+  /// @name Nuclear PDFs
+  //@{
+
+  /// Nuclear PDF: returns a vector \f$ x f_i(x, Q) \f$ with index \f$ 0 < i < 12 \f$.
+  /// @arg 0..5 = \f$ \bar{t} \f$, ..., \f$ \bar{u} \f$, \f$ \bar{d} \f$;
+  /// @arg 6 = \f$ g \f$;
+  /// @arg 7..12 = \f$ d \f$, \f$ u \f$, ..., \f$ t \f$.
+  ///
+  /// NB. Extra @a a param for atomic mass number.
+  std::vector<double> xfxa(double x, double Q, double a);
+  /// Nuclear PDF: returns a vector \f$ x f_i(x, Q) \f$ with index \f$ 0 < i < 12 \f$.
+  /// @arg 0..5 = \f$ \bar{t} \f$, ..., \f$ \bar{u} \f$, \f$ \bar{d} \f$;
+  /// @arg 6 = \f$ g \f$;
+  /// @arg 7..12 = \f$ d \f$, \f$ u \f$, ..., \f$ t \f$.
+  ///
+  /// NB. Extra @a a param for atomic mass number.
+  std::vector<double> xfxa(int nset, double x, double Q, double a);
+
+  /// Nuclear PDF: fills primitive 13 element array pointed at by @a results with
+  /// \f$ x f(x, Q) \f$ with index \f$ 0 < i < 12 \f$.
+  /// @arg 0..5 = \f$ \bar{t} \f$, ..., \f$ \bar{u} \f$, \f$ \bar{d} \f$;
+  /// @arg 6 = \f$ g \f$;
+  /// @arg 7..12 = \f$ d \f$, \f$ u \f$, ..., \f$ t \f$.
+  ///
+  /// NB. Extra @a a param for atomic mass number.
+  void xfxa(double x, double Q, double a, double* results);
+  /// Nuclear PDF: fills primitive 13 element array pointed at by @a results with
+  /// \f$ x f(x, Q) \f$ with index \f$ 0 < i < 12 \f$.
+  /// @arg 0..5 = \f$ \bar{t} \f$, ..., \f$ \bar{u} \f$, \f$ \bar{d} \f$;
+  /// @arg 6 = \f$ g \f$;
+  /// @arg 7..12 = \f$ d \f$, \f$ u \f$, ..., \f$ t \f$.
+  ///
+  /// NB. Extra @a a param for atomic mass number.
+  void xfxa(int nset, double x, double Q, double a, double* results);
+
+  /// Nuclear PDF: returns \f$ x f(x, Q) \f$ for flavour @a fl - this time the flavour encoding
+  /// is as in the LHAPDF manual.
+  /// @arg -6..-1 = \f$ \bar{t} \f$, ..., \f$ \bar{u} \f$, \f$ \bar{d} \f$;
+  /// @arg 0 = \f$ g \f$
+  /// @arg 1..6 = \f$ d \f$, \f$ u \f$, ..., \f$ t \f$.
+  ///
+  /// NB. Extra @a a param for atomic mass number.
+  double xfxa(double x, double Q, double a, int fl);
+  /// Nuclear PDF: returns \f$ x f(x, Q) \f$ for flavour @a fl - this time the flavour encoding
+  /// is as in the LHAPDF manual.
+  /// @arg -6..-1 = \f$ \bar{t} \f$, ..., \f$ \bar{u} \f$, \f$ \bar{d} \f$;
+  /// @arg 0 = \f$ g \f$
+  /// @arg 1..6 = \f$ d \f$, \f$ u \f$, ..., \f$ t \f$.
+  ///
+  /// NB. Extra @a a param for atomic mass number.
+  double xfxa(int nset, double x, double Q, double a, int fl);
+  //@}
+
+
+  /// @name Nucleon MRST QED PDF
+  /// These functions only apply to the MRST QED PDF set, since they return an extra element
+  /// for the additional photon.
+  //@{
+
+  /// MRST QED PDF: returns a vector \f$ x f_i(x, Q) \f$ with index \f$ 0 < i < 12 \f$.
+  /// @arg 0..5 = \f$ \bar{t} \f$, ..., \f$ \bar{u} \f$, \f$ \bar{d} \f$;
+  /// @arg 6 = \f$ g \f$;
+  /// @arg 7..12 = \f$ d \f$, \f$ u \f$, ..., \f$ t \f$;
+  /// @arg 13 = \f$ \gamma \f$.
+  ///
+  /// NB. Note extra element in this set for MRST photon.
+  std::vector<double> xfxphoton(double x, double Q);
+  /// MRST QED PDF: returns a vector \f$ x f_i(x, Q) \f$ with index \f$ 0 < i < 12 \f$.
+  /// @arg 0..5 = \f$ \bar{t} \f$, ..., \f$ \bar{u} \f$, \f$ \bar{d} \f$;
+  /// @arg 6 = \f$ g \f$;
+  /// @arg 7..12 = \f$ d \f$, \f$ u \f$, ..., \f$ t \f$;
+  /// @arg 13 = \f$ \gamma \f$.
+  std::vector<double> xfxphoton(int nset, double x, double Q);
+
+
+  /// MRST QED PDF: fills primitive 14 element array pointed at by @a results with
+  /// \f$ x f(x, Q) \f$ with index \f$ 0 < i < 12 \f$.
+  /// @arg 0..5 = \f$ \bar{t} \f$, ..., \f$ \bar{u} \f$, \f$ \bar{d} \f$;
+  /// @arg 6 = \f$ g \f$;
+  /// @arg 7..12 = \f$ d \f$, \f$ u \f$, ..., \f$ t \f$.
+  /// @arg 13 = \f$ \gamma \f$.
+  ///
+  /// NB. Note extra element in this set for MRST photon.
+  void xfxphoton(double x, double Q, double* results);
+  /// MRST QED PDF: fills primitive 14 element array pointed at by @a results with
+  /// \f$ x f(x, Q) \f$ with index \f$ 0 < i < 12 \f$.
+  /// @arg 0..5 = \f$ \bar{t} \f$, ..., \f$ \bar{u} \f$, \f$ \bar{d} \f$;
+  /// @arg 6 = \f$ g \f$;
+  /// @arg 7..12 = \f$ d \f$, \f$ u \f$, ..., \f$ t \f$.
+  /// @arg 13 = \f$ \gamma \f$.
+  ///
+  /// NB. Note extra element in this set for MRST photon.
+  void xfxphoton(int nset, double x, double Q, double* results);
+
+
+  /// MRST QED PDF: returns \f$ x f(x, Q) \f$ for flavour @a fl - this time the flavour encoding
+  /// is as in the LHAPDF manual.
+  /// @arg -6..-1 = \f$ \bar{t} \f$, ..., \f$ \bar{u} \f$, \f$ \bar{d} \f$;
+  /// @arg 0 = \f$ g \f$
+  /// @arg 1..6 = \f$ d \f$, \f$ u \f$, ..., \f$ t \f$;
+  /// @arg 7 = \f$ \gamma \f$.
+  ///
+  /// NB. Note extra element in this set for MRST photon.
+  double xfxphoton(double x, double Q, int fl);
+  /// MRST QED PDF: returns \f$ x f(x, Q) \f$ for flavour @a fl - this time the flavour encoding
+  /// is as in the LHAPDF manual.
+  /// @arg -6..-1 = \f$ \bar{t} \f$, ..., \f$ \bar{u} \f$, \f$ \bar{d} \f$;
+  /// @arg 0 = \f$ g \f$
+  /// @arg 1..6 = \f$ d \f$, \f$ u \f$, ..., \f$ t \f$;
+  /// @arg 7 = \f$ \gamma \f$.
+  double xfxphoton(int nset, double x, double Q, int fl);
+  //@}
+
+
+  /// @name Deprecated initialisation functions
+  /// LHAPDF functions for initialising PDF sets. If you need to use
+  /// more than one set simultaneously, use the multi-set functions, which
+  /// have a integer @c nset first argument.
+  /// @deprecated These init methods are deprecated.
+  //@{
+
+  /// The PDF set by file path, see subdir @c PDFsets of LHAPDF for choices.
+  //void initPDFSet(const std::string& path);
+  /// The PDF set by file path, see subdir @c PDFsets of LHAPDF for choices.
+  //void initPDFSet(int nset, const std::string& path);
+
+  /// The PDF set by name and type, see subdir @c PDFsets of LHAPDF for choices.
+  void initPDFSetByName(const std::string& name, SetType type);
+  /// The PDF set by name and type, see subdir @c PDFsets of LHAPDF for choices.
+  void initPDFSetByName(int nset, const std::string& name, SetType type);
+
+  /// The PDF set by filename, see subdir @c PDFsets of LHAPDF for choices.
+  void initPDFSetByName(const std::string& filename);
+  /// The PDF set by filename, see subdir @c PDFsets of LHAPDF for choices.
+  void initPDFSetByName(int nset, const std::string& filename);
+
+  /// The choice of PDF member out of one distribution.
+  void initPDF(int memset);
+  /// The choice of PDF member out of one distribution.
+  void initPDF(int nset, int memset);
+
+  /// @brief Convenient initializer with PDF set @a name, set type @a type and member @a memset.
+  /// @param name The name of the desired set.
+  /// @param type The type of PDF set (grid or data) by enum.
+  /// @param memset PDF number within set @a name.
+  /// Equivalent to @c initPDFSetByName + @c initPDF.
+  void initPDFByName(const std::string& name, SetType type, int memset);
+
+  /// @brief Typical initializer for multiple PDF sets with PDF set @a name and member @a memset.
+  /// @param nset Specifies the reference number for the set to be initialized.
+  /// @param name Name of the desired set.
+  /// @param type The type of PDF set (grid or data) by enum.
+  /// @param memset PDF number within set @a name.
+  /// Equivalent to @c initPDFSetByNameM + @c initPDFM.
+  void initPDFByName(int nset, const std::string& name, SetType type, int memset);
+
+  /// @brief Convenient initializer with PDF set @a filename and member @a memset.
+  /// @param filename The name of the grid or data file of the desired set.
+  /// @param memset PDF number within set @a name.
+  /// Equivalent to @c initPDFSetByName + @c initPDF.
+  void initPDFByName(const std::string& filename, int memset);
+  /// @brief Typical initializer for multiple PDF sets with PDF set @a name and member @a memset.
+  /// @param nset Specifies the reference number for the set to be initialized.
+  /// @param filename Name of the grid or data file of the desired set.
+  /// @param memset PDF number within set @a name.
+  /// Equivalent to @c initPDFSetByNameM + @c initPDFM.
+  void initPDFByName(int nset, const std::string& filename, int memset);
+  //@}
+
+
+}
+
+#endif
diff --git a/LHAPDF/lhapdf-5.9.1/include/LHAPDF/LHAPDFConfig.h b/LHAPDF/lhapdf-5.9.1/include/LHAPDF/LHAPDFConfig.h
new file mode 100644 (file)
index 0000000..05f3513
--- /dev/null
@@ -0,0 +1,13 @@
+#ifndef LHAPDF_LHAPDFCONFIG_H
+#define LHAPDF_LHAPDFCONFIG_H
+
+/* LHAPDF version string */
+#undef LHAPDF_VERSION
+
+/* Was LHAPDF built in low-memory mode? */
+#undef LHAPDF_LOWMEM
+
+/* How many LHAPDF PDF sets can be used concurrently? */
+#undef LHAPDF_NMXSET
+
+#endif
diff --git a/LHAPDF/lhapdf-5.9.1/include/LHAPDF/LHAPDFConfig.h.in b/LHAPDF/lhapdf-5.9.1/include/LHAPDF/LHAPDFConfig.h.in
new file mode 100644 (file)
index 0000000..05f3513
--- /dev/null
@@ -0,0 +1,13 @@
+#ifndef LHAPDF_LHAPDFCONFIG_H
+#define LHAPDF_LHAPDFCONFIG_H
+
+/* LHAPDF version string */
+#undef LHAPDF_VERSION
+
+/* Was LHAPDF built in low-memory mode? */
+#undef LHAPDF_LOWMEM
+
+/* How many LHAPDF PDF sets can be used concurrently? */
+#undef LHAPDF_NMXSET
+
+#endif
diff --git a/LHAPDF/lhapdf-5.9.1/include/LHAPDF/LHAPDFWrap.h b/LHAPDF/lhapdf-5.9.1/include/LHAPDF/LHAPDFWrap.h
new file mode 100644 (file)
index 0000000..f591d9c
--- /dev/null
@@ -0,0 +1,204 @@
+#ifndef LHAPDFWRAP_H
+#define LHAPDFWRAP_H
+
+#include <string>
+#include <vector>
+
+// WARNING! This C++ interface is deprecated in favour of the 
+// interface declared in LHAPDF/LHAPDF.h
+
+// This class is a wrapper around the LHAPDF package for parton
+// distribution functions of the proton.
+//
+// Originally by Stefan Gieseke.
+// Adapted for LHAPDFv4 by Mike Whalley.
+// Adapted for LHAPDFv5 by Craig Group/Mike Whalley.
+// Fortran portability and interface improvements by Andy Buckley.
+
+
+/////////////////////////////////////////////////////////////////
+
+
+/// Wrapper class used to contain all the wrapper functions.
+/// @deprecated 
+/// The class-based C++ wrapper on LHAPDF will be retired in a forthcoming
+/// release of LHAPDF in favour of the namespaced wrapper declared in @c
+/// LHAPDF.h. Please convert client code which uses the class interface to use
+/// the new interface instead.  Typically, this will just involve changing the
+/// header include from @c "LHAPDF/LHAPDFWrap.h" to @c "LHAPDF/LHAPDFWrap.h",
+/// changing any constructors to initialisation functions, and replacing @c
+/// LHAPDFWrap objects with an @c LHAPDF namespace. For example,
+/// @code
+///  #include "LHAPDF/LHAPDFWrap.h"
+///  LHAPDFWrap pdf = LHAPDFWrap("MRST2004qed.LHgrid", 0);
+///  pdf.getDescription();
+/// @endcode
+/// would be replaced by
+/// @code
+///  #include "LHAPDF/LHAPDF.h"
+///  LHAPDF::initPDFByName("MRST2004qed.LHgrid", 0);
+///  LHAPDF::getDescription();
+/// @endcode
+class LHAPDFWrap {
+
+public:
+  /// Do-nothing constructor.
+  LHAPDFWrap();
+  
+  /// Typical constructor with PDF set 'name' 
+  /// 'name' is the name of the grid or data file of the desired set.  
+  LHAPDFWrap(const std::string& name);
+
+  /// Typical constructor with PDF set 'name' and subset 'memset' 
+  /// 'name' is the name of the grid or data file of the desired set.  
+  LHAPDFWrap(const std::string& name, int memset);
+
+  /// Typical constructor (when multiple PDF sets need to be initialized) 
+  /// with pdfset 'name' and subset 'memset'.
+  /// 'name' is the name of the grid or data file of the desired set.  
+  /// int nset specifies the reference number for the set to be initialized
+  LHAPDFWrap(int nset, const std::string& name);
+
+  /// Typical constructor (when multiple PDF sets need to be initialized) 
+  /// with PDF set 'name' and subset 'memset'. 
+  /// 'name' is the name of the grid or data file of the desired set.  
+  /// int nset specifies the reference number for the set to be initialized
+  LHAPDFWrap(int nset, const std::string& name, int memset);
+
+  /// Returns a vector xf(x, Q) with index 0 < i < 12.
+  /// 0..5 = tbar, ..., ubar, dbar; 
+  /// 6 = g; 
+  /// 7..12 = d, u, ..., t
+  std::vector<double> xfx(double x, double Q);
+
+  /// Returns xf(x, Q) for flavour fl - this time the flavour encoding
+  /// is as in the LHAPDF manual...
+  /// -6..-1 = tbar,...,ubar, dbar
+  /// 1..6 = duscbt
+  /// 0 = g
+  double xfx(double x, double Q, int fl);
+
+  std::vector<double> xfxp(double x, double Q, double P2, int ip);
+  double xfxp(double x, double Q, double P2, int ip, int fl);
+
+  std::vector<double> xfxa(double x, double Q, double a);
+  double xfxa(double x, double Q, double a, int fl);
+
+  std::vector<double> xfxphoton(double x, double Q);
+  double xfxphoton(double x, double Q, int fl);
+
+  /// The PDF set by name, see subdir 'PDFset' of LHAPDFv2 for choices
+  void initPDFSet(const std::string& name);
+
+  /// The PDF set by name, see subdir 'PDFset' of LHAPDFv2 for choices
+  void initPDFSetByName(const std::string& name);
+
+  /// The choice of PDF subset out of one distribution
+  void initPDF(int memset);
+
+  /// Prints a brief description of the current pdf set to stdout
+  void getDescription();
+
+  /// Number of subsets available in the current distribution.
+  int numberPDF();
+
+  /// \f$ \alpha_\mathrm{s} \f$ used by the current PDF.
+  double alphasPDF(double Q);
+
+  int getOrderPDF();
+
+  /// Perturbative order of parton evolution and \f$ \alpha_\mathrm{s} \f$ respectively.
+  int getOrderAlphaS();
+
+  /// Quark mass used for flavour f.
+  double getQMass(int f);
+
+  /// Threshold for flavour f.
+  double getThreshold(int f);
+
+  /// Number of flavours used in the current PDF set.
+  int getNf();
+
+  /// Value of QCD lambda4 for member m 
+  double getLam4(int m);
+
+  /// Value of QCD lambda5 for member m 
+  double getLam5(int m);
+
+  double getXmin(int m);
+  double getXmax(int m);
+  double getQ2min(int m);
+  double getQ2max(int m);
+
+  void extrapolate();
+
+  // Additional functions for when more than 1 PDF set is being stored in memory
+
+  // Returns a vector xf(x, Q) with index 0 < i < 12.
+  // 0..5 = tbar, ..., ubar, dbar; 
+  // 6 = g; 
+  // 7..12 = d, u, ..., t
+  std::vector<double> xfxM(int nset, double x, double Q);
+
+  // Returns xf(x, Q) for flavour fl - this time the flavour encoding
+  // is as in the LHAPDF manual...
+  // -6..-1 = tbar,...,ubar, dbar
+  // 1..6 = duscbt
+  // 0 = g
+  double xfxM(int nset, double x, double Q, int fl);
+
+  std::vector<double> xfxpM(int nset, double x, double Q, double P2, int ip);
+  double xfxpM(int nset, double x, double Q, double P2, int ip, int fl);
+
+  std::vector<double> xfxaM(int nset, double x, double Q, double a);
+  double xfxaM(int nset, double x, double Q, double a, int fl);
+
+  std::vector<double> xfxphotonM(int nset, double x, double Q);
+  double xfxphotonM(int nset, double x, double Q, int fl);
+
+  /// The PDF set by name, see subdir 'PDFset' of LHAPDFv2 for choices
+  void initPDFSetM(int nset, const std::string& name);
+
+  /// The PDF set by name, see subdir 'PDFset' of LHAPDFv2 for choices
+  void initPDFSetByNameM(int nset, const std::string& name);
+
+  /// The choice of PDF subset out of one distribution
+  void initPDFM(int nset, int memset);
+
+  /// Prints a brief description of the current PDF set to stdout
+  void getDescriptionM(int nset);
+
+  /// Number of subsets available in the current distribution.
+  int numberPDFM(int nset);
+
+  /// \f$ \alpha_\mathrm{s} \f$ used by the current PDF.
+  double alphasPDFM(int nset, double Q);
+
+  int getOrderPDFM(int nset);
+
+  /// Perturbative order of parton evolution and \f$ \alpha_\mathrm{s} \f$ respectively.
+  int getOrderAlphaSM(int nset);
+
+  /// Quark mass used for flavour f.
+  double getQMassM(int nset, int f);
+
+  /// Threshold for flavour f.
+  double getThresholdM(int nset, int f);
+
+  /// Number of flavours used in the current PDF set.
+  int getNfM(int nset);
+
+  /// Value of QCD lambda4 for member m 
+  double getLam4M(int nset, int m);
+
+  /// Value of QCD lambda5 for member m 
+  double getLam5M(int nset, int m);
+
+  double getXminM(int nset, int m);
+  double getXmaxM(int nset, int m);
+  double getQ2minM(int nset, int m);
+  double getQ2maxM(int nset, int m);
+
+};
+
+#endif
diff --git a/LHAPDF/lhapdf-5.9.1/include/LHAPDF/LHAPDFfw.h b/LHAPDF/lhapdf-5.9.1/include/LHAPDF/LHAPDFfw.h
new file mode 100644 (file)
index 0000000..2bf08c7
--- /dev/null
@@ -0,0 +1,140 @@
+#ifndef LHAPDFfw_H
+#define LHAPDFfw_H
+
+// Forward declarations of signatures of Fortran
+// intermediate wrapper functions.
+
+#include "LHAPDF/FortranWrappers.h"
+
+extern "C" {
+
+  #define fgetprefixpath FC_FUNC(getprefixpath, GETPREFIXPATH)
+  void fgetprefixpath(char*, int len);
+  #define fgetindexpath FC_FUNC(getindexpath, GETINDEXPATH)
+  void fgetindexpath(char*, int len);
+  #define fgetdirpath FC_FUNC(getdirpath, GETDIRPATH)
+  void fgetdirpath(char*, int len);
+
+  #define finitlhapdf FC_FUNC(initlhapdf, INITLHAPDF)
+  void finitlhapdf();
+
+  #define fgetlhapdfversion FC_FUNC(getlhapdfversion, GETLHAPDFVERSION)
+  void fgetlhapdfversion(char*, int len);
+
+  #define fgetmaxnumsets FC_FUNC(getmaxnumsets, GETMAXNUMSETS)
+  void fgetmaxnumsets(int* len);
+
+  #define finitpdfset FC_FUNC(finitpdfset, FINITPDFSET)
+  void finitpdfset(char*, int len);
+  #define finitpdfsetbyname FC_FUNC(finitpdfsetbyname, FINITPDFSETBYNAME)
+  void finitpdfsetbyname(char*, int len);
+  #define finitpdf FC_FUNC(finitpdf, FINITPDF)
+  void finitpdf(int*);
+  #define fevolvepdf FC_FUNC(fevolvepdf, FEVOLVEPDF)
+  void fevolvepdf(double*, double *, double*);
+  #define fevolvepdfp FC_FUNC(fevolvepdfp, FEVOLVEPDFP)
+  void fevolvepdfp(double*, double *, double*, int*, double*);
+  #define fevolvepdfa FC_FUNC(fevolvepdfa, FEVOLVEPDFA)
+  void fevolvepdfa(double*, double *, double *, double*);
+  #define fevolvepdfphoton FC_FUNC(fevolvepdfphoton, FEVOLVEPDFPHOTON)
+  void fevolvepdfphoton(double*, double *, double*, double*);
+  #define fhasphoton FC_FUNC(fhasphoton, FHASPHOTON)
+  void fhasphoton(int*);
+  #define fnumberpdf FC_FUNC(fnumberpdf, FNUMBERPDF)
+  void fnumberpdf(int*);
+  #define falphaspdf FC_FUNC(falphaspdf, FALPHASPDF)
+  void falphaspdf(double*, double *);
+  #define fgetorderpdf FC_FUNC(fgetorderpdf, FGETORDERPDF)
+  void fgetorderpdf(int*);
+  #define fgetorderas FC_FUNC(fgetorderas, FGETORDERAS)
+  void fgetorderas(int*);
+  #define fgetdesc FC_FUNC(fgetdesc, FGETDESC)
+  void fgetdesc();
+  #define fgetqmass FC_FUNC(fgetqmass, FGETQMASS)
+  void fgetqmass(int*, double*);
+  #define fgetthreshold FC_FUNC(fgetthreshold, FGETTHRESHOLD)
+  void fgetthreshold(int*, double*);
+  #define fgetnf FC_FUNC(fgetnf, FGETNF)
+  void fgetnf(int*);
+  #define fgetlam4 FC_FUNC(fgetlam4, FGETLAM4)
+  void fgetlam4(int*, double*);
+  #define fgetlam5 FC_FUNC(fgetlam5, FGETLAM5)
+  void fgetlam5(int*, double*);
+  #define fgetxmin FC_FUNC(fgetxmin, FGETXMIN)
+  void fgetxmin(int*, double*);
+  #define fgetxmax FC_FUNC(fgetxmax, FGETXMAX)
+  void fgetxmax(int*, double*);
+  #define fgetq2min FC_FUNC(fgetq2min, FGETQ2MIN)
+  void fgetq2min(int*, double*);
+  #define fgetq2max FC_FUNC(fgetq2max, FGETQ2MAX)
+  void fgetq2max(int*, double*);
+  #define fgetminmax FC_FUNC(fgetminmax, FGETMINMAX)
+  void fgetminmax(int*, double*, double*, double*, double*);
+  #define fextrapolate FC_FUNC(fextrapolate, FEXTRAPOLATE)
+  void fextrapolate();
+
+  // v5 subroutines for multiple set initialization
+  #define finitpdfsetm FC_FUNC(finitpdfsetm, FINITPDFSETM)
+  void finitpdfsetm(int*, char*, int len);
+  #define finitpdfsetbynamem FC_FUNC(finitpdfsetbynamem, FINITPDFSETBYNAMEM)
+  void finitpdfsetbynamem(int*, char*, int len);
+  #define finitpdfm FC_FUNC(finitpdfm, FINITPDFM)
+  void finitpdfm(int*, int*);
+  #define fevolvepdfm FC_FUNC(fevolvepdfm, FEVOLVEPDFM)
+  void fevolvepdfm(int*, double*, double *, double*);
+  #define fevolvepdfpm FC_FUNC(fevolvepdfpm, FEVOLVEPDFPM)
+  void fevolvepdfpm(int*, double*, double *, double*, int*, double*);
+  #define fevolvepdfam FC_FUNC(fevolvepdfam, FEVOLVEPDFAM)
+  void fevolvepdfam(int*, double*, double *, double *, double*);
+  #define fevolvepdfphotonm FC_FUNC(fevolvepdfphotonm, FEVOLVEPDFPHOTONM)
+  void fevolvepdfphotonm(int*, double*, double *, double*, double*);
+  #define fnumberpdfm FC_FUNC(fnumberpdfm, FNUMBERPDFM)
+  void fnumberpdfm(int*, int*);
+  #define falphaspdfm FC_FUNC(falphaspdfm, FALPHASPDFM)
+  void falphaspdfm(int*, double*, double *);
+  #define fgetorderpdfm FC_FUNC(fgetorderpdfm, FGETORDERPDFM)
+  void fgetorderpdfm(int*, int*);
+  #define fgetorderasm FC_FUNC(fgetorderasm, FGETORDERASM)
+  void fgetorderasm(int*, int*);
+  #define fgetdescm FC_FUNC(fgetdescm, FGETDESCM)
+  void fgetdescm(int*);
+  #define fgetqmassm FC_FUNC(fgetqmassm, FGETQMASSM)
+  void fgetqmassm(int*, int*, double*);
+  #define fgetthresholdm FC_FUNC(fgetthresholdm, FGETTHRESHOLDM)
+  void fgetthresholdm(int*, int*, double*);
+  #define fgetnfm FC_FUNC(fgetnfm, FGETNFM)
+  void fgetnfm(int*, int*);
+  #define fgetlam4m FC_FUNC(fgetlam4m, FGETLAM4M)
+  void fgetlam4m(int*, int*, double*);
+  #define fgetlam5m FC_FUNC(fgetlam5m, FGETLAM5M)
+  void fgetlam5m(int*, int*, double*);
+  #define fgetxminm FC_FUNC(fgetxminm, FGETXMINM)
+  void fgetxminm(int*, int*, double*);
+  #define fgetxmaxm FC_FUNC(fgetxmaxm, FGETXMAXM)
+  void fgetxmaxm(int*, int*, double*);
+  #define fgetq2minm FC_FUNC(fgetq2minm, FGETQ2MINM)
+  void fgetq2minm(int*, int*, double*);
+  #define fgetq2maxm FC_FUNC(fgetq2maxm, FGETQ2MAXM)
+  void fgetq2maxm(int*, int*, double*);
+  #define fgetminmaxm FC_FUNC(fgetminmaxm, FGETMINMAXM)
+  void fgetminmaxm(int*, int*, double*, double*, double*, double*);
+  #define fextrapolateon FC_FUNC(fextrapolateon, FEXTRAPOLATEON)
+  void fextrapolateon();
+  #define fextrapolateoff FC_FUNC(fextrapolateoff, FEXTRAPOLATEOFF)
+  void fextrapolateoff();
+  #define fsilent FC_FUNC(fsilent, FSILENT)
+  void fsilent();
+  #define flowkey FC_FUNC(flowkey, FLOWKEY)
+  void flowkey();
+  #define fdefaultverb FC_FUNC(fdefaultverb, FDEFAULTVERB)
+  void fdefaultverb();
+  #define fsetpdfpath FC_FUNC(fsetpdfpath, FSETPDFPATH)
+  void fsetpdfpath(char*, int len);
+
+  #define fsetlhaparm FC_FUNC(setlhaparm, SETLHAPARM)
+  void fsetlhaparm(char*, int len);
+
+
+}
+
+#endif
diff --git a/LHAPDF/lhapdf-5.9.1/include/LHAPDF/Makefile.am b/LHAPDF/lhapdf-5.9.1/include/LHAPDF/Makefile.am
new file mode 100644 (file)
index 0000000..bb1cdb9
--- /dev/null
@@ -0,0 +1,17 @@
+EXTRA_DIST = FortranWrappers.h.in LHAPDFConfig.h.in
+
+if ENABLE_CCWRAP
+
+PKGincludedir = $(includedir)/LHAPDF
+PKGinclude_HEADERS = LHAPDF.h LHAPDFfw.h
+nodist_PKGinclude_HEADERS = FortranWrappers.h LHAPDFConfig.h
+if ENABLE_OLDCCWRAP
+PKGinclude_HEADERS += LHAPDFWrap.h
+endif
+
+else 
+
+## Make sure that headers are always bundled
+EXTRA_DIST += LHAPDF.h LHAPDFfw.h LHAPDFWrap.h
+
+endif
diff --git a/LHAPDF/lhapdf-5.9.1/include/LHAPDF/Makefile.in b/LHAPDF/lhapdf-5.9.1/include/LHAPDF/Makefile.in
new file mode 100644 (file)
index 0000000..6723849
--- /dev/null
@@ -0,0 +1,490 @@
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+@ENABLE_CCWRAP_TRUE@@ENABLE_OLDCCWRAP_TRUE@am__append_1 = LHAPDFWrap.h
+@ENABLE_CCWRAP_FALSE@am__append_2 = LHAPDF.h LHAPDFfw.h LHAPDFWrap.h
+subdir = include/LHAPDF
+DIST_COMMON = $(am__PKGinclude_HEADERS_DIST) \
+       $(srcdir)/FortranWrappers.h.in $(srcdir)/LHAPDFConfig.h.in \
+       $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/binreloc.m4 \
+       $(top_srcdir)/m4/compilerflags.m4 $(top_srcdir)/m4/libtool.m4 \
+       $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+       $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+       $(top_srcdir)/m4/python.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config/config.h FortranWrappers.h \
+       LHAPDFConfig.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+am__PKGinclude_HEADERS_DIST = LHAPDF.h LHAPDFfw.h LHAPDFWrap.h
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(PKGincludedir)" \
+       "$(DESTDIR)$(PKGincludedir)"
+PKGincludeHEADERS_INSTALL = $(INSTALL_HEADER)
+nodist_PKGincludeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(PKGinclude_HEADERS) $(nodist_PKGinclude_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_CPPFLAGS = @AM_CPPFLAGS@
+AM_CXXFLAGS = @AM_CXXFLAGS@
+AM_FCFLAGS = @AM_FCFLAGS@
+AM_FFLAGS = @AM_FFLAGS@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BINRELOC_CFLAGS = @BINRELOC_CFLAGS@
+BINRELOC_LIBS = @BINRELOC_LIBS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DOXYGEN = @DOXYGEN@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+MKOCTFILE = @MKOCTFILE@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NMXSET = @NMXSET@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OCTAVE = @OCTAVE@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PYTHON = @PYTHON@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWVERS = @SWVERS@
+VERSION = @VERSION@
+VERSIONFLAGS = @VERSIONFLAGS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_FC = @ac_ct_FC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+EXTRA_DIST = FortranWrappers.h.in LHAPDFConfig.h.in $(am__append_2)
+@ENABLE_CCWRAP_TRUE@PKGincludedir = $(includedir)/LHAPDF
+@ENABLE_CCWRAP_TRUE@PKGinclude_HEADERS = LHAPDF.h LHAPDFfw.h \
+@ENABLE_CCWRAP_TRUE@   $(am__append_1)
+@ENABLE_CCWRAP_TRUE@nodist_PKGinclude_HEADERS = FortranWrappers.h LHAPDFConfig.h
+all: FortranWrappers.h LHAPDFConfig.h
+       $(MAKE) $(AM_MAKEFLAGS) all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  include/LHAPDF/Makefile'; \
+       cd $(top_srcdir) && \
+         $(AUTOMAKE) --gnu  include/LHAPDF/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+FortranWrappers.h: stamp-h2
+       @if test ! -f $@; then \
+         rm -f stamp-h2; \
+         $(MAKE) $(AM_MAKEFLAGS) stamp-h2; \
+       else :; fi
+
+stamp-h2: $(srcdir)/FortranWrappers.h.in $(top_builddir)/config.status
+       @rm -f stamp-h2
+       cd $(top_builddir) && $(SHELL) ./config.status include/LHAPDF/FortranWrappers.h
+$(srcdir)/FortranWrappers.h.in:  $(am__configure_deps) 
+       cd $(top_srcdir) && $(AUTOHEADER)
+       rm -f stamp-h2
+       touch $@
+
+LHAPDFConfig.h: stamp-h3
+       @if test ! -f $@; then \
+         rm -f stamp-h3; \
+         $(MAKE) $(AM_MAKEFLAGS) stamp-h3; \
+       else :; fi
+
+stamp-h3: $(srcdir)/LHAPDFConfig.h.in $(top_builddir)/config.status
+       @rm -f stamp-h3
+       cd $(top_builddir) && $(SHELL) ./config.status include/LHAPDF/LHAPDFConfig.h
+
+distclean-hdr:
+       -rm -f FortranWrappers.h stamp-h2 LHAPDFConfig.h stamp-h3
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+install-PKGincludeHEADERS: $(PKGinclude_HEADERS)
+       @$(NORMAL_INSTALL)
+       test -z "$(PKGincludedir)" || $(MKDIR_P) "$(DESTDIR)$(PKGincludedir)"
+       @list='$(PKGinclude_HEADERS)'; for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         f=$(am__strip_dir) \
+         echo " $(PKGincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(PKGincludedir)/$$f'"; \
+         $(PKGincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(PKGincludedir)/$$f"; \
+       done
+
+uninstall-PKGincludeHEADERS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(PKGinclude_HEADERS)'; for p in $$list; do \
+         f=$(am__strip_dir) \
+         echo " rm -f '$(DESTDIR)$(PKGincludedir)/$$f'"; \
+         rm -f "$(DESTDIR)$(PKGincludedir)/$$f"; \
+       done
+install-nodist_PKGincludeHEADERS: $(nodist_PKGinclude_HEADERS)
+       @$(NORMAL_INSTALL)
+       test -z "$(PKGincludedir)" || $(MKDIR_P) "$(DESTDIR)$(PKGincludedir)"
+       @list='$(nodist_PKGinclude_HEADERS)'; for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         f=$(am__strip_dir) \
+         echo " $(nodist_PKGincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(PKGincludedir)/$$f'"; \
+         $(nodist_PKGincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(PKGincludedir)/$$f"; \
+       done
+
+uninstall-nodist_PKGincludeHEADERS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(nodist_PKGinclude_HEADERS)'; for p in $$list; do \
+         f=$(am__strip_dir) \
+         echo " rm -f '$(DESTDIR)$(PKGincludedir)/$$f'"; \
+         rm -f "$(DESTDIR)$(PKGincludedir)/$$f"; \
+       done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES) FortranWrappers.h.in LHAPDFConfig.h.in $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       here=`pwd`; \
+       list='$(SOURCES) $(HEADERS) FortranWrappers.h.in LHAPDFConfig.h.in $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+           $$tags $$unique; \
+       fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES) FortranWrappers.h.in LHAPDFConfig.h.in $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       list='$(SOURCES) $(HEADERS) FortranWrappers.h.in LHAPDFConfig.h.in $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       test -z "$(CTAGS_ARGS)$$tags$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$tags $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && cd $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+           fi; \
+           cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+         else \
+           test -f $(distdir)/$$file \
+           || cp -p $$d/$$file $(distdir)/$$file \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS) FortranWrappers.h LHAPDFConfig.h
+installdirs:
+       for dir in "$(DESTDIR)$(PKGincludedir)" "$(DESTDIR)$(PKGincludedir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+       done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+         `test -z '$(STRIP)' || \
+           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+       -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-hdr distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-PKGincludeHEADERS \
+       install-nodist_PKGincludeHEADERS
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-PKGincludeHEADERS \
+       uninstall-nodist_PKGincludeHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+       clean-libtool ctags distclean distclean-generic distclean-hdr \
+       distclean-libtool distclean-tags distdir dvi dvi-am html \
+       html-am info info-am install install-PKGincludeHEADERS \
+       install-am install-data install-data-am install-dvi \
+       install-dvi-am install-exec install-exec-am install-html \
+       install-html-am install-info install-info-am install-man \
+       install-nodist_PKGincludeHEADERS install-pdf install-pdf-am \
+       install-ps install-ps-am install-strip installcheck \
+       installcheck-am installdirs maintainer-clean \
+       maintainer-clean-generic mostlyclean mostlyclean-generic \
+       mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+       uninstall-PKGincludeHEADERS uninstall-am \
+       uninstall-nodist_PKGincludeHEADERS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/LHAPDF/lhapdf-5.9.1/include/Makefile.am b/LHAPDF/lhapdf-5.9.1/include/Makefile.am
new file mode 100644 (file)
index 0000000..1450427
--- /dev/null
@@ -0,0 +1 @@
+SUBDIRS = LHAPDF
diff --git a/LHAPDF/lhapdf-5.9.1/include/Makefile.in b/LHAPDF/lhapdf-5.9.1/include/Makefile.in
new file mode 100644 (file)
index 0000000..937c3db
--- /dev/null
@@ -0,0 +1,514 @@
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = include
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/binreloc.m4 \
+       $(top_srcdir)/m4/compilerflags.m4 $(top_srcdir)/m4/libtool.m4 \
+       $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+       $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+       $(top_srcdir)/m4/python.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config/config.h \
+       $(top_builddir)/include/LHAPDF/FortranWrappers.h \
+       $(top_builddir)/include/LHAPDF/LHAPDFConfig.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+       html-recursive info-recursive install-data-recursive \
+       install-dvi-recursive install-exec-recursive \
+       install-html-recursive install-info-recursive \
+       install-pdf-recursive install-ps-recursive install-recursive \
+       installcheck-recursive installdirs-recursive pdf-recursive \
+       ps-recursive uninstall-recursive
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive        \
+  distclean-recursive maintainer-clean-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_CPPFLAGS = @AM_CPPFLAGS@
+AM_CXXFLAGS = @AM_CXXFLAGS@
+AM_FCFLAGS = @AM_FCFLAGS@
+AM_FFLAGS = @AM_FFLAGS@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BINRELOC_CFLAGS = @BINRELOC_CFLAGS@
+BINRELOC_LIBS = @BINRELOC_LIBS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DOXYGEN = @DOXYGEN@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+MKOCTFILE = @MKOCTFILE@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NMXSET = @NMXSET@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OCTAVE = @OCTAVE@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PYTHON = @PYTHON@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWVERS = @SWVERS@
+VERSION = @VERSION@
+VERSIONFLAGS = @VERSIONFLAGS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_FC = @ac_ct_FC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+SUBDIRS = LHAPDF
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  include/Makefile'; \
+       cd $(top_srcdir) && \
+         $(AUTOMAKE) --gnu  include/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+       @failcom='exit 1'; \
+       for f in x $$MAKEFLAGS; do \
+         case $$f in \
+           *=* | --[!k]*);; \
+           *k*) failcom='fail=yes';; \
+         esac; \
+       done; \
+       dot_seen=no; \
+       target=`echo $@ | sed s/-recursive//`; \
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         echo "Making $$target in $$subdir"; \
+         if test "$$subdir" = "."; then \
+           dot_seen=yes; \
+           local_target="$$target-am"; \
+         else \
+           local_target="$$target"; \
+         fi; \
+         (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+         || eval $$failcom; \
+       done; \
+       if test "$$dot_seen" = "no"; then \
+         $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+       fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+       @failcom='exit 1'; \
+       for f in x $$MAKEFLAGS; do \
+         case $$f in \
+           *=* | --[!k]*);; \
+           *k*) failcom='fail=yes';; \
+         esac; \
+       done; \
+       dot_seen=no; \
+       case "$@" in \
+         distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+         *) list='$(SUBDIRS)' ;; \
+       esac; \
+       rev=''; for subdir in $$list; do \
+         if test "$$subdir" = "."; then :; else \
+           rev="$$subdir $$rev"; \
+         fi; \
+       done; \
+       rev="$$rev ."; \
+       target=`echo $@ | sed s/-recursive//`; \
+       for subdir in $$rev; do \
+         echo "Making $$target in $$subdir"; \
+         if test "$$subdir" = "."; then \
+           local_target="$$target-am"; \
+         else \
+           local_target="$$target"; \
+         fi; \
+         (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+         || eval $$failcom; \
+       done && test -z "$$fail"
+tags-recursive:
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+       done
+ctags-recursive:
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+       done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       here=`pwd`; \
+       if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+         include_option=--etags-include; \
+         empty_fix=.; \
+       else \
+         include_option=--include; \
+         empty_fix=; \
+       fi; \
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         if test "$$subdir" = .; then :; else \
+           test ! -f $$subdir/TAGS || \
+             tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+         fi; \
+       done; \
+       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+           $$tags $$unique; \
+       fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       test -z "$(CTAGS_ARGS)$$tags$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$tags $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && cd $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+           fi; \
+           cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+         else \
+           test -f $(distdir)/$$file \
+           || cp -p $$d/$$file $(distdir)/$$file \
+           || exit 1; \
+         fi; \
+       done
+       list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+         if test "$$subdir" = .; then :; else \
+           test -d "$(distdir)/$$subdir" \
+           || $(MKDIR_P) "$(distdir)/$$subdir" \
+           || exit 1; \
+           distdir=`$(am__cd) $(distdir) && pwd`; \
+           top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+           (cd $$subdir && \
+             $(MAKE) $(AM_MAKEFLAGS) \
+               top_distdir="$$top_distdir" \
+               distdir="$$distdir/$$subdir" \
+               am__remove_distdir=: \
+               am__skip_length_check=: \
+               distdir) \
+             || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+         `test -z '$(STRIP)' || \
+           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+       -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-info: install-info-recursive
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-ps: install-ps-recursive
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
+       install-strip
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+       all all-am check check-am clean clean-generic clean-libtool \
+       ctags ctags-recursive distclean distclean-generic \
+       distclean-libtool distclean-tags distdir dvi dvi-am html \
+       html-am info info-am install install-am install-data \
+       install-data-am install-dvi install-dvi-am install-exec \
+       install-exec-am install-html install-html-am install-info \
+       install-info-am install-man install-pdf install-pdf-am \
+       install-ps install-ps-am install-strip installcheck \
+       installcheck-am installdirs installdirs-am maintainer-clean \
+       maintainer-clean-generic mostlyclean mostlyclean-generic \
+       mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
+       uninstall uninstall-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/LHAPDF/lhapdf-5.9.1/src/EVLCTEQ.f b/LHAPDF/lhapdf-5.9.1/src/EVLCTEQ.f
new file mode 100644 (file)
index 0000000..3cd65ff
--- /dev/null
@@ -0,0 +1,2910 @@
+! -*- F90 -*-
+
+
+SUBROUTINE CtLhALFSET (QS, ALFS) 
+  IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+  EXTERNAL CtLhRTALF 
+  COMMON / CtLhRTALFC / ALFST, JORD, NEFF 
+  DATA ALAM, BLAM, ERR / 0.01, 10.0, 0.02 / 
+  ALFST = ALFS 
+  CALL CtLhParQcd (2, 'ORDR', ORDR, IR1) 
+  JORD  = Int(ORDR) 
+  NEFF = LhCtNFL(QS) 
+  EFLLN  = CtLhQZBRNT (CtLhRTALF, ALAM, BLAM, ERR, IR2) 
+  EFFLAM = QS / EXP (EFLLN) 
+  CALL CtLhSETL1 (NEFF, EFFLAM) 
+END SUBROUTINE CtLhALFSET
+
+
+FUNCTION CtLhALPI (AMU) 
+  IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+  COMMON / LhCtCWZPRM / ALAM(0:9), AMHAT(0:9), AMN, NHQ 
+  COMMON / LhCtQCDPAR_LHA / AL, NF, NORDER, SET 
+  LOGICAL SET 
+  PARAMETER (D0 = 0.D0, D1 = 1.D0, BIG = 1.0D15) 
+  DATA IW1, IW2 / 2*0 / 
+  IF(.NOT.SET) CALL CtLhLAMCWZ 
+  NEFF = LhCtNFL(AMU) 
+  ALM  = ALAM(NEFF) 
+  CtLhALPI = CtLhALPQCD (NORDER, NEFF, AMU/ALM, IRT) 
+  IF (IRT .EQ. 1) THEN 
+     CALL CtLhWARNR (IW1, 'AMU < ALAM in CtLhALPI', 'AMU', AMU,     &
+          &              ALM, BIG, 1)                                        
+  ELSEIF (IRT .EQ. 2) THEN 
+     CALL CtLhWARNR (IW2, 'CtLhALPI > 3; Be aware!', 'CtLhALPI',    &
+          &  CtLhALPI, D0, D1, 0)                                            
+  ENDIF
+  RETURN 
+END FUNCTION CtLhALPI
+
+
+FUNCTION CtLhALPQCD (IRDR, NF, RML, IRT) 
+  IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+  PARAMETER (D0 = 0.D0, D1 = 1.D0, BIG = 1.0D15) 
+  PARAMETER (CG = 3.0d0, TR = 0.5d0, CF = 4.0d0/3.0d0) 
+  IRT = 0 
+  IF (IRDR .LT. 1 .OR. IRDR .GT. 2) THEN 
+     print *,                                                        &
+          &  'Order out of range in CtLhALPQCD: IRDR = ', IRDR               
+     STOP 
+  ENDIF
+  B0 = (11.d0*CG  - 2.* NF) / 3.d0 
+  B1 = (34.d0*CG**2 - 10.d0*CG*NF - 6.d0*CF*NF) / 3.d0 
+  RM2 = RML**2 
+  IF (RM2 .LE. 1.) THEN 
+     IRT = 1 
+     CtLhALPQCD = 99. 
+     RETURN 
+  ENDIF
+  ALN = LOG (RM2) 
+  AL = 4.d0/ B0 / ALN 
+  IF (IRDR .GE. 2) AL = AL * (1.d0-B1*LOG(ALN) / ALN / B0**2) 
+  IF (AL .GE. 3.) THEN 
+     IRT = 2 
+  ENDIF
+  CtLhALPQCD = AL 
+  RETURN 
+END FUNCTION CtLhALPQCD
+
+
+FUNCTION CtLhAMHATF(I) 
+  IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+  COMMON / LhCtCWZPRM / ALAM(0:9), AMHAT(0:9), AMN, NHQ 
+  COMMON / LhCtQCDPAR_LHA / AL, NF, NORDER, SET 
+  LOGICAL SET 
+  IF (.NOT.SET) CALL CtLhLAMCWZ 
+  IF ((I.LE.0).OR.(I.GT.9)) THEN 
+     print *,'warning I OUT OF RANGE IN CtLhAMHATF' 
+     CtLhAMHATF = 0 
+  ELSE 
+     CtLhAMHATF = AMHAT(I) 
+  ENDIF
+  RETURN 
+END FUNCTION CtLhAMHATF
+
+
+FUNCTION CtLhDXDZ (Z) 
+  IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+  PARAMETER (D0=0D0, D1=1D0, D2=2D0, D3=3D0, D4=4D0, D10=1D1) 
+  DATA HUGE, IWRN / 1.E20, 0 / 
+  ZZ = Z 
+  X = CtLhXFRMZ (ZZ) 
+  TEM = CtLhDZDX (X) 
+  IF     (TEM .NE. D0) THEN 
+     TMP = D1 / TEM 
+  Else 
+     CALL CtLhWARNR(IWRN, 'CtLhDXDZ singular in CtLhDXDZ; set=HUGE',   &
+          &             'Z', Z, D0, D1, 0)                                   
+     TMP = HUGE 
+  EndIf
+  CtLhDXDZ = TMP 
+  RETURN 
+END FUNCTION CtLhDXDZ
+
+
+SUBROUTINE CtLhEVLPAR (IACT, NAME, VALUE, IRET) 
+  IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+  CHARACTER*(*) NAME 
+  IRET = 1 
+  IF     (IACT .EQ. 0) THEN 
+     WRITE ( NINT(VALUE) , 101) 
+101  FORMAT (/ ' Initiation parameters:   Qini, Ipd0, Ihdn ' / &
+          &                  ' Maximum Q, Order of Alpha:     Qmax, IKNL ' / &
+          &                  ' X- mesh parameters   :   Xmin, Xcr,   Nx  ' / &
+          &                  ' LnQ-mesh parameters  :         Nt,   Jt   ' / &
+          &                  ' # of parton flavors  :         NfMx       ' /)
+     IRET = 4 
+  ElseIF (IACT .EQ. 1) THEN 
+     CALL CtLhEVLSET (NAME, VALUE, IRET) 
+  Else 
+     print *,'fatal evlpar' 
+     stop 
+  EndIf
+  RETURN 
+END SUBROUTINE CtLhEVLPAR
+
+
+SUBROUTINE CtLhEVLSET (NAME, VALUE, IRET) 
+  IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+  LOGICAL LSTX 
+  CHARACTER*(*) NAME 
+  PARAMETER (MXX = 105, MXQ = 25, MXF = 6) 
+  PARAMETER (MXPN = MXF * 2 + 2) 
+  PARAMETER (MXQX= MXQ * MXX,   MXPQX = MXQX * MXPN) 
+  COMMON / LhCtXXARAY / XCR, XMIN, XV(0:MXX), LSTX, NX 
+  COMMON / LhCtQARAY1 / QINI,QMAX, QV(0:MXQ),TV(0:MXQ), NT,JT,NG 
+  COMMON / LhCtEVLPAC / AL, IKNL, IPD0, IHDN, NfMx                  &
+       & / PdfSwh / Iset, IpdMod, Iptn0, NuIni                            
+  IRET = 1 
+  IF     (NAME .EQ. 'QINI')  THEN 
+     IF (VALUE .LE. 0) GOTO 12 
+     QINI = VALUE 
+  ElseIF (NAME .EQ. 'IPD0')  THEN 
+     ITEM = NINT(VALUE) 
+     IF (Item .Eq. 10 .or. Item .Eq. 11) GOTO 12 
+     IPD0 = ITEM 
+  ElseIF (NAME .EQ. 'IHDN') THEN 
+     ITEM = NINT(VALUE) 
+     IF (ITEM .LT. -1 .OR. ITEM .GT. 5) GOTO 12 
+     IHDN = ITEM 
+  ElseIF (NAME .EQ. 'QMAX')  THEN 
+     IF (VALUE .LE. QINI) GOTO 12 
+     QMAX = VALUE 
+  ElseIF (NAME .EQ. 'IKNL') THEN 
+     ITMP = NINT(VALUE) 
+     ITEM = ABS(ITMP) 
+     IF (ITEM.NE.1.AND.ITEM.NE.2) GOTO 12 
+     IKNL = ITMP 
+  ElseIF (NAME .EQ. 'XCR') THEN 
+     IF (VALUE .LT. XMIN .OR. VALUE .GT. 10.) GOTO 12 
+     XCR = VALUE 
+     LSTX = .FALSE. 
+  ElseIF (NAME .EQ. 'XMIN') THEN 
+     IF (VALUE .LT. 1D-7 .OR. VALUE .GT. 1D0) GOTO 12 
+     XMIN = VALUE 
+     LSTX = .FALSE. 
+  ElseIF (NAME .EQ. 'NX') THEN 
+     ITEM = NINT(VALUE) 
+     IF (ITEM .LT. 10 .OR. ITEM .GT. MXX-1) GOTO 12 
+     NX = ITEM 
+     LSTX = .FALSE. 
+  ElseIF (NAME .EQ. 'NT') THEN 
+     ITEM = NINT(VALUE) 
+     IF (ITEM .LT. 2 .OR. ITEM .GT. MXQ) GOTO 12 
+     NT = ITEM 
+  ElseIF (NAME .EQ. 'JT') THEN 
+     ITEM = NINT(VALUE) 
+     IF (ITEM .LT. 1 .OR. ITEM .GT. 5) GOTO 12 
+     JT = ITEM 
+  ElseIF (NAME .EQ. 'NFMX') THEN 
+     ITEM = NINT(VALUE) 
+     IF (ITEM .LT. 1 .OR. ITEM .GT. MXPN) GOTO 12 
+     NfMx = ITEM 
+  ElseIF (NAME .EQ. 'IPDMOD') THEN 
+     ITEM = NINT(VALUE) 
+     IF (Abs(Item) .Gt. 1) GOTO 12 
+     IpdMod = ITEM 
+  ElseIF (NAME .EQ. 'IPTN0') THEN 
+     ITEM = NINT(VALUE) 
+     IF (ABS(ITEM) .GT. MXF) GOTO 12 
+     IPTN0 = ITEM 
+  ElseIF (NAME .EQ. 'NUINI') THEN 
+     ITEM = NINT(VALUE) 
+     IF (ITEM .LE. 0) GOTO 12 
+     NuIni = ITEM 
+  Else 
+     IRET = 0 
+  EndIf
+  RETURN 
+12 IRET = 2 
+  RETURN 
+END SUBROUTINE CtLhEVLSET
+
+
+SUBROUTINE CtLhEVOLVE (FINI, IRET) 
+  IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+  include 'parmsetup.inc' 
+  LOGICAL LSTX 
+  PARAMETER (MXX = 105, MXQ = 25, MXF = 6) 
+  PARAMETER (MXPN = MXF * 2 + 2) 
+  PARAMETER (MXQX= MXQ * MXX,   MXPQX = MXQX * MXPN) 
+  PARAMETER (M1=-3, M2=3, NDG=3, NDH=NDG+1, L1=M1-1, L2=M2+NDG-2) 
+  COMMON / LhCtXXARAY / XCR, XMIN, XV(0:MXX), LSTX, NX 
+  COMMON / LhCtQARAY1 / QINI,QMAX, QV(0:MXQ),TV(0:MXQ), NT,JT,NG 
+  COMMON / LhCtQARAY2 / TLN(MXF), DTN(MXF), NTL(MXF), NTN(MXF) 
+  COMMON / LhCtEVLPAC / AL, IKNL, IPD0, IHDN, NfMx 
+  COMMON / LhCtPEVLDT / UPD(MXPQX,nmxset), KF, Nelmt 
+  COMMON / LhCtVARIBX / XA(MXX, L1:L2), ELY(MXX), DXTZ(MXX) 
+  COMMON / LhCtVARBAB / GB(NDG, NDH, MXX), H(NDH, MXX, M1:M2) 
+  DIMENSION QRKP(MXF) 
+  DIMENSION JI(-MXF : MXF+1) 
+  EXTERNAL LhCtNSRHSP, LhCtNSRHSM, FINI 
+  DATA DZER / 0.0 / 
+  save nxsave, ntsave, jtsave, ngsave,                              &
+       &     xcrsave, xminsave, qinisave, qmaxsave, ientry                
+  data ientry / 0 / 
+  !                                                                       
+  call getnset(iset) 
+  !                                                                       
+  ientry = ientry + 1 
+  IRET = 0 
+  IF (IHDN .LE. 4) THEN 
+     MXVAL = 2 
+  ElseIF (IHDN .LE. 6) THEN 
+     MXVAL = 3 
+  EndIf
+  IF (.NOT. LSTX) CALL CtLhXARRAY 
+  CALL CtLhPARPDF (2, 'ALAM', AL, IR) 
+  CALL CtLhQARRAY (NINI) 
+  NFSN = NFMX + 1 
+  KF = 2 * NFMX + 2 
+  Nelmt = KF * (Nt+1) * (Nx+1) 
+  DO IFLV = -NFMX, NFMX+1 
+     JFL = NFMX + IFLV 
+     JI(IFLV) = JFL * (NT+1) * (NX+1) 
+  END DO
+  DO IZ = 1, NX 
+     UPD(JI(0)+IZ+1,iset) = FINI (0, XV(IZ)) 
+     UPD(JI(NFSN)+IZ+1,iset) = 0 
+     IF (NFMX .EQ. 0) EXIT
+     DO IFLV = 1, NINI 
+        A = FINI ( IFLV, XV(IZ)) 
+        B = FINI (-IFLV, XV(IZ)) 
+        QRKP (IFLV) = A + B 
+        UPD(JI(NFSN)+IZ+1,iset) =                                     &
+             &       UPD(JI(NFSN)+IZ+1,iset) + QRKP (IFLV)                      
+        UPD(JI(-IFLV)+IZ+1,iset) = A - B 
+     END DO
+     DO IFLV = 1, NINI 
+        UPD(JI( IFLV)+IZ+1,iset) =                                   &
+             &        QRKP(IFLV) - UPD(JI(NFSN)+IZ+1,iset)/NINI                 
+     END DO
+  END DO
+  DO NEFF = NINI, NFMX 
+     IF (IKNL .EQ. 2) CALL CtLhSTUPKL (NEFF) 
+     ICNT = NEFF - NINI + 1 
+     IF (NTN(ICNT) .EQ. 0) EXIT
+     NITR = NTN (ICNT) 
+     DT   = DTN (ICNT) 
+     TIN  = TLN (ICNT) 
+     CALL CtLhSNEVL (IKNL, NX, NITR, JT, DT, TIN, NEFF,            &
+          &    UPD(JI(NFSN)+2,iset), UPD(JI(0)+2,iset),                      &
+          &    UPD(JI(NFSN)+1,iset), UPD(JI(0)+1,iset))                      
+     IF (NEFF .EQ. 0) GOTO 88 
+     DO IFLV = 1, NEFF 
+        CALL CtLhNSEVL (LhCtNSRHSP, IKNL, NX, NITR, JT, DT, TIN,     &
+             &     NEFF, UPD(JI( IFLV)+2,iset), UPD(JI( IFLV)+1,iset))          
+        IF (IFLV .LE. MXVAL)                                         &
+             &     CALL CtLhNSEVL (LhCtNSRHSM, IKNL, NX, NITR, JT, DT, TIN,     &
+             &     NEFF, UPD(JI(-IFLV)+2,iset), UPD(JI(-IFLV)+1,iset))          
+        DO IS = 0, NITR 
+           DO IX = 0, NX 
+              TP = UPD (IS*(NX+1) + IX + 1 + JI( IFLV),iset) 
+              TS = UPD (IS*(NX+1) + IX + 1 + JI( NFSN),iset) / NEFF 
+              TP = TP + TS 
+              IF (IKNL .GT. 0) TP = MAX (TP, DZER) 
+              IF (IFLV .LE. MXVAL) THEN 
+                 TM = UPD (IS*(NX+1) + IX + 1 + JI(-IFLV),iset) 
+                 IF (IKNL .GT. 0) THEN 
+                    TM = MAX (TM, DZER) 
+                    TP = MAX (TP, TM) 
+                 EndIf
+              Else 
+                 TM = 0. 
+              EndIf
+              UPD (JI( IFLV) + IS*(NX+1) + IX + 1,iset) = (TP + TM)/2. 
+              UPD (JI(-IFLV) + IS*(NX+1) + IX + 1,iset) = (TP - TM)/2. 
+           END DO
+        END DO
+     END DO
+     DO IFLV = NEFF + 1, NFMX 
+        DO IS = 0, NITR 
+           DO IX = 0, NX 
+              UPD(JI( IFLV) + IS*(NX+1) + IX + 1,iset) = 0 
+              UPD(JI(-IFLV) + IS*(NX+1) + IX + 1,iset) = 0 
+           END DO
+        END DO
+     END DO
+88   CONTINUE 
+     IF (NFMX .EQ. NEFF) EXIT
+     DO IFLV = -NFMX, NFMX+1 
+        JI(IFLV) = JI(IFLV) + NITR * (NX+1) 
+     END DO
+     CALL CtLhHQRK (NX, TT, NEFF+1, UPD(JI(0)+2,iset),               &
+          &     UPD(JI(NEFF+1)+2,iset))                                      
+     DO IZ = 1, NX 
+        QRKP (NEFF+1) = 2. * UPD(JI( NEFF+1) + IZ + 1,iset) 
+        UPD (JI(NFSN)+IZ+1,iset) = UPD (JI(NFSN)+IZ+1,iset)            &
+             &        + QRKP (NEFF+1)                                           
+        VS00 =  UPD (JI(NFSN)+IZ+1,iset) / (NEFF+1) 
+        UPD(JI( NEFF+1) + IZ + 1,iset) = QRKP(NEFF+1) - VS00 
+        DO IFL = 1, NEFF 
+           A = UPD(JI( IFL)+IZ+1,iset) 
+           B = UPD(JI(-IFL)+IZ+1,iset) 
+           QRKP(IFL) = A + B 
+           UPD(JI( IFL)+IZ+1,iset) = QRKP(IFL) - VS00 
+           IF (IFL .LE. MXVAL)  UPD(JI(-IFL)+IZ+1,iset) = A - B 
+        END DO
+     END DO
+  END DO
+  if(ientry .eq. 1) then 
+     nxsave = nx 
+     ntsave = nt 
+     jtsave = jt 
+     ngsave = ng 
+     xcrsave = xcr 
+     xminsave = xmin 
+     qinisave = qini 
+     qmaxsave = qmax 
+  endif
+  if((nx .ne. nxsave) .or.                                        &
+       &           (nt .ne. ntsave) .or.                                  &
+       &           (jt .ne. jtsave) .or.                                  &
+       &           (ng .ne. ngsave) .or.                                  &
+       &           (xcr .ne. xcrsave) .or.                                &
+       &           (xmin .ne. xminsave) .or.                              &
+       &           (qini .ne. qinisave) .or.                              &
+       &           (qmax .ne. qmaxsave)) then                             
+     write(6,669) nx, nt, jt, ng, xcr, xmin,                      &
+          &                        qini, qmax, ientry                        
+669  format(1x,'evolve.f:  nx,nt,jt,ng=',4i4,                  &
+          &               ' xcr,xmin=',2f9.6,                                &
+          &               ' qini, qmax',f7.4,1x,e12.5,' ientry=',i6)         
+     nxsave = nx 
+     ntsave = nt 
+     jtsave = jt 
+     ngsave = ng 
+     qinisave = qini 
+     qmaxsave = qmax 
+     xcrsave = xcr 
+     xminsave = xmin 
+  endif
+  Return 
+END SUBROUTINE CtLhEVOLVE
+
+
+FUNCTION CtLhFINTRP (FF,  X0, DX, NX,  XV,  ERR, IR) 
+  IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+  PARAMETER (D0=0D0, D1=1D0, D2=2D0, D3=3D0, D4=4D0, D10=1D1) 
+  PARAMETER (MX = 3) 
+  DIMENSION FF (0:NX), XX(MX) 
+  DATA SML, XX / 1.D-5,  0., 1.0, 2.0 / 
+  DATA  IW1, IW3, IW5 / 3 * 0 / 
+  IR = 0 
+  X = XV 
+  ERR = 0. 
+  ANX = NX 
+  CtLhFINTRP = 0. 
+  IF (NX .LT. 1) THEN 
+     CALL CtLhWARNI(IW1, 'Nx < 1, error in CtLhFINTRP.',            &
+          &              'NX', NX, 1, 256, 1)                                
+     IR = 1 
+     RETURN 
+  ELSE 
+     MNX = MIN(NX+1, MX) 
+  ENDIF
+  IF (DX .LE. 0) THEN 
+     CALL CtLhWARNR(IW3, 'DX < 0, error in CtLhFINTRP.',            &
+          &              'DX', DX, D0, D1, 1)                                
+     IR = 2 
+     RETURN 
+  ENDIF
+  XM = X0 + DX * NX 
+  IF (X .LT. X0-SML .OR. X .GT. XM+SML) THEN 
+     CALL CtLhWARNR(IW5,                                             &
+          &     'X out of range in CtLhFINTRP, Extrapolation used.',         &
+          &     'X',X,X0,XM,1)                                               
+     IR = 3 
+  ENDIF
+  TX = (X - X0) / DX 
+  IF (TX .LE. 1.) THEN 
+     IX = 0 
+  ELSEIF (TX .GE. ANX-1.) THEN 
+     IX = NX - 2 
+  ELSE 
+     IX = Int(TX) 
+  ENDIF
+  DDX = TX - IX 
+  CALL CtLhRATINT (XX, FF(IX), MNX, DDX, TEM, ERR) 
+  CtLhFINTRP = TEM 
+  RETURN 
+END FUNCTION CtLhFINTRP
+
+
+FUNCTION CtLhGausInt(F,XL,XR,AERR,RERR,ERR,IRT) 
+  IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+  DIMENSION XLIMS(100), R(93), W(93) 
+  INTEGER PTR(4),NORD(4) 
+  external f 
+  DATA PTR,NORD/4,10,22,46,  6,12,24,48/ 
+  DATA R/.2386191860,.6612093865,.9324695142,                     &
+       & .1252334085,.3678314990,.5873179543,.7699026742,.9041172563,     &
+       & .9815606342,.0640568929,.1911188675,.3150426797,.4337935076,     &
+       & .5454214714,.6480936519,.7401241916,.8200019860,.8864155270,     &
+       & .9382745520,.9747285560,.9951872200,.0323801710,.0970046992,     &
+       & .1612223561,.2247637903,.2873624873,.3487558863,.4086864820,     &
+       & .4669029048,.5231609747,.5772247261,.6288673968,.6778723796,     &
+       & .7240341309,.7671590325,.8070662040,.8435882616,.8765720203,     &
+       & .9058791367,.9313866907,.9529877032,.9705915925,.9841245837,     &
+       & .9935301723,.9987710073,.0162767488,.0488129851,.0812974955,     &
+       & .1136958501,.1459737146,.1780968824,.2100313105,.2417431561,     &
+       & .2731988126,.3043649444,.3352085229,.3656968614,.3957976498,     &
+       & .4254789884,.4547094222,.4834579739,.5116941772,.5393881083,     &
+       & .5665104186,.5930323648,.6189258401,.6441634037,.6687183100,     &
+       & .6925645366,.7156768123,.7380306437,.7596023411,.7803690438,     &
+       & .8003087441,.8194003107,.8376235112,.8549590334,.8713885059,     &
+       & .8868945174,.9014606353,.9150714231,.9277124567,.9393703398,     &
+       & .9500327178,.9596882914,.9683268285,.9759391746,.9825172636,     &
+       & .9880541263,.9925439003,.9959818430,.9983643759,.9996895039/     
+  DATA W/.4679139346,.3607615730,.1713244924,                     &
+       & .2491470458,.2334925365,.2031674267,.1600783285,.1069393260,     &
+       & .0471753364,.1279381953,.1258374563,.1216704729,.1155056681,     &
+       & .1074442701,.0976186521,.0861901615,.0733464814,.0592985849,     &
+       & .0442774388,.0285313886,.0123412298,.0647376968,.0644661644,     &
+       & .0639242386,.0631141923,.0620394232,.0607044392,.0591148397,     &
+       & .0572772921,.0551995037,.0528901894,.0503590356,.0476166585,     &
+       & .0446745609,.0415450829,.0382413511,.0347772226,.0311672278,     &
+       & .0274265097,.0235707608,.0196161605,.0155793157,.0114772346,     &
+       & .0073275539,.0031533461,.0325506145,.0325161187,.0324471637,     &
+       & .0323438226,.0322062048,.0320344562,.0318287589,.0315893308,     &
+       & .0313164256,.0310103326,.0306713761,.0302999154,.0298963441,     &
+       & .0294610900,.0289946142,.0284974111,.0279700076,.0274129627,     &
+       & .0268268667,.0262123407,.0255700360,.0249006332,.0242048418,     &
+       & .0234833991,.0227370697,.0219666444,.0211729399,.0203567972,     &
+       & .0195190811,.0186606796,.0177825023,.0168854799,.0159705629,     &
+       & .0150387210,.0140909418,.0131282296,.0121516047,.0111621020,     &
+       & .0101607705,.0091486712,.0081268769,.0070964708,.0060585455,     &
+       & .0050142027,.0039645543,.0029107318,.0018539608,.0007967921/     
+  DATA TOLABS,TOLREL,NMAX/1.E-35,5.E-4,100/ 
+  TOLABS=AERR 
+  TOLREL=RERR 
+  
+  CtLhGausInt=0. 
+  NLIMS=2 
+  XLIMS(1)=XL 
+  XLIMS(2)=XR 
+10 AA=(XLIMS(NLIMS)-XLIMS(NLIMS-1))/2D0 
+  BB=(XLIMS(NLIMS)+XLIMS(NLIMS-1))/2D0 
+  TVAL=0. 
+  DO 15 I=1,3 
+15   TVAL=TVAL+W(I)*(F(BB+AA*R(I))+F(BB-AA*R(I))) 
+     TVAL=TVAL*AA 
+     DO 25 J=1,4 
+        VAL=0. 
+        DO 20 I=PTR(J),PTR(J)-1+NORD(J) 
+20         VAL=VAL+W(I)*(F(BB+AA*R(I))+F(BB-AA*R(I))) 
+           VAL=VAL*AA 
+           TOL=MAX(TOLABS,TOLREL*ABS(VAL)) 
+           IF (ABS(TVAL-VAL).LT.TOL) THEN 
+              CtLhGausInt=CtLhGausInt+VAL 
+              NLIMS=NLIMS-2 
+              IF (NLIMS.NE.0) GOTO 10 
+              RETURN 
+           END IF
+25         TVAL=VAL 
+           IF (NMAX.EQ.2) THEN 
+              CtLhGausInt=VAL 
+              RETURN 
+           END IF
+           IF (NLIMS.GT.(NMAX-2)) THEN 
+              write(*,50) CtLhGausInt,NMAX,BB-AA,BB+AA 
+              RETURN 
+           END IF
+           XLIMS(NLIMS+1)=BB 
+           XLIMS(NLIMS+2)=BB+AA 
+           XLIMS(NLIMS)=BB 
+           NLIMS=NLIMS+2 
+           GOTO 10 
+50         FORMAT (' CtLhGausInt FAILS, CtLhGausInt,NMAX,XL,XR=',          &
+                &            G15.7,I5,2G15.7)                                      
+      END                                           
+      SUBROUTINE CtLhHINTEG (NX, F, H) 
+      IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+      PARAMETER (MXX = 105, MXQ = 25, MXF = 6) 
+      PARAMETER (MXPN = MXF * 2 + 2) 
+      PARAMETER (MXQX= MXQ * MXX,   MXPQX = MXQX * MXPN) 
+      PARAMETER (M1=-3, M2=3, NDG=3, NDH=NDG+1, L1=M1-1, L2=M2+NDG-2) 
+      COMMON / LhCtHINTEC / GH(NDG, MXX) 
+      COMMON / LhCtVARIBX / XA(MXX, L1:L2), ELY(MXX), DXTZ(MXX) 
+      DIMENSION F(NX), H(NX), G(MXX) 
+      DZ = 1D0 / (NX-1) 
+      DO 20 I = 1, NX-2 
+         NP = NX - I + 1 
+         TEM = GH(1,I)*F(I) + GH(2,I)*F(I+1) + GH(3,I)*F(I+2) 
+         DO 30 KZ = 3, NP 
+            IY = I + KZ - 1 
+            W = XA(I,1) / XA(IY,1) 
+            G(KZ) = DXTZ(IY)*(F(IY)-W*F(I))/(1.-W) 
+   30    CONTINUE 
+         HTEM = CtLhSMPSNA (NP-2, DZ, G(3), ERR) 
+         TEM1 = F(I) * ELY(I) 
+         H(I) = TEM + HTEM + TEM1 
+   20 END DO 
+      H(NX-1) = F(NX) - F(NX-1) + F(NX-1) * (ELY(NX-1) - XA(NX-1,0)) 
+      H(NX)   = 0 
+      RETURN 
+      END                                           
+      SUBROUTINE CtLhHQRK (NX, TT, NQRK, Y, F) 
+      IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+      PARAMETER (MXX = 105, MXQ = 25, MXF = 6) 
+      DIMENSION Y(NX), F(NX) 
+      IF (NX .GT. 1) GOTO 11 
+11    CONTINUE 
+      DO IZ = 1, NX 
+         IF (NX .GT. 1) THEN 
+            F(IZ) = 0 
+            EXIT
+         EndIf
+      END DO
+      RETURN 
+      END                                           
+
+
+      SUBROUTINE CtLhINTEGR (NX, M, F,   G, IR) 
+      IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+      CHARACTER MSG*80 
+      PARAMETER (MXX = 105, MXQ = 25, MXF = 6) 
+      PARAMETER (MXPN = MXF * 2 + 2) 
+      PARAMETER (MXQX= MXQ * MXX,   MXPQX = MXQX * MXPN) 
+      PARAMETER (M1=-3, M2=3, NDG=3, NDH=NDG+1, L1=M1-1, L2=M2+NDG-2) 
+      COMMON / LhCtVARIBX / XA(MXX, L1:L2), ELY(MXX), DXTZ(MXX) 
+      COMMON / LhCtVARBAB / GB(NDG, NDH, MXX), H(NDH, MXX, M1:M2) 
+      DIMENSION   F(NX), G(NX) 
+      DATA IWRN1, IWRN2 / 0, 0 / 
+      IRR = 0 
+      IF (NX .LT. 1 .OR. XA(NX-1,1) .EQ. 0D0) THEN 
+        MSG = 'NX out of range in CtLhINTEGR call' 
+        CALL CtLhWARNI (IWRN1, MSG, 'NX', NX, 0, MXX, 0) 
+        IRR = 1 
+      EndIf 
+      IF (M .LT. M1 .OR. M .GT. M2) THEN 
+        MSG ='Exponent M out of range in CtLhINTEGR' 
+        CALL CtLhWARNI (IWRN2, MSG, 'M', M, M1, M2, 1) 
+        IRR = 2 
+      EndIf 
+      G(NX) = 0D0 
+      TEM = H(1, NX-1, -M) * F(NX-2) + H(2, NX-1, -M) * F(NX-1)         &
+     &    + H(3, NX-1, -M) * F(NX)                                      
+      IF (M .EQ. 0) THEN 
+         G(NX-1) = TEM 
+      Else 
+         G(NX-1) = TEM * XA(NX-1, M) 
+      EndIf 
+      DO 10 I = NX-2, 2, -1 
+         TEM = TEM + H(1,I,-M)*F(I-1) + H(2,I,-M)*F(I)                  &
+     &             + H(3,I,-M)*F(I+1) + H(4,I,-M)*F(I+2)                
+         IF (M .EQ. 0) THEN 
+            G(I) = TEM 
+         Else 
+            G(I) = TEM * XA(I, M) 
+         EndIf 
+   10 END DO 
+      TEM = TEM + H(2,1,-M)*F(1) + H(3,1,-M)*F(2) + H(4,1,-M)*F(3) 
+      IF (M .EQ. 0) THEN 
+         G(1) = TEM 
+      Else 
+         G(1) = TEM * XA(1, M) 
+      EndIf 
+      IR = IRR 
+      RETURN 
+      END       
+
+                                    
+      SUBROUTINE CtLhKERNEL                                             &
+     &(XX, FF1, FG1, GF1, GG1, PNSP, PNSM, FF2, FG2, GF2, GG2, NFL, IRT)
+      IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+      PARAMETER (PI = 3.141592653589793d0, PI2 = PI ** 2) 
+      PARAMETER (D0 = 0.0, D1 = 1.0) 
+      DATA CF, CG, TR, IWRN / 1.33333333333333d0, 3.0d0, 0.5d0, 0 / 
+      IRT = 0 
+      TRNF = TR * NFL 
+      X = XX 
+      IF (X .LE. 0. .OR. X .GE. 1.) THEN 
+        CALL CtLhWARNR(IWRN, 'X out of range in CtLhKERNEL', 'X', X,    &
+     &             D0, D1, 1)                                           
+        IRT = 1 
+        RETURN 
+      EndIf 
+      XI = 1./ X 
+      X2 = X ** 2 
+      XM1I = 1./ (1.- X) 
+      XP1I = 1./ (1.+ X) 
+      XLN = LOG (X) 
+      XLN2 = XLN ** 2 
+      XLN1M = LOG (1.- X) 
+      SPEN2 = CtLhSPENC2 (X) 
+      FFP = (1.+ X2) * XM1I 
+      FGP = (2.- 2.* X + X2) / X 
+      GFP = 1. - 2.* X + 2.* X2 
+      GGP = XM1I + XI - 2. + X - X2 
+      FFM = (1.+ X2) * XP1I 
+      FGM = - (2.+ 2.* X + X2) / X 
+      GFM = 1. + 2.* X + 2.* X2 
+      GGM = XP1I - XI - 2. - X - X2 
+      FF1 = CF * FFP * (1.- X) 
+      FG1 = CF * FGP * X 
+      GF1 = 2.* TRNF * GFP 
+      GG1 = 2.* CG * GGP * X * (1.-X) 
+      PCF2 = -2.* FFP *XLN*XLN1M - (3.*XM1I + 2.*X)*XLN                 &
+     &     - (1.+X)/2.*XLN2 - 5.*(1.-X)                                 
+      PCFG = FFP * (XLN2 + 11.*XLN/3.+ 67./9.- PI**2 / 3.)              &
+     &     + 2.*(1.+X) * XLN + 40.* (1.-X) / 3.                         
+      PCFT = (FFP * (- XLN - 5./3.) - 2.*(1.-X)) * 2./ 3. 
+      PQQB = 2.* FFM * SPEN2 + 2.*(1.+X)*XLN + 4.*(1.-X) 
+      PQQB = (CF**2-CF*CG/2.) * PQQB 
+      PQQ2 = CF**2 * PCF2 + CF*CG * PCFG / 2. + CF*TRNF * PCFT 
+      PNSP = (PQQ2 + PQQB) * (1.-X) 
+      PNSM = (PQQ2 - PQQB) * (1.-X) 
+      FFCF2 = - 1. + X + (1.- 3.*X) * XLN / 2. - (1.+ X) * XLN2 / 2.    &
+     &      - FFP * (3.* XLN / 2. + 2.* XLN * XLN1M)                    &
+     &      + FFM * 2.* SPEN2                                           
+      FFCFG = 14./3.* (1.-X)                                            &
+     &      + FFP * (11./6.* XLN + XLN2 / 2. + 67./18. - PI2 / 6.)      &
+     &      - FFM * SPEN2                                               
+      FFCFT = - 16./3. + 40./3.* X + (10.* X + 16./3.* X2 + 2.) * XLN   &
+     &                 - 112./9.* X2 + 40./9./X - 2.* (1.+ X) * XLN2    &
+     &      - FFP * (10./9. + 2./3. * XLN)                              
+      FGCF2 = - 5./2.- 7./2.* X + (2.+ 7./2.* X) * XLN + (X/2.-1.)*XLN2 &
+     &               - 2.* X * XLN1M                                    &
+     &      - FGP * (3.* XLN1M + XLN1M ** 2)                            
+      FGCFG = 28./9. + 65./18.* X + 44./9. * X2 - (12.+ 5.*X + 8./3.*X2)&
+     &                      * XLN + (4.+ X) * XLN2 + 2.* X * XLN1M      &
+     &      + FGP * (-2.*XLN*XLN1M + XLN2/2. + 11./3.*XLN1M + XLN1M**2  &
+     &               - PI2/6. + 0.5)                                    &
+     &      + FGM * SPEN2                                               
+      FGCFT = -4./3.* X - FGP * (20./9.+ 4./3.*XLN1M) 
+      GFCFT = 4.- 9.*X + (-1.+ 4.*X)*XLN + (-1.+ 2.*X)*XLN2 + 4.*XLN1M  &
+     &      + GFP * (-4.*XLN*XLN1M + 4.*XLN + 2.*XLN2 - 4.*XLN1M        &
+     &               + 2.*XLN1M**2 - 2./3.* PI2 + 10.)                  
+      GFCGT = 182./9.+ 14./9.*X + 40./9./X + (136./3.*X - 38./3.)*XLN   &
+     &               - 4.*XLN1M - (2.+ 8.*X)*XLN2                       &
+     &      + GFP * (-XLN2 + 44./3.*XLN - 2.*XLN1M**2 + 4.*XLN1M        &
+     &               + PI2/3. - 218./9.)                                &
+     &      + GFM * 2. * SPEN2                                          
+      GGCFT = -16.+ 8.*X + 20./3.*X2 + 4./3./X + (-6.-10.*X)*XLN        &
+     &        - 2.* (1.+ X) * XLN2                                      
+      GGCGT = 2.- 2.*X + 26./9.*X2 - 26./9./X - 4./3.*(1.+X)*XLN        &
+     &      - GGP * 20./9.                                              
+      GGCG2 = 27./2.*(1.-X) + 67./9.*(X2-XI) + 4.*(1.+X)*XLN2           &
+     &              + (-25.+ 11.*X - 44.*X2)/3.*XLN                     &
+     &      + GGP * (67./9.- 4.*XLN*XLN1M + XLN2 - PI2/3.)              &
+     &      + GGM * 2.* SPEN2                                           
+      FF2 = CF * TRNF * FFCFT + CF ** 2 * FFCF2 + CF * CG   * FFCFG 
+      FG2 = CF * TRNF * FGCFT + CF ** 2 * FGCF2 + CF * CG   * FGCFG 
+      GF2 = CF * TRNF * GFCFT                   + CG * TRNF * GFCGT 
+      GG2 = CF * TRNF * GGCFT + CG ** 2 * GGCG2 + CG * TRNF * GGCGT 
+      XLG = (LOG(1./(1.-X)) + 1.) 
+      XG2 = XLG ** 2 
+      FF2 = FF2 * X * (1.- X) 
+      FG2 = FG2 * X / XG2 
+      GF2 = GF2 * X / XG2 
+      GG2 = GG2 * X * (1.- X) 
+      RETURN 
+      END       
+
+                                    
+      SUBROUTINE CtLhLAMCWZ 
+      IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+      COMMON / LhCtQCDPAR_LHA / AL, NF, NORDER, SET 
+      LOGICAL SET 
+      CALL CtLhSETL1 (NF, AL) 
+      END                                           
+
+
+      FUNCTION LhCtNAMQCD(NNAME) 
+      IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+      CHARACTER NNAME*(*), NAME*8 
+      COMMON / LhCtQCDPAR_LHA / AL, NF, NORDER, SET 
+      LOGICAL SET 
+      CHARACTER ONECH*(1) 
+      ONECH = '0' 
+      IASC0 = ICHAR(ONECH) 
+      NAME = NNAME 
+      LhCtNAMQCD=0 
+      IF ( (NAME .EQ. 'ALAM') .OR. (NAME .EQ. 'LAMB') .OR.              &
+     &        (NAME .EQ. 'LAM') .OR. (NAME .EQ. 'LAMBDA') )             &
+     &             LhCtNAMQCD=1                                         
+      IF ( (NAME .EQ. 'NFL') .OR. (NAME(1:3) .EQ. '#FL') .OR.           &
+     &        (NAME .EQ. '# FL') )                                      &
+     &             LhCtNAMQCD=2                                         
+      DO 10 I=1, 9 
+         IF (NAME .EQ. 'M'//CHAR(I+IASC0))                              &
+     &             LhCtNAMQCD=I+2                                       
+   10    CONTINUE 
+      DO 20 I= 0, NF 
+         IF (NAME .EQ. 'LAM'//CHAR(I+IASC0))                            &
+     &             LhCtNAMQCD=I+13                                      
+   20    CONTINUE 
+      IF (NAME(:3).EQ.'ORD' .OR. NAME(:3).EQ.'NRD') LhCtNAMQCD = 24 
+      RETURN 
+      END     
+
+                                      
+      FUNCTION LhCtNFL(AMU) 
+      IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+      COMMON / LhCtCWZPRM / ALAM(0:9), AMHAT(0:9), AMN, NHQ 
+      COMMON / LhCtQCDPAR_LHA / AL, NF, NORDER, SET 
+      LOGICAL SET 
+      IF (.NOT. SET) CALL CtLhLAMCWZ 
+      LhCtNFL = NF - NHQ 
+      IF ((LhCtNFL .EQ. NF) .OR. (AMU .LE. AMN)) GOTO 20 
+      DO 10 I = NF - NHQ + 1, NF 
+         IF (AMU .GE. AMHAT(I)) THEN 
+            LhCtNFL = I 
+         ELSE 
+            GOTO 20 
+         ENDIF 
+   10    CONTINUE 
+   20 RETURN 
+      END       
+
+                                    
+      SUBROUTINE CtLhNSEVL (RHS, IKNL,NX,NT,JT,DT,TIN,NEFF,U0,UN) 
+      IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+      PARAMETER (MXX = 105, MXQ = 25, MXF = 6) 
+      PARAMETER (MXPN = MXF * 2 + 2) 
+      PARAMETER (MXQX= MXQ * MXX,   MXPQX = MXQX * MXPN) 
+      PARAMETER (M1=-3, M2=3, NDG=3, NDH=NDG+1, L1=M1-1, L2=M2+NDG-2) 
+      COMMON / LhCtVARIBX / XA(MXX, L1:L2), ELY(MXX), DXTZ(MXX) 
+      DIMENSION  U0(NX), UN(0:NX, 0:NT) 
+      DIMENSION  Y0(MXX), Y1(MXX), YP(MXX), F0(MXX), F1(MXX), FP(MXX) 
+      external rhs 
+      DDT = DT / JT 
+      IF (NX .GT. MXX) THEN 
+      WRITE (*,*) 'Nx =', NX, ' greater than Max pts in CtLhNSEVL.' 
+      STOP 'Program stopped in CtLhNSEVL' 
+      EndIf 
+! ++ remove unused quantities (jcp)                                     
+! ++  TMD = TIN + DT * NT / 2.                                          
+! ++  AMU = EXP(TMD)                                                    
+! ++  TEM = 6./ (33.- 2.* NEFF) / CtLhALPI(AMU)                         
+! ++  TLAM = TMD - TEM                                                  
+      DO 9 IX = 1, NX 
+      UN(IX, 0)  = U0(IX) 
+    9 END DO 
+      UN(0, 0) = 3D0*U0(1) - 3D0*U0(2) - U0(1) 
+      TT = TIN 
+      DO 10 IZ = 1, NX 
+      Y0(IZ)   = U0(IZ) 
+   10 END DO 
+      DO 20 IS = 1, NT 
+         DO 202 JS = 1, JT 
+            IRND = (IS-1) * JT + JS 
+            IF (IRND .EQ. 1) THEN 
+                CALL RHS (TT, Neff, Y0, F0) 
+                DO 250 IZ = 1, NX 
+                   Y0(IZ) = Y0(IZ) + DDT * F0(IZ) 
+  250           CONTINUE 
+                TT = TT + DDT 
+                CALL RHS (TT, NEFF, Y0, F1) 
+                DO 251 IZ = 1, NX 
+                   Y1(IZ) = U0(IZ) + DDT * (F0(IZ) + F1(IZ)) / 2D0 
+  251           CONTINUE 
+            Else 
+                CALL RHS (TT, NEFF, Y1, F1) 
+                DO 252 IZ = 1, NX 
+                   YP(IZ) = Y1(IZ) + DDT * (3D0 * F1(IZ) - F0(IZ)) / 2D0 
+  252           CONTINUE 
+                TT = TT + DDT 
+                CALL RHS (TT, NEFF, YP, FP) 
+                DO 253 IZ = 1, NX 
+                   Y1(IZ) = Y1(IZ) + DDT * (FP(IZ) + F1(IZ)) / 2D0 
+                   F0(IZ) = F1(IZ) 
+  253           CONTINUE 
+            EndIf 
+  202    CONTINUE 
+         DO 260 IZ = 1, NX 
+            UN (IZ, IS) = Y1(IZ) 
+  260    CONTINUE 
+         UN(0, IS) = 3D0*Y1(1) - 3D0*Y1(2) + Y1(3) 
+   20 END DO 
+      RETURN 
+      END       
+
+                                    
+      SUBROUTINE LhCtNSRHSM (TT, NEFF, FI, FO) 
+      IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+      LOGICAL LSTX 
+      PARAMETER (MXX = 105, MXQ = 25, MXF = 6) 
+      PARAMETER (M1=-3, M2=3, NDG=3, NDH=NDG+1, L1=M1-1, L2=M2+NDG-2) 
+      COMMON / LhCtVARIBX / XA(MXX, L1:L2), ELY(MXX), DXTZ(MXX) 
+      COMMON / LhCtXXARAY / XCR, XMIN, XV(0:MXX), LSTX, NX 
+      COMMON / LhCtXYARAY / ZZ(MXX, MXX), ZV(0:MXX) 
+      COMMON / LhCtKRNL01 / AFF2(MXX),AFG2(MXX),AGF2(MXX),AGG2(MXX),    &
+     &                  ANSP (MXX), ANSM (MXX), ZFG2, ZGF2, ZQQB        
+      COMMON / LhCtKRN2ND / FFG(MXX, MXX), GGF(MXX, MXX), PNS(MXX, MXX) 
+      COMMON / LhCtEVLPAC / AL, IKNL, IPD0, IHDN, NfMx 
+      DIMENSION G1(MXX), FI(NX), FO(NX) 
+      DIMENSION W0(MXX), W1(MXX), WH(MXX) 
+      S = EXP(TT) 
+      Q = AL * EXP (S) 
+      CPL = CtLhALPI(Q) 
+      CPL2= CPL ** 2 / 2. * S 
+      CPL = CPL * S 
+      CALL CtLhINTEGR (NX, 0, FI, W0, IR1) 
+      CALL CtLhINTEGR (NX, 1, FI, W1, IR2) 
+      CALL CtLhHINTEG (NX,    FI, WH) 
+      DO 230 IZ = 1, NX 
+      FO(IZ) = 2.* FI(IZ) + 4./3.* ( 2.* WH(IZ) - W0(IZ) - W1(IZ)) 
+      FO(IZ) = CPL * FO(IZ) 
+  230 END DO 
+      IF (IKNL .EQ. 2) THEN 
+      DZ = 1./ (NX - 1) 
+      DO 21 IX = 1, NX-1 
+        NP = NX - IX + 1 
+        IS = NP 
+        DO 31 KZ = 2, NP 
+          IY = IX + KZ - 1 
+          IT = NX - IY + 1 
+          XY = ZZ (IS, IT) 
+          G1(KZ) = PNS (IS,IT) * (FI(IY) - XY * FI(IX)) 
+   31   CONTINUE 
+        TEM1 = CtLhSMPNOL (NP, DZ, G1, ERR) 
+        TMP2 = (TEM1 - FI(IX) * ANSM(IX)) * CPL2 
+        FO(IX) = FO(IX) + TMP2 
+   21 END DO 
+      EndIf 
+      RETURN 
+      END       
+
+                                    
+      SUBROUTINE LhCtNSRHSP (TT, NEFF, FI, FO) 
+      IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+      LOGICAL LSTX 
+      PARAMETER (MXX = 105, MXQ = 25, MXF = 6) 
+      PARAMETER (M1=-3, M2=3, NDG=3, NDH=NDG+1, L1=M1-1, L2=M2+NDG-2) 
+      COMMON / LhCtVARIBX / XA(MXX, L1:L2), ELY(MXX), DXTZ(MXX) 
+      COMMON / LhCtXXARAY / XCR, XMIN, XV(0:MXX), LSTX, NX 
+      COMMON / LhCtXYARAY / ZZ(MXX, MXX), ZV(0:MXX) 
+      COMMON / LhCtKRNL01 / AFF2(MXX),AFG2(MXX),AGF2(MXX),AGG2(MXX),    &
+     &                  ANSP (MXX), ANSM (MXX), ZFG2, ZGF2, ZQQB        
+      COMMON / LhCtKRN2ND / FFG(MXX, MXX), GGF(MXX, MXX), PNS(MXX, MXX) 
+      COMMON / LhCtEVLPAC / AL, IKNL, IPD0, IHDN, NfMx 
+      DIMENSION G1(MXX), FI(NX), FO(NX) 
+      DIMENSION W0(MXX), W1(MXX), WH(MXX) 
+      S = EXP(TT) 
+      Q = AL * EXP (S) 
+      CPL = CtLhALPI(Q) 
+      CPL2= CPL ** 2 / 2. * S 
+      CPL = CPL * S 
+      CALL CtLhINTEGR (NX, 0, FI, W0, IR1) 
+      CALL CtLhINTEGR (NX, 1, FI, W1, IR2) 
+      CALL CtLhHINTEG (NX,    FI, WH) 
+      DO 230 IZ = 1, NX 
+      FO(IZ) = 2.* FI(IZ) + 4./3.* ( 2.* WH(IZ) - W0(IZ) - W1(IZ)) 
+      FO(IZ) = CPL * FO(IZ) 
+  230 END DO 
+      IF (IKNL .EQ. 2) THEN 
+      DZ = 1./ (NX - 1) 
+      DO 21 IX = 1, NX-1 
+        NP = NX - IX + 1 
+        DO 31 KZ = 2, NP 
+          IY = IX + KZ - 1 
+          XY = ZZ (NX-IX+1, NX-IY+1) 
+          G1(KZ) = PNS (IX,IY) * (FI(IY) - XY * FI(IX)) 
+   31   CONTINUE 
+        TEM1 = CtLhSMPNOL (NP, DZ, G1, ERR) 
+        TMP2 = (TEM1 + FI(IX) * (-ANSP(IX) + ZQQB)) * CPL2 
+        FO(IX) = FO(IX) + TMP2 
+   21 END DO 
+      EndIf 
+      RETURN 
+      END     
+
+                                      
+      FUNCTION CtLhPARDIS (IPRTN, XX, QQ) 
+      IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+      include 'parmsetup.inc' 
+      Character Msg*80 
+      LOGICAL LSTX 
+      PARAMETER (MXX = 105, MXQ = 25, MXF = 6) 
+      PARAMETER (MXPN = MXF * 2 + 2) 
+      PARAMETER (MXQX= MXQ * MXX,   MXPQX = MXQX * MXPN) 
+      PARAMETER (M1=-3, M2=3, NDG=3, NDH=NDG+1, L1=M1-1, L2=M2+NDG-2) 
+      PARAMETER (Smll = 1D-9) 
+        parameter(nqvec = 4) 
+      COMMON / LhCtXXARAY / XCR, XMIN, XV(0:MXX), LSTX, NX 
+      COMMON / LhCtXYARAY / ZZ(MXX, MXX), ZV(0:MXX) 
+      COMMON / LhCtVARIBX / XA(MXX, L1:L2), ELY(MXX), DXTZ(MXX) 
+      COMMON / LhCtQARAY1 / QINI,QMAX, QV(0:MXQ),TV(0:MXQ), NT,JT,NG 
+      COMMON / LhCtQARAY2 / TLN(MXF), DTN(MXF), NTL(MXF), NTN(MXF) 
+      COMMON / LhCtEVLPAC / AL, IKNL, IPD0, IHDN, NfMx 
+      COMMON / LhCtPEVLDT / UPD(MXPQX,nmxset), KF, Nelmt 
+      COMMON / LhCtCOMQMS / VALQMS(9) 
+      dimension fvec(4), fij(4) 
+      dimension xvpow(0:mxx) 
+      Data Iwrn1, Iwrn2, Iwrn3, OneP / 3*0, 1.00001 / 
+                                 !**** choice of interpolation variable 
+      data xpow / 0.3d0 / 
+      data nxsave / 0 / 
+        save xvpow, nxsave 
+         save xlast, qlast 
+         save jq, jx, JLx, JLq, ss, sy2, sy3, s23, ty2, ty3 
+         save const1 , const2, const3, const4, const5, const6 
+         save tt, t13, t12, t23, t34 , t24, tmp1, tmp2, tdet 
+!                                                                       
+      call getnset(iset) 
+!                                                                       
+      if(nx .ne. nxsave) then 
+         xvpow(0) = 0D0 
+         do i = 1, nx 
+            xvpow(i) = xv(i)**xpow 
+         enddo 
+        nxsave = nx 
+      endif 
+                                                                        
+      X = XX 
+      Q = QQ 
+                                                                        
+!      if((x.lt.xmin).or.(x.gt.1.d0)) print 98,x                        
+!  98  format(' WARNING:  X=',e12.5,' OUT OF RANGE')                    
+!      if((q.lt.qini).or.(q.gt.qmax)) print 99,q                        
+!  99  format(' WARNING:  Q=',e12.5,' OUT OF RANGE')                    
+                                                                        
+! enforce threshold early to improve speed...                           
+        ii = iabs(IPRTN) 
+        if(ii .ne. 0) then 
+           if(QQ .lt. VALQMS(ii) ) then 
+              ctlhpardis = 0.d0 
+              return 
+           endif 
+        endif 
+                                                                        
+! force pardis = 0.0d0 at exactly =1.0d0 - added mrw 10/May/06          
+        if(xx .eq. 1.0d0) then 
+          ctlhpardis = 0.0d0 
+          return 
+        endif 
+                                                                        
+! skip the initialization in x if same as in the previous call.         
+        if(x .eq. xlast) goto 100 
+        xlast = x 
+                                                                        
+      JLx = -1 
+      JU = Nx+1 
+   11 If (JU-JLx .GT. 1) Then 
+         JM = (JU+JLx) / 2 
+         If (X .Ge. XV(JM)) Then 
+            JLx = JM 
+         Else 
+            JU = JM 
+         Endif 
+         Goto 11 
+      Endif 
+      If     (JLx .LE. -1) Then 
+        Print '(A,1pE12.4)','Severe error: x <= 0 in ParDis x=', x 
+        Stop 
+      ElseIf (JLx .Eq. 0) Then 
+         Jx = 0 
+         Msg = '0 < X < Xmin in ParDis; extrapolation used!' 
+         CALL CtLhWARNR (IWRN1, Msg, 'X', X, Xmin, 1D0, 1) 
+      Elseif (JLx .LE. Nx-2) Then 
+         Jx = JLx - 1 
+      Elseif (JLx.Eq.Nx-1 .or. x.LT.OneP) Then 
+         Jx = JLx - 2 
+      Else 
+        Print '(A,1pE12.4)','Severe error: x > 1 in ParDis x=', x 
+        Stop 
+      Endif 
+      ss = x**xpow 
+      If (JLx.Ge.2 .and. JLx.Le.Nx-2) Then 
+      svec1 = xvpow(jx) 
+      svec2 = xvpow(jx+1) 
+      svec3 = xvpow(jx+2) 
+      svec4 = xvpow(jx+3) 
+      s12 = svec1 - svec2 
+      s13 = svec1 - svec3 
+      s23 = svec2 - svec3 
+      s24 = svec2 - svec4 
+      s34 = svec3 - svec4 
+      sy2 = ss - svec2 
+      sy3 = ss - svec3 
+      const1 = s13/s23 
+      const2 = s12/s23 
+      const3 = s34/s23 
+      const4 = s24/s23 
+      s1213 = s12 + s13 
+      s2434 = s24 + s34 
+      sdet = s12*s34 - s1213*s2434 
+      tmp = sy2*sy3/sdet 
+      const5 = (s34*sy2-s2434*sy3)*tmp/s12 
+      const6 = (s1213*sy2-s12*sy3)*tmp/s34 
+      EndIf 
+                                                                        
+  100      continue 
+                                                                        
+! skip the initialization in q if same as in the previous call.         
+        if(q .eq. qlast) goto 110 
+        qlast = q 
+                                                                        
+      tt = log(log(Q/Al)) 
+                                                                        
+      JLq = -1 
+      JU = NT+1 
+   12 If (JU-JLq .GT. 1) Then 
+         JM = (JU+JLq) / 2 
+         If (Q .GE. QV(JM)) Then 
+            JLq = JM 
+         Else 
+            JU = JM 
+         Endif 
+         Goto 12 
+       Endif 
+      If     (JLq .LE. 0) Then 
+         Jq = 0 
+         If (JLq .LT. 0) Then 
+          Msg = 'Q < Q0 in ParDis; extrapolation used!' 
+          CALL CtLhWARNR (IWRN2, Msg, 'Q', Q, Qini, 1D0, 1) 
+         EndIf 
+      Elseif (JLq .LE. Nt-2) Then 
+         Jq = JLq - 1 
+      Else 
+        Jq = Nt - 3 
+        If (JLq .GE. Nt) Then 
+         Msg = 'Q > Qmax in ParDis; extrapolation used!' 
+         CALL CtLhWARNR (IWRN3, Msg, 'Q', Q, Qmax, 1D0, 1) 
+        Endif 
+      Endif 
+                                                                        
+      If (JLq.GE.1 .and. JLq.LE.Nt-2) Then 
+      tvec1 = Tv(jq) 
+      tvec2 = Tv(jq+1) 
+      tvec3 = Tv(jq+2) 
+      tvec4 = Tv(jq+3) 
+      t12 = tvec1 - tvec2 
+      t13 = tvec1 - tvec3 
+      t23 = tvec2 - tvec3 
+      t24 = tvec2 - tvec4 
+      t34 = tvec3 - tvec4 
+      ty2 = tt - tvec2 
+      ty3 = tt - tvec3 
+      tmp1 = t12 + t13 
+      tmp2 = t24 + t34 
+      tdet = t12*t34 - tmp1*tmp2 
+      EndIf 
+                                                                        
+  110      continue 
+                                                                        
+      jtmp = ((IPRTN + NfMx)*(NT+1)+(jq-1))*(NX+1)+jx+1 
+      Do it = 1, nqvec 
+         J1  = jtmp + it*(NX+1) 
+       If (Jx .Eq. 0) Then 
+         fij(1) = 0 
+         fij(2) = Upd(J1+1,iset) * Xa(1,2) 
+         fij(3) = Upd(J1+2,iset) * Xa(2,2) 
+         fij(4) = Upd(J1+3,iset) * Xa(3,2) 
+         Call CtLhPolint4 (XVpow(0), Fij(1), 4, ss, Fx, Dfx) 
+                                                                        
+         If (x .GT. 0D0)  Fvec(it) =  Fx / x**2 
+       ElseIf  (JLx .Eq. Nx-1) Then 
+        Call CtLhPolint4 (XVpow(Nx-3), Upd(J1,iset), 4, ss, Fx, Dfx) 
+        Fvec(it) = Fx 
+       Else 
+         sf2 = Upd(J1+1,iset) 
+         sf3 = Upd(J1+2,iset) 
+         Fvec(it) = (const5*(Upd(J1,iset)                               &
+     &                             - sf2*const1 + sf3*const2)           &
+     &               + const6*(Upd(J1+3,iset)                           &
+     &                             + sf2*const3 - sf3*const4)           &
+     &               + sf2*sy3 - sf3*sy2) / s23                         
+       Endif 
+      enddo 
+      If (JLq .LE. 0) Then 
+        Call CtLhPolint4 (TV(0), Fvec(1), 4, tt, ff, Dfq) 
+      ElseIf (JLq .GE. Nt-1) Then 
+        Call CtLhPolint4 (TV(Nt-3), Fvec(1), 4, tt, ff, Dfq) 
+      Else 
+        tf2 = fvec(2) 
+        tf3 = fvec(3) 
+        g1 = ( tf2*t13 - tf3*t12) / t23 
+        g4 = (-tf2*t34 + tf3*t24) / t23 
+        h00 = ((t34*ty2-tmp2*ty3)*(fvec(1)-g1)/t12                      &
+     &          +  (tmp1*ty2-t12*ty3)*(fvec(4)-g4)/t34)                 
+        ff = (h00*ty2*ty3/tdet + tf2*ty3 - tf3*ty2) / t23 
+      EndIf 
+      CtLhPARDIS = ff 
+      Return 
+      END                                           
+                
+                                                        
+      SUBROUTINE CtLhPARPDF (IACT, NAME, VALUE, IRET) 
+      IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+      CHARACTER NAME*(*), Uname*10 
+      LOGICAL START1 
+      DATA ILEVEL, LRET / 1, 1 / 
+      JRET = IRET 
+      CALL CtLhUPC (NAME, Ln, Uname) 
+      IF (IACT .EQ. 0 .OR. IACT .EQ. 4) then 
+!     >    IVALUE = NINT (VALUE)   !tentatively remove this since it see
+       print *,'Fatal error: iact=',iact 
+       stop 
+      ENDIF 
+      START1 = (IACT .NE. 1) .AND. (IACT .NE. 2) 
+! prepare to remove this stuff, since I think IACT=1 or 2 always        
+      if(start1) then 
+        print *,'Fatal error: start1=',start1 
+        stop 
+      endif 
+      IF (START1)  ILEVEL = 1 
+      GOTO (1, 2), ILEVEL 
+    1 START1 = .TRUE. 
+      ILEVEL = 0 
+      CALL CtLhParQcd (IACT, Uname(1:Ln), VALUE, JRET) 
+              IF (JRET .EQ. 1)  GOTO 11 
+              IF (JRET .EQ. 2)  GOTO 12 
+              IF (JRET .EQ. 3)  GOTO 13 
+              IF (JRET .GT. 4)  GOTO 15 
+              ILEVEL =  ILEVEL + 1 
+    2 CALL CtLhEVLPAR (IACT, Uname(1:Ln), VALUE, JRET) 
+              IF (JRET .EQ. 1)  GOTO 11 
+              IF (JRET .EQ. 2)  GOTO 12 
+              IF (JRET .EQ. 3)  GOTO 13 
+              IF (JRET .GT. 4)  GOTO 15 
+              ILEVEL =  ILEVEL + 1 
+      IF (.NOT. START1) GOTO 1 
+      IF (JRET .EQ. 0)  GOTO 10 
+      GOTO 14 
+   10 CONTINUE 
+   11 CONTINUE 
+   12 CONTINUE 
+   13 CONTINUE 
+   14 CONTINUE 
+   15 CONTINUE 
+      IF (JRET .NE. 4) LRET = JRET 
+      IF (LRET.EQ.0 .OR. LRET.EQ.2 .OR. LRET.EQ.3) THEN 
+        PRINT *, 'Error in CtLhPARPDF: IRET, IACT, NAME, VALUE =',      &
+     &  LRET, IACT, NAME, VALUE                                         
+        PRINT *, 'fatal error in CtLhparpdf' 
+        stop 
+      EndIf 
+      IRET= JRET 
+      RETURN 
+      END       
+
+                                    
+      SUBROUTINE CtLhParQcd(IACT,NAME,VALUE,IRET) 
+      IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+      INTEGER IACT,IRET 
+      CHARACTER*(*) NAME 
+      IRET=1 
+      IF (IACT.EQ.0) THEN 
+         WRITE (NINT(VALUE), *)  'LAM(BDA), NFL, ORD(ER), Mi, ',        &
+     &               '(i in 1 to 9), LAMi (i in 1 to NFL)'              
+         IRET=4 
+      ELSEIF (IACT.EQ.1) THEN 
+         CALL CtLhQCDSET (NAME,VALUE,IRET) 
+      ELSEIF (IACT.EQ.2) THEN 
+         CALL CtLhQCDGET (NAME,VALUE,IRET) 
+      ELSE 
+         IRET=3 
+      ENDIF 
+      RETURN 
+      END     
+
+                                      
+      FUNCTION CtLhPFF1 (XX) 
+      IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+      LOGICAL LA, LB, LSTX 
+      PARAMETER (D0=0D0, D1=1D0, D2=2D0, D3=3D0, D4=4D0, D10=1D1) 
+      PARAMETER (MXX = 105, MXQ = 25, MXF = 6) 
+      PARAMETER (M1=-3, M2=3, NDG=3, NDH=NDG+1, L1=M1-1, L2=M2+NDG-2) 
+      PARAMETER (MX = 3) 
+      COMMON / LhCtXXARAY / XCR, XMIN, XV(0:MXX), LSTX, NX 
+      COMMON / LhCtKRNL00 / DZ, XL(MX), NNX 
+      COMMON / LhCtVARIBX / XA(MXX, L1:L2), ELY(MXX), DXTZ(MXX) 
+      COMMON / LhCtKRN1ST / FF1(0:MXX),FG1(0:MXX),GF1(0:MXX),GG1(0:MXX),&
+     &                  FF2(0:MXX), FG2(0:MXX), GF2(0:MXX), GG2(0:MXX), &
+     &                  PNSP(0:MXX), PNSM(0:MXX)                        
+      SAVE 
+      DATA LA, LB / 2 * .FALSE. / 
+      LB = .TRUE. 
+      ENTRY CtLhTFF1(ZZ) 
+      LA = .TRUE. 
+      IF (LA .AND. .NOT.LB) THEN 
+        Z = ZZ 
+        X = CtLhXFRMZ (Z) 
+      Else 
+        X = XX 
+      EndIf 
+      IF (X .GE. D1) THEN 
+        CtLhPFF1 = 0 
+        RETURN 
+      ElseIF (X .GE. XMIN) THEN 
+        Z = CtLhZFRMX (X) 
+        TEM = CtLhFINTRP (FF1,  -DZ, DZ, NX,  Z,  ERR, IRT) 
+      Else 
+        CALL CtLhPOLIN1 (XL, FF1(1), MX, X, TEM, ERR) 
+      EndIf 
+      IF (LA) THEN 
+         IF (LB) THEN 
+            CtLhPFF1 = TEM / (1.-X) 
+            LB   =.FALSE. 
+         Else 
+            CtLhTFF1 = TEM / (1.-X) * CtLhDXDZ(Z) 
+         EndIf 
+         LA   =.FALSE. 
+      Else 
+         IF (LB) THEN 
+! +++ something is wrong, since QFF1 and RFF1 are not used.             
+! +++ but this code appears to only be used for extrapolation           
+! +++ to small x, which is unreliable anyway, so ignore for now (jcp)   
+            QFF1 = TEM 
+            LB   =.FALSE. 
+         Else 
+            RFF1 = TEM * X / (1.-X) 
+         EndIf 
+      EndIf 
+      RETURN 
+      ENTRY CtLhFNSP (XX) 
+      X = XX 
+      IF (X .GE. D1) THEN 
+        CtLhFNSP = 0. 
+        RETURN 
+      ElseIF (X .GE. XMIN) THEN 
+        Z = CtLhZFRMX (X) 
+        TEM = CtLhFINTRP (PNSP,  -DZ, DZ, NX,  Z,  ERR, IRT) 
+      Else 
+        CALL CtLhPOLIN1 (XL, PNSP(1), MX, X, TEM, ERR) 
+      EndIf 
+      CtLhFNSP = TEM / (1.- X) 
+      RETURN 
+      ENTRY CtLhFNSM (XX) 
+      X = XX 
+      IF (X .GE. D1) THEN 
+        CtLhFNSM = 0. 
+        RETURN 
+      ElseIF (X .GE. XMIN) THEN 
+        Z = CtLhZFRMX (X) 
+        TEM = CtLhFINTRP (PNSM,  -DZ, DZ, NX,  Z,  ERR, IRT) 
+      Else 
+        CALL CtLhPOLIN1 (XL, PNSM(1), MX, X, TEM, ERR) 
+      EndIf 
+      CtLhFNSM = TEM / (1.- X) 
+      RETURN 
+      ENTRY CtLhRGG1 (XX) 
+      X = XX 
+      IF (X .GE. D1) THEN 
+                                   !error corrected? (jcp)              
+        CtLhRGG1= 0 
+        RETURN 
+      ElseIF (X .GE. XMIN) THEN 
+        Z = CtLhZFRMX (X) 
+        TEM = CtLhFINTRP (GG1,  -DZ, DZ, NX,  Z,  ERR, IRT) 
+      Else 
+        CALL CtLhPOLIN1 (XL, GG1(1), MX, X, TEM, ERR) 
+      EndIf 
+      IF (LA) THEN 
+                                            !error corrected? (jcp)     
+         CtLhRGG1 = TEM / X / (1.-X) 
+         LA   =.FALSE. 
+      Else 
+         IF (LB) THEN 
+                                              !error corrected? (jcp)   
+            CtLhRGG1 = TEM / X 
+            LB   =.FALSE. 
+         Else 
+            CtLhRGG1 = TEM / (1.-X) 
+         EndIf 
+      EndIf 
+      RETURN 
+      ENTRY CtLhRFF2 (XX) 
+      X = XX 
+      IF (X .GE. D1) THEN 
+                                    !error corrected? (jcp)             
+        CtLhRFF2 = 0 
+        RETURN 
+      ElseIF (X .GE. XMIN) THEN 
+        Z = CtLhZFRMX (X) 
+        TEM = CtLhFINTRP (FF2,  -DZ, DZ, NX,  Z,  ERR, IRT) 
+      Else 
+        CALL CtLhPOLIN1 (XL, FF2(1), MX, X, TEM, ERR) 
+      EndIf 
+      IF (LA) THEN 
+                                            !error corrected? (jcp)     
+         CtLhRFF2 = TEM / X / (1.-X) 
+         LA   =.FALSE. 
+      Else 
+         IF (LB) THEN 
+                                              !error corrected? (jcp)   
+            CtLhRFF2 = TEM / X 
+            LB   =.FALSE. 
+         Else 
+            CtLhRFF2 = TEM / (1.-X) 
+         EndIf 
+      EndIf 
+      RETURN 
+      ENTRY CtLhRGG2 (XX) 
+      X = XX 
+      IF (X .GE. D1) THEN 
+                                    !error corrected? (jcp)             
+        CtLhRGG2 = 0 
+        RETURN 
+      ElseIF (X .GE. XMIN) THEN 
+        Z = CtLhZFRMX (X) 
+        TEM = CtLhFINTRP (GG2,  -DZ, DZ, NX,  Z,  ERR, IRT) 
+      Else 
+        CALL CtLhPOLIN1 (XL, GG2(1), MX, X, TEM, ERR) 
+      EndIf 
+      IF (LA) THEN 
+                                            !error corrected? (jcp)     
+         CtLhRGG2 = TEM / X / (1.-X) 
+         LA   =.FALSE. 
+      Else 
+         IF (LB) THEN 
+                                      !error corrected? (jcp)           
+            CtLhRGG2 = TEM / X 
+            LB   =.FALSE. 
+         Else 
+            CtLhRGG2 = TEM / (1.-X) 
+         EndIf 
+      EndIf 
+      RETURN 
+      END       
+
+                                    
+      SUBROUTINE CtLhPOLIN1 (XA,YA,N,X,Y,DY) 
+      IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+      PARAMETER (NMAX=10) 
+      DIMENSION XA(N),YA(N),C(NMAX),D(NMAX) 
+      NS=1 
+      DIF=ABS(X-XA(1)) 
+      DO 11 I=1,N 
+        DIFT=ABS(X-XA(I)) 
+        IF (DIFT.LT.DIF) THEN 
+          NS=I 
+          DIF=DIFT 
+        ENDIF 
+        C(I)=YA(I) 
+        D(I)=YA(I) 
+   11 END DO 
+      Y=YA(NS) 
+      NS=NS-1 
+      DO 13 M=1,N-1 
+        DO 12 I=1,N-M 
+          HO=XA(I)-X 
+          HP=XA(I+M)-X 
+          W=C(I+1)-D(I) 
+          DEN=HO-HP 
+          DEN=W/DEN 
+          D(I)=HP*DEN 
+          C(I)=HO*DEN 
+   12   CONTINUE 
+        IF (2*NS.LT.N-M)THEN 
+          DY=C(NS+1) 
+        ELSE 
+          DY=D(NS) 
+          NS=NS-1 
+        ENDIF 
+        Y=Y+DY 
+   13 END DO 
+      RETURN 
+      END       
+
+                                    
+      SUBROUTINE CtLhQARRAY (NINI) 
+      IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+      PARAMETER (MXX = 105, MXQ = 25, MXF = 6) 
+      PARAMETER (MXPN = MXF * 2 + 2) 
+      PARAMETER (MXQX= MXQ * MXX,   MXPQX = MXQX * MXPN) 
+      COMMON / LhCtQARAY1 / QINI,QMAX, QV(0:MXQ),TV(0:MXQ), NT,JT,NG 
+      COMMON / LhCtQARAY2 / TLN(MXF), DTN(MXF), NTL(MXF), NTN(MXF) 
+      COMMON / LhCtEVLPAC / AL, IKNL, IPD0, IHDN, NfMx 
+      NCNT = 0 
+      IF (NT .GE. mxq) NT = mxq - 1 
+      S = LOG(QINI/AL) 
+      TINI = LOG(S) 
+      S = LOG(QMAX/AL) 
+      TMAX = LOG(S) 
+    1 DT0 = (TMAX - TINI) / float(NT) 
+      NINI = LhCtNFL(QINI) 
+      NFMX = LhCtNFL(QMAX) 
+      Call CtLhParQcd (2, 'ORDER', Ord, Ir) 
+      Call CtLhParQcd (2, 'ALAM', Al0, Ir) 
+      Call CtLhParQcd (2, 'NFL', Afl0, Ir) 
+      AFL = NfMx 
+      Call CtLhParQcd (1, 'NFL', AFL, Ir) 
+      Iordr = Nint (Ord) 
+      Ifl0  = Nint (Afl0) 
+      Call CtLhSetLam (Ifl0, Al0, Iordr) 
+      NG = NFMX - NINI + 1 
+      QIN  = QINI 
+      QOUT = QINI 
+      S = LOG(QIN/AL) 
+      TIN  = LOG(S) 
+      TLN(1) = TIN 
+      NTL(1)  = 0 
+      QV(0) = QINI 
+      TV(0) = Tin 
+      DO 20 NEFF = NINI, NFMX 
+        ICNT = NEFF - NINI + 1 
+        IF (NEFF .LT. NFMX) THEN 
+          THRN = CtLhAMHATF (NEFF + 1) 
+          QOUN = MIN (QMAX, THRN) 
+        Else 
+          QOUN = QMAX 
+        EndIf 
+        IF (QOUN-QOUT .LE. 0.0001) THEN 
+          DT   = 0 
+          NITR = 0 
+        Else 
+          QOUT = QOUN 
+          S = LOG(QOUT/AL) 
+          TOUT = LOG(S) 
+          TEM = TOUT - TIN 
+          NITR = INT (TEM / DT0) + 1 
+          DT  = TEM / NITR 
+        EndIf 
+        DTN (ICNT) = DT 
+        NTN (ICNT) = NITR 
+        TLN (ICNT) = TIN 
+        NTL (ICNT+1) = NTL(ICNT) + NITR 
+        IF (NITR .NE. 0) THEN 
+        DO 205 I = 1, NITR 
+           TV (NTL(ICNT)+I) = TIN + DT * I 
+           S = EXP (TV(NTL(ICNT)+I)) 
+           QV (NTL(ICNT)+I) = AL * EXP (S) 
+  205   CONTINUE 
+        EndIf 
+        QIN = QOUT 
+        TIN = TOUT 
+   20 END DO 
+      NCNT = NCNT + 1 
+      NTP = NTL (NG + 1) 
+      ND  = NTP - NT 
+      IF (NTP .GE. MXQ) THEN 
+         NT = MXQ - ND - NCNT 
+         GOTO 1 
+      EndIf 
+      NT = NTP 
+      RETURN 
+      END       
+
+                                    
+      SUBROUTINE CtLhQCDGET(NAME,VALUE,IRET) 
+      IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+      CHARACTER*(*) NAME 
+      COMMON / LhCtCWZPRM / ALAM(0:9), AMHAT(0:9), AMN, NHQ 
+      COMMON / LhCtQCDPAR_LHA / AL, NF, NORDER, SET 
+      COMMON / LhCtCOMQMS / VALQMS(9) 
+      LOGICAL SET 
+      PARAMETER (PI=3.141592653589793d0, EULER=0.57721566) 
+      ICODE = LhCtNAMQCD(NAME) 
+      IRET = 1 
+      IF (ICODE .EQ. 1) THEN 
+         VALUE = AL 
+      ELSEIF (ICODE .EQ. 2) THEN 
+         VALUE = NF 
+      ELSEIF ((ICODE .GE. 3) .AND. (ICODE .LE. 12))  THEN 
+         VALUE = VALQMS(ICODE - 2) 
+      ELSEIF ((ICODE .GE. 13) .AND. (ICODE .LE. 13+NF))  THEN 
+         VALUE = ALAM(ICODE - 13) 
+      ELSEIF (ICODE .EQ. 24) THEN 
+         VALUE = NORDER 
+      ELSE 
+         IRET=0 
+      ENDIF 
+      END       
+
+                                    
+      SUBROUTINE CtLhQCDSET (NAME,VALUE,IRET) 
+      IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+      CHARACTER*(*) NAME 
+      COMMON / LhCtCOMQMS / VALQMS(9) 
+      COMMON / LhCtQCDPAR_LHA / AL, NF, NORDER, SET 
+      LOGICAL SET 
+      PARAMETER (PI=3.141592653589793d0, EULER=0.57721566) 
+      IVALUE = NINT(VALUE) 
+      ICODE  = LhCtNAMQCD(NAME) 
+      IF (ICODE .EQ. 0) THEN 
+         IRET=0 
+!     print *,'warning empty CtLhQCDSET call: NAME=',                   
+!     &                 NAME,' VALUE=',VALUE                            
+      ELSE 
+         IRET = 1 
+         SET = .FALSE. 
+         IF (ICODE .EQ. 1) THEN 
+            IF (VALUE.LE.0) GOTO 12 
+            AL=VALUE 
+         ELSEIF (ICODE .EQ. 2) THEN 
+            IF ( (IVALUE .LT. 0) .OR. (IVALUE .GT. 9)) GOTO 12 
+            NF = IVALUE 
+         ELSEIF ((ICODE .GE. 3) .AND. (ICODE .LE. 11))  THEN 
+            IF (VALUE .LT. 0) GOTO 12 
+            Scle = Min (Value , VALQMS(ICODE - 2)) 
+            AlfScle = CtLhALPI(Scle) * Pi 
+            VALQMS(ICODE - 2) = VALUE 
+            Call CtLhAlfSet (Scle, AlfScle) 
+         ELSEIF ((ICODE .GE. 13) .AND. (ICODE .LE. 13+NF))  THEN 
+            IF (VALUE .LE. 0) GOTO 12 
+            CALL CtLhSETL1 (ICODE-13, VALUE) 
+         ELSEIF (ICODE .EQ. 24)  THEN 
+            IF ((IVALUE .LT. 1) .OR. (IVALUE .GT. 2)) GOTO 12 
+            NORDER = IVALUE 
+         ENDIF 
+         IF (.NOT. SET) CALL CtLhLAMCWZ 
+      ENDIF 
+      RETURN 
+   12 IRET=2 
+      RETURN 
+      END     
+
+                                      
+      FUNCTION CtLhQZBRNT(FUNC, X1, X2, TOLIN, IRT) 
+      IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+      PARAMETER (ITMAX = 1000, EPS = 3.E-12) 
+      external func 
+      TOL = ABS(TOLIN) 
+      A=X1 
+      B=X2 
+      FA=FUNC(A) 
+      FB=FUNC(B) 
+      IF(FB*FA.GT.0.)  THEN 
+        WRITE (*, *) 'Root must be bracketed for CtLhQZBRNT.' 
+        IRT = 1 
+      ENDIF 
+      FC=FB 
+      DO 11 ITER=1,ITMAX 
+        IF(FB*FC.GT.0.) THEN 
+          C=A 
+          FC=FA 
+          D=B-A 
+          E=D 
+        ENDIF 
+        IF(ABS(FC).LT.ABS(FB)) THEN 
+          A=B 
+          B=C 
+          C=A 
+          FA=FB 
+          FB=FC 
+          FC=FA 
+        ENDIF 
+        TOL1=2.*EPS*ABS(B)+0.5*TOL 
+        XM=.5*(C-B) 
+        IF(ABS(XM).LE.TOL1 .OR. FB.EQ.0.)THEN 
+          CtLhQZBRNT=B 
+          RETURN 
+        ENDIF 
+        IF(ABS(E).GE.TOL1 .AND. ABS(FA).GT.ABS(FB)) THEN 
+          S=FB/FA 
+          IF(A.EQ.C) THEN 
+            P=2.*XM*S 
+            Q=1.-S 
+          ELSE 
+            Q=FA/FC 
+            R=FB/FC 
+            P=S*(2.*XM*Q*(Q-R)-(B-A)*(R-1.)) 
+            Q=(Q-1.)*(R-1.)*(S-1.) 
+          ENDIF 
+          IF(P.GT.0.) Q=-Q 
+          P=ABS(P) 
+          IF(2.*P .LT. MIN(3.*XM*Q-ABS(TOL1*Q),ABS(E*Q))) THEN 
+            E=D 
+            D=P/Q 
+          ELSE 
+            D=XM 
+            E=D 
+          ENDIF 
+        ELSE 
+          D=XM 
+          E=D 
+        ENDIF 
+        A=B 
+        FA=FB 
+        IF(ABS(D) .GT. TOL1) THEN 
+          B=B+D 
+        ELSE 
+          B=B+SIGN(TOL1,XM) 
+        ENDIF 
+        FB=FUNC(B) 
+   11 END DO 
+      WRITE (*, *) 'CtLhQZBRNT exceeding maximum iterations.' 
+      IRT = 2 
+      CtLhQZBRNT=B 
+      RETURN 
+      END       
+
+                                    
+      SUBROUTINE CtLhRATINT(XA,YA,N,X,Y,DY) 
+      IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+      PARAMETER (NMAX=10,TINY=1.E-25) 
+      DIMENSION XA(N),YA(N),C(NMAX),D(NMAX) 
+      NS=1 
+      HH=ABS(X-XA(1)) 
+      DO 11 I=1,N 
+        H=ABS(X-XA(I)) 
+        IF (H.EQ.0.)THEN 
+          Y=YA(I) 
+          DY=0.0 
+          RETURN 
+        ELSE IF (H.LT.HH) THEN 
+          NS=I 
+          HH=H 
+        ENDIF 
+        C(I)=YA(I) 
+        D(I)=YA(I)+TINY 
+   11 END DO 
+      Y=YA(NS) 
+      NS=NS-1 
+      DO 13 M=1,N-1 
+        DO 12 I=1,N-M 
+          W=C(I+1)-D(I) 
+          H=XA(I+M)-X 
+          T=(XA(I)-X)*D(I)/H 
+          DD=T-C(I+1) 
+          DD=W/DD 
+          D(I)=C(I+1)*DD 
+          C(I)=T*DD 
+   12   CONTINUE 
+        IF (2*NS.LT.N-M)THEN 
+          DY=C(NS+1) 
+        ELSE 
+          DY=D(NS) 
+          NS=NS-1 
+        ENDIF 
+        Y=Y+DY 
+   13 END DO 
+      RETURN 
+      END     
+
+                                      
+      FUNCTION CtLhRTALF (EFLLN) 
+      IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+      include 'parmsetup.inc' 
+      PARAMETER (PI = 3.141592653589793d0) 
+      COMMON / CtLhRTALFC / ALFST, JORD, NEFF 
+      EFMULM = EXP (EFLLN) 
+      TEM1 = PI / ALFST 
+      TEM2 = 1. / CtLhALPQCD (JORD, NEFF, EFMULM, I) 
+      CtLhRTALF = TEM1 - TEM2 
+      END       
+
+                                    
+      Subroutine CtLhbldat1 
+      IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+      include 'parmsetup.inc' 
+      LOGICAL LSTX 
+      PARAMETER (MXX = 105, MXQ = 25, MxF = 6) 
+      PARAMETER (MxPN = MxF * 2 + 2) 
+      PARAMETER (MxQX= MXQ * MXX,   MxPQX = MxQX * MxPN) 
+      COMMON / LhCtXXARAY / XCR, XMIN, XV(0:MXX), LSTX, NX 
+      COMMON / LhCtQARAY1 / QINI,QMAX, QV(0:MXQ),TV(0:MXQ), NT,JT,NG 
+      COMMON / LhCtEVLPAC / AL, IKNL, IPD0, IHDN, NfMx 
+      COMMON / LhCtPEVLDT / UPD(MXPQX,nmxset), KF, Nelmt 
+        PARAMETER (NF0 = 4, Nshp = 8,NEX = Nshp+2) 
+      XMIN =  .999999D-4 
+      XCR = 1.5 
+      JT = 1 
+      Return 
+      END       
+
+                                    
+      SUBROUTINE CtLhSETL1  (NEF, VLAM) 
+      IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+      LOGICAL SET 
+      COMMON / LhCtCWZPRM / ALAM(0:9), AMHAT(0:9), AMN, NHQ 
+      COMMON / LhCtQCDPAR_LHA / AL, NF, NORDER, SET 
+      COMMON / LhCtCOMQMS / VALQMS(9) 
+      IF (NEF .LT. 0 .OR. NEF .GT. NF) THEN 
+        WRITE(*,*)'NEF out of range in CtLhSETL1: NEF NF =',NEF,NF 
+        STOP 
+      ENDIF 
+      AMHAT(0) = 0. 
+      DO 5 N = 1, NF 
+         AMHAT(N) = VALQMS(N) 
+    5    CONTINUE 
+      ALAM(NEF) = VLAM 
+      DO 10 N = NEF, 1, -1 
+         CALL CtLhTRNLAM(NORDER, N, -1, IR1) 
+   10    CONTINUE 
+      DO 20 N = NEF, NF-1 
+         CALL CtLhTRNLAM(NORDER, N, 1, IR1) 
+   20    CONTINUE 
+      DO 30, N = NF, 1, -1 
+         IF ((ALAM(N) .GE. 0.7 * AMHAT(N))                              &
+     &       .OR. (ALAM(N-1) .GE. 0.7 * AMHAT(N)))THEN                  
+            NHQ = NF - N 
+            GOTO 40 
+            ENDIF 
+   30    CONTINUE 
+      NHQ = NF 
+   40 CONTINUE 
+      DO 50, N = NF-NHQ, 1, -1 
+         AMHAT(N) = 0 
+         ALAM(N-1) = ALAM(N) 
+   50    CONTINUE 
+      AMN = ALAM(NF) 
+      DO 60, N = 0, NF-1 
+         IF (ALAM(N) .GT. AMN)  AMN = ALAM(N) 
+   60    CONTINUE 
+      AMN = AMN * 1.0001 
+      AL = ALAM(NF) 
+      SET = .TRUE. 
+      RETURN 
+      END       
+
+                                    
+      SUBROUTINE CtLhSETLAM (NEF, WLAM, IRDR) 
+      IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+      COMMON / LhCtQCDPAR_LHA / AL, NF, NORDER, SET 
+      LOGICAL SET 
+      IF ((NEF .LT. 0) .OR. (NEF .GT. NF)) THEN 
+         WRITE(*,*)'NEF out of range in CtLhSETLAM: NEF NF=',NEF,NF 
+         STOP 
+      ENDIF 
+      VLAM = WLAM 
+      IF (IRDR .NE. NORDER) then 
+        PRINT *,'fatal error: wanted cnvl1' 
+        stop 
+      ENDIF 
+      CALL CtLhSETL1 (NEF, VLAM) 
+      END       
+
+                                    
+      Subroutine CtLhbldat2 
+      IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+      COMMON / LhCtCOMQMS / VALQMS(9) 
+      COMMON / LhCtQCDPAR_LHA / AL, NF, NORDER, SET 
+      LOGICAL SET 
+      AL = .226d0 
+      NF = 5 
+      NORDER = 2 
+      SET = .FALSE. 
+      VALQMS(1) =  0. 
+      VALQMS(2) =  0. 
+      VALQMS(3) =  0.2d0 
+      VALQMS(4) =  1.3d0 
+      VALQMS(5) =  4.5d0 
+      VALQMS(6) =  174.d0 
+      VALQMS(7) =  0. 
+      VALQMS(8) =  0. 
+      VALQMS(9) =  0. 
+      Return 
+      END     
+
+                                      
+      FUNCTION CtLhSMPNOL (NX, DX, FN, ERR) 
+      IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+      DIMENSION FN(NX) 
+      MS = MOD(NX, 2) 
+      IF (NX .LE. 1 .OR. NX .GT. 1000) THEN 
+         PRINT *, 'NX =', NX, ' OUT OF RANGE IN CtLhSMPNOL!' 
+         STOP 
+      ELSEIF (NX .EQ. 2) THEN 
+         TEM = DX * FN(2) 
+      ELSEIF (NX .EQ. 3) THEN 
+         TEM = DX * FN(2) * 2. 
+      ELSE 
+         IF (MS .EQ. 0) THEN 
+            TEM = DX * (23.* FN(2) - 16.* FN(3) + 5.* FN(4)) / 12. 
+            TMP = DX * (3.* FN(2) - FN(3)) / 2. 
+            ERR = ABS(TEM - TMP) 
+            TEM = TEM + CtLhSMPSNA (NX-1, DX, FN(2), ER1) 
+            ERR = ABS(ER1) + ERR 
+         ELSE 
+            TEM = DX * (8.* FN(2) - 4.* FN(3) + 8.* FN(4)) / 3. 
+            TMP = DX * (3.* FN(2) + 2.* FN(3) + 3.* FN(4)) / 2. 
+            ERR = ABS(TEM - TMP) 
+            TEM = TEM + CtLhSMPSNA (NX-4, DX, FN(5), ER1) 
+            ERR = ABS(ER1) + ERR 
+         ENDIF 
+      ENDIF 
+      CtLhSMPNOL = TEM 
+      RETURN 
+      END     
+
+                                      
+      FUNCTION CtLhSMPSNA (NX, DX, F, ERR) 
+      IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+      PARAMETER (D0=0D0, D1=1D0, D2=2D0, D3=3D0, D4=4D0, D10=1D1) 
+      PARAMETER (MAXX = 1000) 
+      DIMENSION F(NX) 
+      DATA IW1, IW2, TINY / 2*0, 1.E-35 / 
+      IF (DX .LE. 0.) THEN 
+        CALL CtLhWARNR(IW2,'DX cannot be < 0. in CtLhSMPSNA', 'DX',     &
+     &         DX, D0, D1, 0)                                           
+        CtLhSMPSNA = 0. 
+        RETURN 
+      ENDIF 
+      IF (NX .LE. 0 .OR. NX .GT. MAXX) THEN 
+        CALL CtLhWARNI(IW1, 'NX out of range in CtLhSMPSNA', 'NX', NX,  &
+     &               1, MAXX, 1)                                        
+        SIMP = 0. 
+      ELSEIF (NX .EQ. 1) THEN 
+        SIMP = 0. 
+      ELSEIF (NX .EQ. 2) THEN 
+        SIMP = (F(1) + F(2)) / 2. 
+        ERRD = (F(1) - F(2)) / 2. 
+      ELSE 
+        MS = MOD(NX, 2) 
+        IF (MS .EQ. 0) THEN 
+          ADD = (9.*F(NX) + 19.*F(NX-1) - 5.*F(NX-2) + F(NX-3)) / 24. 
+          NZ = NX - 1 
+        ELSE 
+          ADD = 0. 
+          NZ = NX 
+        ENDIF 
+        IF (NZ .EQ. 3) THEN 
+          SIMP = (F(1) + 4.* F(2) + F(3)) / 3. 
+          TRPZ = (F(1) + 2.* F(2) + F(3)) / 2. 
+        ELSE 
+          SE = F(2) 
+          SO = 0 
+          NM1 = NZ - 1 
+          DO 60 I = 4, NM1, 2 
+            IM1 = I - 1 
+            SE = SE + F(I) 
+            SO = SO + F(IM1) 
+   60     CONTINUE 
+          SIMP = (F(1) + 4.* SE + 2.* SO + F(NZ)) / 3. 
+          TRPZ = (F(1) + 2.* (SE + SO) + F(NZ)) / 2. 
+        ENDIF 
+        ERRD = TRPZ - SIMP 
+        SIMP = SIMP + ADD 
+      ENDIF 
+      CtLhSMPSNA = SIMP * DX 
+      IF (ABS(SIMP) .GT. TINY) THEN 
+        ERR = ERRD / SIMP 
+      ELSE 
+        ERR = 0. 
+      ENDIF 
+      RETURN 
+      END       
+
+                                    
+      SUBROUTINE CtLhSNEVL(IKNL,NX,NT,JT,DT,TIN,NEFF,UI,GI,US,GS) 
+      IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+      PARAMETER (MXX = 105, MXQ = 25, MXF = 6) 
+      PARAMETER (MXQX= MXQ * MXX) 
+      PARAMETER (M1=-3, M2=3, NDG=3, NDH=NDG+1, L1=M1-1, L2=M2+NDG-2) 
+      COMMON / LhCtVARIBX / XA(MXX, L1:L2), ELY(MXX), DXTZ(MXX) 
+      DIMENSION UI(NX), US(0:NX, 0:NT) 
+      DIMENSION GI(NX), GS(0:NX, 0:NT) 
+      DIMENSION Y0(MXX), Y1(MXX), YP(MXX), F0(MXX), F1(MXX), FP(MXX) 
+      DIMENSION Z0(MXX), Z1(MXX), ZP(MXX), G0(MXX), G1(MXX), GP(MXX) 
+      DATA D0 / 0.0 / 
+      JTT = 2 * JT 
+      DDT = DT / JTT 
+      IF (NX .GT. MXX) THEN 
+      WRITE (*,*) 'Nx =', NX, ' too many pts in CtLhSNEVL' 
+      STOP 'Program stopped in CtLhSNEVL' 
+      EndIf 
+! ++ remove unused quantities (jcp)                                     
+! ++  TMD = TIN + DT * NT / 2.                                          
+! ++  AMU = EXP(TMD)                                                    
+! ++  TEM = 6./ (33.- 2.* NEFF) / CtLhALPI(AMU)                         
+! ++  TLAM = TMD - TEM                                                  
+      DO 9 IX = 1, NX 
+      US (IX, 0) = UI(IX) 
+      GS (IX, 0) = GI(IX) 
+    9 END DO 
+      US ( 0, 0) = (UI(1) - UI(2))* 3D0 + UI(3) 
+      GS ( 0, 0) = (GI(1) - GI(2))* 3D0 + GI(3) 
+      TT = TIN 
+      DO 10 IZ = 1, NX 
+      Y0(IZ) = UI(IZ) 
+      Z0(IZ) = GI(IZ) 
+   10 END DO 
+      DO 20 IS = 1, NT 
+         DO 202 JS = 1, JTT 
+            IRND = (IS-1) * JTT + JS 
+            IF (IRND .EQ. 1) THEN 
+                CALL CtLhSNRHS (TT, NEFF, Y0,Z0,  F0,G0) 
+                DO 250 IZ = 1, NX 
+                   Y0(IZ) = Y0(IZ) + DDT * F0(IZ) 
+                   Z0(IZ) = Z0(IZ) + DDT * G0(IZ) 
+  250           CONTINUE 
+                TT = TT + DDT 
+                CALL CtLhSNRHS (TT, NEFF, Y0, Z0,  F1, G1) 
+                DO 251 IZ = 1, NX 
+                   Y1(IZ) = UI(IZ) + DDT * (F0(IZ) + F1(IZ)) / 2D0 
+                   Z1(IZ) = GI(IZ) + DDT * (G0(IZ) + G1(IZ)) / 2D0 
+  251           CONTINUE 
+            Else 
+                CALL CtLhSNRHS (TT, NEFF, Y1, Z1,  F1, G1) 
+                DO 252 IZ = 1, NX 
+                   YP(IZ) = Y1(IZ) + DDT * (3D0 * F1(IZ) - F0(IZ)) / 2D0 
+                   ZP(IZ) = Z1(IZ) + DDT * (3D0 * G1(IZ) - G0(IZ)) / 2D0 
+  252           CONTINUE 
+                TT = TT + DDT 
+                CALL CtLhSNRHS (TT, NEFF, YP, ZP,  FP, GP) 
+                DO 253 IZ = 1, NX 
+                   Y1(IZ) = Y1(IZ) + DDT * (FP(IZ) + F1(IZ)) / 2D0 
+                   Z1(IZ) = Z1(IZ) + DDT * (GP(IZ) + G1(IZ)) / 2D0 
+                   F0(IZ) = F1(IZ) 
+                   G0(IZ) = G1(IZ) 
+  253           CONTINUE 
+            EndIf 
+  202    CONTINUE 
+         DO 260 IX = 1, NX 
+           IF (IKNL .GT. 0) THEN 
+            US (IX, IS) = MAX(Y1(IX), D0) 
+            GS (IX, IS) = MAX(Z1(IX), D0) 
+           Else 
+            US (IX, IS) = Y1(IX) 
+            GS (IX, IS) = Z1(IX) 
+           EndIf 
+  260    CONTINUE 
+         US(0, IS) = 3D0*Y1(1) - 3D0*Y1(2) + Y1(3) 
+         GS(0, IS) = 3D0*Z1(1) - 3D0*Z1(2) + Z1(3) 
+   20 END DO 
+      RETURN 
+      END       
+
+                                    
+      SUBROUTINE CtLhSNRHS (TT, NEFF, FI, GI,  FO, GO) 
+      IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+      LOGICAL LSTX 
+      PARAMETER (MXX = 105, MXQ = 25, MXF = 6) 
+      PARAMETER (M1=-3, M2=3, NDG=3, NDH=NDG+1, L1=M1-1, L2=M2+NDG-2) 
+      COMMON / LhCtVARIBX / XA(MXX, L1:L2), ELY(MXX), DXTZ(MXX) 
+      COMMON / LhCtXXARAY / XCR, XMIN, XV(0:MXX), LSTX, NX 
+      COMMON / LhCtXYARAY / ZZ(MXX, MXX), ZV(0:MXX) 
+      COMMON / LhCtKRNL01 / AFF2(MXX),AFG2(MXX),AGF2(MXX),AGG2(MXX),    &
+     &                  ANSP (MXX), ANSM (MXX), ZFG2, ZGF2, ZQQB        
+      COMMON / LhCtKRN2ND / FFG(MXX, MXX), GGF(MXX, MXX), PNS(MXX, MXX) 
+      COMMON / LhCtEVLPAC / AL, IKNL, IPD0, IHDN, NfMx 
+      DIMENSION GI(NX), GO(NX), G1(MXX), G2(MXX), G3(MXX), G4(MXX) 
+      DIMENSION FI(NX), FO(NX), W0(MXX), W1(MXX), WH(MXX), WM(MXX) 
+      DIMENSION R0(MXX), R1(MXX), R2(MXX), RH(MXX), RM(MXX) 
+      S = EXP(TT) 
+      Q = AL * EXP (S) 
+      CPL = CtLhALPI(Q) 
+      CPL2= CPL ** 2 / 2. * S 
+      CPL = CPL * S 
+      CALL CtLhINTEGR (NX,-1, FI, WM, IR1) 
+      CALL CtLhINTEGR (NX, 0, FI, W0, IR2) 
+      CALL CtLhINTEGR (NX, 1, FI, W1, IR3) 
+      CALL CtLhINTEGR (NX,-1, GI, RM, IR4) 
+      CALL CtLhINTEGR (NX, 0, GI, R0, IR5) 
+      CALL CtLhINTEGR (NX, 1, GI, R1, IR6) 
+      CALL CtLhINTEGR (NX, 2, GI, R2, IR7) 
+      CALL CtLhHINTEG (NX,    FI, WH) 
+      CALL CtLhHINTEG (NX,    GI, RH) 
+      IF (IKNL .GT. 0) THEN 
+      DO 230 IZ = 1, NX 
+      FO(IZ) = ( 2D0 * FI(IZ)                                           &
+     &      + 4D0 / 3D0 * ( 2D0 * WH(IZ) - W0(IZ) - W1(IZ) ))           &
+     &      + NEFF * ( R0(IZ) - 2D0 * R1(IZ) + 2D0 * R2(IZ) )           
+      FO(IZ) = FO(IZ) * CPL 
+      GO(IZ) = 4D0 / 3D0 * ( 2D0 * WM(IZ) - 2D0 * W0(IZ)  + W1(IZ) )    &
+     &      + (33D0 - 2D0 * NEFF) / 6D0 * GI(IZ)                        &
+     &      + 6D0 * (RH(IZ) + RM(IZ) - 2D0 * R0(IZ) + R1(IZ) - R2(IZ))  
+      GO(IZ) = GO(IZ) * CPL 
+  230 END DO 
+      Else 
+      DO 240 IZ = 1, NX 
+      FO(IZ) = NEFF * (-R0(IZ) + 2.* R1(IZ) )                           &
+     & + 2.* FI(IZ) + 4./ 3.* ( 2.* WH(IZ) - W0(IZ) - W1(IZ) )          
+      FO(IZ) = FO(IZ) * CPL 
+      GO(IZ) = 4./ 3.* ( 2.* W0(IZ) - W1(IZ) )                          &
+     &+ (33.- 2.* NEFF) / 6.* GI(IZ) + 6.*(RH(IZ) + R0(IZ) - 2.* R1(IZ))
+      GO(IZ) = GO(IZ) * CPL 
+  240 END DO 
+      EndIf 
+      IF (IKNL .EQ. 2) THEN 
+      DZ = 1./(NX - 1) 
+      DO 21 I = 1, NX-1 
+        NP = NX - I + 1 
+        IS = NP 
+           g2(1)=0d0 
+           g3(1)=0d0 
+        DO 31 KZ = 2, NP 
+          IY = I + KZ - 1 
+          IT = NX - IY + 1 
+          XY = ZZ (IS, IT) 
+          G1(KZ) = FFG(I, IY) * (FI(IY) - XY**2 *FI(I)) 
+          G4(KZ) = GGF(I, IY) * (GI(IY) - XY**2 *GI(I)) 
+                                                        !FG             
+           G2(KZ) = FFG(IS,IT) * (GI(IY) - xy*GI(I)) 
+                                                        !GF (usual notat
+           G3(KZ) = GGF(IS,IT) * (FI(IY) - XY*FI(I)) 
+   31   CONTINUE 
+        TEM1 = CtLhSMPNOL (NP, DZ, G1, ERR) 
+        TEM2 = CtLhSMPSNA (NP, DZ, G2, ERR) 
+        TEM3 = CtLhSMPSNA (NP, DZ, G3, ERR) 
+        TEM4 = CtLhSMPNOL (NP, DZ, G4, ERR) 
+        TEM1 = TEM1 - FI(I) * (AFF2(I) + ZGF2) 
+        TEM4 = TEM4 - GI(I) * (AGG2(I) + ZFG2) 
+         tem2 = tem2 + GI(I)*AFG2(I) 
+         tem3=  tem3 + FI(I)*AGF2(I) 
+        TMF = TEM1 + TEM2 
+        TMG = TEM3 + TEM4 
+        FO(I) = FO(I) + TMF * CPL2 
+        GO(I) = GO(I) + TMG * CPL2 
+   21 END DO 
+      EndIf 
+      RETURN 
+      END     
+
+                                      
+      FUNCTION CtLhSPENC2 (X) 
+      IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+      EXTERNAL CtLhSPN2IN 
+      COMMON / LhCtSPENCC / XX 
+      DATA U1, AERR, RERR / 1.D0, 1.E-7, 5.E-3 / 
+      XX = X 
+      TEM = CtLhGausInt(CtLhSPN2IN, XX, U1, AERR, RERR, ERR, IRT) 
+      CtLhSPENC2 = TEM + LOG (XX) ** 2 / 2. 
+      RETURN 
+      END     
+
+                                      
+      FUNCTION CtLhSPN2IN (ZZ) 
+      IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+      COMMON / LhCtSPENCC / X 
+      Z = ZZ 
+      TEM = LOG (1.+ X - Z) / Z 
+      CtLhSPN2IN = TEM 
+      RETURN 
+      END       
+
+                                    
+      SUBROUTINE CtLhSTUPKL (NFL) 
+      IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+      LOGICAL LSTX 
+      PARAMETER (D0=0D0, D1=1D0, D2=2D0, D3=3D0, D4=4D0, D10=1D1) 
+      PARAMETER (MXX = 105, MXQ = 25, MXF = 6) 
+      PARAMETER (MX = 3) 
+      PARAMETER (M1=-3, M2=3, NDG=3, NDH=NDG+1, L1=M1-1, L2=M2+NDG-2) 
+      COMMON / LhCtXXARAY / XCR, XMIN, XV(0:MXX), LSTX, NX 
+      COMMON / LhCtXYARAY / ZZ(MXX, MXX), ZV(0:MXX) 
+      COMMON / LhCtVARIBX / XA(MXX, L1:L2), ELY(MXX), DXTZ(MXX) 
+      COMMON / LhCtKRN1ST / FF1(0:MXX),FG1(0:MXX),GF1(0:MXX),GG1(0:MXX),&
+     &                  FF2(0:MXX), FG2(0:MXX), GF2(0:MXX), GG2(0:MXX), &
+     &                  PNSP(0:MXX), PNSM(0:MXX)                        
+      COMMON / LhCtKRN2ND / FFG(MXX, MXX), GGF(MXX, MXX), PNS(MXX, MXX) 
+      COMMON / LhCtKRNL00 / DZ, XL(MX), NNX 
+      COMMON / LhCtKRNL01 / AFF2(MXX),AFG2(MXX),AGF2(MXX),AGG2(MXX),    &
+     &                  ANSP (MXX), ANSM (MXX), ZFG2, ZGF2, ZQQB        
+      EXTERNAL CtLhPFF1, CtLhRGG1, CtLhRFF2, CtLhRGG2 
+      EXTERNAL CtLhFNSP, CtLhFNSM 
+      dimension aff1(mxx),agg1(mxx) 
+      PARAMETER (PI = 3.141592653589793d0, PI2 = PI**2) 
+      DATA CF, CG, TR / 1.33333333333333d0, 3.0, 0.5 / 
+                                              ! zeta(3.0)               
+      data zeta3/1.20205690315959d0/ 
+      SAVE 
+      DATA AERR, RERR / 0.0, 0.02 / 
+      NNX = NX 
+      DZ = 1./ (NX - 1) 
+      DO 5 I0 = 1, MX 
+        XL(I0) = XV(I0) 
+    5 END DO 
+      DO 10 I = 1, NX-1 
+        XZ = XV(I) 
+      CALL CtLhKERNEL (XZ, FF1(I), GF1(I), FG1(I), GG1(I), PNSP(I),     &
+     &          PNSM(I), FF2(I), GF2(I), FG2(I), GG2(I), NFL, IRT)      
+   10 END DO 
+      FF1(0) = FF1(1) * 3. - FF1(2) * 3. + FF1(3) 
+      FG1(0) = FG1(1) * 3. - FG1(2) * 3. + FG1(3) 
+      GF1(0) = GF1(1) * 3. - GF1(2) * 3. + GF1(3) 
+      GG1(0) = GG1(1) * 3. - GG1(2) * 3. + GG1(3) 
+      PNSP(0) = PNSP(1) * 3. - PNSP(2) * 3. + PNSP(3) 
+      PNSM(0) = PNSM(1) * 3. - PNSM(2) * 3. + PNSM(3) 
+      FF2(0) = FF2(1) * 3. - FF2(2) * 3. + FF2(3) 
+      FG2(0) = FG2(1) * 3. - FG2(2) * 3. + FG2(3) 
+      GF2(0) = GF2(1) * 3. - GF2(2) * 3. + GF2(3) 
+      GG2(0) = GG2(1) * 3. - GG2(2) * 3. + GG2(3) 
+      FF1(NX) = FF1(NX-1) * 3. - FF1(NX-2) * 3. + FF1(NX-3) 
+      FG1(NX) = FG1(NX-1) * 3. - FG1(NX-2) * 3. + FG1(NX-3) 
+      GF1(NX) = GF1(NX-1) * 3. - GF1(NX-2) * 3. + GF1(NX-3) 
+      GG1(NX) = GG1(NX-1) * 3. - GG1(NX-2) * 3. + GG1(NX-3) 
+      PNSM(NX) = PNSM(NX-1) * 3. - PNSM(NX-2) * 3. + PNSM(NX-3) 
+      PNSP(NX) = PNSP(NX-1) * 3. - PNSP(NX-2) * 3. + PNSP(NX-3) 
+      FF2(NX) = FF2(NX-1) * 3. - FF2(NX-2) * 3. + FF2(NX-3) 
+      FG2(NX) = FG2(NX-1) * 3. - FG2(NX-2) * 3. + FG2(NX-3) 
+      GF2(NX) = GF2(NX-1) * 3. - GF2(NX-2) * 3. + GF2(NX-3) 
+      GG2(NX) = GG2(NX-1) * 3. - GG2(NX-2) * 3. + GG2(NX-3) 
+         RER = RERR * 4. 
+         AFF1(1) = CtLhGausInt(CtLhPFF1,D0,XV(1),AERR,RERR,ER1,IRT) 
+         DGG1     = NFL / 3. 
+         TMPG     = CtLhGausInt(CtLhRGG1,D0,XV(1),AERR,RERR,ER3,IRT) 
+         AGG1(1) = TMPG + DGG1 
+       ANSM(1) = CtLhGausInt(CtLhFNSM,D0,XV(1),AERR,RER,ER2,IRT) 
+       ANSP(1) = CtLhGausInt(CtLhFNSP,D0,XV(1),AERR,RER,ER2,IRT) 
+         AER = AFF1(1) * RER 
+         AFF2(1) = CtLhGausInt(CtLhRFF2, D0, XV(1),  AER, RER, ER2, IRT) 
+         AER = AGG1(1) * RER 
+         AGG2(1) = CtLhGausInt(CtLhRGG2, D0, XV(1),  AER, RER, ER4, IRT) 
+      DO 20 I2 = 2, NX-1 
+      TEM =CtLhGausInt(CtLhPFF1,XV(I2-1),XV(I2),AERR,RERR,ER1,IRT) 
+      AFF1(I2) = TEM + AFF1(I2-1) 
+      AER = ABS(TEM * RER) 
+      AFF2(I2)=CtLhGausInt(CtLhRFF2,XV(I2-1),XV(I2),AER,RER,ER2,IRT)    &
+     &        +AFF2(I2-1)                                               
+      TEM      = CtLhGausInt(CtLhRGG1,XV(I2-1),XV(I2),AERR,RERR,ER3,IRT) 
+      TMPG     = TMPG + TEM 
+      AGG1(I2) = TMPG + DGG1 
+      AER = ABS(TEM * RER) 
+      AGG2(I2)=CtLhGausInt(CtLhRGG2,XV(I2-1),XV(I2),AER,RER,ER4,IRT)    &
+     &        +AGG2(I2-1)                                               
+      ANSP(I2)=CtLhGausInt(CtLhFNSP,XV(I2-1),XV(I2),AERR,RER,ER4,IRT)   &
+     &        +ANSP(I2-1)                                               
+      ANSM(I2)=CtLhGausInt(CtLhFNSM,XV(I2-1),XV(I2),AERR,RER,ER4,IRT)   &
+     &        +ANSM(I2-1)                                               
+   20 END DO 
+      ANSP(NX)=CtLhGausInt(CtLhFNSP,XV(NX-1),D1,AERR,RER,ERR,           &
+     & IRT) + ANSP(NX-1)                                                
+      ANSM(NX)=CtLhGausInt(CtLhFNSM,XV(NX-1),D1,AERR,RER,ERR,           &
+     & IRT) + ANSM(NX-1)                                                
+           TRNF = TR * NFL 
+                                                          !loop over x  
+      do i2=1,nx-1 
+         x=xv(i2) 
+!        XI = 1./ X                !unused - jcp                        
+         X2 = X ** 2 
+         X3=  x**3 
+         XLN = DLOG (X) 
+         XLN2 = XLN ** 2 
+         XLN1M = DLOG (1.- X) 
+         xLi2m=CtLhxLi(2,-x) 
+         xLi2=CtLhxLi(2,x) 
+         xLi3=CtLhxLi(3,x) 
+         xLi31m=CtLhxLi(3,1d0-x) 
+         xLi32=CtLhxLi(3,x2) 
+         xln1m2=xln1m*xln1m 
+         xln1p=dlog(1d0+x) 
+         x1m=1d0-x 
+         x1p=1d0+x 
+         x3m=3d0-x 
+         x3p=3d0+x 
+         wgfcft=                                                        &
+     & (9 + 4*Pi2 - 22*x + 13*x2 + 6*(3 - 4*x + x2)*xln1m +             &
+     & 40*xln - 24*xLi2)/9.                                             
+       wgfcf2=                                                          &
+     & (6*(2*(-9 + Pi2) + 3*x*(5 + x)) +4*(3 +2*Pi2+3*x*(-3 + 2*x))*    &
+     & xln1m + 6*x3m*x1m*xln1m2 - 6*(x*(8 + 3*x) + 4*xln1m2)*           &
+     & xln - 3*(-4 + x)*x*xln2)/12 - 2*(3 + 2*xln1m)*xLi2 - 4*xLi31m    
+       wgfcfg=                                                          &
+     & (3637-186*Pi2-x*(3198+72*Pi2+x*(231 + 208*x)))/108.- xln +       &
+     & (3*xln1m*(-33 - 4*Pi2 + (50 - 17*x)*x - 3*x3m*x1m*xln1m) +       &
+     & 2*(x*(198 + x*(27+8*x))+9*xln1m*(3 - 4*x + x2 + 2*xln1m))*       &
+     & xln - 9*x*(4 + x)*xln2)/18- x1p*x3p*xln*xln1p-                   &
+     & (x1p*x3p - 4*xln)*xLi2m + (31d0/3d0 +4*xln1m- 4*xln)*xLi2 +      &
+     & 4*xLi31m + 12*xLi3 - 2*xLi32 - 10*zeta3                          
+       wfgcft=                                                          &
+     & (18 - 81*x + 6*Pi2*x + 123*x2 - 6*Pi2*x2 - 60*x3 +               &
+     & 4*Pi2*x3 - 6*(-2 + 3*x - 3*x2 + 2*x3)*xln1m2 -33*x*xln +         &
+     & 15*x2*xln - 24*x3*xln - 9*x*xln2 + 9*x2*xln2 -                   &
+     & 12*x3*xln2 - 12*x1m*xln1m*(-1 + 2*x2 + 2*xln - x*xln +           &
+     & 2*x2*xln) - 24*xLi2)/9.                                          
+       wfgcgt=                                                          &
+     & (2*(-67 + 2*Pi2 + x*(64 + x*(-91 + 3*Pi2 + 94*x)) +              &
+     & x1m*(7+x*(-5+16*x))*xln1m -3*x1m*(2+ x*(-1+2*x))*xln1m2 -        &
+     & 20*xln - 3*x*xln*(13 + 16*x*x1p - 3*x1p*xln) +                   &
+     & 6*x1p*(2+x+2*x2)*xln*xln1p+6*x1p*(2+x+2*x2)*xLi2m))/9.           
+       AGF2(I2) = CF*TRNF*WGFCFT+CF**2* WGFCF2+CF*CG*WGFCFG 
+       AFG2(I2) = CF*TRNF*WFGCFT            +CG*TRNF*WFGCGT 
+            !i2                                                         
+      enddo 
+       AGF2(nx)=0d0 
+       AFG2(nx)=0d0 
+       ZGF2=-28./27.*Cf**2+94./27.*Cf*Cg -52./27.*Cf*TrNf 
+       ZFG2= 37./27.*Cf*TrNf + 35./54.*Cg*TrNf 
+       ZQQB=1.43862321154902*(Cf**2-0.5*Cf*Cg) 
+      DO 21 IX = 1, NX-1 
+        X = XV(IX) 
+        NP = NX - IX + 1 
+        IS = NP 
+        XG2 = (LOG(1./(1.-X)) + 1.) ** 2 
+        FFG (IS, IS) = FG2(NX) * DXTZ(I) * XG2 
+      GGF (IS, IS) = GF2(NX) * DXTZ(I) * XG2 
+      PNS (IS, IS) =PNSM(NX) * DXTZ(I) 
+        DO 31 KZ = 2, NP 
+          IY = IX + KZ - 1 
+          IT = NX - IY + 1 
+          XY = X / XV(IY) 
+          XM1 = 1.- XY 
+          XG2 = (LOG(1./XM1) + 1.) ** 2 
+          Z  = ZZ (IX, IY) 
+          TZ = (Z + DZ) / DZ 
+          IZ = Int(TZ) 
+          IZ = MAX (IZ, 0) 
+          IZ = MIN (IZ, NX-1) 
+          DT = TZ - IZ 
+          TEM = (FF2(IZ) * (1.- DT) + FF2(IZ+1) * DT) / XM1 / XY 
+          FFG (IX, IY) = TEM * DXTZ(IY) 
+          TEM = (FG2(IZ) * (1.- DT) + FG2(IZ+1) * DT) * XG2 / XY 
+          FFG (IS, IT) = TEM * DXTZ(IY) 
+          TEM = (GF2(IZ) * (1.- DT) + GF2(IZ+1) * DT) * XG2 / XY 
+        GGF (IS, IT) = TEM * DXTZ(IY) 
+          TEM = (GG2(IZ) * (1.- DT) + GG2(IZ+1) * DT) / XM1 / XY 
+        GGF (IX, IY) = TEM * DXTZ(IY) 
+        TEM = (PNSP(IZ) * (1.- DT) + PNSP(IZ+1) * DT) / XM1 
+        PNS (IX, IY) = TEM * DXTZ(IY) 
+        TEM = (PNSM(IZ) * (1.- DT) + PNSM(IZ+1) * DT) / XM1 
+        PNS (IS, IT) = TEM * DXTZ(IY) 
+   31   CONTINUE 
+   21 END DO 
+      RETURN 
+      END       
+
+                                    
+      SUBROUTINE CtLhTRNLAM (IRDR, NF, IACT, IRT) 
+      IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+      COMMON / LhCtCWZPRM / ALAM(0:9), AMHAT(0:9), AMN, NHQ 
+      COMMON / LhCtTRNCOM / VMULM, JRDR, N, N1 
+      EXTERNAL CtLhZBRLAM 
+      DATA ALM0, BLM0, RERR / 0.01, 10.0, 0.0001 / 
+      DATA IR1, SML / 0, 1.E-5 / 
+      IRT = 0 
+      N = NF 
+      JRDR = IRDR 
+      JACT = IACT 
+      VLAM = ALAM(N) 
+      IF (JACT .GT. 0) THEN 
+         N1 = N + 1 
+         THMS = AMHAT(N1) 
+         ALM = LOG (THMS/VLAM) 
+         BLM = BLM0 
+      ELSE 
+         N1 = N -1 
+         THMS = AMHAT(N) 
+         ALM = ALM0 
+         THMS = MAX (THMS, SML) 
+         BLM = LOG (THMS/VLAM) 
+      ENDIF 
+      IF (VLAM .GE. 0.7 * THMS) THEN 
+         IF (JACT .EQ. 1) THEN 
+            AMHAT(N1) = 0 
+         ELSE 
+            AMHAT(N) = 0 
+         ENDIF 
+         IRT = 4 
+         ALAM(N1) = VLAM 
+         RETURN 
+      ENDIF 
+      IF (ALM .GE. BLM) THEN 
+         WRITE (*, *) 'CtLhTRNLAM has ALM >= BLM: ', ALM, BLM 
+         WRITE (*, *) 'I do not know how to continue' 
+         STOP 
+         ENDIF 
+      VMULM = THMS/VLAM 
+      ERR = RERR * LOG (VMULM) 
+      WLLN = CtLhQZBRNT (CtLhZBRLAM, ALM, BLM, ERR, IR1) 
+      ALAM(N1) = THMS / EXP (WLLN) 
+      IF (IR1 .NE. 0) THEN 
+         WRITE (*, *) 'CtLhQZBRNT failed in CtLhTRNLAM; ',              &
+     &        'NF, VLAM =', NF, VLAM                                    
+         WRITE (*, *) 'I do not know how to continue' 
+        STOP 
+      ENDIF 
+      RETURN 
+      END       
+      
+                              
+      SUBROUTINE CtLhUPC (A, La, UpA) 
+      CHARACTER A*(*), UpA*(*), C*(1) 
+      INTEGER I, La, Ld 
+      La = Len(A) 
+      Lb = Len(UpA) 
+      If (Lb .Lt. La) Stop 'UpCase conversion length mismatch!' 
+      Ld = ICHAR('A')-ICHAR('a') 
+      DO 1 I = 1, Lb 
+        If (I .Le. La) Then 
+         c = A(I:I) 
+         IF ( LGE(C, 'a') .AND. LLE(C, 'z') ) THEN 
+           UpA (I:I) = CHAR(Ichar(c) + ld) 
+         Else 
+           UpA (I:I) = C 
+         ENDIF 
+        Else 
+         UpA (I:I) = ' ' 
+        Endif 
+    1 END DO 
+                                                                        
+      RETURN 
+      END       
+
+                                    
+      SUBROUTINE CtLhWARNI (IWRN, MSG, NMVAR, IVAB,                     &
+     &                  IMIN, IMAX, IACT)                               
+      CHARACTER*(*) MSG, NMVAR 
+      Save Iw 
+      Data Nmax / 100 / 
+      IW = IWRN 
+      IV = IVAB 
+                                                                        
+      IF  (IW .EQ. 0) THEN 
+         PRINT '(1X,A/1X, 2A,I10)', MSG, NMVAR,' = ', IV 
+         IF (IACT .EQ. 1) THEN 
+         PRINT '(A/2I10)', ' The limits are: ', IMIN, IMAX 
+         ENDIF 
+      ENDIF 
+      If (Iw .LT. Nmax) Then 
+         PRINT '(1X,A/1X, 2A,I10)', MSG, NMVAR,' = ', IV 
+      Elseif (Iw .Eq. Nmax) Then 
+         Print '(/A/)', 'CtLhWARNI Severe Warning: Too many errors' 
+      Endif 
+      IWRN = IW + 1 
+      RETURN 
+      END       
+
+                                    
+      SUBROUTINE CtLhWARNR (IWRN, MSG, NMVAR, VARIAB,                   &
+     &                  VMIN, VMAX, IACT)                               
+      IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+      PARAMETER (D0=0D0, D1=1D0, D2=2D0, D3=3D0, D4=4D0, D10=1D1) 
+      CHARACTER*(*) MSG, NMVAR 
+      Save Iw 
+!      Data Nmax / 100 /                                                
+      Data Nmax / 10 / 
+      IW = IWRN 
+      VR = VARIAB 
+      IF  (IW .EQ. 0) THEN 
+         PRINT '(1X, A/1X,2A,1PD16.7)', MSG, NMVAR, ' = ', VR 
+         IF (IACT .EQ. 1) THEN 
+         PRINT       '(A/2(1PE15.4))', ' The limits are: ', VMIN, VMAX 
+         ENDIF 
+      ENDIF 
+      If (Iw .LT. Nmax) Then 
+         PRINT '(I5, 2A/1X,2A,1PD16.7)', IW, '   ', MSG,                &
+     &                  NMVAR, ' = ', VR                                
+      Elseif (Iw .Eq. Nmax) Then 
+         Print '(/A/)', 'CtLhWARNR Severe Warning: Too many errors' 
+      Endif 
+      IWRN = IW + 1 
+      RETURN 
+      END       
+
+                                    
+      SUBROUTINE CtLhXARRAY 
+      IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+      LOGICAL LSTX 
+      PARAMETER (D0 = 0.0, D10=10.0) 
+      PARAMETER (MXX = 105, MXQ = 25, MXF = 6) 
+      PARAMETER (MXPN = MXF * 2 + 2) 
+      PARAMETER (MXQX= MXQ * MXX,   MXPQX = MXQX * MXPN) 
+      PARAMETER (M1=-3, M2=3, NDG=3, NDH=NDG+1, L1=M1-1, L2=M2+NDG-2) 
+      Character Msg*80 
+      COMMON / LhCtVARIBX / XA(MXX, L1:L2), ELY(MXX), DXTZ(MXX) 
+      COMMON / LhCtVARBAB / GB(NDG, NDH, MXX), H(NDH, MXX, M1:M2) 
+      COMMON / LhCtHINTEC / GH(NDG, MXX) 
+      COMMON / LhCtXXARAY / XCR, XMIN, XV(0:MXX), LSTX, NX 
+      COMMON / LhCtXYARAY / ZZ(MXX, MXX), ZV(0:MXX) 
+      DIMENSION G1(NDG,NDH), G2(NDG,NDH), A(NDG) 
+      DATA F12, F22, F32 / 1D0, 1D0, 1D0 / 
+      DATA (G1(I,NDH), G2(I,1), I=1,NDG) / 0.0,0.0,0.0,0.0,0.0,0.0 / 
+      DATA PUNY / 1D-30 / 
+      XV(0) = 0D0 
+      DZ = 1D0 / (NX-1) 
+      DO 10 I = 1, NX - 1 
+         Z = DZ * (I-1) 
+         ZV(I) = Z 
+         X = CtLhXFRMZ (Z) 
+         DXTZ(I) = CtLhDXDZ(Z) / X 
+         XV (I)  = X 
+         XA(I, 1) = X 
+         XA(I, 0) = LOG (X) 
+         DO 20 L = L1, L2 
+          IF (L .NE. 0 .AND. L .NE. 1)  XA(I, L) = X ** L 
+   20    CONTINUE 
+   10 END DO 
+         XV(1) = Xmin 
+         XV(NX) = 1D0 
+         ZV(Nx) = 1D0 
+         DXTZ(NX) = CtLhDXDZ(1.D0) 
+         DO 21 L = L1, L2 
+            XA (NX, L) = 1D0 
+   21    CONTINUE 
+         XA (NX, 0) = 0D0 
+      DO 11 I = 1, NX-1 
+         ELY(I) = LOG(1D0 - XV(I)) 
+   11 END DO 
+       ELY(NX) = 3D0* ELY(NX-1) - 3D0* ELY(NX-2) + ELY(NX-3) 
+      DO 17 IX = 1, NX 
+      ZZ (IX, IX) = 1. 
+      DO 17 IY = IX+1, NX 
+         XY = XV(IX) / XV(IY) 
+         ZZ (IX, IY) = CtLhZFRMX (XY) 
+         ZZ (NX-IX+1, NX-IY+1) = XY 
+   17 CONTINUE 
+      DO 30 I = 1, NX-1 
+      IF (I .NE. NX-1) THEN 
+        F11 = 1D0/XV(I) 
+        F21 = 1D0/XV(I+1) 
+        F31 = 1D0/XV(I+2) 
+        F13 = XV(I) 
+        F23 = XV(I+1) 
+        F33 = XV(I+2) 
+        DET = F11*F22*F33 + F21*F32*F13 + F31*F12*F23                   &
+     &      - F31*F22*F13 - F21*F12*F33 - F11*F32*F23                   
+        IF (ABS(DET) .LT. PUNY) THEN 
+           Msg='Determinant close to zero; will be arbitrarily set to:' 
+           CALL CtLhWARNR(IWRN, Msg, 'DET', PUNY, D0, D0, 0) 
+           DET = PUNY 
+        EndIf 
+        G2(1,2) = (F22*F33 - F23*F32) / DET 
+        G2(1,3) = (F32*F13 - F33*F12) / DET 
+        G2(1,4) = (F12*F23 - F13*F22) / DET 
+        G2(2,2) = (F23*F31 - F21*F33) / DET 
+        G2(2,3) = (F33*F11 - F31*F13) / DET 
+        G2(2,4) = (F13*F21 - F11*F23) / DET 
+        G2(3,2) = (F21*F32 - F22*F31) / DET 
+        G2(3,3) = (F31*F12 - F32*F11) / DET 
+        G2(3,4) = (F11*F22 - F12*F21) / DET 
+        B2 = LOG (XV(I+2)/XV(I)) 
+        B3 = XV(I) * (B2 - 1.) + XV(I+2) 
+        GH (1,I) = B2 * G2 (2,2) + B3 * G2 (3,2) 
+        GH (2,I) = B2 * G2 (2,3) + B3 * G2 (3,3) 
+        GH (3,I) = B2 * G2 (2,4) + B3 * G2 (3,4) 
+      EndIf 
+        DO 51 J = 1, NDH 
+           DO 52 L = 1, NDG 
+              IF     (I .EQ. 1) THEN 
+                 GB(L,J,I) = G2(L,J) 
+              ElseIF (I .EQ. NX-1) THEN 
+                 GB(L,J,I) = G1(L,J) 
+              Else 
+                 GB(L,J,I) = (G1(L,J) + G2(L,J)) / 2D0 
+              EndIf 
+   52      CONTINUE 
+   51   CONTINUE 
+        DO 35 MM = M1, M2 
+           DO 40 K = 1, NDG 
+             KK = K + MM - 2 
+             IF (KK .EQ. 0) THEN 
+               A(K) = XA(I+1, 0) - XA(I, 0) 
+             Else 
+               A(K) = (XA(I+1, KK) - XA(I, KK)) / DBLE(KK) 
+             EndIf 
+   40      CONTINUE 
+           DO 41 J = 1, NDH 
+             TEM = 0 
+             DO 43 L = 1, NDG 
+               TEM = TEM + A(L) * GB(L,J,I) 
+   43        CONTINUE 
+             H(J,I,MM) = TEM 
+   41      CONTINUE 
+   35   CONTINUE 
+      DO 42 J = 1, NDG 
+        DO 44 L = 1, NDG 
+           G1(L,J) = G2(L,J+1) 
+   44 END DO 
+   42 END DO 
+   30 END DO 
+      LSTX = .TRUE. 
+      RETURN 
+      END     
+
+                                      
+      FUNCTION CtLhXFRMZ (Z) 
+      IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+      LOGICAL LSTX 
+      PARAMETER (D0=0D0, D1=1D0, D2=2D0, D3=3D0, D4=4D0, D10=1D1) 
+      PARAMETER (MXX = 105) 
+      COMMON / LhCtXXARAY / XCR, XMIN, XV(0:MXX), LSTX, NX 
+      COMMON / LhCtINVERT / ZA 
+      EXTERNAL CtLhZFXL 
+      DATA TEM, RER / D1, 1E-3 / 
+      DATA ZLOW, ZHIGH, IWRN2 / -10.0, 1.00002, 0 / 
+      EPS = TEM * RER 
+      ZA = Z 
+      IF (Z .LE. ZHIGH .AND. Z .GT. ZLOW) THEN 
+          XLA = LOG (XMIN) * 1.5 
+          XLB = 0.00001 
+          TEM = CtLhZBRNT (CtLhZFXL, XLA, XLB, EPS, IRT) 
+      Else 
+        CALL CtLhWARNR (IWRN2, 'Z out of range in CtLhXFRMZ, X set=0.', &
+     &              'Z', Z, ZLOW, ZHIGH, 1)                             
+        TEM = 0 
+      EndIf 
+      CtLhXFRMZ = EXP(TEM) 
+      RETURN 
+      END     
+
+                                      
+      FUNCTION CtLhxLi(n,x) 
+      implicit NONE 
+      integer NCUT, i,n,m3 
+      real*8 CtLhxLi,Out,x,pi2by6,zeta3,c1,c2 
+      real*8 r,xt,L,xln1m 
+      parameter (m3=8) 
+      dimension c1(2:m3),c2(2:m3) 
+      data NCUT/27/ 
+      data c1/0.75,-0.5833333333333333d0,0.454861111111111d0,           &
+     &        -0.3680555555555555d0,0.3073611111111111d0,               &
+     &        -0.2630555555555555d0,0.2294880243764172d0/               
+      data c2/-0.5d0,0.5d0,-0.4583333333333333d0,0.416666666666666d0,   &
+     &        -0.3805555555555555d0,0.35d0,-0.3241071428571428d0/       
+      data zeta3,pi2by6 /1.20205690315959d0,1.64493406684823d0/ 
+      L=0.0 
+      i=0 
+      r=1.0 
+      if (abs(x).gt.r) then 
+        PRINT *,'Li: x out of range (-1,1) , x=',x 
+        STOP 
+      endif 
+      if (n.lt.0) then 
+       PRINT *,'Polylogarithm Li undefined for n=',n 
+       STOP 
+      elseif (n.eq.0) then 
+       Out=x/(1d0-x) 
+      elseif (n.eq.1) then 
+       Out=-dlog(1-x) 
+      elseif (n.eq.2) then 
+                                                !Calculate dilogarithm  
+                                                !separately for x<0.5 an
+      if (x.ge.(-0.5).and.x.le.0.5) then 
+         do while(i.le.NCUT) 
+                 i=i+1 
+          r=r*x 
+          L=L+r/i/i 
+         enddo 
+         Out=L 
+       elseif (x.eq.0) then 
+         Out=0d0 
+                             !n.eq.2,x>0.5                              
+       elseif(x.gt.0.5) then 
+         xt = 1.0-x 
+         L = pi2by6 - dlog(x)*dlog(xt) 
+         do while(i.le.NCUT) 
+          i=i+1 
+          r=r*xt 
+          L=L-r/i/i 
+         enddo 
+         Out=L 
+       elseif (x.lt.(-0.5)) then 
+         xt=-x/(1d0-x) 
+         L=-0.5*dlog(1-x)**2 
+         do while (i.le.NCUT) 
+          i=i+1 
+          r=r*xt 
+          L=L-r/i/i 
+         enddo 
+         Out=L 
+       endif 
+                                        !use the expansion of Li3 near x
+      elseif (n.eq.3.and.x.ge.0.8) then 
+       L=zeta3+pi2by6*dlog(x) 
+       xt=(1d0-x) 
+       xln1m=dlog(xt) 
+       do i=2,m3 
+        L=L+(c1(i)+c2(i)*xln1m)*xt**i 
+       enddo 
+       Out=L 
+           !n>3 or x=3,x<0.8                                            
+      else 
+         do while(i.le.NCUT) 
+          i=i+1 
+          r=r*x 
+          L=L+r/dble(i)**dble(n) 
+         enddo 
+         Out=L 
+      endif 
+      CtLhxLi=Out 
+          ! CtLhxLi                                                     
+      END     
+
+                                      
+      FUNCTION CtLhZBRLAM (WLLN) 
+      IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+      COMMON / LhCtTRNCOM / VMULM, JRDR, N, N1 
+      WMULM = EXP (WLLN) 
+      TEM1 = 1./ CtLhALPQCD(JRDR, N1, WMULM, I) 
+      TEM2 = 1./ CtLhALPQCD(JRDR, N,  VMULM, I) 
+      CtLhZBRLAM = TEM1 - TEM2 
+      END     
+
+                                      
+      FUNCTION CtLhZBRNT(FUNC, X1, X2, TOL, IRT) 
+      IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+      PARAMETER (ITMAX = 1000, EPS = 3.E-12) 
+      external func 
+      IRT = 0 
+      TOL = ABS(TOL) 
+      A=X1 
+      B=X2 
+      FA=FUNC(A) 
+      FB=FUNC(B) 
+      IF(FB*FA.GT.0.)  THEN 
+        PRINT *, 'Root must be bracketed for CtLhZBRNT. Set = 0' 
+        IRT = 1 
+        CtLhZBRNT=0. 
+        RETURN 
+      ENDIF 
+      FC=FB 
+      DO 11 ITER=1,ITMAX 
+        IF(FB*FC.GT.0.) THEN 
+          C=A 
+          FC=FA 
+          D=B-A 
+          E=D 
+        ENDIF 
+        IF(ABS(FC).LT.ABS(FB)) THEN 
+          A=B 
+          B=C 
+          C=A 
+          FA=FB 
+          FB=FC 
+          FC=FA 
+        ENDIF 
+        TOL1=2.*EPS*ABS(B)+0.5*TOL 
+        XM=.5*(C-B) 
+        IF(ABS(XM).LE.TOL1 .OR. FB.EQ.0.)THEN 
+          CtLhZBRNT=B 
+          RETURN 
+        ENDIF 
+        IF(ABS(E).GE.TOL1 .AND. ABS(FA).GT.ABS(FB)) THEN 
+          S=FB/FA 
+          IF(A.EQ.C) THEN 
+            P=2.*XM*S 
+            Q=1.-S 
+          ELSE 
+            Q=FA/FC 
+            R=FB/FC 
+            P=S*(2.*XM*Q*(Q-R)-(B-A)*(R-1.)) 
+            Q=(Q-1.)*(R-1.)*(S-1.) 
+          ENDIF 
+          IF(P.GT.0.) Q=-Q 
+          P=ABS(P) 
+          IF(2.*P .LT. MIN(3.*XM*Q-ABS(TOL1*Q),ABS(E*Q))) THEN 
+            E=D 
+            D=P/Q 
+          ELSE 
+            D=XM 
+            E=D 
+          ENDIF 
+        ELSE 
+          D=XM 
+          E=D 
+        ENDIF 
+        A=B 
+        FA=FB 
+        IF(ABS(D) .GT. TOL1) THEN 
+          B=B+D 
+        ELSE 
+          B=B+SIGN(TOL1,XM) 
+        ENDIF 
+        FB=FUNC(B) 
+   11 END DO 
+      PRINT *, 'CtLhZBRNT exceeding maximum iterations.' 
+      IRT = 2 
+      CtLhZBRNT=B 
+      RETURN 
+      END     
+
+                                      
+      FUNCTION CtLhZFRMX (XX) 
+      IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+      LOGICAL LSTX 
+      PARAMETER (D0=0D0, D1=1D0, D2=2D0, D3=3D0, D4=4D0, D10=1D1) 
+      PARAMETER (MXX = 105) 
+      COMMON / LhCtXXARAY / XCR, XMIN, XV(0:MXX), LSTX, NX 
+      DATA IWRN1, HUGE, TINY / 0, 1.E35, 1.E-35 / 
+      F(X) = (XCR-XMIN) * LOG (X/XMIN) + LOG (XCR/XMIN) * (X-XMIN) 
+      D(X) = (XCR-XMIN) / X          + LOG (XCR/XMIN) 
+      X = XX 
+      IF (X .GE. XMIN) THEN 
+         TEM = F(X) / F(D1) 
+      ElseIF (X .GE. D0) THEN 
+         X = MAX (X, TINY) 
+         TEM = F(X) / F(D1) 
+      Else 
+         CALL CtLhWARNR(IWRN1, 'X out of range in CtLhZFRMX'            &
+     &             , 'X', X, TINY, HUGE, 1)                             
+         TEM = 99. 
+         STOP 
+      EndIf 
+      CtLhZFRMX = TEM 
+      RETURN 
+      ENTRY CtLhDZDX (XX) 
+      X = XX 
+      IF (X .GE. XMIN) THEN 
+         TEM = D(X) / F(D1) 
+      ElseIF (X .GE. D0) THEN 
+         X = MAX (X, TINY) 
+         TEM = D(X) / F(D1) 
+      Else 
+         CALL CtLhWARNR(IWRN1, 'X out of range in CtLhDZDX '            &
+     &             , 'X', X, TINY, HUGE, 1)                             
+         TEM = 99. 
+         STOP 
+      EndIf 
+      CtLhDZDX = TEM 
+      RETURN 
+      END     
+
+                                      
+      FUNCTION CtLhZFXL (XL) 
+      IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+      COMMON / LhCtINVERT / ZA 
+      X = EXP(XL) 
+      TT = CtLhZFRMX (X) - ZA 
+      CtLhZFXL = TT 
+      RETURN 
+      END                                           
+
+      SUBROUTINE CtLhPOLINT4 (XA,YA,N,X,Y,DY) 
+! fast version of polint, valid only for N=4                            
+! Have explicitly unrolled the loops.                                   
+                                                                        
+      IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+                                                                        
+      PARAMETER (NMAX=4) 
+      DIMENSION XA(N),YA(N),C(NMAX),D(NMAX) 
+                                                                        
+        if(n .ne. 4) then 
+           print *,'fatal CtLhPolint4 call',n 
+           stop 
+        endif 
+                                                                        
+      NS=1 
+      DIF=ABS(X-XA(1)) 
+                                                                        
+        DIFT=ABS(X-XA(1)) 
+        IF (DIFT.LT.DIF) THEN 
+          NS=1 
+          DIF=DIFT 
+        ENDIF 
+        C(1)=YA(1) 
+        D(1)=YA(1) 
+                                                                        
+        DIFT=ABS(X-XA(2)) 
+        IF (DIFT.LT.DIF) THEN 
+          NS=2 
+          DIF=DIFT 
+        ENDIF 
+        C(2)=YA(2) 
+        D(2)=YA(2) 
+                                                                        
+        DIFT=ABS(X-XA(3)) 
+        IF (DIFT.LT.DIF) THEN 
+          NS=3 
+          DIF=DIFT 
+        ENDIF 
+        C(3)=YA(3) 
+        D(3)=YA(3) 
+                                                                        
+        DIFT=ABS(X-XA(4)) 
+        IF (DIFT.LT.DIF) THEN 
+          NS=4 
+          DIF=DIFT 
+        ENDIF 
+        C(4)=YA(4) 
+        D(4)=YA(4) 
+                                                                        
+                                                                        
+      Y=YA(NS) 
+      NS=NS-1 
+                                                                        
+                                                                        
+          HO=XA(1)-X 
+          HP=XA(2)-X 
+          W=C(2)-D(1) 
+          DEN=W/(HO-HP) 
+          D(1)=HP*DEN 
+          C(1)=HO*DEN 
+                                                                        
+                                                                        
+          HO=XA(2)-X 
+          HP=XA(3)-X 
+          W=C(3)-D(2) 
+          DEN=W/(HO-HP) 
+          D(2)=HP*DEN 
+          C(2)=HO*DEN 
+                                                                        
+                                                                        
+          HO=XA(3)-X 
+          HP=XA(4)-X 
+          W=C(4)-D(3) 
+          DEN=W/(HO-HP) 
+          D(3)=HP*DEN 
+          C(3)=HO*DEN 
+                                                                        
+        IF (2*NS.LT.3)THEN 
+          DY=C(NS+1) 
+        ELSE 
+          DY=D(NS) 
+          NS=NS-1 
+        ENDIF 
+        Y=Y+DY 
+                                                                        
+          HO=XA(1)-X 
+          HP=XA(3)-X 
+          W=C(2)-D(1) 
+          DEN=W/(HO-HP) 
+          D(1)=HP*DEN 
+          C(1)=HO*DEN 
+                                                                        
+          HO=XA(2)-X 
+          HP=XA(4)-X 
+          W=C(3)-D(2) 
+          DEN=W/(HO-HP) 
+          D(2)=HP*DEN 
+          C(2)=HO*DEN 
+                                                                        
+        IF (2*NS.LT.2)THEN 
+          DY=C(NS+1) 
+        ELSE 
+          DY=D(NS) 
+          NS=NS-1 
+        ENDIF 
+        Y=Y+DY 
+                                                                        
+          HO=XA(1)-X 
+          HP=XA(4)-X 
+          W=C(2)-D(1) 
+          DEN=W/(HO-HP) 
+          D(1)=HP*DEN 
+          C(1)=HO*DEN 
+                                                                        
+        IF (2*NS.LT.4-3)THEN 
+          DY=C(NS+1) 
+        ELSE 
+          DY=D(NS) 
+          NS=NS-1 
+        ENDIF 
+        Y=Y+DY 
+                                                                        
+      RETURN 
+      END                                           
+      SUBROUTINE CTLHPOLINT3 (XA,YA,N,X,Y,DY) 
+! fast version of polint, valid only for N=3                            
+! Have explicitly unrolled the loops.                                   
+      IMPLICIT DOUBLE PRECISION (A-H, O-Z) 
+      PARAMETER (NMAX=3) 
+      DIMENSION XA(N),YA(N),C(NMAX),D(NMAX) 
+        if(n .ne. 3) then 
+           print *,'fatal CtLhPolint3 call',n 
+           stop 
+        endif 
+      NS=1 
+      DIF=ABS(X-XA(1)) 
+        DIFT=ABS(X-XA(1)) 
+        IF (DIFT.LT.DIF) THEN 
+          NS=1 
+          DIF=DIFT 
+        ENDIF 
+        C(1)=YA(1) 
+        D(1)=YA(1) 
+        DIFT=ABS(X-XA(2)) 
+        IF (DIFT.LT.DIF) THEN 
+          NS=2 
+          DIF=DIFT 
+        ENDIF 
+        C(2)=YA(2) 
+        D(2)=YA(2) 
+        DIFT=ABS(X-XA(3)) 
+        IF (DIFT.LT.DIF) THEN 
+          NS=3 
+          DIF=DIFT 
+        ENDIF 
+        C(3)=YA(3) 
+        D(3)=YA(3) 
+      Y=YA(NS) 
+      NS=NS-1 
+          HO=XA(1)-X 
+          HP=XA(2)-X 
+          W=C(2)-D(1) 
+          DEN=W/(HO-HP) 
+          D(1)=HP*DEN 
+          C(1)=HO*DEN 
+          HO=XA(2)-X 
+          HP=XA(3)-X 
+          W=C(3)-D(2) 
+          DEN=W/(HO-HP) 
+          D(2)=HP*DEN 
+          C(2)=HO*DEN 
+        IF (2*NS.LT.2)THEN 
+          DY=C(NS+1) 
+        ELSE 
+          DY=D(NS) 
+          NS=NS-1 
+        ENDIF 
+        Y=Y+DY 
+          HO=XA(1)-X 
+          HP=XA(3)-X 
+          W=C(2)-D(1) 
+          DEN=W/(HO-HP) 
+          D(1)=HP*DEN 
+          C(1)=HO*DEN 
+        IF (2*NS.LT.1)THEN 
+          DY=C(NS+1) 
+        ELSE 
+          DY=D(NS) 
+          NS=NS-1 
+        ENDIF 
+        Y=Y+DY 
+      RETURN 
+      END                                           
diff --git a/LHAPDF/lhapdf-5.9.1/src/EVLNNPDF.f b/LHAPDF/lhapdf-5.9.1/src/EVLNNPDF.f
new file mode 100644 (file)
index 0000000..1213091
--- /dev/null
@@ -0,0 +1,3065 @@
+!********************************************************************** 
+!                                                                       
+!     TABLE OF CONTENTS                                                 
+!                                                                       
+!     1. evolinit -> Initializes the evolution code by filling the COMMO
+!                    BLOCKS which contain the constants                 
+!     2. alphasNNPDF,ffn,vfn,funcs -> Routines related to the computatio
+!     3. evolfactx -> Computes the evolution kernels in x-space.        
+!     4. xgrid  -> Gives the x pts for the convolution                  
+!     5. gammax -> FT algorithm for Mellin inversion                    
+!     6. gamma -> evaluates gamma coefficients                          
+!     7. evolfactn -> N space quantities evaluation                     
+!     8. evolint -> convolution routines                                
+!     9. andim_IPT -> Evaluates an dimension                            
+!     10.matutils.f, psi.f -> Matrix operation, special functions and dg
+!                                                                       
+!     NB: pdfin & NN are in wrapXNN.f                                   
+!                                                                       
+!********************************************************************** 
+                                                                        
+!****                                                                   
+! 1 *-------------------------------------------------------------------
+!****                                                                   
+      SUBROUTINE LH_EVOLINIT 
+      IMPLICIT none 
+!                                                                       
+      INTEGER ipt,imodev,ivfn,itmc 
+      COMMON/nnpdf10EVFLAGS/ipt,imodev,ivfn,itmc 
+!                                                                       
+      REAL*8 ca,cf,tr 
+      COMMON/NNPDF10COLFACT/ca,cf,tr 
+      REAL*8 emc,zeta2,zeta3,zeta4,pi 
+      PARAMETER (pi    = 3.1415926535897932385) 
+      COMMON /NNPDF10CONSTS/ emc,zeta2,zeta3,zeta4 
+!                                                                       
+      REAL*8 beta0(3:6),beta1(3:6),beta2(3:6) 
+      REAL*8 b1(3:6),b2(3:6) 
+      COMMON /NNPDF10BETA/ beta0,beta1,beta2,b1,b2 
+      REAL*8 q2th(4:6),asref,q2ref 
+      REAL*8 as0,asc,asb,ast,asq 
+      COMMON/nnpdf10VFNS/ q2th,asref,q2ref 
+      COMMON /NNPDF10AS/ as0,asc,asb,ast,asq 
+!                                                                       
+      REAL*8 q20,q2 
+      COMMON/NNPDF10EVSCALE/q20,q2 
+!                                                                       
+      INTEGER i, nff 
+      REAL*8 alphas,LH_AlphaExactBeta,LH_AlphaMZ 
+      EXTERNAL LH_AlphaExactBeta,LH_AlphaMZ 
+!                                                                       
+!     Color Factors                                                     
+!                                                                       
+      CA= 3D0 
+      CF= 4D0/3D0 
+      TR= 0.5D0 
+!                                                                       
+!     Constants                                                         
+!                                                                       
+      EMC   = 0.5772156649D0 
+      ZETA2 = 1.644934067D0 
+      ZETA3 = 1.2020569031D0 
+      ZETA4 = 1.0823232337D0 
+!                                                                       
+!     Beta function coefficients                                        
+!                                                                       
+      DO I=3,6 
+         BETA0(I) = (33d0-2d0*I)/3d0 
+         BETA1(I) = 102d0-38d0/3d0*I 
+         BETA2(I) = 2857d0/2d0-5033d0/18d0*I+325d0/54d0*I**2d0 
+         B1(I) = BETA1(I)/BETA0(I) 
+         B2(I) = BETA2(I)/BETA0(I) 
+      ENDDO 
+!                                                                       
+      IF(IVFN.EQ.0) THEN 
+         NFF = 3
+         IF(IMODEV.EQ.1)THEN 
+            CALL LH_FFN(q20,alphas,ipt,LH_AlphaExactBeta,NFF) 
+         ELSEIF(IMODEV.EQ.0)THEN 
+            CALL LH_FFN(q20,alphas,ipt,LH_AlphaMZ,NFF) 
+         ENDIF 
+         AS0 = ALPHAS/4d0/PI 
+         IF(IMODEV.EQ.1)THEN 
+            CALL LH_FFN(q2TH(4),alphas,ipt,LH_AlphaExactBeta,NFF) 
+         ELSEIF(IMODEV.EQ.0)THEN 
+            CALL LH_FFN(q2TH(4),alphas,ipt,LH_AlphaMZ,NFF) 
+         ENDIF 
+         ASC = ALPHAS/4d0/PI 
+         IF(IMODEV.EQ.1)THEN 
+            CALL LH_FFN(q2TH(5),alphas,ipt,LH_AlphaExactBeta,NFF) 
+         ELSEIF(IMODEV.EQ.0)THEN 
+            CALL LH_FFN(q2TH(5),alphas,ipt,LH_AlphaMZ,NFF) 
+         ENDIF 
+         ASB = ALPHAS/4d0/PI 
+         IF(IMODEV.EQ.1)THEN 
+            CALL LH_FFN(q2TH(6),alphas,ipt,LH_AlphaExactBeta,NFF) 
+         ELSEIF(IMODEV.EQ.0)THEN 
+            CALL LH_FFN(q2TH(6),alphas,ipt,LH_AlphaMZ,NFF) 
+         ENDIF 
+         AST = ALPHAS/4d0/PI 
+      ELSE 
+         IF(IMODEV.EQ.1)THEN 
+            CALL LH_VFN(q20,alphas,ipt,LH_AlphaExactBeta) 
+         ELSEIF(IMODEV.EQ.0)THEN 
+            CALL LH_VFN(q20,alphas,ipt,LH_AlphaMZ) 
+         ENDIF 
+         AS0 = ALPHAS/4d0/PI 
+         IF(IMODEV.EQ.1)THEN 
+            CALL LH_VFN(q2TH(4),alphas,ipt,LH_AlphaExactBeta) 
+         ELSEIF(IMODEV.EQ.0)THEN 
+            CALL LH_VFN(q2TH(4),alphas,ipt,LH_AlphaMZ) 
+         ENDIF 
+         ASC = ALPHAS/4d0/PI 
+         IF(IMODEV.EQ.1)THEN 
+            CALL LH_VFN(q2TH(5),alphas,ipt,LH_AlphaExactBeta) 
+         ELSEIF(IMODEV.EQ.0)THEN 
+            CALL LH_VFN(q2TH(5),alphas,ipt,LH_AlphaMZ) 
+         ENDIF 
+         ASB = ALPHAS/4d0/PI 
+         IF(IMODEV.EQ.1)THEN 
+            CALL LH_VFN(q2TH(6),alphas,ipt,LH_AlphaExactBeta) 
+         ELSEIF(IMODEV.EQ.0)THEN 
+            CALL LH_VFN(q2TH(6),alphas,ipt,LH_AlphaMZ) 
+         ENDIF 
+         AST = ALPHAS/4d0/PI 
+      ENDIF 
+!                                                                       
+      ASQ = 0.d0 
+!                                                                       
+      RETURN 
+      END                                           
+                                                                        
+!****                                                                   
+! 2 *-------------------------------------------------------------------
+!****                                                                   
+      FUNCTION alphaNNPDF(QQ) 
+      IMPLICIT none 
+!                                                                       
+      INTEGER nff 
+      INTEGER ipt,imodev,ivfn,itmc 
+      COMMON/NNPDF10EVFLAGS/ipt,imodev,ivfn,itmc 
+!                                                                       
+      REAL*8 alphaNNPDF 
+      REAL*8 qq,qq2 
+      REAL*8 alphas,LH_AlphaExactBeta,LH_AlphaMZ 
+      EXTERNAL LH_AlphaExactBeta,LH_AlphaMZ 
+!                                                                       
+      qq2 = qq**2. 
+      CALL lh_evolinit 
+!                                                                       
+      IF(ivfn.eq.0)THEN
+         WRITE(*,*)"FFN not available!"
+         NFF = 3
+         IF(imodev.eq.1)THEN 
+            CALL LH_FFN(qq2,alphas,ipt,LH_AlphaExactBeta,NFF) 
+         ELSEIF(imodev.eq.0)THEN 
+            CALL LH_FFN(qq2,alphas,ipt,LH_AlphaMZ,NFF) 
+         ENDIF 
+      ELSEIF(ivfn.EQ.1)THEN 
+         IF (imodev.EQ.1)THEN 
+            CALL LH_VFN(qq2,alphas,ipt,LH_AlphaExactBeta) 
+         ELSEIF(imodev.EQ.0)THEN 
+            CALL LH_VFN(qq2,alphas,ipt,LH_AlphaMZ) 
+         ENDIF 
+      ENDIF 
+!                                                                       
+      alphaNNPDF = alphas 
+!                                                                       
+      RETURN 
+      END                                           
+                                                                        
+!                                                                       
+!     FFN: returns the value of alpha_s computed for Fixed              
+!          Flavour Number.                                              
+!     VFN: returns the value of alpha_s computed for Variable           
+!          Flavour Number.                                              
+!                                                                       
+      SUBROUTINE LH_FFN(q2,alphas,ipt,FUNC,nf) 
+      IMPLICIT none 
+!                                                                       
+      REAL*8 emc,zeta2,zeta3,zeta4,pi 
+      PARAMETER (pi    = 3.1415926535897932385) 
+      COMMON /NNPDF10CONSTS/ emc,zeta2,zeta3,zeta4 
+!                                                                       
+      REAL*8 q2th(4:6),asref,q2ref 
+      REAL*8 as0,asc,asb,ast,asq 
+      COMMON/nnpdf10VFNS/ q2th,asref,q2ref 
+      COMMON /NNPDF10AS/ as0,asc,asb,ast,asq 
+!                                                                       
+      INTEGER nf 
+      INTEGER ipt 
+      REAL*8  q2,qq2 
+      REAL*8  alphas,func,alphasref,qq2ref 
+!                                                                       
+      alphasref = asref 
+      qq2ref    = q2ref 
+      qq2       = q2 
+                                                                        
+      alphas = FUNC(nf,qq2ref,alphasref,qq2,ipt) 
+                                                                        
+      RETURN 
+      END                                           
+!                                                                       
+!                                                                       
+      SUBROUTINE LH_VFN(qq2,alphas,ipt,FUNC) 
+      IMPLICIT none 
+!
+      REAL*8 emc,zeta2,zeta3,zeta4,pi 
+      PARAMETER (pi    = 3.1415926535897932385) 
+      COMMON /NNPDF10CONSTS/ emc,zeta2,zeta3,zeta4 
+
+      REAL*8 q2th(4:6),asref,q2ref 
+      REAL*8 as0,asc,asb,ast,asq 
+      COMMON/nnpdf10VFNS/ q2th,asref,q2ref 
+      COMMON /NNPDF10AS/ as0,asc,asb,ast,asq 
+!
+      INTEGER nfi,nff,dnf,snf,ipt
+      double precision q2,qq2,FUNC,alphasref,qq2ref
+      double precision alphas,c2,asi
+!     c2 is the same coefficient used in eq. 2.42
+!     of hep-ph/0408244 and obtained in eq. 10 
+!     of hep-ph/9706430. In the following it is divided
+!     by (4*pi)^2 to match the notations
+      parameter(c2=14d0/3d0)
+      external FUNC
+
+      q2=qq2
+
+      if(q2.ge.q2th(6))then
+         nff=6
+      elseif(q2.ge.q2th(5))then
+         nff=5
+      elseif(q2.ge.q2th(4))then
+         nff=4
+      else
+         nff=3
+      endif
+      if(q2ref.gt.q2th(6))then
+         nfi=6
+      elseif(q2ref.gt.q2th(5))then
+         nfi=5
+      elseif(q2ref.gt.q2th(4))then
+         nfi=4
+      else
+         nfi=3
+      endif
+!
+      alphasref = asref
+      qq2ref = q2ref
+
+ 10   if(nff.eq.nfi) then
+         alphas = FUNC(nfi,qq2ref,alphasref,q2,ipt)
+         return
+      else
+         if(nff.gt.nfi)then
+            dnf=1
+            snf=1
+         else
+            dnf=-1
+            snf=0
+         endif
+         asi = FUNC(nfi,qq2ref,alphasref,q2th(nfi+snf),ipt)
+         if(ipt.ge.2)then
+            if(nff.gt.nfi) asi=asi+(c2/(4d0*pi)**2d0)*asi**3d0
+            if(nff.lt.nfi) asi=asi-(c2/(4d0*pi)**2d0)*asi**3d0
+         endif
+         alphasref = asi
+         qq2ref = q2th(nfi+snf)
+         nfi = nfi+dnf
+         goto 10
+      endif   
+      end
+!                                                                       
+!     FUNCS for the computation of alpha_s with diff methods            
+!     - AlphaMZ: computes alpha_s as function of alpha_s at a given     
+!                refernce scale.                                        
+!     - AlphaExactBeta: Exact solution of the QCD beta function         
+!                       equation using fourth order Runge-Kutta         
+!                       algorithm.                                      
+!                                                                       
+      FUNCTION LH_AlphaMZ(nfi,mz2,asz,q2,ipt) 
+      IMPLICIT none 
+!                                                                       
+      REAL*8 emc,zeta2,zeta3,zeta4,pi 
+      PARAMETER (pi    = 3.1415926535897932385) 
+      COMMON /NNPDF10CONSTS/ emc,zeta2,zeta3,zeta4 
+!                                                                       
+      REAL*8 beta0(3:6),beta1(3:6),beta2(3:6) 
+      REAL*8 b1(3:6),b2(3:6) 
+      COMMON/nnpdf10BETA/beta0,beta1,beta2,b1,b2 
+!                                                                       
+      INTEGER nfi,ipt 
+      REAL*8 q2ref,q2,asi,asref 
+      REAL*8 alo,t,as,den,mz2,asz,LH_AlphaMZ 
+                                                                        
+      q2ref = mz2 
+      asref = asz/4./pi 
+      asi = asref 
+      t   = log(q2/q2ref) 
+      den = 1.+beta0(nfi)*asi*t 
+      alo = asi/den 
+                                                                        
+!     LO                                                                
+      as = alo 
+                                                                        
+!     NLO                                                               
+      IF(ipt.GE.1) as = alo*(1-b1(nfi)*alo*log(den)) 
+                                                                        
+!     NNLO                                                              
+      IF(ipt.GE.2)THEN 
+         as = alo*(1.+(alo*(alo-asi)*(b2(nfi)-b1(nfi)**2.)              &
+     &        +as*b1(nfi)*dlog(as/asi)))                                
+      ENDIF 
+!                                                                       
+      LH_AlphaMZ = 4d0*pi*as 
+!                                                                       
+      RETURN 
+      END                                           
+!                                                                       
+!                                                                       
+      FUNCTION LH_AlphaExactBeta(nf,r20,as0,r2,ipt) 
+!                                                                       
+      REAL*8 emc,zeta2,zeta3,zeta4,pi 
+      PARAMETER (pi    = 3.1415926535897932385) 
+      COMMON /NNPDF10CONSTS/ emc,zeta2,zeta3,zeta4 
+!                                                                       
+      REAL*8 beta0(3:6),beta1(3:6),beta2(3:6) 
+      REAL*8 b1(3:6),b2(3:6) 
+      COMMON/nnpdf10BETA/beta0,beta1,beta2,b1,b2 
+!                                                                       
+      INTEGER NFMIN, NFMAX, NF, NSTEP, K1,ipt,nnf 
+      REAL*8 LH_fbeta,LH_AlphaExactBeta 
+      REAL*8 as,as0,r20,r2 
+      REAL*8 dlr,lrrat,sxth 
+      REAL*8 xk0,xk1,xk2,xk3 
+                                                                        
+      PARAMETER (NFMIN = 3, NFMAX = 6) 
+      PARAMETER (NSTEP=50) 
+      PARAMETER (SXTH = 0.166666666666666D0 ) 
+!                                                                       
+      NNF = NF 
+      AS0 = AS0/4./pi 
+      AS  = AS0 
+      LRRAT = dLOG (R2/R20) 
+      DLR   = LRRAT / NSTEP 
+!                                                                       
+!     ..Solution of the evolution equation depending on  NAORD          
+!   (fourth-order Runge-Kutta beyond the leading order)                 
+      IF (IPT.EQ.0) THEN 
+         AS = AS0 / (1d0+ BETA0(NF) * AS0 * LRRAT) 
+      ELSE IF (IPT.EQ.1) THEN 
+         DO 2 K1 = 1, NSTEP 
+            XK0 = DLR * LH_FBETA (AS,NNF,IPT) 
+            XK1 = DLR * LH_FBETA (AS + 0.5d0 * XK0,NNF,IPT) 
+            XK2 = DLR * LH_FBETA (AS + 0.5d0 * XK1,NNF,IPT) 
+            XK3 = DLR * LH_FBETA (AS + XK2,NNF,IPT) 
+            AS = AS + SXTH * (XK0 + 2d0* XK1 + 2d0* XK2 + XK3) 
+    2     CONTINUE 
+      ELSE IF (IPT.EQ.2) THEN 
+         DO 3 K1 = 1, NSTEP 
+            XK0 = DLR * LH_FBETA (AS,nnf,ipt) 
+            XK1 = DLR * LH_FBETA (AS + 0.5d0 * XK0,nnf,ipt) 
+            XK2 = DLR * LH_FBETA (AS + 0.5d0 * XK1,nnf,ipt) 
+            XK3 = DLR * LH_FBETA (AS + XK2,nnf,ipt) 
+            AS = AS + SXTH * (XK0 + 2d0* XK1 + 2d0* XK2 + XK3) 
+    3    CONTINUE 
+      END IF 
+                                                                        
+      LH_alphaexactbeta = as*(4d0*pi) 
+                                                                        
+      RETURN 
+      END                                           
+!                                                                       
+      FUNCTION LH_fbeta(a,nf,ipt) 
+      IMPLICIT none 
+!                                                                       
+      REAL*8 beta0(3:6),beta1(3:6),beta2(3:6) 
+      REAL*8 b1(3:6),b2(3:6) 
+      COMMON/nnpdf10BETA/beta0,beta1,beta2,b1,b2 
+!                                                                       
+      REAL*8 lh_fbeta,a 
+      INTEGER nf,ipt 
+                                                                        
+      IF(ipt.EQ.1)THEN 
+         LH_FBETA = - A**2d0 * ( BETA0(NF) + A * BETA1(NF) ) 
+      ELSEIF(ipt.EQ.2)THEN 
+         LH_FBETA = - A**2d0 * ( BETA0(NF) + A * ( BETA1(NF)            &
+     &     + A * BETA2(NF) ) )                                          
+      ENDIF 
+                                                                        
+      RETURN 
+      END                                           
+!                                                                       
+!     Find \LambdaQCD(nf) from the reference scale                      
+!     Needed for LHAPDF interface                                       
+!                                                                       
+      function LH_LAMBDAZ(NF) 
+      implicit none 
+!                                                                       
+      REAL*8 emc,zeta2,zeta3,zeta4,pi 
+      PARAMETER (pi    = 3.1415926535897932385) 
+      COMMON /NNPDF10CONSTS/ emc,zeta2,zeta3,zeta4 
+!                                                                       
+      REAL*8 beta0(3:6),beta1(3:6),beta2(3:6) 
+      REAL*8 b1(3:6),b2(3:6) 
+      COMMON/nnpdf10BETA/beta0,beta1,beta2,b1,b2 
+!                                                                       
+      REAL*8 q2th(4:6),asref,q2ref 
+      REAL*8 as0,asc,asb,ast,asq 
+      COMMON/nnpdf10VFNS/ q2th,asref,q2ref 
+      COMMON /NNPDF10AS/ as0,asc,asb,ast,asq 
+!                                                                       
+      INTEGER nf,i 
+      REAL*8 LH_lambdaz 
+      REAL*8 aref,lambda5sq,lambdaz5,qth(4:6) 
+!                                                                       
+      AREF = ASREF /(4.d0*PI) 
+      DO I= 3,6 
+         QTH(i) = dsqrt(Q2TH(I)) 
+      ENDDO 
+!                                                                       
+      LAMBDA5SQ = Q2REF * DEXP(-1d0/(BETA0(5)*AREF)                     &
+     &     - (BETA1(5)/BETA0(5)**2d0)                                   &
+     &     * DLOG(BETA1(5)*AREF/(BETA0(5)+BETA1(5)*AREF)))              
+      LAMBDAZ5 = DSQRT(LAMBDA5SQ) 
+      IF(NF.EQ.5)THEN 
+         LH_LAMBDAZ = LAMBDAZ5 
+      ELSEIF(NF.EQ.6)THEN 
+                               !!!!!! add formula!!!!                   
+         LH_LAMBDAZ = LAMBDAZ5 
+      ELSEIF(NF.LE.4)THEN 
+         LH_LAMBDAZ = LAMBDAZ5 * ((QTH(5)/LAMBDAZ5)**(2d0/25d0))        &
+     &        * dLOG(Q2TH(5)/LAMBDA5SQ)**(963d0/14375d0)                
+      ENDIF 
+                                                                        
+!                                                                       
+      RETURN 
+      END                                           
+!****                                                                   
+! 3 *-------------------------------------------------------------------
+!****                                                                   
+!                                                                       
+!     evolfactx: Computes the ev. kernels in x-space.(DIFF FROM CODE!! N
+!                                                                       
+      SUBROUTINE LH_EVOLFACTX(obs,x) 
+      IMPLICIT none 
+!                                                                       
+      INTEGER npoints 
+      PARAMETER(npoints=2**8) 
+      INTEGER IPT,IMODEV,IVFN,ITMC 
+      COMMON /NNPDF10EVFLAGS/ IPT,IMODEV,IVFN,ITMC 
+      INTEGER ieval,niter,nmax 
+      COMMON /nnpdf10NGRID/ ieval,niter,nmax 
+      REAL*8 xmin,xm1,xm2,xmax 
+      COMMON/nnpdf10GRID/xmin,xm1,xm2,xmax 
+!                                                                       
+                                             ! NO MORE FNCTS OF NDATA   
+      REAL*8 gm2ns(4),gm2ns24(2),gm2sg(2,2) 
+      COMMON /nnpdf10GM2/gm2ns,gm2ns24,gm2sg 
+      REAL*8 xx(NPOINTS),wn(NPOINTS),evkns(4,NPOINTS),                  &
+     &     evksg(2,2,NPOINTS),evkns24(2,NPOINTS)                        
+      COMMON /nnpdf10XEVK/ xx,wn,evkns,evksg,evkns24 
+!                                                                       
+      REAL*8 q20,q2 
+      COMMON/nnpdf10EVSCALE/q20,q2 
+      REAL*8 q2th(4:6),asref,q2ref 
+      REAL*8 as0,asc,asb,ast,asq 
+      COMMON/nnpdf10VFNS/ q2th,asref,q2ref 
+      COMMON /NNPDF10AS/ as0,asc,asb,ast,asq 
+!                                                                       
+      INTEGER j,obs 
+      REAL*8 x 
+      REAL*8 flx 
+      REAL*8 LH_gamm2ns,LH_gamm2sg,LH_gamm2ns24 
+      REAL*8 xxtmp(NPOINTS),wtmp(NPOINTS) 
+      REAL*8 LH_gammax_nsp,LH_gammax_nsm,LH_gammax_nsvu,LH_gammax_nsvd 
+      REAL*8 LH_gammax_ns24q,LH_gammax_ns24g 
+      REAL*8 LH_gammax_qq, LH_gammax_qg, LH_gammax_gq, LH_gammax_gg 
+!                                                                       
+      flx=0.2d0 
+      if(ipt.eq.2)flx=0.3d0 
+!                                                                       
+      do j=1,NPOINTS 
+         xxtmp(j)=0.d0 
+         wtmp(j)=0.d0 
+      enddo 
+!                                                                       
+      call LH_xgrid(x,xm1,xm2,xmax,flx,niter,xxtmp,wtmp,nmax) 
+!                                                                       
+      DO j=1,NMAX 
+         xx(j)          = xxtmp(j) 
+         wn(j)          = wtmp(j) 
+         evkns(1,j)     = LH_gammax_nsp(xx(j),Q20,Q2) 
+         evkns(2,j)     = LH_gammax_nsm(xx(j),Q20,Q2) 
+         evkns(3,j)     = LH_gammax_nsvu(xx(j),Q20,Q2) 
+         evkns(4,j)     = LH_gammax_nsvd(xx(j),Q20,Q2) 
+         evkns24(1,j)   = LH_gammax_ns24q(xx(j),Q20,Q2) 
+         evkns24(2,j)   = LH_gammax_ns24g(xx(j),Q20,Q2) 
+         evksg(1,1,j)   = LH_gammax_qq(xx(j),Q20,Q2) 
+         evksg(1,2,j)   = LH_gammax_qg(xx(j),Q20,Q2) 
+         evksg(2,1,j)   = LH_gammax_gq(xx(j),Q20,Q2) 
+         evksg(2,2,j)   = LH_gammax_gg(xx(j),Q20,Q2) 
+      ENDDO 
+!                                                                       
+      gm2ns(1)     = LH_gamm2ns(1,x,Q20,Q2) 
+      gm2ns(2)     = LH_gamm2ns(2,x,Q20,Q2) 
+      gm2ns(3)     = LH_gamm2ns(3,x,Q20,Q2) 
+      gm2ns(4)     = LH_gamm2ns(4,x,Q20,Q2) 
+      gm2ns24(1)   = LH_gamm2ns24(1,x,Q20,Q2) 
+      gm2ns24(2)   = LH_gamm2ns24(2,x,Q20,Q2) 
+      gm2sg(1,1)   = LH_gamm2sg(1,1,x,Q20,Q2) 
+      gm2sg(1,2)   = LH_gamm2sg(1,2,x,Q20,Q2) 
+      gm2sg(2,1)   = LH_gamm2sg(2,1,x,Q20,Q2) 
+      gm2sg(2,2)   = LH_gamm2sg(2,2,x,Q20,Q2) 
+!                                                                       
+      RETURN 
+      END                                           
+!****                                                                   
+! 4 *------------------------------------------------------------------ 
+!****                                                                   
+!                                                                       
+!     Gives the pts in x for the convolution grid                       
+!                                                                       
+                                                                        
+      SUBROUTINE LH_xgrid(xmin,xmm1,xmm2,xmax,flx,NITER,xx,wn,NMAX) 
+!                                                                       
+      IMPLICIT none 
+!                                                                       
+      INTEGER npoints 
+      PARAMETER(npoints=2**8) 
+      INTEGER NINT,NINT1,NINT2,NINT3 
+      INTEGER ntmp,NITER,NGAUSS,NMAX 
+      PARAMETER(NGAUSS=4) 
+      INTEGER i,k,ii,k2,k3 
+      REAL*8 xmin,xmax,xm1,rtmp,xdum,xm2,xmm2,flx,xmm1 
+      REAL*8 sum,diff,z 
+      REAL*8 xx(NPOINTS),wn(NPOINTS) 
+      REAL*8 down(NPOINTS),up(NPOINTS) 
+      REAL*8 ZS(NGAUSS),WZ(NGAUSS) 
+!                                                                       
+      DATA WZ                                                           &
+     &       / 0.347854845137454D0,                                  &
+     &         0.652145154862546D0,                                  &
+     &         0.652145154862546D0,                                  &
+     &         0.347854845137454D0/                                  
+                                                                        
+      DATA ZS                                                           &
+     &       / -0.861136311594053D0,                                 &
+     &         -0.339981043584856D0,                                 &
+     &          0.339981043584856D0,                                 &
+     &          0.861136311594053D0 /                                
+                                                                        
+      k=0 
+                                                                        
+      xm1=xmm1 
+                                                                        
+      DO ii=0,NITER 
+                                                                        
+!     X < 0.99: 3 kind of division                                      
+                                                                        
+         IF(xmin.lt.xmm2)THEN 
+                                                                        
+            NINT=2**ii 
+            NINT3=int(flx*NINT) 
+            xm2=xmm2 
+            if(NINT3.lt.1)xm2=xmax 
+                                                                        
+            if(xmin.lt.xm1)then 
+               rtmp=abs((dlog(xm1-xmin))/(xm2-xmin)) 
+               ntmp=int(NINT/rtmp) 
+               NINT1=ntmp 
+            else 
+               NINT1=0 
+            endif 
+                                                                        
+            NINT2=NINT-NINT1-NINT3 
+                                                                        
+            if(xmin.le.xm1)then 
+               do i=1,NINT1 
+                  xdum=xmin*(xm1/xmin)**(dble(i-1)/dble(NINT1)) 
+                  down(i)=xdum 
+               enddo 
+            endif 
+                                                                        
+            if(xmin.gt.xm1)xm1=xmin 
+            if(xmin.le.xm1)then 
+               do i=1,NINT2 
+                  xdum=xm1+(xm2-xm1)*(dble(i-1)/dble(NINT2)) 
+                  down(i+NINT1)=xdum 
+               enddo 
+            endif 
+                                                                        
+            do i=1,NINT3 
+               xdum=1.d0-(1.d0-xm2)*((1.d0-xmax)/                       &
+     &              (1.d0-xm2))**(dble(i-1)/dble(NINT3))                
+               down(i+NINT1+NINT2)=xdum 
+            enddo 
+                                                                        
+!     X>= 0.99: only intervals logarithmic in log(1-x)                  
+         ELSE 
+!                                                                       
+            NINT = 2**ii 
+                                                                        
+            DO i=1,NINT 
+               xdum=1.d0-(1.d0-xmin)*((1.d0-xmax)/                      &
+     &              (1.d0-xmin))**(dble(i-1)/dble(NINT))                
+               down(i)=xdum 
+            ENDDO 
+                                                                        
+         ENDIF 
+                                                                        
+         do i = 2, NINT 
+            up(i-1) = down(i) 
+         enddo 
+         up(NINT)  = xmax 
+                                                                        
+         DO K2 = 1, NINT 
+            SUM  = UP(K2) + DOWN(K2) 
+            DIFF = UP(K2) - DOWN(K2) 
+            DO K3 = 1, NGAUSS 
+               K = K + 1 
+               Z = (SUM + DIFF * ZS(K3)) * 0.5d0 
+               WN(K) = DIFF * 0.5d0 * WZ(K3) 
+               xx(K) = Z 
+               IF(Z.LT.XMIN)WRITE(*,*)"WARNING",K,XX(K),k2,DOWN(K2),UP(K2)                                 
+            ENDDO 
+         ENDDO 
+                                                                        
+!                                                                       
+      ENDDO 
+!                                                                       
+      NMAX=k 
+!                                                                       
+      RETURN 
+      END                                           
+!                                                                       
+!****                                                                   
+! 5 *-------------------------------------------------------------------
+!****                                                                   
+!                                                                       
+!     File: gammax.f                                                    
+!     Contains the functions to compute x*Gamma(x,Q2i,Q2f) as           
+!     Mellin inversions of the evolution operators computed             
+!     in N-space.                                                       
+!                                                                       
+      FUNCTION LH_gammax_nsp(x,Q2i,Q2f) 
+      IMPLICIT none 
+      REAL*8 LH_gammax_nsp 
+      REAL*8 x,Q2i,Q2f 
+      REAL*8 evpdf 
+                                                                        
+      call LH_fixedtalbot_nsp(evpdf,x,Q2i,Q2f) 
+      LH_gammax_nsp = x*evpdf 
+                                                                        
+      RETURN 
+      END                                           
+!                                                                       
+      FUNCTION LH_gammax_nsm(x,Q2i,Q2f) 
+      IMPLICIT none 
+      REAL*8 LH_gammax_nsm 
+      REAL*8 x,Q2i,Q2f 
+      REAL*8 evpdf 
+                                                                        
+      call LH_fixedtalbot_nsm(evpdf,x,Q2i,Q2f) 
+      LH_gammax_nsm = x*evpdf 
+                                                                        
+      RETURN 
+      END                                           
+!                                                                       
+      FUNCTION LH_gammax_nsvu(x,Q2i,Q2f) 
+      IMPLICIT none 
+      REAL*8 LH_gammax_nsvu 
+      REAL*8 x,Q2i,Q2f 
+      REAL*8 evpdf 
+                                                                        
+      call LH_fixedtalbot_nsvu(evpdf,x,Q2i,Q2f) 
+      LH_gammax_nsvu = x*evpdf 
+                                                                        
+      RETURN 
+      END                                           
+!                                                                       
+      FUNCTION LH_gammax_nsvd(x,Q2i,Q2f) 
+      IMPLICIT none 
+      REAL*8 LH_gammax_nsvd 
+      REAL*8 x,Q2i,Q2f 
+      REAL*8 evpdf 
+                                                                        
+      call LH_fixedtalbot_nsvd(evpdf,x,Q2i,Q2f) 
+                                                                        
+      LH_gammax_nsvd = x*evpdf 
+                                                                        
+      RETURN 
+      END                                           
+!                                                                       
+      FUNCTION LH_gammax_ns24q(x,Q2i,Q2f) 
+      IMPLICIT none 
+      REAL*8 LH_gammax_ns24q 
+      REAL*8 x,Q2i,Q2f 
+      REAL*8 evpdf 
+                                                                        
+      call LH_fixedtalbot_ns24q(evpdf,x,Q2i,Q2f) 
+                                                                        
+      LH_gammax_ns24q = x*evpdf 
+                                                                        
+      RETURN 
+      END                                           
+!                                                                       
+      FUNCTION LH_gammax_ns24g(x,Q2i,Q2f) 
+      IMPLICIT none 
+      REAL*8 LH_gammax_ns24g 
+      REAL*8 x,Q2i,Q2f 
+      REAL*8 evpdf 
+                                                                        
+      call LH_fixedtalbot_ns24g(evpdf,x,Q2i,Q2f) 
+                                                                        
+      LH_gammax_ns24g = x*evpdf 
+                                                                        
+      RETURN 
+      END                                           
+!                                                                       
+      FUNCTION LH_gammax_qq(x,Q2i,Q2f) 
+      IMPLICIT none 
+      REAL*8 LH_gammax_qq 
+      REAL*8 x,Q2i,Q2f 
+      REAL*8 evpdf 
+                                                                        
+      call LH_fixedtalbot_qq(evpdf,x,Q2i,Q2f) 
+                                                                        
+      LH_gammax_qq = x*evpdf 
+                                                                        
+      RETURN 
+      END                                           
+!                                                                       
+      FUNCTION LH_gammax_qg(x,Q2i,Q2f) 
+      IMPLICIT none 
+      REAL*8 LH_gammax_qg 
+      REAL*8 x,Q2i,Q2f 
+      REAL*8 evpdf 
+                                                                        
+      call LH_fixedtalbot_qg(evpdf,x,Q2i,Q2f) 
+                                                                        
+      LH_gammax_qg = x*evpdf 
+                                                                        
+      RETURN 
+      END                                           
+!                                                                       
+      FUNCTION LH_gammax_gq(x,Q2i,Q2f) 
+      IMPLICIT none 
+      REAL*8 LH_gammax_gq 
+      REAL*8 x,Q2i,Q2f 
+      REAL*8 evpdf 
+                                                                        
+      call LH_fixedtalbot_gq(evpdf,x,Q2i,Q2f) 
+                                                                        
+      LH_gammax_gq = x*evpdf 
+                                                                        
+      RETURN 
+      END                                           
+!                                                                       
+      FUNCTION LH_gammax_gg(x,Q2i,Q2f) 
+      IMPLICIT none 
+      REAL*8 LH_gammax_gg 
+      REAL*8 x,Q2i,Q2f 
+      REAL*8 evpdf 
+                                                                        
+      call LH_fixedtalbot_gg(evpdf,x,Q2i,Q2f) 
+                                                                        
+      LH_gammax_gg = x*evpdf 
+                                                                        
+      RETURN 
+      END                                           
+!                                                                       
+!     Fixed Talbot algorithm                                            
+                                                                        
+      SUBROUTINE LH_fixedtalbot_nsp(xfunc,x,Q2i,Q2f) 
+      IMPLICIT none 
+                                                                        
+      REAL*8 x,xfunc 
+      REAL*8 Q2i,Q2f 
+      integer m,j 
+      REAL*8 theta,pi,sigma,t,tmp,r 
+      COMPLEX*16 s,s1,tmp2,zpdfns(4),zpdfsg(2,2),ZPDFNS24(2) 
+                                                                        
+      pi=acos(-1d0) 
+      m = 16 
+      t=-dlog(x) 
+                                                                        
+      tmp  = 0d0 
+      tmp2 = 0d0 
+                                                                        
+      r=2d0*m/5d0/t 
+                                                                        
+      do j=1,m-1 
+         theta = dble(j)*pi/dble(m) 
+         sigma=theta+(theta/tan(theta)-1d0)/tan(theta) 
+         s=r*theta*DCMPLX(1d0/tan(theta),1d0) 
+         s1 = s + (1d0,0d0) 
+         call LH_ZFUNC(s1,x,Q2i,Q2f,ZPDFNS,ZPDFNS24,ZPDFSG) 
+         tmp2=exp(t*s1)*DCMPLX(1d0,sigma)*zpdfns(1) 
+         tmp=tmp+dreal(tmp2) 
+      enddo 
+                                                                        
+      call LH_zfunc(DCMPLX(r+1d0,0d0),x,Q2i,Q2f,ZPDFNS,ZPDFNS24,ZPDFSG) 
+                                                                        
+      xfunc=r/m*(tmp+.5d0*exp((r+1d0)*t)*dreal(zpdfns(1))) 
+                                                                        
+      RETURN 
+      END                                           
+!                                                                       
+      SUBROUTINE LH_fixedtalbot_nsm(xfunc,x,Q2i,Q2f) 
+      IMPLICIT none 
+                                                                        
+      REAL*8 x,xfunc 
+      REAL*8 Q2i,Q2f 
+      integer m,j 
+      REAL*8 theta,pi,sigma,t,tmp,r 
+      COMPLEX*16 s,s1,tmp2,zpdfns(4),zpdfsg(2,2),ZPDFNS24(2) 
+                                                                        
+      pi=acos(-1d0) 
+      m = 16 
+                                                                        
+      t=-dlog(x) 
+                                                                        
+      tmp  = 0d0 
+      tmp2 = 0d0 
+                                                                        
+      r=2d0*m/5d0/t 
+                                                                        
+      do j=1,m-1 
+         theta = dble(j)*pi/dble(m) 
+         sigma=theta+(theta/tan(theta)-1d0)/tan(theta) 
+         s=r*theta*DCMPLX(1d0/tan(theta),1d0) 
+         s1 = s + (1d0,0d0) 
+         call LH_zfunc(s1,x,Q2i,Q2f,ZPDFNS,ZPDFNS24,ZPDFSG) 
+         tmp2=exp(t*s1)*DCMPLX(1d0,sigma)*zpdfns(2) 
+         tmp=tmp+dreal(tmp2) 
+      enddo 
+      call LH_zfunc(DCMPLX(r+1d0,0d0),x,Q2i,Q2f,ZPDFNS,ZPDFNS24,ZPDFSG) 
+                                                                        
+      xfunc=r/m*(tmp+.5d0*exp((r+1d0)*t)*dreal(zpdfns(2))) 
+                                                                        
+      RETURN 
+      END                                           
+!                                                                       
+      SUBROUTINE LH_fixedtalbot_nsvu(xfunc,x,Q2i,Q2f) 
+      IMPLICIT none 
+                                                                        
+      REAL*8 x,xfunc 
+      REAL*8 Q2i,Q2f 
+      integer m,j 
+      REAL*8 theta,pi,sigma,t,tmp,r 
+      COMPLEX*16 s,s1,tmp2,zpdfns(4),zpdfsg(2,2),ZPDFNS24(2) 
+                                                                        
+      pi=acos(-1d0) 
+      m = 16 
+                                                                        
+      t=-dlog(x) 
+                                                                        
+      tmp  = 0d0 
+      tmp2 = 0d0 
+                                                                        
+      r=2d0*m/5d0/t 
+                                                                        
+      do j=1,m-1 
+         theta = dble(j)*pi/dble(m) 
+         sigma=theta+(theta/tan(theta)-1d0)/tan(theta) 
+         s=r*theta*DCMPLX(1d0/tan(theta),1d0) 
+         s1 = s + (1d0,0d0) 
+         call LH_zfunc(s1,x,Q2i,Q2f,ZPDFNS,ZPDFNS24,ZPDFSG) 
+         tmp2=exp(t*s1)*DCMPLX(1d0,sigma)*zpdfns(3) 
+         tmp=tmp+dreal(tmp2) 
+      enddo 
+                                                                        
+      call LH_zfunc(DCMPLX(r+1d0,0d0),x,Q2i,Q2f,ZPDFNS,ZPDFNS24,ZPDFSG) 
+                                                                        
+      xfunc=r/m*(tmp+.5d0*exp((r+1d0)*t)*dreal(zpdfns(3))) 
+                                                                        
+      RETURN 
+      END                                           
+!                                                                       
+      SUBROUTINE LH_fixedtalbot_nsvd(xfunc,x,Q2i,Q2f) 
+      IMPLICIT none 
+                                                                        
+      REAL*8 x,xfunc 
+      REAL*8 Q2i,Q2f 
+      integer m,j 
+      REAL*8 theta,pi,sigma,t,tmp,r 
+      COMPLEX*16 s,s1,tmp2,zpdfns(4),zpdfsg(2,2),ZPDFNS24(2) 
+                                                                        
+      pi=acos(-1d0) 
+      m = 16 
+                                                                        
+      t=-dlog(x) 
+                                                                        
+      tmp  = 0d0 
+      tmp2 = 0d0 
+                                                                        
+      r=2d0*m/5d0/t 
+                                                                        
+      do j=1,m-1 
+         theta = dble(j)*pi/dble(m) 
+         sigma=theta+(theta/tan(theta)-1d0)/tan(theta) 
+         s=r*theta*DCMPLX(1d0/tan(theta),1d0) 
+         s1 = s + (1d0,0d0) 
+         call LH_zfunc(s1,x,Q2i,Q2f,ZPDFNS,ZPDFNS24,ZPDFSG) 
+         tmp2=exp(t*s1)*DCMPLX(1d0,sigma)*zpdfns(4) 
+         tmp=tmp+dreal(tmp2) 
+      enddo 
+      call LH_zfunc(DCMPLX(r+1d0,0d0),x,Q2i,Q2f,ZPDFNS,ZPDFNS24,ZPDFSG) 
+                                                                        
+      xfunc=r/m*(tmp+.5d0*exp((r+1d0)*t)*dreal(zpdfns(4))) 
+                                                                        
+      RETURN 
+      END                                           
+!                                                                       
+      SUBROUTINE LH_fixedtalbot_ns24q(xfunc,x,Q2i,Q2f) 
+      IMPLICIT none 
+                                                                        
+      REAL*8 x,xfunc 
+      REAL*8 Q2i,Q2f 
+      integer m,j 
+      REAL*8 theta,pi,sigma,t,tmp,r 
+      COMPLEX*16 s,s1,tmp2,zpdfns(4),zpdfsg(2,2),ZPDFNS24(2) 
+                                                                        
+      pi=acos(-1d0) 
+      m=16 
+                                                                        
+      t=-dlog(x) 
+                                                                        
+      tmp  = 0d0 
+      tmp2 = 0d0 
+                                                                        
+      r=2d0*m/5d0/t 
+                                                                        
+      do j=1,m-1 
+         theta = dble(j)*pi/dble(m) 
+         sigma=theta+(theta/tan(theta)-1d0)/tan(theta) 
+         s=r*theta*DCMPLX(1d0/tan(theta),1d0) 
+         s1 = s + (1d0,0d0) 
+         call LH_ZFUNC(s1,x,Q2i,Q2f,ZPDFNS,ZPDFNS24,ZPDFSG) 
+         tmp2=exp(t*s1)*DCMPLX(1d0,sigma)*zpdfns24(1) 
+         tmp=tmp+dreal(tmp2) 
+      enddo 
+      call LH_zfunc(DCMPLX(r+1d0,0d0),x,Q2i,Q2f,ZPDFNS,ZPDFNS24,ZPDFSG) 
+                                                                        
+      xfunc=r/m*(tmp+.5d0*exp((r+1d0)*t)*dreal(zpdfns24(1))) 
+                                                                        
+      RETURN 
+      END                                           
+!                                                                       
+      SUBROUTINE LH_fixedtalbot_ns24g(xfunc,x,Q2i,Q2f) 
+      IMPLICIT none 
+                                                                        
+      REAL*8 x,xfunc 
+      REAL*8 Q2i,Q2f 
+      integer m,j 
+      REAL*8 theta,pi,sigma,t,tmp,r 
+      COMPLEX*16 s,s1,tmp2,zpdfns(4),zpdfsg(2,2),ZPDFNS24(2) 
+                                                                        
+      pi=acos(-1d0) 
+      m=16 
+                                                                        
+      t=-dlog(x) 
+                                                                        
+      tmp  = 0d0 
+      tmp2 = 0d0 
+                                                                        
+      r=2d0*m/5d0/t 
+                                                                        
+      do j=1,m-1 
+         theta = dble(j)*pi/dble(m) 
+         sigma=theta+(theta/tan(theta)-1d0)/tan(theta) 
+         s=r*theta*DCMPLX(1d0/tan(theta),1d0) 
+         s1 = s + (1d0,0d0) 
+         call LH_ZFUNC(s1,x,Q2i,Q2f,ZPDFNS,ZPDFNS24,ZPDFSG) 
+         tmp2=exp(t*s1)*DCMPLX(1d0,sigma)*zpdfns24(2) 
+         tmp=tmp+dreal(tmp2) 
+      enddo 
+      call LH_zfunc(DCMPLX(r+1d0,0d0),x,Q2i,Q2f,ZPDFNS,ZPDFNS24,ZPDFSG) 
+                                                                        
+      xfunc=r/m*(tmp+.5d0*exp((r+1d0)*t)*dreal(zpdfns24(2))) 
+                                                                        
+      RETURN 
+      END                                           
+!                                                                       
+      SUBROUTINE LH_fixedtalbot_qq(xfunc,x,Q2i,Q2f) 
+      IMPLICIT none 
+                                                                        
+      REAL*8 x,xfunc 
+      REAL*8 Q2i,Q2f 
+      integer m,j 
+      REAL*8 theta,pi,sigma,t,tmp,r 
+      COMPLEX*16 s,s1,tmp2,zpdfns(4),zpdfsg(2,2),ZPDFNS24(2) 
+                                                                        
+      pi=acos(-1d0) 
+      m=16 
+                                                                        
+      t=-dlog(x) 
+                                                                        
+      tmp  = 0d0 
+      tmp2 = 0d0 
+                                                                        
+      r=2d0*m/5d0/t 
+                                                                        
+      do j=1,m-1 
+         theta = dble(j)*pi/dble(m) 
+         sigma=theta+(theta/tan(theta)-1d0)/tan(theta) 
+         s=r*theta*DCMPLX(1d0/tan(theta),1d0) 
+         s1 = s + (1d0,0d0) 
+         call LH_zfunc(s1,x,q2i,q2f,zpdfns,ZPDFNS24,zpdfsg) 
+         tmp2=exp(t*s1)*DCMPLX(1d0,sigma)*zpdfsg(1,1) 
+         tmp=tmp+dreal(tmp2) 
+      enddo 
+      call LH_zfunc(DCMPLX(r+1d0,0d0),x,q2i,q2f,zpdfns,ZPDFNS24,zpdfsg) 
+                                                                        
+      xfunc=r/m*(tmp+.5d0*exp((r+1d0)*t)*dreal(zpdfsg(1,1))) 
+                                                                        
+      RETURN 
+      END                                           
+!                                                                       
+      SUBROUTINE LH_fixedtalbot_qg(xfunc,x,Q2i,Q2f) 
+      IMPLICIT none 
+                                                                        
+      REAL*8 x,xfunc 
+      REAL*8 Q2i,Q2f 
+      integer m,j 
+      REAL*8 theta,pi,sigma,t,tmp,r 
+      COMPLEX*16 s,s1,tmp2,zpdfns(4),zpdfsg(2,2),ZPDFNS24(2) 
+                                                                        
+      pi=acos(-1d0) 
+      m=16 
+                                                                        
+      t=-dlog(x) 
+                                                                        
+      tmp  = 0d0 
+      tmp2 = 0d0 
+                                                                        
+      r=2d0*m/5d0/t 
+                                                                        
+      do j=1,m-1 
+         theta = dble(j)*pi/dble(m) 
+         sigma=theta+(theta/tan(theta)-1d0)/tan(theta) 
+         s=r*theta*DCMPLX(1d0/tan(theta),1d0) 
+         s1 = s + (1d0,0d0) 
+         call LH_zfunc(s1,x,q2i,q2f,zpdfns,ZPDFNS24,zpdfsg) 
+         tmp2=exp(t*s1)*DCMPLX(1d0,sigma)*zpdfsg(1,2) 
+         tmp=tmp+dreal(tmp2) 
+      enddo 
+      call LH_zfunc(DCMPLX(r+1d0,0d0),x,q2i,q2f,zpdfns,ZPDFNS24,zpdfsg) 
+                                                                        
+      xfunc=r/m*(tmp+.5d0*exp((r+1d0)*t)*dreal(zpdfsg(1,2))) 
+                                                                        
+      return 
+      END                                           
+!                                                                       
+      SUBROUTINE LH_fixedtalbot_gq(xfunc,x,Q2i,Q2f) 
+      IMPLICIT none 
+                                                                        
+      REAL*8 x,xfunc 
+      REAL*8 Q2i,Q2f 
+      integer m,j 
+      REAL*8 theta,pi,sigma,t,tmp,r 
+      COMPLEX*16 s,s1,tmp2,zpdfns(4),zpdfsg(2,2),ZPDFNS24(2) 
+                                                                        
+      pi=acos(-1d0) 
+      m=16 
+                                                                        
+      t=-dlog(x) 
+                                                                        
+      tmp  = 0d0 
+      tmp2 = 0d0 
+                                                                        
+      r=2d0*m/5d0/t 
+                                                                        
+      do j=1,m-1 
+         theta = dble(j)*pi/dble(m) 
+         sigma=theta+(theta/tan(theta)-1d0)/tan(theta) 
+         s=r*theta*DCMPLX(1d0/tan(theta),1d0) 
+         s1 = s + (1d0,0d0) 
+         call LH_zfunc(s1,x,q2i,q2f,zpdfns,ZPDFNS24,zpdfsg) 
+         tmp2=exp(t*s1)*DCMPLX(1d0,sigma)*zpdfsg(2,1) 
+         tmp=tmp+dreal(tmp2) 
+      enddo 
+      call LH_zfunc(DCMPLX(r+1d0,0d0),x,Q2i,Q2f,zpdfns,ZPDFNS24,zpdfsg) 
+                                                                        
+      xfunc=r/m*(tmp+.5d0*exp((r+1d0)*t)*dreal(zpdfsg(2,1))) 
+                                                                        
+      return 
+      END                                           
+!                                                                       
+      SUBROUTINE LH_fixedtalbot_gg(xfunc,x,Q2i,Q2f) 
+      IMPLICIT none 
+                                                                        
+      REAL*8 x,xfunc 
+      REAL*8 Q2i,Q2f 
+                                                                        
+      integer m,j 
+      REAL*8 theta,pi,sigma,t,tmp,r 
+      COMPLEX*16 s,s1,tmp2,zpdfns(4),zpdfsg(2,2),ZPDFNS24(2) 
+                                                                        
+      pi=acos(-1d0) 
+      m=16 
+                                                                        
+      t=-dlog(x) 
+                                                                        
+      tmp  = 0d0 
+      tmp2 = 0d0 
+                                                                        
+      r=2d0*m/5d0/t 
+                                                                        
+      do j=1,m-1 
+         theta = dble(j)*pi/dble(m) 
+         sigma=theta+(theta/tan(theta)-1d0)/tan(theta) 
+         s=r*theta*DCMPLX(1d0/tan(theta),1d0) 
+         s1 = s + (1d0,0d0) 
+         call LH_zfunc(s1,x,Q2i,Q2f,zpdfns,ZPDFNS24,zpdfsg) 
+         tmp2=exp(t*s1)*DCMPLX(1d0,sigma)*zpdfsg(2,2) 
+         tmp=tmp+dreal(tmp2) 
+      enddo 
+      call LH_zfunc(DCMPLX(r+1d0,0d0),x,Q2i,Q2f,zpdfns,ZPDFNS24,zpdfsg) 
+                                                                        
+      xfunc=r/m*(tmp+.5d0*exp((r+1d0)*t)*dreal(zpdfsg(2,2))) 
+                                                                        
+      return 
+      END                                           
+                                                                        
+!****                                                                   
+! 6 *-------------------------------------------------------------------
+!****                                                                   
+!     File: gamma.f                                                     
+!     Function for computing Gamma(2), second moment                    
+!     of the evolution factor, for the Singlet-Gluon                    
+!     coupled evolution                                                 
+!                                                                       
+                                                                        
+      FUNCTION LH_gamm2ns(nsflav,x,Q2i,Q2f) 
+      IMPLICIT none 
+!                                                                       
+      REAL*8 Q2i,Q2f 
+!                                                                       
+      REAL*8 Q2it,Q2ft 
+      COMMON / NNPDF10QTRANSFER / Q2it,Q2ft 
+!                                                                       
+      integer nsflav 
+      COMPLEX*16 zn 
+      REAL*8 ain,afin,eps,x 
+      REAL*8 LH_gamm2ns,LH_DGAUSS_INTERN 
+      REAL*8 LH_gammax_nsp_wrp,LH_gammax_nsm_wrp,LH_gammax_nsvu_wrp,    &
+     &     LH_gammax_nsvd_wrp,LH_gammax_nsvct_wrp,LH_gammax_nsvsb_wrp   
+      external LH_gammax_nsp_wrp,LH_gammax_nsm_wrp,LH_gammax_nsvu_wrp,  &
+     &     LH_gammax_nsvd_wrp,LH_gammax_nsvct_wrp,LH_gammax_nsvsb_wrp   
+                                                                        
+      parameter(eps=1d-8) 
+      COMPLEX*16 efnns(4),efnns24(2),efnsg(2,2) 
+                                                                        
+!     NB: 2 moment                                                      
+      zn = (2d0,0d0) 
+!                                                                       
+      call LH_ZFUNC(zn,x,Q2i,Q2f,EFNNS,EFNNS24,EFNSG) 
+!                                                                       
+!     Fill auxiliary variables needed by wrapper functions              
+!                                                                       
+      Q2it = Q2i 
+      Q2ft = Q2f 
+!                                                                       
+      ain=0d0 
+      afin=x 
+!                                                                       
+      IF(NSFLAV.EQ.1) THEN 
+         LH_gamm2ns = DREAL(efnns(1))-                                  &
+     &        LH_DGAUSS_INTERN(LH_gammax_nsp_wrp,ain,afin,eps)          
+       ELSEIF(NSFLAV.EQ.2) THEN 
+         LH_gamm2ns = DREAL(efnns(2))                                   &
+     &         -LH_DGAUSS_INTERN(LH_gammax_nsm_wrp,ain,afin,eps)        
+      ELSEIF(NSFLAV.EQ.3) THEN 
+         LH_gamm2ns = DREAL(efnns(3))                                   &
+     &        -LH_DGAUSS_INTERN(LH_gammax_nsvu_wrp,ain,afin,eps)        
+      ELSEIF(NSFLAV.EQ.4) THEN 
+         LH_gamm2ns = DREAL(efnns(4))                                   &
+     &        -LH_DGAUSS_INTERN(LH_gammax_nsvd_wrp,ain,afin,eps)        
+      ENDIF 
+!                                                                       
+      return 
+      END                                           
+!                                                                       
+      FUNCTION LH_gamm2ns24(ns24flav,x,Q2i,Q2f) 
+      IMPLICIT none 
+!                                                                       
+      REAL*8 Q2i,Q2f 
+!                                                                       
+      REAL*8 Q2it,Q2ft 
+      COMMON / NNPDF10QTRANSFER / Q2it,Q2ft 
+!                                                                       
+      integer ns24flav 
+      COMPLEX*16 zn 
+      REAL*8 ain,afin,eps,x 
+      REAL*8 LH_gamm2ns24,LH_DGAUSS_INTERN 
+      REAL*8 LH_gammax_ns24q_wrp,LH_gammax_ns24g_wrp 
+      external LH_gammax_ns24q_wrp,LH_gammax_ns24g_wrp 
+                                                                        
+      parameter(eps=1d-8) 
+      COMPLEX*16 efnns(4),efnns24(2),efnsg(2,2) 
+                                                                        
+!     NB: 2 moment                                                      
+      zn = (2d0,0d0) 
+!                                                                       
+      call LH_ZFUNC(zn,x,Q2i,Q2f,EFNNS,EFNNS24,EFNSG) 
+!                                                                       
+!     Fill auxiliary variables needed by wrapper functions              
+!                                                                       
+      Q2it = Q2i 
+      Q2ft = Q2f 
+!                                                                       
+      ain=0d0 
+      afin=x 
+!                                                                       
+      IF(ns24flav.EQ.1) THEN 
+         LH_gamm2ns24 = DREAL(efnns24(1))                               &
+     &               -LH_DGAUSS_INTERN(LH_gammax_ns24q_wrp,ain,afin,eps)
+      ELSEIF(ns24flav.EQ.2) THEN 
+         LH_gamm2ns24 = DREAL(efnns24(2))                               &
+     &               -LH_DGAUSS_INTERN(LH_gammax_ns24g_wrp,ain,afin,eps)
+                                                                        
+      ENDIF 
+!                                                                       
+      RETURN 
+      END                                           
+                                                                        
+!                                                                       
+      FUNCTION LH_gamm2sg(l,c,x,Q2i,Q2f) 
+      IMPLICIT none 
+!                                                                       
+      REAL*8 Q2i,Q2f 
+!                                                                       
+      REAL*8 Q2it,Q2ft 
+      COMMON / NNPDF10QTRANSFER / Q2it,Q2ft 
+!                                                                       
+      integer l,c 
+      COMPLEX*16 zn 
+      REAL*8 ain,afin,eps,x 
+      REAL*8 LH_gamm2sg,LH_DGAUSS_INTERN 
+      REAL*8 LH_gammax_qq_wrp,LH_gammax_qg_wrp 
+      REAL*8 LH_gammax_gq_wrp,LH_gammax_gg_wrp 
+      external LH_gammax_qq_wrp,LH_gammax_qg_wrp 
+      external LH_gammax_gq_wrp,LH_gammax_gg_wrp 
+                                                                        
+      parameter(eps=1d-8) 
+      COMPLEX*16 efnns(4),efnns24(2),efnsg(2,2) 
+                                                                        
+!     NB: 2 moment                                                      
+      zn=(2d0,0d0) 
+!                                                                       
+      call LH_ZFUNC(zn,x,Q2i,Q2f,EFNNS,EFNNS24,EFNSG) 
+!                                                                       
+!     Fill auxiliary variables needed by wrapper functions              
+!                                                                       
+      Q2it = Q2i 
+      Q2ft = Q2f 
+!                                                                       
+      ain=0d0 
+      afin=x 
+!                                                                       
+      IF(l.EQ.1.AND.c.EQ.1) THEN 
+         LH_gamm2sg=DREAL(efnsg(1,1))-                                  &
+     &        LH_DGAUSS_INTERN(LH_gammax_qq_wrp,ain,afin,eps)           
+      ELSEIF(l.EQ.1.AND.c.EQ.2) THEN 
+         LH_gamm2sg=DREAL(efnsg(1,2))                                   &
+     &        -LH_DGAUSS_INTERN(LH_gammax_qg_wrp,ain,afin,eps)          
+      ELSEIF(l.EQ.2.AND.c.EQ.1) THEN 
+         LH_gamm2sg=DREAL(efnsg(2,1))                                   &
+     &        -LH_DGAUSS_INTERN(LH_gammax_gq_wrp,ain,afin,eps)          
+      ELSEIF(l.EQ.2.AND.c.EQ.2) THEN 
+         LH_gamm2sg=DREAL(efnsg(2,2))                                   &
+     &        -LH_DGAUSS_INTERN(LH_gammax_gg_wrp,ain,afin,eps)          
+      ENDIF 
+                                                                        
+      RETURN 
+      END                                           
+!                                                                       
+!     Internal Wrapper functions needed to perform x-integration        
+!     of the Gamma functions using Dgauss_Intern.                       
+!                                                                       
+      FUNCTION LH_gammax_nsp_wrp(y) 
+      IMPLICIT none 
+!                                                                       
+      REAL*8 LH_gammax_nsp_wrp 
+      REAL*8 y 
+      REAL*8 QQ2,QQ0 
+      REAL*8 Q2it,Q2ft 
+      COMMON / NNPDF10QTRANSFER / Q2it,Q2ft 
+      REAL*8 LH_gammax_nsp 
+      EXTERNAL LH_gammax_nsp 
+!                                                                       
+      QQ0 = Q2IT 
+      QQ2 = Q2FT 
+      LH_gammax_nsp_wrp = LH_gammax_nsp(y,QQ0,QQ2) 
+!                                                                       
+      RETURN 
+      END                                           
+!                                                                       
+                                                                        
+      FUNCTION LH_gammax_nsm_wrp(y) 
+      IMPLICIT none 
+!                                                                       
+      REAL*8 LH_gammax_nsm_wrp 
+      REAL*8 y 
+      REAL*8 QQ2,QQ0 
+      REAL*8 Q2it,Q2ft 
+      COMMON / NNPDF10QTRANSFER / Q2it,Q2ft 
+      REAL*8 LH_gammax_nsm 
+      EXTERNAL LH_gammax_nsm 
+!                                                                       
+      QQ0 = Q2IT 
+      QQ2 = Q2FT 
+      LH_gammax_nsm_wrp = LH_gammax_nsm(y,QQ0,QQ2) 
+!                                                                       
+      RETURN 
+      END                                           
+!                                                                       
+      FUNCTION LH_gammax_nsvu_wrp(y) 
+      IMPLICIT none 
+!                                                                       
+      REAL*8 LH_gammax_nsvu_wrp 
+      REAL*8 y 
+      REAL*8 QQ2,QQ0 
+      REAL*8 Q2it,Q2ft 
+      COMMON / NNPDF10QTRANSFER / Q2it,Q2ft 
+      REAL*8 LH_gammax_nsvu 
+      EXTERNAL LH_gammax_nsvu 
+!                                                                       
+      QQ0 = Q2IT 
+      QQ2 = Q2FT 
+      LH_gammax_nsvu_wrp = LH_gammax_nsvu(y,QQ0,QQ2) 
+!                                                                       
+      RETURN 
+      END                                           
+!                                                                       
+      FUNCTION LH_gammax_nsvd_wrp(y) 
+      IMPLICIT none 
+!                                                                       
+      REAL*8 LH_gammax_nsvd_wrp 
+      REAL*8 y 
+      REAL*8 Q2it,Q2ft 
+      REAL*8 QQ2,QQ0 
+      COMMON / NNPDF10QTRANSFER / Q2it,Q2ft 
+      REAL*8 LH_gammax_nsvd 
+      EXTERNAL LH_gammax_nsvd 
+!                                                                       
+      QQ0 = Q2IT 
+      QQ2 = Q2FT 
+      LH_gammax_nsvd_wrp = LH_gammax_nsvd(y,QQ0,QQ2) 
+!                                                                       
+      RETURN 
+      END                                           
+!                                                                       
+      FUNCTION LH_gammax_ns24q_wrp(y) 
+      IMPLICIT none 
+!                                                                       
+      REAL*8 LH_gammax_ns24q_wrp 
+      REAL*8 y 
+      REAL*8 Q2it,Q2ft 
+      REAL*8 QQ2,QQ0 
+      COMMON / NNPDF10QTRANSFER / Q2it,Q2ft 
+      REAL*8 LH_gammax_ns24q 
+      EXTERNAL LH_gammax_ns24q 
+!                                                                       
+      QQ0 = Q2IT 
+      QQ2 = Q2FT 
+      LH_gammax_ns24q_wrp = LH_gammax_ns24q(y,QQ0,QQ2) 
+!                                                                       
+      RETURN 
+      END                                           
+!                                                                       
+      FUNCTION LH_gammax_ns24g_wrp(y) 
+      IMPLICIT none 
+!                                                                       
+      REAL*8 LH_gammax_ns24g_wrp 
+      REAL*8 y 
+      REAL*8 Q2it,Q2ft 
+      REAL*8 QQ2,QQ0 
+      COMMON / NNPDF10QTRANSFER / Q2it,Q2ft 
+      REAL*8 LH_gammax_ns24g 
+      EXTERNAL LH_gammax_ns24g 
+!                                                                       
+      QQ0 = Q2IT 
+      QQ2 = Q2FT 
+      LH_gammax_ns24g_wrp = LH_gammax_ns24g(y,QQ0,QQ2) 
+!                                                                       
+      RETURN 
+      END                                           
+!                                                                       
+      FUNCTION LH_gammax_qq_wrp(y) 
+      IMPLICIT none 
+!                                                                       
+      REAL*8 LH_gammax_qq_wrp 
+      REAL*8 y 
+      REAL*8 Q2it,Q2ft 
+      REAL*8 QQ2,QQ0 
+      COMMON / NNPDF10QTRANSFER / Q2it,Q2ft 
+      REAL*8 LH_gammax_qq 
+      EXTERNAL LH_gammax_qq 
+!                                                                       
+      QQ0 = Q2IT 
+      QQ2 = Q2FT 
+      LH_gammax_qq_wrp = LH_gammax_qq(y,QQ0,QQ2) 
+!                                                                       
+      RETURN 
+      END                                           
+!                                                                       
+      FUNCTION LH_gammax_qg_wrp(y) 
+      IMPLICIT none 
+!                                                                       
+      REAL*8 LH_gammax_qg_wrp 
+      REAL*8 y 
+      REAL*8 Q2it,Q2ft 
+      REAL*8 QQ2,QQ0 
+      COMMON / NNPDF10QTRANSFER / Q2it,Q2ft 
+      REAL*8 LH_gammax_qg 
+      EXTERNAL LH_gammax_qg 
+!                                                                       
+      QQ0 = Q2IT 
+      QQ2 = Q2FT 
+      LH_gammax_qg_wrp = LH_gammax_qg(y,QQ0,QQ2) 
+!                                                                       
+      RETURN 
+      END                                           
+!                                                                       
+      FUNCTION LH_gammax_gq_wrp(y) 
+      IMPLICIT none 
+!                                                                       
+      REAL*8 LH_gammax_gq_wrp 
+      REAL*8 y 
+      REAL*8 Q2it,Q2ft 
+      REAL*8 QQ2,QQ0 
+      COMMON / NNPDF10QTRANSFER / Q2it,Q2ft 
+      REAL*8 LH_gammax_gq 
+      EXTERNAL LH_gammax_gq 
+!                                                                       
+      QQ0 = Q2IT 
+      QQ2 = Q2FT 
+      LH_gammax_gq_wrp = LH_gammax_gq(y,QQ0,QQ2) 
+!                                                                       
+      RETURN 
+      END                                           
+!                                                                       
+      FUNCTION LH_gammax_gg_wrp(y) 
+      IMPLICIT none 
+!                                                                       
+      REAL*8 LH_gammax_gg_wrp 
+      REAL*8 y 
+      REAL*8 Q2it,Q2ft 
+      REAL*8 QQ2,QQ0 
+      COMMON / NNPDF10QTRANSFER / Q2it,Q2ft 
+      REAL*8 LH_gammax_gg 
+      EXTERNAL LH_gammax_qg 
+!                                                                       
+      QQ0 = Q2IT 
+      QQ2 = Q2FT 
+      LH_gammax_gg_wrp = LH_gammax_gg(y,QQ0,QQ2) 
+!                                                                       
+      RETURN 
+      END                                           
+                                                                        
+!****                                                                   
+! 7 *-------------------------------------------------------------------
+!****                                                                   
+!     File: evolfactn.f                                                 
+!     Returns the evolution factors in N space                          
+!      - Fixed Flavour Number Scheme (IVFN=0)                           
+!      - Zero Mass-Variable Flavour Number Scheme (IVFN=1)              
+!                                                                       
+      SUBROUTINE LH_ZFUNC(ZN,X,Q20,Q2,ZFUNCNS,ZFUNCNS24,ZFUNCSG) 
+      IMPLICIT none 
+!                                                                       
+      INTEGER IPT,IMODEV,IVFN,ITMC 
+      COMMON /NNPDF10EVFLAGS/ IPT,IMODEV,IVFN,ITMC 
+!                                                                       
+      REAL*8 q2th(4:6),asref,q2ref 
+      REAL*8 as0,asc,asb,ast,asq 
+      COMMON /nnpdf10VFNS/ q2th,asref,q2ref 
+      COMMON /NNPDF10AS/ as0,asc,asb,ast,asq 
+!                                                                       
+      INTEGER I,J 
+      INTEGER NFI,NFF,STEP 
+!                                                                       
+      REAL*8 Q20,Q2 
+      REAL*8 X 
+!                                                                       
+      COMPLEX*16 ZN 
+      COMPLEX*16 EFNNS(4),EFNSG(2,2) 
+      COMPLEX*16 EFNNS0(4),EFNSG0(2,2),EFNSG1(2,2) 
+      COMPLEX*16 ZFUNCNS(4),ZFUNCNS24(2),ZFUNCSG(2,2) 
+!                                                                       
+      COMPLEX*16 EFNNSBQ(4),EFNNSCB(4),EFNNSBT(4),EFNNSTQ(4) 
+      COMPLEX*16 EFNSGBQ(2,2),EFNSGCB(2,2),EFNSGBT(2,2),EFNSGTQ(2,2) 
+!                                                                       
+!     Allow backward evolution                                          
+!                                                                       
+      IF(Q20.LE.Q2) STEP =  1 
+      IF(Q20.GT.Q2) STEP = -1 
+!                                                                       
+!     Determine # of active flavours at the initial (NFI) and           
+!     final (NFF) scale.                                                
+!                                                                       
+      IF(Q20.GE.Q2TH(6)) THEN 
+         NFI=6 
+      ELSEIF(Q20.GE.Q2TH(5)) THEN 
+         NFI=5 
+      ELSEIF(Q20.GE.Q2TH(4)) THEN 
+         NFI=4 
+      ELSE 
+         NFI=3 
+      ENDIF 
+!                                                                       
+      IF(Q2.GT.Q2TH(6)) THEN 
+         NFF=6 
+      ELSEIF(Q2.GT.Q2TH(5)) THEN 
+         NFF=5 
+      ELSEIF(Q2.GT.Q2TH(4)) THEN 
+         NFF=4 
+      ELSE 
+         NFF=3 
+      ENDIF 
+      IF(IVFN.EQ.0) NFF=4 
+!                                                                       
+!     No call to Coefficient Functions!                                 
+!     Evolution Kernel                                                  
+      DO I=1,4 
+         EFNNS0(I) = (0d0,0d0) 
+      ENDDO 
+      DO I=1,2 
+         DO J=1,2 
+            EFNSG0(I,J) = (0.D0,0.D0) 
+            EFNSG1(I,J) = (0.D0,0.D0) 
+            EFNSG(I,J) = (0.D0,0.D0) 
+         END DO 
+      END DO 
+!                                                                       
+!     Fixed Flavour Number Scheme (NF=4)                                
+      IF (IVFN.EQ.0) THEN 
+         NFI = 4 
+         CALL LH_EVOLFACTN(ZN,Q20,Q2,NFI,EFNNS,EFNSG1) 
+         ZFUNCNS24(1) = EFNSG1(1,1) 
+         ZFUNCNS24(2) = EFNSG1(1,2) 
+!                                                                       
+!     (Zero Mass-) Variable Flavour Number Scheme                       
+      ELSEIF(IVFN.EQ.1) THEN 
+         IF(NFF.EQ.NFI) THEN 
+            CALL LH_EVOLFACTN(ZN,Q20,Q2,NFI,EFNNS,EFNSG1) 
+         ELSE 
+            CALL LH_EVOLFACTN(ZN,Q20,Q2TH(NFI+STEP),NFI,EFNNS0,EFNSG0) 
+            DO I=1,4 
+               EFNNS(I) = EFNNS0(I) 
+            ENDDO 
+            CALL LH_MEQUAL_C(EFNSG,EFNSG0,2,2) 
+   10       NFI = NFI+STEP 
+            IF(NFI.NE.NFF) THEN 
+               CALL LH_EVOLFACTN(ZN,Q2TH(NFI),Q2TH(NFI+STEP),NFI,       &
+     &              EFNNS0,EFNSG0)                                      
+            ELSE 
+               CALL LH_EVOLFACTN(ZN,Q2TH(NFI),Q2,NFI,EFNNS0,EFNSG0) 
+            ENDIF 
+            DO I=1,4 
+               EFNNS(I) = EFNNS(I)*EFNNS0(I) 
+            ENDDO 
+            CALL LH_MMULT_C(EFNSG0,2,2,EFNSG,2,2,EFNSG1) 
+                                                                        
+            IF(NFI.NE.NFF) THEN 
+               CALL LH_MEQUAL_C(EFNSG,EFNSG1,2,2) 
+               GOTO 10 
+            ENDIF 
+         ENDIF 
+!                                                                       
+!     Evolution of T_24                                                 
+         IF(Q2.LE.Q2TH(5))THEN 
+            ZFUNCNS24(1) = EFNSG1(1,1) 
+            ZFUNCNS24(2) = EFNSG1(1,2) 
+         ELSEIF(Q2.LE.Q2TH(6)) THEN 
+            CALL LH_EVOLFACTN(ZN,Q20,Q2TH(5),4,EFNNSCB,EFNSGCB) 
+            CALL LH_EVOLFACTN(ZN,Q2TH(5),Q2 ,5,EFNNSBQ,EFNSGBQ) 
+            ZFUNCNS24(1) = EFNNSBQ(1)*EFNSGCB(1,1) 
+            ZFUNCNS24(2) = EFNNSBQ(1)*EFNSGCB(1,2) 
+         ELSE 
+            CALL LH_EVOLFACTN(ZN,Q20,Q2TH(5),4,EFNNSCB,EFNSGCB) 
+            CALL LH_EVOLFACTN(ZN,Q2TH(5),Q2TH(6),5,EFNNSBT,EFNSGBT) 
+            CALL LH_EVOLFACTN(ZN,Q2TH(6),Q2,6,EFNNSTQ,EFNSGTQ) 
+            ZFUNCNS24(1) = EFNNSTQ(1)*EFNNSBT(1)*EFNSGCB(1,1) 
+            ZFUNCNS24(2) = EFNNSTQ(1)*EFNNSBT(1)*EFNSGCB(1,2) 
+         ENDIF 
+      ENDIF 
+!                                                                       
+!     Output                                                            
+      DO I=1,4 
+         ZFUNCNS(I) =  EFNNS(I) 
+      ENDDO 
+                                                                        
+      DO I=1,2 
+         ZFUNCNS24(I)= ZFUNCNS24(I) 
+      ENDDO 
+                                                                        
+      DO I=1,2 
+         DO J=1,2 
+            ZFUNCSG(I,J)= EFNSG1(I,J) 
+         ENDDO 
+      ENDDO 
+                                                                        
+      RETURN 
+      END                                           
+!                                                                       
+!     Returns the evolution factors, in N space, from Q20 to Q2 with NF 
+!     active flavours, for Non Singlet and Singlet-Gluon.               
+!                                                                       
+      SUBROUTINE LH_EVOLFACTN(ZN,Q2I,Q2F,NF,EFNNS,EFNSG) 
+      IMPLICIT none 
+!                                                                       
+      INTEGER IPT,IMODEV,IVFN,ITMC 
+      COMMON /NNPDF10EVFLAGS/ IPT,IMODEV,IVFN,ITMC 
+!