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

Go to the source code of this file.

Functions/Subroutines

subroutine cpush (a)
 
subroutine cpop (a, remain)
 
subroutine cgetstacked (stackpos, aTrack, icon)
 
subroutine cinitstack
 
subroutine cgetcurrentstackpos (stackpos)
 
subroutine cresetstackpos (stackpos)
 
subroutine csortstack
 

Function/Subroutine Documentation

◆ cgetcurrentstackpos()

subroutine cgetcurrentstackpos ( integer  stackpos)

Definition at line 84 of file cstack.f.

Referenced by chooknepint(), cinteraction(), cmoveptcl1(), and cmoveptcl3().

84  implicit none
85 #include "Zmaxdef.h"
86 #include "Ztrack.h"
87 #include "Zstackv.h"
88  integer stackpos
89  stackpos=stack_pos
Here is the caller graph for this function:

◆ cgetstacked()

subroutine cgetstacked ( integer  stackpos,
type(track aTrack,
integer  icon 
)

Definition at line 57 of file cstack.f.

57  implicit none
58 #include "Zmaxdef.h"
59 #include "Ztrack.h"
60 #include "Zstackv.h"
61  integer stackpos ! input. stack pos from which track is
62  ! to be extracted.
63  type(track)::atrack ! output extracted track.
64  integer icon ! output. 0 OK 1--> no. track at stackpos
65 ! diff. from cpop; Stack_pos is not affected.
66  if(stackpos .le. stack_pos .and. stackpos .ge. 1) then
67  atrack = stack(stackpos)
68  icon = 0
69  else
70  icon = 1
71  endif
Definition: Ztrack.h:44

◆ cinitstack()

subroutine cinitstack ( )

Definition at line 76 of file cstack.f.

Referenced by c1by1(), ceventloop(), chookbgevent(), cinteraction(), cpushinci(), cresetprim(), and cresetprim2().

76 ! initialize stack.
77  implicit none
78 #include "Zmaxdef.h"
79 #include "Ztrack.h"
80 #include "Zstackv.h"
81  stack_pos = 0
Here is the caller graph for this function:

◆ cpop()

subroutine cpop ( type(track a,
integer  remain 
)

Definition at line 38 of file cstack.f.

Referenced by cpushinci(), and ctrackingall().

38  implicit none
39 #include "Zmaxdef.h"
40 #include "Ztrack.h"
41 #include "Zstackv.h"
42  type(track)::a
43 
44  integer remain
45 !
46 ! remain: int. is the number of ptcls remaining unprocessed
47 ! including the current one to be processed now.
48  if( stack_pos .le. 0) then
49  remain = 0
50  else
51  remain = stack_pos
52  a = stack(stack_pos)
53  stack_pos = stack_pos -1
54  endif
Definition: Ztrack.h:44
real(4), save a
Definition: cNRLAtmos.f:20
Here is the caller graph for this function:

◆ cpush()

subroutine cpush ( type(track a)

Definition at line 4 of file cstack.f.

References cerrormsg().

Referenced by ceventloop(), cforcessp(), cmove_c_stack(), cmoveptcl1(), cmoveptcl3(), cpushinci(), cresetprim(), cresetprim2(), and ctracking().

4  implicit none
5 #include "Zmaxdef.h"
6 #include "Ztrack.h"
7 #include "Zstackv.h"
8 #include "Zevhnv.h"
9  type(track)::a
10  character*70 msg
11 
12 !
13 ! call cifDead(a, icon) ! this is moved to after cpop.
14 ! ! so some ptcl may be stored even if
15 ! ! low energy.
16 ! if(icon .eq. 0) then
17  if( a%p%code /= 0) then
18  if( stack_pos .ge. max_stack_size) then
19  write(msg,*) 'stack area full=',max_stack_size
20  call cerrormsg(msg, 0)
21  else
22  stack_pos = stack_pos + 1
23  stack(stack_pos) = a
24  endif
25  else
26 ! although very rare, 0 code appears; neglect it (once /5 days)
27 
28  write(0,*) ' code=0 appeared subcode=',a%p%subcode
29  write(0,*) ' charge=',a%p%charge
30  write(0,*) ' px,py, pz, E, mass=',a%p%fm%p(1:4), a%p%mass
31  write(0,*) ' neglected for stacking in cstack.f'
32  write(0,*) 'ActiveMdl=',activemdl
33 !c call checkstat("in cpush")
34  endif
subroutine cerrormsg(msg, needrtn)
Definition: cerrorMsg.f:4
Definition: Ztrack.h:44
real(4), save a
Definition: cNRLAtmos.f:20
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cresetstackpos()

subroutine cresetstackpos ( integer  stackpos)

Definition at line 92 of file cstack.f.

Referenced by cinteraction(), and cthinstack().

92  implicit none
93 #include "Zmaxdef.h"
94 #include "Ztrack.h"
95 #include "Zstackv.h"
96  integer stackpos
97  stack_pos=stackpos
Here is the caller graph for this function:

◆ csortstack()

subroutine csortstack ( )

Definition at line 102 of file cstack.f.

References kqsortd(), and ksortinv().

Referenced by cpushinci(), and xbgrun().

102 ! sort stack dscending order
103  implicit none
104 #include "Zmaxdef.h"
105 #include "Ztrack.h"
106 #include "Zstackv.h"
107  real*8 erg(max_stack_size)
108  type(track)::sorted(max_stack_size)
109  integer idx(max_stack_size)
110 
111  integer i, j, k
112  type(track)::temp
113  do i = 1, stack_pos
114  erg(i) = stack(i)%p%fm%p(4)
115  enddo
116 
117  call kqsortd(erg, idx, stack_pos)
118  call ksortinv(idx, stack_pos)
119 
120  do i = 1, stack_pos
121  sorted(i) = stack(idx(i))
122  enddo
123 
124  do i = 1, stack_pos
125  stack(i) = sorted(i)
126  enddo
nodes i
Definition: Ztrack.h:44
averg real MaxCPU integer idx(Maxp)
********************block data cblkHeavy ********************integer j data *HeavyG2symbol *data *HeavyG2code kiron data j
Definition: cblkHeavy.h:36
subroutine kqsortd(A, ORD, N)
Definition: kqsortd.f:23
real(4), dimension(:), allocatable, save temp
Definition: cNRLAtmos.f:29
subroutine ksortinv(idx, n)
Definition: ksortinv.f:2
float erg[maxp]
Definition: Zprivate.h:7
Here is the call graph for this function:
Here is the caller graph for this function: