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

Go to the source code of this file.

Functions/Subroutines

subroutine chookbgrun
 
subroutine chookbgevent
 
subroutine chookobs (aTrack, id)
 
subroutine chookenevent
 
subroutine chookenrun
 
subroutine chooktrace
 
subroutine chookeint (never)
 
subroutine chookgint (never)
 
subroutine chooknepint (never)
 

Function/Subroutine Documentation

◆ chookbgevent()

subroutine chookbgevent ( )

Definition at line 38 of file chook.f.

References mpirank.

38  implicit none
39 #if defined (DOMPI)
40 #include "mpif.h"
41 #include "Zmpi.h"
42  real*8 etime1
43  etime1 = mpi_wtime()
44  write(0,*) 'rank=',mpirank, ' time start=',etime1
45 #endif
integer mpirank
Definition: Zmpibasic.h:1

◆ chookbgrun()

subroutine chookbgrun ( )

Definition at line 13 of file chook.f.

References cprintobs(), cprintprim(), and cwriteparam().

13  implicit none
14 #include "Zmanagerp.h"
15 
16 ! If you feel writing the parameters on stderr is
17 ! a bother, comment out the next or
18 ! use other device than ErrorOut.
19 ! Also you may comment out all output routines below.
20 
21 ! namelist output
22  call cwriteparam(errorout, 0)
23 ! primary information
24  call cprintprim(errorout)
25 ! observation level information
26  call cprintobs(errorout)
27 
28 
subroutine cprintobs(io)
Definition: cprintObs.f:2
subroutine cprintprim(out)
Definition: cprintPrim.f:3
subroutine cwriteparam(io, force)
Definition: cwriteParam.f:4
Here is the call graph for this function:

◆ chookeint()

subroutine chookeint ( integer  never)

Definition at line 237 of file chook.f.

237  implicit none
238 
239 #include "Ztrack.h"
240 #include "Ztrackv.h"
241 ! #include "Ztrackp.h"
242 
243  integer never ! input & output
244 
245 ! don't make never = 1, if you want to get
246 ! information after an electron made interaction
247 ! if this is made non zero, this routine will never be called.
248 !
249 ! MovedTrack is the electron that made interaction
250 ! Pwork contains produced particles.
251 ! Nproduced has the number of particles in Pwork
252 ! IntInfArray(ProcessNo) contains the type of interaction
253 !
254 ! default setting
255  never = 1
256 !
257 ! IntInfArray(ProcessNo).process will have one of
258 ! 'brems', 'mscat', 'bscat',or 'anihi'
259 !

◆ chookenevent()

subroutine chookenevent ( )

Definition at line 103 of file chook.f.

References cqfirstcolmedia(), cqfirstipi(), cqincident(), and mpirank.

103 
104  implicit none
105 #include "Ztrack.h"
106 #include "Ztrackv.h"
107 #include "Zobs.h"
108 #include "Zobsp.h"
109 #include "Zobsv.h"
110 
111  integer i
112 
113  type(coord):: angle
114  type(track):: incident
115 
116 #if defined (DOMPI)
117 #include "mpif.h"
118 #include "Zmpi.h"
119  real*8 etime2
120  etime2 = mpi_wtime()
121  write(0,*) 'rank=',mpirank, ' time end=',etime2
122 #endif
123  real(8):: xs
124  integer:: ia, iz
125 
126  if(observeas) then
127 ! electron size in B approx.
128  write(*, *) (asobssites(i)%esize, i=1, noofassites)
129 ! size weighted age
130  write(*, *) (asobssites(i)%age, i=1, noofassites)
131  endif
132  call cqincident(incident, angle)
133 
134  write(0,*) '1ry c,subc,chg, TE cos-zenith '
135  write(0,*)
136  * incident%p%code, incident%p%subcode, incident%p%charge,
137  * incident%p%fm%p(4), incident%vec%coszenith
138  call cqfirstipi(incident) ! first int point info.
139  write(0,*) ' 1st int. depth, height, coszenith'
140  write(0,*) incident%pos%depth, incident%pos%height,
141  * incident%vec%coszenith
142  call cqfirstcolmedia(ia, iz, xs)
143  write(0,*) ' first A,Z,xs=', ia, iz, xs
subroutine cqincident(incident, AngleAtObs)
Definition: cmkIncident.f:486
nodes i
Definition: Ztrack.h:44
! constants thru Cosmos real ! if multiplied to deg radian Torad ! light velocity m sec ! infinty ! kg m2 *Togpcm2 g cm2 ! g cm2 *Tokgpm2 kg m2 ! cm *Tom m ! m *Tocm cm ! g cm3 *Tokgpm3 kg m3 ! kg m3 *Togpcm3 g cm3 ! sec *Tonsec nsec ! Tesla m ! Avogadro *A2deninv ! mfp *n * xs
Definition: Zglobalc.h:18
integer mpirank
Definition: Zmpibasic.h:1
subroutine cqfirstcolmedia(A, Z, xs)
Definition: ciniTracking.f:211
subroutine cqfirstipi(ptrack)
Definition: ciniTracking.f:199
Definition: Zcoord.h:43
Here is the call graph for this function:

◆ chookenrun()

subroutine chookenrun ( )

Definition at line 151 of file chook.f.

151 
152  implicit none
153 #include "Ztrack.h"
154 #include "Ztrackp.h"
155  integer klena
156  character*24 tracefile
157  character*1 qm/"'"/
158  write(*,'(a)') '# ^ ^ ^'
159  write(*,'(a)') '# | | | '
160  write(*,'(a)') '# depth indx code charge time E '//
161  * ' X (m) Y (m) Wx Wy Wz'//
162  * ' cos(zenith)'
163 
164  write(*, *)
165 
166  write(0, *)
167  * ' ****** Congratulations ****** '
168 
169  if(trace .gt. 0) then
170  tracefile = tracedir(1:klena(tracedir))//'trace?'
171  write(0, *)
172  * ' particle trace data has been created'//
173  * ' in '//tracefile
174  write(0, *)
175  * ' ?=1,2... You can see it by Geomview (or gnuplot): '
176  write(0, *)
177  * 'Geomview is faster & better; If it has been installed, do '
178  write(0, *)
179  * ' dispcosTraceByGeomv path-to-tracefile(=trace1 or 2)'
180  write(0, *) " "
181  write(0, *)
182  * ' For gnuplot, use dispcosTraceByGnup instead '
183  write(0,*) ' In both case, if no argument is given,'
184  write(0,*) ' usage will be shown'
185  write(0,*)
186  write(0,*)
187  * " ***Make Trace=0 in 'param file' for normal jobs***"
188  endif
189  write(0, *)
190  * '************ Have a nice day !! **************'
191 
integer function klena(cha)
Definition: klena.f:20

◆ chookgint()

subroutine chookgint ( integer  never)

Definition at line 266 of file chook.f.

266  implicit none
267 
268 #include "Ztrack.h"
269 #include "Ztrackv.h"
270 ! #include "Ztrackp.h"
271 
272  integer never ! input & output
273 
274 ! don't make never = 1, if you want to get
275 ! information after a gamma ray made interaction
276 ! if this is made non zero, this routine will never be called.
277 !
278 ! MovedTrack is the gamma that made interaction
279 ! Pwork contains produced particles.
280 ! Nproduced has the number of particles in Pwork
281 ! IntInfArray(ProcessNo) contains the type of interaction
282 !
283 ! default setting
284  never = 1
285 ! IntInfArray(ProcessNo).process will have one of
286 ! 'pair', 'comp', 'photoe' or 'photop'
287 !

◆ chooknepint()

subroutine chooknepint ( integer  never)

Definition at line 295 of file chook.f.

295  use modxsecmedia
296  implicit none
297 
298 #include "Ztrack.h"
299 #include "Ztrackv.h"
300 
301  integer never ! input & output
302  integer:: a,z
303  real(8):: xs, pabs, teta
304  integer:: i
305 
306 
307 
308 ! don't make never = 1, if you want to get
309 ! information after a non-e-g particle made interaction
310 ! if this is made non zero, this routine will never be called.
311 !
312 ! MovedTrack is the particle that made interaction
313 ! Pwork contains produced particles.
314 ! Nproduced has the 0number of particles in Pwork
315 ! IntInfArray(ProcessNo) contains the type of interaction
316 !
317 ! default setting
318  never = 1
nodes z
nodes i
! constants thru Cosmos real ! if multiplied to deg radian Torad ! light velocity m sec ! infinty ! kg m2 *Togpcm2 g cm2 ! g cm2 *Tokgpm2 kg m2 ! cm *Tom m ! m *Tocm cm ! g cm3 *Tokgpm3 kg m3 ! kg m3 *Togpcm3 g cm3 ! sec *Tonsec nsec ! Tesla m ! Avogadro *A2deninv ! mfp *n * xs
Definition: Zglobalc.h:18
real(4), save a
Definition: cNRLAtmos.f:20

◆ chookobs()

subroutine chookobs ( type(track aTrack,
integer  id 
)

Definition at line 54 of file chook.f.

54 !
55 ! Note that every real variable is in double precision so
56 ! that you may output it in sigle precision to save the memory.
57 ! In some cases it is essential to put it in sigle (say,
58 ! for gnuplot).
59 !
60  implicit none
61 #include "Ztrack.h"
62  integer id ! input. 1 ==> aTrack is going out from
63 ! outer boundery.
64 ! 2 ==> reached at an observation level
65 ! 3 ==> reached at inner boundery.
66  type(track):: atrack
67 !
68 ! For id =2, you need not output the z value, because it is always
69 ! 0 (within the computational accuracy).
70 !
71  if(id .eq. 2) then
72 ! output typical quantities.
73  write(*, '(3i3, 1p, 4g15.4,0p, 4f10.6)')
74  * atrack%where, ! observation level. integer*2. 1 is highest.
75  * atrack%p%code, ! ptcl code. integer*2.
76  * atrack%p%charge, ! charge, integer*2
77  * atrack%t, ! relateive arrival time in nsec (NOT sec).
78  ! if TimeStructure is F, nonsense.
79  * atrack%p%fm%p(4), ! total energy in GeV.
80  * atrack%pos%xyz%r(1), atrack%pos%xyz%r(2), ! x, y in m
81  * atrack%vec%w%r(1), ! direc. cos%x in the current detector system.
82  * atrack%vec%w%r(2), ! direc. cos%y
83  * atrack%vec%w%r(3), ! direc. cos%z
84  * atrack%vec%coszenith ! cos of zenith angle
85  endif
86 ! you may need in some case other information such as
87 ! aTrack.p.subcode ! sub code of the particle integer*2
88 ! aTrack.p.mass ! mass
89 ! aTrack.wgt ! weight of the particle (may not be 1. if
90  ! ThinSampling =T)
91 ! aTrack.p.fm.p(1) ! momentum x component. Note. Momentum is
92 ! given in the Earth xyz system.
93 
94 ! aTrack.p.fm.p(2) ! y
95 ! aTrack.p.fm.p(3) ! z
96 
Definition: Ztrack.h:44

◆ chooktrace()

subroutine chooktrace ( )

Definition at line 202 of file chook.f.

202  implicit none
203 
204 #include "Ztrack.h"
205 #include "Ztrackv.h"
206 #include "Ztrackp.h"
207 #include "Zobs.h"
208 #include "Zobsv.h"
209 
210  real*4 h1, h2
211 !
212 ! Every time a particle is moved in the atmosphere, this routine is called,
213 ! if trace > 60.
214 ! For a one track segment,
215 ! TrackBefMove has track information at the beginning of the segment.
216 ! MoveTrack has track information at the end of the segment.
217 !
218 ! You can know the information a track contains in the
219 ! chookObs routine. (Note however, no conversion of coordinate
220 ! has been done. The values are in the Earth xyz system.)
221 ! Besides quantities explained there, you can use, for a given 'track'
222 !
223 ! atrack.pos.xyz.x, atrack.pos.xyz.y, atrack.pos.xyz.z (x,y.z)
224 ! atrack.pos.radiallen (distance from the center of the earth)
225 ! atrack.pos.depth (vertical depth)
226 ! atrack.pos.height (vertical heigth from sea level)
227 !
228 
229  h1 = trackbefmove%pos%height- obssites(noofsites)%pos%height
230  h2 = movedtrack%pos%height - obssites(noofsites)%pos%height
231