COSMOS v7.655  COSMOSv7655
(AirShowerMC)
inc_writeHyb.f
Go to the documentation of this file.
1 
2  if(observeas) then
3 #if defined (DOMPI)
4  msg = dir(1:lengdir)//"/"//execid(1:lengid)//".hyb"
5 !
6 #define NgXXX NgA
7 ! #define NgXXX Ng
8 #define NeXXX NeA
9 ! #define NeXXX Ne
10 #define NmuXXX NmuA
11 ! #define NmuXXX Nmu
12 #define NhadXXX NhadA
13 ! #define NhadXXX Nhad
14 #define SumElossXXX SumElossA
15 ! #define SumElossXXX SumEloss
16 #else
17  msg = dir(1:lengdir)//"/"//execid(1:lengid)//
18  * "-@."//numb(1:lengn)//".hyb"
19 #define NgXXX Ng
20 #define NeXXX Ne
21 #define NmuXXX Nmu
22 #define NhadXXX Nhad
23 #define SumElossXXX SumEloss
24 #endif
25  call copenfw2(fnob, msg, 1, icon)
26  if(icon .gt. 1) then
27  write(0,*) ' icon=', icon
28  call cerrormsg(msg, 1)
29  call cerrormsg('could not be opened', 0)
30  endif
31  cog = 0.
32  sumne = 0.
33 
34  do i = 1, noofassites
35 
36  asobssites(i).esize = asobssites(i).esize* enhance
37 
38  if(i .gt. 1 .and. i .lt. noofassites ) then
39  dd =(asdepthlist(i+1) - asdepthlist(i-1))/2.0
40  elseif(i .eq. 1) then
41  dd =(asdepthlist(2) - asdepthlist(1))
42  else
43  dd =(asdepthlist(noofassites) -
44  * asdepthlist(noofassites-1))
45  endif
46  cog = cog + asobssites(i).esize*dd*asdepthlist(i)
47  sumne= sumne +asobssites(i).esize*dd
48  enddo
49 ! 0.1 is for g/cm2
50  cog = cog*0.1/sumne
51 
52  cog2 = 0.
53  sumne = 0.
54  do i = 1, noofassites
55  if( asobssites(i).age .gt.
56  * (2.0-asobssites(noofassites).age)) then
57  if(i .gt. 1 .and. i .lt. noofassites ) then
58  dd =( asdepthlist(i+1) - asdepthlist(i-1))/2.0
59  elseif(i .eq. 1) then
60  dd =(asdepthlist(2) - asdepthlist(1))
61  else
62  dd =(asdepthlist(noofassites) -
63  * asdepthlist(noofassites-1))
64  endif
65  dd = dd
66  cog2 = cog2 + asobssites(i).esize*asdepthlist(i)*dd
67  sumne= sumne +asobssites(i).esize*dd
68  endif
69  enddo
70  if(sumne .gt. 0.) then
71  cog2 = cog2*0.1/sumne
72  else
73 ! too deep penetration
74  cog2 = asdepthlist(noofassites)*0.1
75  endif
76 
77 
78  if(fnob .ge. 0 ) then
79  write(fnob,
80  * '("h ", i4, 3i3, 1pE11.3, 0p 3f11.7, 1pE11.3, 0p, 2f7.0)')
81  * eventno, inci.p.code,
82  * inci.p.subcode, inci.p.charge,
83  * inci.p.fm.e, -angle.r(1), -angle.r(2), -angle.r(3),
84  * firstz, cog, cog2
85  else
86  write(*,
87  * '("h ", i4, 3i3, 1pE11.3, 0p 3f11.7, 1pE11.3, 0p, 2f7.0)')
88  * eventno, inci.p.code,
89  * inci.p.subcode, inci.p.charge,
90  * inci.p.fm.e, -angle.r(1), -angle.r(2), -angle.r(3),
91  * firstz, cog, cog2
92  endif
93 
94  do i = 1, noofassites
95  if(fnob .ge. 0) then
96  write(fnob, '("t ", i3, 2f7.1, 2f6.3, 1p6E11.3)')
97  * i,
98  * asdepthlist(i)*0.1, asobssites(i).mu,
99  * asobssites(i).age, asdepthlist(i)*0.1/cog2,
100  * ngxxx(i), nexxx(i), nmuxxx(i), nhadxxx(i),
101  * asobssites(i).esize, sumelossxxx(i)
102  else
103  write(*, '("t ", i3, 2f7.1, 2f6.3, 1p6E11.3)')
104  * i,
105  * asdepthlist(i)*0.1, asobssites(i).mu,
106  * asobssites(i).age, asdepthlist(i)*0.1/cog2,
107  * ngxxx(i), nexxx(i), nmuxxx(i), nhadxxx(i),
108  * asobssites(i).esize, sumelossxxx(i)
109  endif
110  enddo
111  if(fnob .gt. 0 ) then
112  write(fnob,*)
113  close(fnob)
114  else
115  write(*,*)
116  endif
117  endif
subroutine cerrormsg(msg, needrtn)
Definition: cerrorMsg.f:4
dE dx *! Nuc Int sampling table e
Definition: cblkMuInt.h:130
*Zfirst p fm *Zfirst p Zfirst p Zfirst p *Zfirst p *Zfirst pos xyz r
Definition: ZavoidUnionMap.h:1
nodes i
integer lengn
Definition: interface2.h:1
********************block data cblkHeavy ********************integer j data *HeavyG2symbol p
Definition: cblkHeavy.h:7
subroutine copenfw2(io, fnin, form, icon)
Definition: copenf.f:205
*Zfirst p fm *Zfirst p Zfirst p code
Definition: ZavoidUnionMap.h:1
*Zfirst p fm *Zfirst p Zfirst p Zfirst p *Zfirst p charge
Definition: ZavoidUnionMap.h:1
*Zfirst p fm *Zfirst p Zfirst p Zfirst p subcode
Definition: ZavoidUnionMap.h:1