COSMOS v7.655  COSMOSv7655
(AirShowerMC)
inc_reduceSize.f
Go to the documentation of this file.
1 ! This is the same as inc_readandput.f but this dose not read file
2 ! data is in buf.
3 ! this part is used only by rank 0
4 ! to read .dat created by each rank and reduce it
5 ! and to store data as a single file
6  limit(1) = reallimitg
7  limit(2) = reallimite
8  limit(3) = reallimitmu
9  limit(4) = reallimith
10 
11  do k = 1, ansites
12  do j = 1, 4
13  do l = 1,nfai
14  do i = 1, nrbin
15  nrfairec(i, l, j, k)=0
16  enddo
17  enddo
18  enddo
19  enddo
20 ! single file to store combined all .dat
21 ! msg=' '
22 ! msg =dir(1:lengdir)//"/"//execid(1:lengid)//".dat"
23 !///////////
24 ! write(0,*) ' asking main file opening'
25 !///////
26 ! call copenfw2(fnodat+1, msg, 1, icon)
27 ! if(icon .gt. 1) then
28 ! write(0,*) ' icon=', icon
29 ! call cerrorMsg(msg, 1)
30 ! call cerrorMsg('could not be opened', 0)
31 ! endif
32 
33  inbuf = 0
34  do i = 1, bufc
35  ldep = buf(i).ldep
36  depidx = w2il(ldep)
37  faiidx= buf(i).faiidx
38  ridx = buf(i).ridx
39  codex = buf(i).code
40  codex = min(codex, 4)
41  wgt = buf(i).wgt
42  if( nrfaireca(ridx, faiidx, codex, depidx) .gt.
43  * limit(codex) ) then
44 ! accept with this prob.
45  prob = limit(codex)/
46  * nrfaireca(ridx, faiidx, codex, depidx)
47 
48  else
49  prob = 1.0
50  endif
51 
52  if( prob .gt. 1.) then
53  wwgt = wgt
54  accept = .true.
55  else
56  prob = prob * wgt
57  if(prob .gt. 1.) then
58  accept = .true.
59  wwgt = prob
60  else
61  call rndc(u)
62  if(u .lt. prob) then
63  accept = .true.
64  wwgt= 1.
65  else
66  accept = .false.
67  endif
68  endif
69  endif
70  if(accept) then
71  nrfairec(ridx, faiidx, codex, depidx)=
72  * nrfairec(ridx, faiidx, codex, depidx) + wwgt
73  inbuf = inbuf + 1
74  buf(inbuf) = buf(i)
75 ! if(KeepWeight) then
76 ! write(fnodat+1,
77 ! * '(6i3, 1pE11.3, 0p,f6.1,1p2E11.3,0p, 2f8.4,f10.6,1pE11.3)')
78 ! * buf(i).ldep, buf(i).code, buf(i).subcode,
79 ! * buf(i).charge, buf(i).ridx, buf(i).faiidx,
80 ! * buf(i).rinmu, buf(i).fai, buf(i).Ek,
81 ! * buf(i).t, buf(i).wx, buf(i).wy, buf(i).wz,
82 ! * wwgt
83 ! else
84 ! write(fnodat+1,
85 ! * '(6i3, 1pE11.3, 0p,f6.1,1p2E11.3,0p, 2f8.4,f10.6)')
86 ! * buf(i).ldep, buf(i).code, buf(i).subcode,
87 ! * buf(i).charge, buf(i).ridx, buf(i).faiidx,
88 ! * buf(i).rinmu, buf(i).fai, buf(i).Ek,
89 ! * buf(i).t, buf(i).wx, buf(i).wy, buf(i).wz
90 ! endif
91 ! endif
92  enddo
nodes i
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
Definition: cblkElemag.h:7
subroutine rndc(u)
Definition: rnd.f:91
! timing nrbin
Definition: Zprivate2.h:12
********************block data cblkHeavy ********************integer j data *HeavyG2symbol *data *HeavyG2code kiron data j
Definition: cblkHeavy.h:36
*Zfirst p fm *Zfirst p Zfirst p code
Definition: ZavoidUnionMap.h:1
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 ! knockon is considered Obsolete *PhotoProd false
Definition: cblkElemag.h:7
*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
Definition: ZavoidUnionMap.h:1
! timing nfai
Definition: Zprivate2.h:12