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)
33 integer n, dirpathlength, setnamelength
34 character*512 dirpath, setpath
40 c check enviromental variable LHAPATH
41 call getenv('LHAPATH',dirpath)
42 if (dirpath.eq.'') then
43 C Take the data from $ALICE_ROOT/LHAPDF/PDFsets
44 CALL GETENV('ALICE_ROOT',CHROOT)
45 LNROOT = LNBLNK(CHROOT)
47 dirpath='PDFsets' ! Default value
49 dirpath=CHROOT(1:LNROOT)//'/LHAPDF/PDFsets'
53 c Now do some mangling to get the right path length from the
54 c (hopefully) over-long string read in from the file
56 do while (dirpath(n:n) .eq. ' ' .and. n .gt. 0)
61 c How long is 'name', really?
63 do while (setname(n:n) .eq. ' ' .and. n .gt. 0)
68 c Combine the set directory path and the set name
69 setpath(1:dirpathlength) = dirpath(1:dirpathlength)
70 setpath(dirpathlength+1:dirpathlength+1) = "/"
71 setpath(dirpathlength+2:dirpathlength+setnamelength+1) = setname(1
73 c setpath(dirpathlength+setnamelength+2:dirpathlength+setnamelength+
75 c write(*,*) setpath(1:dirpathlength+setnamelength+2)
77 call InitPDFsetM(nset,setpath(1:dirpathlength+setnamelength+1))
80 c ---------------------------------------------------------
82 subroutine InitPDFset(setpath)
87 call InitPDFsetM(nset,setpath)
91 subroutine InitPDFsetM(nset,setpath)
93 include 'parmsetup.inc'
97 integer id,token,Ctoken
99 common/lhasilent/lhasilent
104 open(unit=1,file=setpath,status='old')
106 if ((index(s2,'1.0').ne.1)
107 +.and.(index(s2,'1.1').ne.1)
108 +.and.(index(s2,'2.0').ne.1)
109 +.and.(index(s2,'2.1').ne.1)
110 +.and.(index(s2,'3.0').ne.1)
111 +.and.(index(s2,'3.1').ne.1)
112 +.and.(index(s2,'4.0').ne.1)
113 +.and.(index(s2,'5.0').ne.1))then
115 . 'Version ',s2,' not supported by this version of LHAPDF'
118 if(lhasilent.eq.0) then
119 write(*,*) '*************************************'
120 write(*,*) '* LHAPDF Version 5.2.2 *'
121 write(*,*) '*************************************'
128 c print *,'id = ',id,string
130 write(*,*) 'File description error:'
131 write(*,*) 'Command not understood: ',string
134 if (id.eq.1) call descriptionPDF(nset,id)
136 if (id.eq.2) call initEvolve(nset)
138 if (id.eq.3) call initAlphasPDF(nset)
140 if (id.eq.4) call initInputPDF(nset)
142 if (id.eq.5) call initListPDF(nset)
144 if (id.eq.6) call initQCDparams(nset)
148 c print *,'calling InitEvolveCode',nset
149 call InitEvolveCode(nset)
154 integer function token(s)
160 data t/'Description:','Evolution:','Alphas:',
161 . 'Parametrization:','Parameterlist:',
169 if (s.eq.t(i)) token=i
172 count(token)=count(token)+1
173 if (count(token).eq.2) then
174 write(*,*) 'File description error:'
175 write(*,*) 'Second definition of entry: ',s
190 subroutine LHAprint(iprint)
192 integer lhasilent,iprint
193 common/lhasilent/lhasilent
195 c print *,'lhasilent',lhasilent