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

Go to the source code of this file.

Functions/Subroutines

subroutine ksamprsa (costheta)
 

Function/Subroutine Documentation

◆ ksamprsa()

subroutine ksamprsa ( real*8  costheta)

Definition at line 8 of file ksampRSA.f.

References d0, and rndc().

Referenced by ccohs().

8  implicit none
9 ! sample cos from (1+cos^2)dcos
10  real*8 costheta ! output cos ofsampled angle
11  real*8 u1, u2, u3
12 
13  call rndc(u1)
14  if(u1 .lt. 0.75d0) then
15  call rndc(u2)
16  costheta = 2.0*u2 -1.
17  else
18 ! second term. take max of 3 u's.
19  call rndc(u1)
20  call rndc(u2)
21  call rndc(u3)
22  costheta = max(u1, u2, u3)
23  call rndc(u1)
24  if(u1 .lt. 0.5) then
25  costheta = -costheta
26  endif
27  endif
subroutine rndc(u)
Definition: rnd.f:91
block data cblkEvhnp ! currently usable models data RegMdls ad *special data *Cekaon d0
Definition: cblkEvhnp.h:5
Here is the call graph for this function:
Here is the caller graph for this function: