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

Go to the source code of this file.

Functions/Subroutines

subroutine ksampaf0 (x, y, n, coef, nc, yi, total, coef2)
 
subroutine ksampaf0_b (x, y, n, coef, nc)
 
subroutine ksampaf (x, yi, n, coef2, nc, xs)
 

Function/Subroutine Documentation

◆ ksampaf()

subroutine ksampaf ( real*8, dimension(n x,
real*8, dimension(n yi,
integer  n,
real*8, dimension(nc, 3)  coef2,
integer  nc,
real*8  xs 
)

Definition at line 120 of file ksampAF.f.

References kcsplintp(), and rndc().

Referenced by csampaf().

120  implicit none
121  integer n
122  real*8 x(n), yi(n)
123  integer nc
124  real*8 coef2(nc, 3)
125  real*8 xs !output. sampled x
126  real*8 u
127 
128  call rndc(u)
129  call kcsplintp(yi, x, n, coef2, nc, u, xs)
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
subroutine kcsplintp(x, y, n, coef, nc, v, f)
Definition: kcsplIntp.f:2
real cut integer nc
Definition: Zprivate.h:1
integer n
Definition: Zcinippxc.h:1
! structure defining a particle at production ! Basic idea of what is to be contained in ! the particle structue is that dynamical ones should be included those derivable from the particle code ! is not included ******************************************************type fmom momentum sequence union map real e endmap map real * x
Definition: Zptcl.h:21
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ksampaf0()

subroutine ksampaf0 ( real*8, dimension(n x,
real*8, dimension(n y,
integer  n,
real*8, dimension(nc, 3)  coef,
integer  nc,
real*8, dimension(n yi,
real*8  total,
real*8, dimension(nc, 3)  coef2 
)

Definition at line 55 of file ksampAF.f.

References kcsplcoef(), and kcsplinteg().

Referenced by csampaf0().

55  implicit none
56  integer n ! input number of data points
57  real*8 x(n), y(n) ! input data points (x,y)
58 ! zero is assumed at x<x(1) or x>x(n)
59  integer nc ! input. must be >=n-1
60  real*8 coef(nc, 3) ! output. to keep the spline coefficents
61  real*8 yi(n) ! output. yi(i)= Normalized integral from x=x(1) to x(i)
62 ! (i = 1, n) (yia(1)=0. yi(n)= 1.0)
63  real*8 total ! integral valeu of the function
64 !
65  real*8 coef2(nc, 3) !ouptut. coef2 to be used for (yi, x)
66 ! spline interploation
67 !
68 
69 
70 
71  real*8 dx, a, b, sum
72  integer i
73  real*8 x1, x2
74 
75  if( nc .lt. n-1 ) then
76  write(0,*) ' nc< n-1 in ksamplAF0'
77  stop 1234
78  endif
79 
80  call kcsplcoef(x, y, n, coef, nc)
81  a = x(1)
82  b = x(n)
83  call kcsplinteg(x, y, n, coef, nc, a, b, total)
84 
85  yi(1) = 0.
86  do i = 2, n
87  b = x(i)
88  call kcsplinteg(x, y, n, coef, nc, a, b, sum)
89  yi(i) = sum/total
90  enddo
91 ! to assure yi(n) = 1.
92  yi(n) = 1.
93  call kcsplcoef(yi, x, n, coef2, nc)
subroutine kcsplinteg(x, y, n, coef, nc, a, b, s)
Definition: kcsplInteg.f:2
block data include Zlatfit h c fitting region data x1(1)/0.03/
subroutine kcsplcoef(x, y, n, coef, nc)
Definition: kcsplCoef.f:2
nodes i
integer npitbl real *nx dx real dx
Definition: Zcinippxc.h:10
latitude latitude this system is used *****************************************************************! type coord sequence union map real y
Definition: Zcoord.h:25
real(4), save a
Definition: cNRLAtmos.f:20
real(4), save b
Definition: cNRLAtmos.f:21
real cut integer nc
Definition: Zprivate.h:1
block data include Zlatfit h c fitting region data x2(1)/0.5/data x1(2)/0.3/
integer n
Definition: Zcinippxc.h:1
! structure defining a particle at production ! Basic idea of what is to be contained in ! the particle structue is that dynamical ones should be included those derivable from the particle code ! is not included ******************************************************type fmom momentum sequence union map real e endmap map real * x
Definition: Zptcl.h:21
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ksampaf0_b()

subroutine ksampaf0_b ( real*8, dimension(n x,
real*8, dimension(n y,
integer  n,
real*8, dimension(nc, 3)  coef,
integer  nc 
)

Definition at line 98 of file ksampAF.f.

References kcsplcoef().

98  implicit none
99 ! this is only for getting interplation
100  integer n ! input number of data points
101  real*8 x(n), y(n) ! input data points (x,y)
102 ! zero is assumed at x<x(1) or x>x(n)
103  integer nc ! input. must be >=n-1
104  real*8 coef(nc, 3) ! output. to keep the spline coefficents
105 
106 
107  real*8 dx, a, b
108  integer i
109  real*8 x1, x2
110 
111  if( nc .lt. n-1 ) then
112  write(0,*) ' nc< n-1 in ksamplAF0'
113  stop 1234
114  endif
115 
116  call kcsplcoef(x, y, n, coef, nc)
block data include Zlatfit h c fitting region data x1(1)/0.03/
subroutine kcsplcoef(x, y, n, coef, nc)
Definition: kcsplCoef.f:2
nodes i
integer npitbl real *nx dx real dx
Definition: Zcinippxc.h:10
latitude latitude this system is used *****************************************************************! type coord sequence union map real y
Definition: Zcoord.h:25
real(4), save a
Definition: cNRLAtmos.f:20
real(4), save b
Definition: cNRLAtmos.f:21
real cut integer nc
Definition: Zprivate.h:1
block data include Zlatfit h c fitting region data x2(1)/0.5/data x1(2)/0.3/
integer n
Definition: Zcinippxc.h:1
! structure defining a particle at production ! Basic idea of what is to be contained in ! the particle structue is that dynamical ones should be included those derivable from the particle code ! is not included ******************************************************type fmom momentum sequence union map real e endmap map real * x
Definition: Zptcl.h:21
Here is the call graph for this function: