1 c Automatically determine the path to the system's PDF set
2 c collection using the lhapdf-config utility (which must be
3 c in the user's execution path
4 c ---------------------------------------------------------
5 subroutine InitPDFsetByCodes(code1, code2, code3)
6 write(*,*) "Not implemented yet: this will move the 'glue' interf
7 +ace to LHAPDF proper and use the InitPDFsetByName function to get
8 +the path automatically."
11 c ---------------------------------------------------------
14 c Automatically determine the path to the system's PDF set
15 c collection using the lhapdf-config utility (which must be
16 c in the user's execution path
17 c --------------------------------------------------------
18 subroutine InitPDFsetByName(setname)
23 call InitPDFsetByNameM(nset,setname)
27 subroutine InitPDFsetByNameM(nset,setname)
32 integer n, dirpathlength, setnamelength
33 character*512 dirpath, setpath
39 c check enviromental variable LHAPATH
40 call getenv('LHAPATH',dirpath)
41 if (dirpath.eq.'') then
42 C Take the data from $ALICE_ROOT/LHAPDF/PDFsets
43 CALL GETENV('ALICE_ROOT',CHROOT)
44 LNROOT = LNBLNK(CHROOT)
46 dirpath='PDFsets' ! Default value
48 dirpath=CHROOT(1:LNROOT)//'/LHAPDF/PDFsets'
52 c Now do some mangling to get the right path length from the
53 c (hopefully) over-long string read in from the file
55 do while (dirpath(n:n) .eq. ' ' .and. n .gt. 0)
60 c How long is 'name', really?
62 do while (setname(n:n) .eq. ' ' .and. n .gt. 0)
67 c Combine the set directory path and the set name
68 setpath(1:dirpathlength) = dirpath(1:dirpathlength)
69 setpath(dirpathlength+1:dirpathlength+1) = "/"
70 setpath(dirpathlength+2:dirpathlength+setnamelength+1) = setname(1
72 c setpath(dirpathlength+setnamelength+2:dirpathlength+setnamelength+
74 c write(*,*) setpath(1:dirpathlength+setnamelength+2)
76 call InitPDFsetM(nset,setpath(1:dirpathlength+setnamelength+1))
79 c ---------------------------------------------------------
81 subroutine InitPDFset(setpath)
86 call InitPDFsetM(nset,setpath)
90 subroutine InitPDFsetM(nset,setpath)
92 include 'parmsetup.inc'
96 integer id,token,Ctoken
98 common/lhasilent/lhasilent
103 open(unit=1,file=setpath,status='old')
105 if ((index(s2,'1.0').ne.1)
106 +.and.(index(s2,'1.1').ne.1)
107 +.and.(index(s2,'2.0').ne.1)
108 +.and.(index(s2,'2.1').ne.1)
109 +.and.(index(s2,'3.0').ne.1)
110 +.and.(index(s2,'3.1').ne.1)
111 +.and.(index(s2,'4.0').ne.1)
112 +.and.(index(s2,'5.0').ne.1))then
114 . 'Version ',s2,' not supported by this version of LHAPDF'
117 if(lhasilent.eq.0) then
118 write(*,*) '*************************************'
119 write(*,*) '* LHAPDF Version 5.2.2 *'
120 write(*,*) '*************************************'
127 c print *,'id = ',id,string
129 write(*,*) 'File description error:'
130 write(*,*) 'Command not understood: ',string
133 if (id.eq.1) call descriptionPDF(nset,id)
135 if (id.eq.2) call initEvolve(nset)
137 if (id.eq.3) call initAlphasPDF(nset)
139 if (id.eq.4) call initInputPDF(nset)
141 if (id.eq.5) call initListPDF(nset)
143 if (id.eq.6) call initQCDparams(nset)
147 c print *,'calling InitEvolveCode',nset
148 call InitEvolveCode(nset)
153 integer function token(s)
159 data t/'Description:','Evolution:','Alphas:',
160 . 'Parametrization:','Parameterlist:',
168 if (s.eq.t(i)) token=i
171 count(token)=count(token)+1
172 if (count(token).eq.2) then
173 write(*,*) 'File description error:'
174 write(*,*) 'Second definition of entry: ',s
189 subroutine LHAprint(iprint)
191 integer lhasilent,iprint
192 common/lhasilent/lhasilent
194 c print *,'lhasilent',lhasilent