COSMOS v7.655  COSMOSv7655
(AirShowerMC)
csampAF.f
Go to the documentation of this file.
1  subroutine csampaf0(iowk, filen, sampInfo)
2  implicit none
3 #include "ZsampAF.h"
4  integer iowk ! input file logical number temporarily used
5  character*(*) filen ! input. file name which contains (x,dn/dx)
6 
7  type(sampaf):: sampInfo
8 
9  integer icon
10  integer i
11  call copenf(iowk, filen, icon)
12  if(icon .ne. 0 ) then
13  write(0,*) ' error '
14  write(0,*) 'file: ',filen
15  write(0,*) ' could not be opened'
16  stop
17  endif
18  i = 0
19  call cskipcomment(iowk, icon)
20  if(icon .ne. 0 ) stop
21  do while ( .true. )
22  read(iowk, *, end=100) sampinfo.x(i+1), sampinfo.y(i+1)
23  i = i + 1
24  enddo
25  100 continue
26  close(iowk)
27  sampinfo.n = i
28  call ksampaf0(sampinfo.x, sampinfo.y, sampinfo.n,
29  * sampinfo.coef, sampinfo.n, sampinfo.yi,
30  * sampinfo.sum, sampinfo.coef2)
31  end
32  subroutine csampaf(sampInfo, xs)
33  implicit none
34 #include "ZsampAF.h"
35  type(sampaf):: sampInfo
36  real*8 xs
37  call ksampaf(sampinfo.x, sampinfo.yi, sampinfo.n,
38  * sampinfo.coef2, sampinfo.n, xs)
39  end
40  subroutine csampafintp(sampInfo, xv, ans)
41 ! this is not for sampling but simply
42 ! get value of y at xf
43 
44  implicit none
45 #include "ZsampAF.h"
46  type(sampaf):: sampInfo ! input obtained by csampAF0
47  real*8 xv ! input
48  real*8 ans ! output y at xv
49  call kcsplintp(sampinfo.x, sampinfo.y, sampinfo.n,
50  * sampinfo.coef, sampinfo.n, xv, ans)
51  end
52  subroutine csampafmax(sampInfo, xmax, fmax)
53 ! find max position and value of given function
54 ! (approx value)
55  implicit none
56 #include "ZsampAF.h"
57  type(sampaf):: sampInfo ! input obtained by csampAF0
58  real*8 xmax ! ouput. max position in (x1,x2) ; approx value
59  real*8 fmax ! outpu. max function value
60 
61  real*8 x1, x2
62  real*8 x, dx, temp
63  integer i
64 
65  x1 = sampinfo.x(1)
66  x2 = sampinfo.x(sampinfo.n)
67  x = x1
68  dx = (x2-x1)/sampinfo.n/10.
69  xmax = x1
70  call csampafintp(sampinfo, xmax, fmax)
71  call csampafintp(sampinfo, x2, temp)
72  if( fmax .lt. temp ) then
73  xmax = x2
74  fmax = temp
75  endif
76  x = x + dx
77  do while (x .lt. x2-dx/2 )
78  call csampafintp(sampinfo, x, temp)
79  if( fmax .lt. temp ) then
80  xmax = x
81  fmax = temp
82  endif
83  x = x + dx
84  enddo
85  end
subroutine csampafintp(sampInfo, xv, ans)
Definition: csampAF.f:41
subroutine csampaf0(iowk, filen, sampInfo)
Definition: csampAF.f:2
block data cblkElemag data *AnihiE ! Eposi< 1 TeV, anihilation considered *X0/365.667/, ! radiation length of air in kg/m2 *Ecrit/81.e-3/, ! critical energy of air in GeV *MaxComptonE/1./, ! compton is considered below 1 GeV *MaxPhotoE/1.e-3/, ! above this, PhotoElectric effect neg. *MinPhotoProdE/153.e-3/, ! below 153 MeV, no gp --> hadrons ! scattering const not MeV *Knockon true
Definition: cblkElemag.h:7
subroutine ksampaf(x, yi, n, coef2, nc, xs)
Definition: ksampAF.f:120
subroutine csampaf(sampInfo, xs)
Definition: csampAF.f:33
subroutine ksampaf0(x, y, n, coef, nc, yi, total, coef2)
Definition: ksampAF.f:55
subroutine copenf(io, fnin, icon)
Definition: copenf.f:8
subroutine csampafmax(sampInfo, xmax, fmax)
Definition: csampAF.f:53
latitude latitude this system is used *****************************************************************! type coord sequence union map real y
Definition: Zcoord.h:25
subroutine kcsplintp(x, y, n, coef, nc, v, f)
Definition: kcsplIntp.f:2
subroutine cskipcomment(io, icon)
Definition: cskipComment.f:19
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