COSMOS v7.655  COSMOSv7655
(AirShowerMC)
bin2bin.f File Reference

Go to the source code of this file.

Functions/Subroutines

program main
 
subroutine get1hyb (rew)
 
subroutine mergehyb1 (h1)
 
subroutine openhyb (icon)
 

Function/Subroutine Documentation

◆ get1hyb()

subroutine get1hyb ( logical  rew)

Definition at line 119 of file bin2bin.f.

References parameter().

119  implicit none
120  logical rew
121  character*128 input0
122  integer i, klena
123 
124  integer ndepth
125  parameter(ndepth= 50)
126  integer fn1
127  real*8 asdep(ndepth), munit(ndepth)
128  real*8 esize0(ndepth),
129  * age0(ndepth), cogdep0(ndepth),
130  * seloss0(ndepth),
131  * ng0(ndepth), ne0(ndepth), nmu0(ndepth),
132  * cog0
133  integer evno0
134 
135  common /zbin2ascii/
136  * asdep, esize0, age0,
137  * cogdep0, seloss0, munit,
138  * ng0, ne0, nmu0, cog0,
139  * fn1, evno0
140 
141  if(rew) rewind fn1
142 
143  input0 = "x"
144 !////////////
145 ! write(0,*) ' while'
146 !////////
147  do while (input0(1:10) .ne. " ")
148  input0=" "
149  read( fn1 ,'(a)') input0
150 !////////////
151 ! write(0,*) ' input0=',input0
152 !//////////////
153  if(input0(1:10) .ne. " ") then
154  read(input0(1:klena(input0)), *)
155  * evno0, i, asdep(i), esize0(i), age0(i),
156  * cogdep0(i), seloss0(i),
157  * munit(i), ng0(i), ne0(i), nmu0(i), cog0
158 !/////////
159 ! write(0,*) ' input0 read'
160 !//////////////
161  endif
162  enddo
integer npitbl real *nx parameter(n=101, npitbl=46, nx=n-1) real *8 uconst
nodes i
integer function klena(cha)
Definition: klena.f:20
Here is the call graph for this function:

◆ main()

program main ( )

Definition at line 1 of file bin2bin.f.

References copenfw2(), false, kwhistd(), kwhistp(), kwhistr(), kwhists(), kwhistso(), and true.

Here is the call graph for this function:

◆ mergehyb1()

subroutine mergehyb1 ( type(histogram1 h1)

Definition at line 166 of file bin2bin.f.

References get1hyb(), and parameter().

166  use modhistogram1
167  use modhistogram2
168  use modhistogram3
169  implicit none
170 
171  type(histogram1) h1
172  type(histogram2) h2
173  type(histogram3) h3
174 
175  integer ndepth
176  integer nc
177  parameter(ndepth= 50)
178  integer fn1
179  real*8 asdep(ndepth), munit(ndepth)
180  real*8 esize0(ndepth),
181  * age0(ndepth), cogdep0(ndepth),
182  * seloss0(ndepth),
183  * ng0(ndepth), ne0(ndepth), nmu0(ndepth),
184  * cog0
185  integer evno0
186 
187  common /zbin2ascii/
188  * asdep, esize0, age0,
189  * cogdep0, seloss0, munit,
190  * ng0, ne0, nmu0, cog0,
191  * fn1, evno0
192 
193  integer klena
194  integer j
195 
196  do while (h1%c%eventno .ne. evno0)
197  call get1hyb( h1%c%eventno .lt. evno0)
198  enddo
199 !
200 ! available variables
201 ! * idx, ASdep(idx), Esize0(idx), age0(idx),
202 ! * SEloss0(idx), munit(idx),
203 ! * Ng0(idx), Ne0(idx), Nmu0(idx),
204 ! * ASdep(idx)/cog0, cog0
205 !
206 ! this part must be consistent with
207 ! FleshHist/interface.f output for evid
208 !//////////////
209 ! write(0,*) ' id', h1%c%id
210 !///////////
211 
212  read(h1%c%id, '(i3)') j
213 !//////////////
214 ! write(0,*) ' j=',j
215 !///////////
216  write(h1%c%id,
217  * '(i3, i5, f5.2, f5.2,
218  * i5, i5)')
219  * j, int( asdep(j) ),
220  * age0(j), asdep(j)/cog0,
221  * int(munit(j)), int(cog0)
222 !//////////////
223 ! write(0,*) ' j=',j
224 !///////////
225  return
226 ! *******************
227  entry mergehyb2(h2)
228 ! *******************
229 
230 
231  do while (h2%c%eventno .ne. evno0)
232  call get1hyb( h2%c%eventno .lt. evno0)
233  enddo
234  read(h2%c%id, '(i3)') j
235  write(h2%c%id,
236  * '(i3, i5, f5.2, f5.2,
237  * i5, i5)')
238  * j, int( asdep(j) ),
239  * age0(j), asdep(j)/cog0,
240  * int(munit(j)), int(cog0)
241 
242  return
243 ! *****************
244  entry mergehyb3(h3)
245 ! ****************
246  do while (h3%c%eventno .ne. evno0)
247  call get1hyb( h3%c%eventno .lt. evno0)
248  enddo
249 
250  read(h3%c%id, '(i3)') j
251  write(h3%c%id,
252  * '(i3, i5, f5.2, f5.2,
253  * i5, i5)')
254  * j, int( asdep(j) ),
255  * age0(j), asdep(j)/cog0,
256  * int(munit(j)), int(cog0)
integer npitbl real *nx parameter(n=101, npitbl=46, nx=n-1) real *8 uconst
subroutine get1hyb
********************block data cblkHeavy ********************integer j data *HeavyG2symbol *data *HeavyG2code kiron data j
Definition: cblkHeavy.h:36
integer function klena(cha)
Definition: klena.f:20
real cut integer nc
Definition: Zprivate.h:1
Here is the call graph for this function:

◆ openhyb()

subroutine openhyb ( integer  icon)

Definition at line 261 of file bin2bin.f.

References copenfw2(), and parameter().

261  implicit none
262  integer icon ! output. 1--> hybrid must be read
263  ! 0--> hybrid need not be used
264  integer leng
265  integer ndepth
266  parameter(ndepth= 50)
267  integer fn1
268  real*8 asdep(ndepth), munit(ndepth)
269  real*8 esize0(ndepth),
270  * age0(ndepth), cogdep0(ndepth),
271  * seloss0(ndepth),
272  * ng0(ndepth), ne0(ndepth), nmu0(ndepth),
273  * cog0
274  integer evno0
275 
276  common /zbin2ascii/
277  * asdep, esize0, age0,
278  * cogdep0, seloss0, munit,
279  * ng0, ne0, nmu0, cog0,
280  * fn1, evno0
281 
282  character*120 hyb0
283  integer kgetenv2
284 
285  fn1= 3
286  leng = kgetenv2("HYBFILE0", hyb0)
287  call copenfw2(fn1, hyb0, 1, icon)
288  if(icon .ne. 1) then
289  write(0,*)
290  * "You haven't given env. var. HYBFILE0"
291  write(0,*)
292  * "or File specified by HYBFILE0"
293  if( icon .eq. 0) then
294  write(0,*) 'not exists'
295  else
296  write(0,*) ' cannot be opened '
297  endif
298  stop 9999
299  else
300  write(0,*) hyb0(1:leng), ' opened'
301  icon = 1
302  endif
303 
304  evno0 =0
integer npitbl real *nx parameter(n=101, npitbl=46, nx=n-1) real *8 uconst
integer function kgetenv2(envname, envresult)
Definition: cgetLoginN.f:77
integer leng
Definition: interface2.h:1
subroutine copenfw2(io, fnin, form, icon)
Definition: copenf.f:205
Here is the call graph for this function: