14 #include "../FleshHist/asinfo.f" 15 #include "../FleshHist/asdensity.f" 16 #include "../FleshHist/crecprob.f" 21 #include "../FleshHist/Zprivate0.h" 22 #include "./realLimit.h" 23 integer ldep, code, subcode,
24 *
charge, ridx, faiidx, codex
25 real rinmu, fai, Ek, time,
36 real recprob(
nrbin, 4, ndepth)
41 integer maxsites, nr, newfmt
42 real rat, all, rec, prob
45 integer nrbina, nfaia, ansites0
46 integer leng, i, j, k, l
47 integer i0, j0, k0, l0
49 integer icon0, iconx, icont
51 character*100 nrfaifile, nrfaifile2
54 character*20 field(15)
55 integer fnonrfai, fnonrfai2
56 real cosz, age, sum, Nx, depth
57 real nptcls(
nrbin, 4, ndepth)
58 integer indivdep(ndepth), packeddepidx(ndepth), depidx
60 integer icon, kgetenv2, nrec
68 write(0,*)
"Env. NRFAIFILE not given" 71 call copenfw2(fnonrfai, nrfaifile, 1, icon)
73 write(0,*)
' error cannot open', nrfaifile
77 nrfaifile2 = nrfaifile(1:
leng)//
"-r" 78 call copenfw2(fnonrfai2, nrfaifile2, 1, icon)
80 write(0,*)
' error ', nrfaifile2,
' cannot be created' 89 rnrfairec(
i, l,
j, k)=0
97 read(fnonrfai,
'(a)', end=1000 ) input0
98 if(input0 .ne.
" ")
then 99 call ksplit(input0, 20, 15, field, nr)
101 read(input0(1:
klena(input0)), *)
102 * evno0, e0,nn, cosz, limit(1), nrbina, nfaia, ansites0
106 elseif(nr .eq. 9 )
then 107 read(input0(1:
klena(input0)), *)
108 * evno0, e0,nn, cosz, limit(1), nrbina, nfaia, ansites0,
112 elseif( nr .eq. 13)
then 113 read(input0(1:
klena(input0)), *)
114 * evno0, e0,nn, cosz, emin, nrbina, nfaia, ansites0,
119 limit(1) = reallimitg
120 limit(2) = reallimite
121 limit(3) = reallimitmu
122 limit(4) = reallimith
124 if(nrbina .ne.
nrbin .or. nfaia .ne.
nfai)
then 125 write(0,*)
' nrbina=',nrbina,
'or nfaia=',nfaia,
126 *
' differ from the def. in this prog' 129 if(ansites0 .gt. ndepth)
then 130 write(0,*)
' too many depths' 137 read(fnonrfai,
'(a, f7.1, 4i4)' )
138 * id, intdep(
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 * intdep(
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 )
167 read(fnonrfai,
'(a,f7.1, 4i4)' )
168 * id, intdep(
i), l0, i0, j0, k0
170 if(i0 .ne.
i .or.
j .ne. j0 .or. k .ne. k0)
then 171 write(0,*)
' intdep, i0,j0,k0=',
172 * intdep(
i), i0, j0, k0,
' strange' 175 if( id .ne.
"all")
then 176 write(0,*)
'id=',id,
' strange' 180 * ( nrfaiall0(l,k,
j,
i), l=1,
nrbin )
187 read(fnonrfai,
'(a,f7.1, 3i4)' )
188 * id5, intdep(
i), l0, i0, k0
190 if(i0 .ne.
i .or. k .ne. k0)
then 191 write(0,*)
' intdep, i0,k0=',
192 * intdep(
i), i0, k0,
' strange' 195 if( id5 .ne.
"dE/dx")
then 196 write(0,*)
'id=',id5,
' strange' 200 * ( derfai(l,k,
i), l=1,
nrbin )
205 write(0,*)
' all nrfai data has been read' 206 if(newfmt .eq. 0)
then 207 write(0,
'(i2, 1pE11.3,i3, 0pf7.1, 1pE11.3,0p, 3i4)')
208 * evno0, e0,nn, cosz, limit(1), nrbina, nfaia, ansites0
209 elseif(newfmt .eq. 1)
then 210 write(0,
'(i2, 1pE11.3,i3, 0pf7.1, 1pE11.3,0p, 4i4)')
211 * evno0, e0,nn, cosz, limit(1), nrbina, nfaia, ansites0,
215 7
'(i2, 1pE11.3,i3, 0pf7.1, 1pE11.3, 0p,4i4, 4f10.0)')
216 * evno0, e0,nn, cosz, emin, nrbina, nfaia, ansites0,
226 if(newfmt .ne. 2)
then 227 write(0,*)
' limit=',limit(1),
' is being used' 229 write(0,*)
' limit=',limit,
' are being used' 236 if(nrfairec0(l, k,
j,
i) .gt. limit(
j))
then 238 pnrfairec(l, k,
j,
i)=
239 * limit(
j)/nrfairec0(l, k,
j,
i)
241 pnrfairec(l, k,
j,
i)=1.0
245 write(0,
'(f7.1, 4i4,a)' )
246 * intdep(
i), indivdep(
i),
i,
j, k,
' prob' 247 write(0,
'(1p10E11.3)')
248 * (pnrfairec(l,k,
j,
i), l=1,
nrbin)
259 read(*,
'(a)', end=100, err=500) input0
260 if( index(input0(1:2),
"i") .gt. 0 ) cycle
269 depidx = packeddepidx(ldep)
271 if(depidx .le. 0)
then 272 write(0,*)
' should not happen. depidx=',depidx
273 write(0,*)
' ldep=',ldep,
' code=',
code,
'nrec=',nrec
279 rnrfairec(ridx, faiidx, codex, depidx)=
280 * rnrfairec(ridx, faiidx, codex, depidx) + 1
284 if( newfmt .eq. 0)
then 286 *
'(i2,1pE11.3, 0p,i3, f8.4, 1pE11.3,0p,3i4)' )
287 * evno0, e0, nn, cosz, limit(1),
nrbin,
nfai, ansites0
288 elseif( newfmt .eq. 1)
then 290 *
'(i2,1pE11.3, 0p,i3, f8.4, 1pE11.3,0p,4i4)' )
291 * evno0, e0, nn, cosz, limit(1),
nrbin,
nfai, ansites0,
295 *
'(i2,1pE11.3, 0p,i3, f8.4, 1pE11.3,0p, 4i4,4f10.0)' )
296 * evno0, e0, nn, cosz, emin,
nrbin,
nfai, ansites0,
305 write(fnonrfai2,
'("rec",f7.1, 4i4)' )
306 * intdep(
i), l,
i,
j, k
307 write(fnonrfai2,
'(1p10E11.3)')
308 * ( rnrfairec(l,k,
j,
i), l=1,
nrbin )
316 write(fnonrfai2,
'("all",f7.1, 4i4)' )
317 * intdep(
i), l,
i,
j, k
318 write(fnonrfai2,
'(1p10E11.3)')
319 * ( nrfaiall0(l,k,
j,
i), l=1,
nrbin )
327 write(fnonrfai2,
'("dE/dx",f7.1, 3i4)' )
329 write(fnonrfai2,
'(1p10E11.3)')
330 * ( derfai(l,k,
i), l=1,
nrbin )
334 write(0,*)
'end of run' 338 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 subcode