COSMOS v7.655  COSMOSv7655
(AirShowerMC)
cintModels.f File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine cintmodels (from)
 
subroutine cfixprefix (dsn)
 
subroutine cgettopdir
 
subroutine csetcosorepi (from)
 
subroutine cformfullpath (file, path)
 
subroutine cputgencolcms (cms)
 
subroutine cqgencolcms (cms)
 

Function/Subroutine Documentation

◆ cfixprefix()

subroutine cfixprefix ( character*(*)  dsn)

Definition at line 209 of file cintModels.f.

Referenced by init().

209  implicit none
210 #include "Zmanager.h"
211  character*(*) dsn ! input. config file name or path
212 ! output. PrefixConf= './' or '/.../.../' where
213 ! config file exist.
214 ! PrefixLeng is it's length.
215 !
216 !
217  integer i, j, klena, k
218 
219  if( index(dsn, '/') .eq. 0 ) then
220  prefixconf = './'
221  prefixleng = 2
222  else
223 ! find last '/'
224  i = klena(dsn)
225  do j = i, 1, -1
226  k = index(dsn(j:j), '/')
227  if( k .gt. 0 ) then
228  prefixconf = dsn(1:j)
229  prefixleng = j
230  goto 33
231  endif
232  enddo
233  endif
234  33 continue
nodes i
********************block data cblkHeavy ********************integer j data *HeavyG2symbol *data *HeavyG2code kiron data j
Definition: cblkHeavy.h:36
integer function klena(cha)
Definition: klena.f:20
Here is the caller graph for this function:

◆ cformfullpath()

subroutine cformfullpath ( character*(*)  file,
character*(*)  path 
)

Definition at line 259 of file cintModels.f.

References cerrormsg().

Referenced by cintmodels().

259  implicit none
260 #include "Zmanager.h"
261  character*(*) file ! input. file name
262  character*(*) path ! output. $COSMOSTOP/Data/DPM/file
263  integer klena
264 
265  path = ' '
266 
267  if(cosorepi .eq. 'cosmos') then
268  path = topdir(1:topdirleng)//'/Data/DPM/'
269  * //file(1:klena(file))
270  elseif(cosorepi == 'epics' .or. cosorepi == 'check'
271  * .or. cosorepi == 'gencol') then
272  path = prefixconf(1:prefixleng)//file(1:klena(file))
273  else
274  call cerrormsg(
275  * "cintModels('cosmos') or cintModels('epics')"//
276  * " must have been called ", 0)
277  endif
278 
subroutine cerrormsg(msg, needrtn)
Definition: cerrorMsg.f:4
integer function klena(cha)
Definition: klena.f:20
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cgettopdir()

subroutine cgettopdir ( )

Definition at line 239 of file cintModels.f.

Referenced by cintmodels().

239  implicit none
240 #include "Zmanager.h"
241 
242 
243  character*1 null
244  integer kgetenv
245 
246  null = char(0)
247  topdir = ' '
248  topdirleng = kgetenv("COSMOSTOP"//null, topdir)
Here is the caller graph for this function:

◆ cintmodels()

subroutine cintmodels ( character*(*)  from)

Definition at line 3 of file cintModels.f.

References cerrormsg(), cformfullpath(), and cgettopdir().

Referenced by cbeginrun(), dpmjet(), and init().

3 !
4 ! establish the energy bound for the given interaction model.
5 ! and corresponding init.
6  implicit none
7 #include "Zmanagerp.h"
8 #include "Zmanager.h"
9 #include "Zevhnp.h"
10 #include "Zptcl.h"
11 #include "Zevhnv.h"
12 
13  character*(*) from ! input. cosmos or epics ; from which
14 
15  integer i, j
16  character*100 path
17 
18  cosorepi = from
19  call cgettopdir ! get Cosmos top dir and set it in Zmanager.h
20 
21  do i = 1, maxintmdls
22  modellist(i) = ' '
23  inteerg(i) = 2.d12 ! GeV 10^21 eV
24  modellist2(i) = ' '
25  inteerg2(i) = 2.d12 ! GeV 10^21 eV
26  enddo
27 ! ModelList InteErg
28 ! "xxx" 100.
29 ! "yyy" 1.d12 ====> xxx if E< 100 else yyy
30 !
31 ! "xxx" 1.d12 ====> xxx at entier energy.
32 !
33  intmodel(64:64) = '/'
34  if( xsecmodel == " ") then
35  xsecmodel = intmodel
36  else
37  xsecmodel(64:64) = '/'
38  endif
39 
40  read(intmodel, *, err=100)
41  * (modellist(i), inteerg(i), i=1, maxintmdls)
42  read(xsecmodel, *, err=100)
43  * (modellist2(i), inteerg2(i), i=1, maxintmdls)
44 
45  do i = 1, maxintmdls
46  if(modellist(i) .eq. ' ') then
47  noofmdls = i-1
48  goto 10
49  endif
50  enddo
51  noofmdls = maxintmdls
52  10 continue
53  do i = 1, maxintmdls
54  if(modellist2(i) .eq. ' ') then
55  noofmdls2 = i-1
56  goto 20
57  endif
58  enddo
59  noofmdls2 = maxintmdls
60  20 continue
61 
62  do i = 1, noofmdls-1
63 ! if(InteErg(i) .ge. InteErg(i+1)) then
64  if(inteerg(i) > inteerg(i+1)) then ! v7.633
65 ! energy region invalid
66  call cerrormsg(
67  * 'IntModel is invalid; energy region not ascending', 1)
68  call cerrormsg(intmodel, 0)
69  elseif(inteerg(i) == inteerg(i+1)) then ! v7.633
70 ! a model written between(i) and (i+1)
71 ! will not be used explicitly but initialization
72 ! is tried. It might be used as a rescuee when a
73 ! some model cannot cope with a specific particle.
74  ! issue some message
75  write(0,*) '================================='
76  write(0,*)
77  * i,'-th and ',i+1,'-th energy in IntModel are same'
78  write(0,*) 'The model specified is ',modellist(i+1), '.'
79  write(0,*) 'It will not be used explicitly but might be'
80  write(0,*) 'used when some model needs help for a '
81  write(0,*) 'specific particle. dpmjet3 is a good '
82  write(0,*) 'candidate of such a model'
83  write(0,*) '================================='
84  endif
85 
86  enddo
87  if( noofmdls2 /= noofmdls .or.
88  & any(inteerg(1:noofmdls) /= inteerg2(1:noofmdls)) ) then
89  do i = 1, noofmdls2-1
90  if(inteerg2(i) > inteerg2(i+1)) then
91 ! energy region invalid
92  call cerrormsg(
93  * 'XsecModel is invalid; energy region not ascending', 1)
94  call cerrormsg(xsecmodel, 0)
95  elseif(inteerg2(i) == inteerg2(i+1)) then
96  write(0,*) '================================='
97  write(0,*)
98  * i,'-th and ',i+1,'-th energy in IntModel are same'
99  write(0,*) 'The model specified is ',modellist2(i+1), '.'
100  write(0,*) 'It will not be used explicitly but might be'
101  write(0,*) 'used when some model needs help for a '
102  write(0,*) 'specific particle. dpmjet3 is a good '
103  write(0,*) 'candidate of such a model'
104  write(0,*) '================================='
105  endif
106  enddo
107  endif
108 ! exam models
109  do i = 1, noofmdls
110  do j = 1, nmdls
111  if( modellist(i) .eq. regmdls(j) ) goto 25
112  enddo
113  call cerrormsg( modellist(i), 1)
114  call cerrormsg('above model is not yet registered', 0)
115  25 continue
116  enddo
117 ! exam models
118  do i = 1, noofmdls2
119  do j = 1, nmdls
120  if( modellist2(i) .eq. regmdls(j) ) goto 28
121  enddo
122  call cerrormsg( modellist2(i), 1)
123  call cerrormsg('above model is not yet registered', 0)
124  28 continue
125  enddo
126 
127 !
128  if( index(intmodel, 'fritiof1.6') .gt. 0 .or.
129  * index(intmodel, 'nucrin') .gt. 0 .or.
130  * index(intmodel, 'dpmjet3') .gt. 0 .or.
131  * index(intmodel, 'incdpm3') .gt. 0 .or.
132  * index(intmodel, 'jam') .gt. 0 ) then
133 
134 ! for Lund init. dpm may use Lund at low energy or
135 ! for some particles
136  call haddenc
137  call chanwnc
138  endif
139  if( index(intmodel, 'phits') .gt. 0 .or.
140  * index(xsecmodel, 'phits') .gt. 0 ) then
141  call cprephits
142  endif
143  if( index(intmodel, 'qgsjet2') .gt. 0 .or.
144  * index(xsecmodel, 'qgsjet2') .gt. 0 ) then
145  call ciniqgs
146  endif
147  if( index(intmodel, 'epos') .gt. 0 .or.
148  * index(xsecmodel, 'epos') .gt. 0 ) then
149  call ceposiniall
150  endif
151  if( index(intmodel, 'sibyll') > 0 .or.
152  * index(xsecmodel, 'sibyll') > 0 ) then
153  call csibyllinit
154  endif
155  if( index(intmodel, 'incdpm3') .gt. 0 ) then
156  call ciniincdpm3
157  endif
158 
159  if( index(intmodel, 'gheisha' ) .gt. 0) then
160 ! Gheisha; init. Gheisha cannot use hadrin/nucrin in Cosmos
161  call gpart
162  call gheini
163  endif
164  if( index(intmodel, 'jam' ) .gt. 0) then
165  ! nothing to do ?
166  endif
167  if( index(intmodel, 'dpmjet3') .gt. 0 .or.
168  * index(xsecmodel, 'dpmjet3') .gt. 0 .or.
169  * index(intmodel, 'incdpm3') .gt. 0 ) then
170  if(from .eq. 'cosmos') then
171  ! init for dpmjet. for Cosmos
172  ! If DpmFile is ' ',
173  ! $COSMOSTOP/Data/atmos.inp is the control card for dpmjet3.
174  If( dpmfile .eq. ' ' ) then
175  call cformfullpath('atmos.inp', path)
176  call cinidpmjet(path)
177  else
178  call cinidpmjet(dpmfile)
179  endif
180  elseif(from .eq. 'check') then
181 ! it is assumed that the Glauber file is
182 ! specified by prefix/...GLB
183 
184  elseif(from == 'epics' .or. from == 'gencol') then
185 ! dpmjet.inp is assumed in the same directory
186 ! as config file.
187  call cformfullpath('dpmjet.inp', path)
188  call cinidpmjet(path)
189  else
190  call cerrormsg(from, 1)
191  call cerrormsg('above "from" in cintModels invalid',0)
192  endif
193  endif
194  return
195 
196  100 continue
197  call cerrormsg(
198  * 'IntModel syntax error; prob.missing " mark'//
199  * ' for string; IntModel is', 1)
200  call cerrormsg(intmodel, 0)
subroutine cerrormsg(msg, needrtn)
Definition: cerrorMsg.f:4
nodes i
subroutine cformfullpath(file, path)
Definition: cintModels.f:259
********************block data cblkHeavy ********************integer j data *HeavyG2symbol *data *HeavyG2code kiron data j
Definition: cblkHeavy.h:36
subroutine cgettopdir
Definition: cintModels.f:239
integer maxbin nregion c minsave drx2 ! drawing region real maxdep integer maxpos integer from
Definition: Zfit.h:15
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cputgencolcms()

subroutine cputgencolcms ( type(ptcl cms)

Definition at line 281 of file cintModels.f.

Referenced by formpjtg().

281 ! this is introduced for EPOS
282 ! to save the single precision boost in EPOS
283 ! call afinal is avoided to convert cms to lab
284 ! conversion of which result becomes not accurate
285 ! if we convet it to cms again. (Gencol needs to do so)
286 !
287  implicit none
288 #include "Zptcl.h"
289  type(ptcl):: cms ! input. Gencol must
290  ! inform the cms (/n)
291 
292  common /forgencol/ cmssave
293  type(ptcl):: cmssave
294  cmssave = cms
Definition: Zptcl.h:75
Here is the caller graph for this function:

◆ cqgencolcms()

subroutine cqgencolcms ( type(ptcl cms)

Definition at line 297 of file cintModels.f.

297 ! ask gencol cms
298 !
299  implicit none
300 #include "Zptcl.h"
301  type(ptcl):: cms ! outut.
302  common /forgencol/ cmssave
303  type(ptcl):: cmssave
304  cms = cmssave
Definition: Zptcl.h:75

◆ csetcosorepi()

subroutine csetcosorepi ( character*(*)  from)

Definition at line 252 of file cintModels.f.

Referenced by init().

252  implicit none
253 #include "Zmanager.h"
254  character*(*) from ! input. cosmos or epics
255  cosorepi = from
integer maxbin nregion c minsave drx2 ! drawing region real maxdep integer maxpos integer from
Definition: Zfit.h:15
Here is the caller graph for this function: