COSMOS v7.655  COSMOSv7655
(AirShowerMC)
get1hyb.f
Go to the documentation of this file.
1  module modzbin2ascii
2  implicit none
3  integer,parameter:: ndepth=50
4  integer fn1
5  real*8 asdep(ndepth), munit(ndepth)
6  real*8 esize0(ndepth),
8  * seloss0(ndepth),
10  * nh0(ndepth),
11  * cog, cog2
12  integer evno0
13 
14  contains
15  subroutine get1hyb( rew )
16  implicit none
17  logical rew
18  character*128 input0
19  integer i, klena
20 
21  integer code, subcode, charge
22 
23  real E0, w1, w2, w3, firstz
24 
25 ! data format
26 ! 1 xxx
27 ! 1 xxx
28 ! 1 xxx
29 ! 1 xxx
30 !
31 ! 2 xxx
32 ! 2 xxx
33 ! 2 xxx
34 ! 2 xxx
35 !
36 ! 3 xxx
37 ! 3 xxx
38 ! 3 xxx
39 ! 3 xxx
40  if(rew) rewind fn1
41  input0 = "x"
42  read(fn1,'(a)') input0
43  read(input0(3:klena(input0)), *)
44  * evno0, code, subcode, charge,
45  * e0, w1, w2, w3, firstz, cog, cog2
46  do while (input0(1:10) .ne. " ")
47  input0=" "
48  read( fn1 ,'(a)') input0
49  if(input0(1:10) .ne. " ") then
50  read(input0(1:klena(input0)), *)
51  * i, asdep(i), munit(i), age0(i), cogdep0(i),
52  * ng0(i), ne0(i), nmu0(i), nh0(i),
53  * esize0(i), seloss0(i)
54  endif
55  enddo
56  end subroutine get1hyb
57 ! ***********************
58  subroutine mergehyb1(h1)
59  use modhistogram1
60  use modhistogram2
61  use modhistogram3
62  implicit none
63 
64  type(histogram1) h1
65  type(histogram2) h2
66  type(histogram3) h3
67 
68  integer klena
69  integer j
70 
71  do while (h1%c%eventno .ne. evno0)
72  call get1hyb( h1%c%eventno .lt. evno0)
73  enddo
74 !
75 ! this part must be consistent with
76 ! FleshHist/interface.f output for evid
77  read(h1%c%id, '(i3)') j
78  write(h1%c%id,
79  * '(i3, i5, f5.2, f5.2,
80  * i5, i4)')
81  * j, int( asdep(j) ),
82  * age0(j), cogdep0(j),
83  * int(munit(j)), int(cog2)
84 
85  return
86 ! *******************
87  entry mergehyb2(h2)
88 ! *******************
89 
90 
91  do while (h2%c%eventno .ne. evno0)
92  call get1hyb( h2%c%eventno .lt. evno0)
93  enddo
94  read(h2%c%id, '(i3)') j
95 
96  write(h2%c%id,
97  * '(i3, i5, f5.2, f5.2,
98  * i5, i4)')
99  * j, int( asdep(j) ),
100  * age0(j), cogdep0(j),
101  * int(munit(j)), int(cog2)
102 
103  return
104 ! *****************
105  entry mergehyb3(h3)
106 ! ****************
107 
108 
109  do while (h3%c%eventno .ne. evno0)
110  call get1hyb( h3%c%eventno .lt. evno0)
111  enddo
112 
113  read(h3%c%id, '(i3)') j
114  write(h3%c%id,
115  * '(i3, i5, f5.2, f5.2,
116  * i5, i4)')
117  * j, int( asdep(j) ),
118  * age0(j), cogdep0(j),
119  * int(munit(j)), int(cog2)
120 
121 
122  end subroutine mergehyb1
123 
124 
125  subroutine openhyb(icon)
126  implicit none
127  integer icon ! output. 1--> hybrid must be read
128  ! 0--> hybrid need not be used
129  integer leng
130 
131  character*120 hyb0
132  integer kgetenv2
133 
134 
135  fn1= 3
136  leng = kgetenv2("HYBFILE0", hyb0)
137  call copenfw2(fn1, hyb0, 1, icon)
138  if(icon .ne. 1) then
139  write(0,*)
140  * '*************** caution ************'
141  write(0,*)
142  * "You haven't given env. var. HYBFILE0"
143  write(0,*)
144  * "or File specified by HYBFILE0"
145  if( icon .eq. 0) then
146  write(0,*) 'not exists'
147  else
148  write(0,*) ' cannot be opened '
149  endif
150  write(0,*)
151  * "It's ok if you don't merge hybrid data file"
152  icon = 0
153  else
154  write(0,*) hyb0(1:leng), ' opened'
155  icon = 1
156  endif
157 
158  evno0 =0
159  end subroutine openhyb
160  end module modzbin2ascii
161 
real *8 cog
Definition: get1hyb.f:6
subroutine get1hyb
real *8, dimension(ndepth) esize0
Definition: get1hyb.f:6
real *8, dimension(ndepth) age0
Definition: get1hyb.f:6
real *8, dimension(ndepth) cogdep0
Definition: get1hyb.f:6
real *8, dimension(ndepth) asdep
Definition: get1hyb.f:5
real *8, dimension(ndepth) munit
Definition: get1hyb.f:5
subroutine mergehyb1(h1)
Definition: bin2bin.f:166
real *8, dimension(ndepth) nmu0
Definition: get1hyb.f:6
integer, parameter ndepth
Definition: get1hyb.f:3
subroutine copenfw2(io, fnin, form, icon)
Definition: copenf.f:205
real *8, dimension(ndepth) ne0
Definition: get1hyb.f:6
real *8, dimension(ndepth) seloss0
Definition: get1hyb.f:6
integer fn1
Definition: get1hyb.f:4
real *8, dimension(ndepth) ng0
Definition: get1hyb.f:6
real *8 cog2
Definition: get1hyb.f:6
real *8, dimension(ndepth) nh0
Definition: get1hyb.f:6
integer evno0
Definition: get1hyb.f:12
subroutine openhyb(icon)
Definition: bin2bin.f:261