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

Go to the source code of this file.

Functions/Subroutines

subroutine csmpcolina2 (pj, ia, nc)
 
subroutine csampcolln (pj, prob, np, nx, nc)
 

Function/Subroutine Documentation

◆ csampcolln()

subroutine csampcolln ( type(ptcl pj,
real*4, dimension(np, nx)  prob,
integer  np,
integer  nx,
integer  nc 
)

Definition at line 118 of file csmpColInA2.f.

References cinelx(), d0, parameter(), and rndc().

Referenced by csmpcolina2().

118  implicit none
119 
120 #include "Zptcl.h"
121 
122  type(ptcl):: pj !input projectile particle
123  integer np ! input table size for prob.
124  integer nx ! input. table size for xsection.
125  integer nc ! output number of collisions.
126  real*4 prob(np, nx) ! table for n-coll. prob.
127 
128  real*8 xs
129 !
130  integer idxxs, i
131 
132  real*8 u
133  real*8 xs1, xs2, dxs
134  integer nn
135  parameter(nn = 46) ! this should be nx
136 ! parameter ( xs1 =log10(15.), xs2 =log10(320.) )
137  parameter( xs1 = 1.176091259d0, xs2 = 2.505149978d0,
138  * dxs =( xs2 - xs1)/(nn-1))
139 !
140  if(nx .ne. nn) then
141  write(*,*) ' error input to csampCollN'
142  stop 9999
143  endif
144 ! get cross-section for proton target.
145 ! call cxpXsec(pj, xs)
146  call cinelx(pj, 1.d0, 1.d0, xs)
147  xs = log10(xs)
148 !
149  idxxs = (xs - xs1)/dxs + 1
150  if( (xs - idxxs * dxs - xs1) .gt.
151  * (idxxs * dxs + dxs + xs1 - xs) ) then
152  idxxs = idxxs +1
153  endif
154  idxxs =max(1, min(idxxs, nn))
155 
156  call rndc(u)
157  do i=1, np
158  if(u .le. prob(i, idxxs) ) then
159  nc=i
160  goto 100
161  endif
162  enddo
163  100 continue
integer npitbl real *nx parameter(n=101, npitbl=46, nx=n-1) real *8 uconst
subroutine cinelx(pj, A, Z, xs)
Definition: cinelx.f:4
nodes i
subroutine rndc(u)
Definition: rnd.f:91
! 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
block data cblkEvhnp ! currently usable models data RegMdls ad *special data *Cekaon d0
Definition: cblkEvhnp.h:5
real cut integer nc
Definition: Zprivate.h:1
Definition: Zptcl.h:75
Here is the call graph for this function:
Here is the caller graph for this function:

◆ csmpcolina2()

subroutine csmpcolina2 ( type(ptcl pj,
integer  ia,
integer  nc 
)

Definition at line 3 of file csmpColInA2.f.

References cerrormsg(), cinelx(), csampcolln(), d0, parameter(), and rndc().

Referenced by chacoladhoc().

3  implicit none
4 #include "Zptcl.h"
5  type(ptcl):: pj !input projectile particle
6  integer ia ! target mass no.
7  integer nc ! output number of collisions.
8  call cerrormsg('*** IBM AIX must use SucInt=0 ***', 0)
subroutine cerrormsg(msg, needrtn)
Definition: cerrorMsg.f:4
real cut integer nc
Definition: Zprivate.h:1
Definition: Zptcl.h:75
Here is the call graph for this function:
Here is the caller graph for this function: