12 #include "../FleshHist/asinfo.f" 13 #include "../FleshHist/asdensity.f" 14 #include "../FleshHist/crecprob.f" 18 #include "../FleshHist/Zprivate0.h" 19 #include "./realLimit.h" 20 integer ldep, code, subcode,
21 *
charge, ridx, faiidx, codex
22 real rinmu, fai, Ek, time,
33 real recprob(
nrbin, 4, ndepth)
38 real rat, all, rec, prob
40 real intdeprec(ndepth), intdepall(ndepth)
41 integer nrbina, nfaia, ansites0
42 integer leng, i, j, k, l
43 integer i0, j0, k0, l0
45 integer icon0, iconx, icont
47 character*100 nrfaifile, nrfaifile2
50 integer maxsites, nr, newfmt
51 integer fnonrfai, fnonrfai2
52 real cosz, age, sum, Nx, depth
53 character*20 field(15)
54 real nptcls(
nrbin, 4, ndepth)
55 integer indivdeprec(ndepth), indivdepall(ndepth)
56 integer packeddepidx(ndepth), depidx
58 integer icon, kgetenv2, nrec
66 write(0,*)
"Env. NRFAIFILE not given" 69 call copenfw2(fnonrfai, nrfaifile, 1, icon)
71 write(0,*)
' error cannot open', nrfaifile
75 nrfaifile2 = nrfaifile(1:
leng)//
"-r" 76 call copenfw2(fnonrfai2, nrfaifile2, 1, icon)
78 write(0,*)
' error ', nrfaifile2,
' cannot be created' 87 rnrfairec(
i, l,
j, k)=0
95 read(fnonrfai,
'(a)', end=1000 ) input0
96 if(input0 .ne.
" ")
then 97 call ksplit(input0, 20, 15, field, nr)
99 read(input0(1:
klena(input0)), *)
100 * evno0, e0,nn, cosz, limit(1), nrbina, nfaia, ansites0
104 elseif(nr .eq. 9 )
then 105 read(input0(1:
klena(input0)), *)
106 * evno0, e0,nn, cosz, limit(1), nrbina, nfaia, ansites0,
110 elseif( nr .eq. 13)
then 111 read(input0(1:
klena(input0)), *)
112 * evno0, e0,nn, cosz, emin, nrbina, nfaia, ansites0,
116 limit(1) = reallimitg
117 limit(2) = reallimite
118 limit(3) = reallimitmu
119 limit(4) = reallimith
123 if(nrbina .ne.
nrbin .or. nfaia .ne.
nfai)
then 124 write(0,*)
' nrbina=',nrbina,
'or nfaia=',nfaia,
125 *
' differ from the def. in this prog' 128 if(ansites0 .gt. ndepth)
then 129 write(0,*)
' too many depths' 136 read(fnonrfai,
'(a, f7.1, 4i4)' )
137 * id, intdeprec(
i), l0, i0, j0, k0
148 if(i0 .ne.
i .or.
j .ne. j0 .or. k .ne. k0)
then 149 write(0,*)
' intdep, i0,j0,k0=',
150 * intdeprec(
i), i0, j0, k0,
' strange' 153 if( id .ne.
"rec")
then 154 write(0,*)
'id=',id,
' strange' 159 * ( nrfairec0(l,k,
j,
i), l=1,
nrbin )
168 read(fnonrfai,
'(a,f7.1, 4i4)' )
169 * id, intdepall(
i), l0, i0, j0, k0
171 if(i0 .ne.
i .or.
j .ne. j0 .or. k .ne. k0)
then 172 write(0,*)
' intdep, i0,j0,k0=',
173 * intdepall(
i), i0, j0, k0,
' strange' 176 if( id .ne.
"all")
then 177 write(0,*)
'id=',id,
' strange' 181 * ( nrfaiall0(l,k,
j,
i), l=1,
nrbin )
189 read(fnonrfai,
'(a,f7.1, 3i4)' )
190 * id5, intdepall(
i), l0, i0, k0
192 if(i0 .ne.
i .or. k .ne. k0)
then 193 write(0,*)
' intdep, i0,k0=',
194 * intdepall(
i), i0, k0,
' strange' 197 if( id5 .ne.
"dE/dx")
then 198 write(0,*)
'id=',id5,
' strange' 202 * ( derfai(l,k,
i), l=1,
nrbin )
207 write(0,*)
' all nrfai data has been read' 209 *
'(i2, 1pE11.3,i3, 0pf7.1, 1pE11.3,0p, 4i4,4F8.0)')
210 * evno0, e0,nn, cosz, emin, nrbina, nfaia, ansites0,
218 write(0,*)
' limit=',limit,
' are being used' 224 if(nrfairec0(l, k,
j,
i) .gt. limit(
j))
then 226 pnrfairec(l, k,
j,
i)=
227 * limit(
j)/nrfairec0(l, k,
j,
i)
229 pnrfairec(l, k,
j,
i)=1.0
233 write(0,
'(f7.1, 4i4,a)' )
234 * intdeprec(
i), indivdeprec(
i),
i,
j, k,
' prob' 235 write(0,
'(1p10E11.3)')
236 * (pnrfairec(l,k,
j,
i), l=1,
nrbin)
247 read(*,
'(a)', end=100, err=500) input0
248 if( index(input0(1:2),
"i") .gt. 0 ) cycle
256 #if KeepWeight == yes 260 depidx = packeddepidx(ldep)
262 if(depidx .le. 0)
then 263 write(0,*)
' should not happen. depidx=',depidx
264 write(0,*)
' ldep=',ldep,
' code=',
code,
'nrec=',nrec
271 * pnrfairec(ridx, faiidx, codex, depidx) )
then 272 rnrfairec(ridx, faiidx, codex, depidx)=
273 * rnrfairec(ridx, faiidx, codex, depidx) + 1
274 #if KeepWeight != yes 276 *
'(6i3, 1pE11.3, 0p,f6.1,1p2E11.3,0p, 2f8.4,f10.6)')
284 *
'(6i3, 1pE11.3, 0p,f6.1,1p2E11.3,0p, 2f8.4,f10.6,1pE11.3)')
297 if(newfmt .eq. 0)
then 299 *
'(i2,1pE11.3, 0p,i3, f8.4, 1pE11.3,0p, 3i4)' )
300 * evno0, e0, nn, cosz, limit(1),
nrbin,
nfai, ansites0
301 elseif( newfmt .eq. 1)
then 303 *
'(i2,1pE11.3, 0p,i3, f8.4, 1pE11.3,0p, 4i4)' )
304 * evno0, e0, nn, cosz, limit(1),
nrbin,
nfai, ansites0,
308 *
'(i2,1pE11.3, 0p,i3, f8.4, 1pE11.3,0p, 4i4, 4f8.0)' )
309 * evno0, e0, nn, cosz, emin,
nrbin,
nfai, ansites0,
316 write(fnonrfai2,
'("rec",f7.1, 4i4)' )
317 * intdeprec(
i), l,
i,
j, k
318 write(fnonrfai2,
'(1p10E11.3)')
319 * ( rnrfairec(l,k,
j,
i), l=1,
nrbin )
328 write(fnonrfai2,
'("all",f7.1, 4i4)' )
329 * intdepall(
i), l,
i,
j, k
330 write(fnonrfai2,
'(1p10E11.3)')
331 * ( nrfaiall0(l,k,
j,
i), l=1,
nrbin )
340 write(fnonrfai2,
'("dE/dx",f7.1, 3i4)' )
341 * intdepall(
i), l,
i, k
342 write(fnonrfai2,
'(1p10E11.3)')
343 * ( derfai(l,k,
i), l=1,
nrbin )
347 write(0,*)
'end of run' 351 write(0,*)
' input error at record =', nrec
integer npitbl real *nx parameter(n=101, npitbl=46, nx=n-1) real *8 uconst
subroutine ksplit(a, m, n, b, nr)
integer function kgetenv2(envname, envresult)
block data cblkElemag data *AnihiE ! Eposi< 1 TeV, anihilation considered *X0/365.667/, ! radiation length of air in kg/m2 *Ecrit/81.e-3/, ! critical energy of air in GeV *MaxComptonE/1./, ! compton is considered below 1 GeV *MaxPhotoE/1.e-3/, ! above this, PhotoElectric effect neg. *MinPhotoProdE/153.e-3/, ! below 153 MeV, no gp --> hadrons ! scattering const not MeV *Knockon true
********************block data cblkHeavy ********************integer j data *HeavyG2symbol *data *HeavyG2code kiron data j
subroutine copenfw2(io, fnin, form, icon)
*Zfirst p fm *Zfirst p Zfirst p code
dE dx *! Nuc Int sampling table d
*Zfirst p fm *Zfirst p Zfirst p Zfirst p *Zfirst p charge
integer function klena(cha)
*Zfirst p fm *Zfirst p Zfirst p Zfirst p *Zfirst p *Zfirst pos xyz Zfirst pos xyz *Zfirst pos *Zfirst pos Zfirst pos *Zfirst pos *Zfirst Zfirst vec w *Zfirst vec w Zfirst vec *Zfirst wgt
*Zfirst p fm *Zfirst p Zfirst p Zfirst p subcode