COSMOS v7.655  COSMOSv7655
(AirShowerMC)
select.f
Go to the documentation of this file.
1  implicit none
2 #include "Zprivate.h"
3 #include "Ztrack.h"
4 
5 
6 
7  integer num, cumnum, irevent(2), i, nr, firstev, lastev
8  type(track)::Zfirst
9  character*160 str
10  character*80 skelin, stro(4)
11 
12  real*8 temp
13 
14  integer klena, nlow
15 
16  mdev = 71
17  rdev = 70
18 
19  str = ' '
20  read(*,'(a)') str
21 !
22  do i = 1, 4
23  stro(i) = ' '
24  enddo
25 !
26  call ksplit(str, 80, 4, stro, nr)
27  if(nr .lt. 4) stop 'must give 2 files and 2 event #'
28 
29  skelin = stro(1)
30  read( stro(2), * ) firstev
31  read( stro(3), * ) lastev
32  mskel = stro(4)
33 
34 
35  open(rdev, file=skelin(1:klena(skelin)), form='unformatted',
36  * status='old')
37  open(mdev, file=mskel(1:klena(mskel)), form='unformatted',
38  * status='unknown')
39 
40  do while(.true.)
41  read(rdev, end= 1000) cumnum, num, irevent, zfirst
42 
43  if(cumnum .gt. lastev) goto 1000
44 
45  copy =cumnum .ge. firstev .and. cumnum .le. lastev
46  if(copy) then
47  write(mdev) cumnum, num, irevent, zfirst
48  endif
49  call cgethes(rdev)
50  nlow = 1
51  do while (nlow .ne. -1)
52  read(rdev) nlow, p
53  if(copy) then
54  write(mdev) nlow, p
55  endif
56  do i = 1, nlow
57  read(rdev) c
58  if(copy) then
59  write(mdev) c
60  endif
61  enddo
62  enddo
63  enddo
64  1000 continue
65  if(lastev .gt. cumnum) then
66  call cerrormsg(
67  * 'EOF before the specified last event reached; ok?', 1)
68  else
69  call cerrormsg(
70  * ' all events copied successfully', 1)
71  endif
72 
73  end
74 
75 
76  subroutine cgethes(from)
77  implicit none
78 #include "Zprivate.h"
79  integer from
80 !
81 
82  integer i
83 
84  read(from) np
85  if(copy) then
86  write(mdev) np
87  endif
88  do i = 1, np
89  read(from) o(i)
90  if(copy) then
91  write(mdev) o(i)
92  endif
93  enddo
94 
95  end
subroutine ksplit(a, m, n, b, nr)
Definition: ksplit.f:2
subroutine cerrormsg(msg, needrtn)
Definition: cerrorMsg.f:4
nodes i
Definition: Ztrack.h:44
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
********************block data cblkHeavy ********************integer j data *HeavyG2symbol p
Definition: cblkHeavy.h:7
subroutine cgethes(from)
Definition: chookFlesh.f:322
struct ob o[NpMax]
Definition: Zprivate.h:34
integer function klena(cha)
Definition: klena.f:20
dE dx *! Nuc Int sampling table c
Definition: cblkMuInt.h:130