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

Go to the source code of this file.

Functions/Subroutines

program __getst.f__
 
subroutine inteflux (comp, ans)
 
real *8 function primdn (eorp)
 
real *8 function funczen (zenx)
 
real *8 function funcazim (azm)
 
subroutine chooktrace
 
subroutine chookceren
 
subroutine chookcerens
 
subroutine chookcerene
 
subroutine chookbgrun
 
subroutine csetcosdeg (cosin, degin)
 

Function/Subroutine Documentation

◆ __getst.f__()

program __getst.f__ ( )

Definition at line 20 of file getST.f.

References azmmax, azmmin, cbeginrun(), cerrormsg(), coszenith, cprintprim(), creadparam(), csetcosdeg(), false, i, inteflux(), rigc, true, zen1, and zen2.

20  integer i
nodes i
Here is the call graph for this function:

◆ chookbgrun()

subroutine chookbgrun ( )

Definition at line 329 of file getST.f.

◆ chookceren()

subroutine chookceren ( )

Definition at line 323 of file getST.f.

◆ chookcerene()

subroutine chookcerene ( )

Definition at line 327 of file getST.f.

◆ chookcerens()

subroutine chookcerens ( )

Definition at line 325 of file getST.f.

◆ chooktrace()

subroutine chooktrace ( )

Definition at line 321 of file getST.f.

◆ csetcosdeg()

subroutine csetcosdeg ( logical  cosin,
logical  degin 
)

Definition at line 332 of file getST.f.

References degree.

332  implicit none
333  logical cosin, degin
334 #include "Zptcl.h"
335 #include "Zprimary.h"
336 
337  include 'Zflux.h'
338 
339  cosfactor = cosin
340  degree = degin
real zen logical degree
Definition: Zflux.h:1

◆ funcazim()

real*8 function funcazim ( real*8  azm)

Definition at line 286 of file getST.f.

References cconv_prim_e(), cprimflux0(), crigcut(), d0, degree, e, and zen.

Referenced by funcazim().

286  implicit none
287 #include "Zglobalc.h"
288 #include "Zptcl.h"
289 #include "Zprimary.h"
290  include 'Zflux.h'
291 
292  type(ptcl):: aptcl
293  real*8 rig, azm, prob, flux, zeny
294 
295 ! E= E_or_P must be converted to rigidity
296  call cconv_prim_e(compx, e, aptcl)
297 
298  rig =sqrt( aptcl%fm%p(4)**2 - aptcl%mass**2)/aptcl%charge
299  if(degree) then
300  zeny = zen/torad
301  else
302  zeny = zen
303  endif
304  call crigcut(azm, zeny, rig, prob)
305 !/////////////
306 ! prob = 1.
307 !/////////////
308  call cprimflux0(compx, e, flux) ! E = EorP
309  if(cosfactor .eq. 0 ) then
310  funcazim = flux * prob
311  elseif(cosfactor .eq. 1) then
312  funcazim = flux * prob * zen
313  elseif(cosfactor .eq. 2) then
314  funcazim = flux * prob *(1.0d0+ zen)/2.d0
315  else
316  funcazim = flux * prob *
317  * (zen + ratio*sqrt(1.-zen**2)) / sqrt(1.+ratio**2)
318  endif
dE dx *! Nuc Int sampling table e
Definition: cblkMuInt.h:130
real *8 function funcazim(azm)
Definition: getST.f:286
subroutine crigcut(azmin, zen, rig, prob)
Definition: crigCut.f:6
subroutine cconv_prim_e(comp, e_or_p, aPtcl)
Definition: csampPrimary.f:128
block data cblkEvhnp ! currently usable models data RegMdls ad *special data *Cekaon d0
Definition: cblkEvhnp.h:5
subroutine cprimflux0(comp, e_or_p, flux)
Definition: cprimFlux0.f:2
Definition: Zptcl.h:75
real zen
Definition: Zflux.h:1
real zen logical degree
Definition: Zflux.h:1
Here is the call graph for this function:
Here is the caller graph for this function:

◆ funczen()

real*8 function funczen ( real*8  zenx)

Definition at line 266 of file getST.f.

References azmmax, azmmin, d, kdexpintf(), and zen.

266  implicit none
267 #include "Zptcl.h"
268 #include "Zprimary.h"
269 
270  real*8 zenx
271 
272  include 'Zflux.h'
273 
274  integer icon
275  real*8 eps, ans, error
276  real*8 funcazim
277  external funcazim
278  data eps/1.d-5/
279 
280  zen = zenx
281  call kdexpintf(funcazim, azmmin, azmmax, eps, ans, error, icon)
282  funczen = ans
atmos%rho(atmos%nodes) **exp(-(z-atmos%z(atmos%nodes))/Hinf) elseif(z .lt. atmos%z(1)) then ans=atmos%rho(1) **exp((atmos%z(1) -z)/atmos%H(1)) else call kdwhereis(z, atmos%nodes, atmos%z, 1, i) a=atmos%a(i) if(a .ne. 0.d0) then ans=atmos%rho(i) **(1+a *(z-atmos%z(i))/atmos%H(i)) **(-1.0d0-1.d0/a) else ans=*atmos%rho(i) *exp(-(z-atmos%z(i))/atmos%H(i)) endif endif ! zsave=z ! endif cvh2den=ans end ! ---------------------------------- real *8 function cvh2temp(z) implicit none ! vettical height to temperatur(Kelvin) real *8 z ! input. vertical height in m ! output is temperature of the atmospher in Kelvin real *8 ans integer i if(z .gt. atmos%z(atmos%nodes)) then ans=atmos%T(atmos%nodes) elseif(z .lt. atmos%z(1)) then ans=atmos%T(1)+atmos%b(1) *(z - atmos%z(1)) else call kdwhereis(z, atmos%nodes, atmos%z, 1, i) ans=atmos%T(i)+atmos%b(i) *(z-atmos%z(i)) endif cvh2temp=ans end !--------------------------------------------- real *8 function cthick2h(t) implicit none real *8 t ! input. air thickness in kg/m^2 real *8 logt, ans integer i real *8 dod0, fd, a logt=log(t) if(t .ge. atmos%cumd(1)) then ans=atmos%z(1) - *(logt - atmos%logcumd(1)) *atmos%H(1) elseif(t .le. atmos%cumd(atmos%nodes)) then ans=atmos%z(atmos%nodes) - *Hinf *log(t/atmos%cumd(atmos%nodes)) else call kdwhereis(t, atmos%nodes, atmos%cumd, 1, i) ! i is such that X(i) > x >=x(i+1) ans
real *8 function funcazim(azm)
Definition: getST.f:286
real * azmmin
Definition: Zflux.h:1
real *8 function funczen(zenx)
Definition: getST.f:266
subroutine kdexpintf(func, a, b, eps, ans, error, icon)
Definition: kdexpIntF.f:55
dE dx *! Nuc Int sampling table d
Definition: cblkMuInt.h:130
real azmmax
Definition: Zflux.h:1
real zen
Definition: Zflux.h:1
Here is the call graph for this function:

◆ inteflux()

subroutine inteflux ( type (component comp,
real*8  ans 
)

Definition at line 150 of file getST.f.

References azmmax, azmmin, cconv_prim_e2(), cmkptc(), d, d0, inteprim2(), kdexpintfb(), kdwhereis(), primdn(), rigc, zen1, and zen2.

Referenced by __getst.f__(), __getst2.f__(), and __getst3.f__().

150  implicit none
151 #include "Zglobalc.h"
152 #include "Zptcl.h"
153 #include "Zprimary.h"
154  type(component):: comp
155  real*8 ans
156  include 'Zflux.h'
157 
158  real*8 eps, error, ans2, eth, e_or_p
159  integer icon
160 
161 
162  integer imax
163  external primdn
164  real*8 primdn
165  type(ptcl)::aptcl
166  integer j
167  data eps/1.d-4/
168 
169 
170 
171  compx = comp
172  imax = comp%no_of_seg
173  if(rigc .eq. 0.) then
174 ! no rigidy cut. integrate segmented power functions
175  call inteprim2(comp, 1, imax, ans)
176  if(cosfactor .eq. 0) then
177  if(abs(ans/comp%inte_value-1.d0) .gt. 1.d-3 ) then
178  write(*,*) ' ans=',ans, ' internal integral=',
179  * comp%inte_value
180  stop 9999
181  endif
182  ans = ans * (zen2-zen1)* abs(azmmax - azmmin)*torad
183  elseif(cosfactor .eq. 1) then
184 ! take into account the horizontal area.
185  ans = comp%inte_value * (zen2**2- zen1**2)/2 *
186  * abs(azmmax - azmmin)*torad
187  elseif(cosfactor .eq. 2) then
188 !
189  ans = comp%inte_value
190  * *(zen2-zen1)/2.d0* (1.d0 + (zen1 + zen2)/2)*
191  * abs(azmmax - azmmin)*torad
192  elseif(cosfactor .eq. 3) then
193 ! cos + rat*sin
194  ans = comp%inte_value *
195  * ( (zen2-zen1)/2.0d0 + ratio* (
196  * acos(zen1)-acos(zen2) +
197  * 0.5*( zen2*sqrt(1.-zen2**2) -
198  * zen1*sqrt(1.-zen1**2) )) )
199  * /sqrt(1.+ratio**2)
200  * * abs(azmmax - azmmin)*torad
201  else
202  write(*,*) ' error of cosin'
203  stop 9999
204  endif
205  else
206  call cmkptc(comp%code, comp%subcode, comp%charge, aptcl)
207  eth =sqrt( (rigc*comp%charge)**2 + aptcl%mass**2 )
208  call cconv_prim_e2(comp, eth, e_or_p)
209  call kdwhereis(e_or_p, comp%no_of_seg+1, comp%energy, 1, j)
210  if(j .le. imax) then
211 ! energy integral;
212  call kdexpintfb(primdn, comp%energy(1), comp%energy(j+1),
213  * eps, ans, error, icon)
214  ans = ans * torad
215  endif
216 ! add E> comp.energy(j+1)
217  if(j+1 .lt. imax ) then
218  call inteprim2(comp, j+1, imax, ans2)
219  if(cosfactor .eq. 0 ) then
220  ans2 = ans2 * (zen2- zen1)*abs(azmmax - azmmin)*torad
221  elseif(cosfactor .eq. 1) then
222  ans2 = ans2 * (zen2**2- zen1**2)/2 *
223  * abs(azmmax - azmmin)*torad
224  elseif(cosfactor .eq. 2) then
225 ! fai is from 0 to 2pi;
226  ans2 =
227  * ans2 *(zen2-zen1)/2.d0* (1.d0 + (zen1 + zen2)/2.d0)
228  else
229  ans2 = ans2 *
230  * ( (zen2-zen1)/2.0d0 + ratio* (
231  * acos(zen1)-acos(zen2) +
232  * 0.5*( zen2*sqrt(1.-zen2**2) -
233  * zen1*sqrt(1.-zen1**2) )) )
234  * /sqrt(1.+ratio**2)
235  * * abs(azmmax - azmmin)*torad
236  endif
237  else
238  ans2 = 0.
239  endif
240  ans = ans + ans2
241  endif
real zen2
Definition: Zflux.h:1
real *8 function primdn(eorp)
Definition: getST.f:246
real zen1
Definition: Zflux.h:1
atmos%rho(atmos%nodes) **exp(-(z-atmos%z(atmos%nodes))/Hinf) elseif(z .lt. atmos%z(1)) then ans=atmos%rho(1) **exp((atmos%z(1) -z)/atmos%H(1)) else call kdwhereis(z, atmos%nodes, atmos%z, 1, i) a=atmos%a(i) if(a .ne. 0.d0) then ans=atmos%rho(i) **(1+a *(z-atmos%z(i))/atmos%H(i)) **(-1.0d0-1.d0/a) else ans=*atmos%rho(i) *exp(-(z-atmos%z(i))/atmos%H(i)) endif endif ! zsave=z ! endif cvh2den=ans end ! ---------------------------------- real *8 function cvh2temp(z) implicit none ! vettical height to temperatur(Kelvin) real *8 z ! input. vertical height in m ! output is temperature of the atmospher in Kelvin real *8 ans integer i if(z .gt. atmos%z(atmos%nodes)) then ans=atmos%T(atmos%nodes) elseif(z .lt. atmos%z(1)) then ans=atmos%T(1)+atmos%b(1) *(z - atmos%z(1)) else call kdwhereis(z, atmos%nodes, atmos%z, 1, i) ans=atmos%T(i)+atmos%b(i) *(z-atmos%z(i)) endif cvh2temp=ans end !--------------------------------------------- real *8 function cthick2h(t) implicit none real *8 t ! input. air thickness in kg/m^2 real *8 logt, ans integer i real *8 dod0, fd, a logt=log(t) if(t .ge. atmos%cumd(1)) then ans=atmos%z(1) - *(logt - atmos%logcumd(1)) *atmos%H(1) elseif(t .le. atmos%cumd(atmos%nodes)) then ans=atmos%z(atmos%nodes) - *Hinf *log(t/atmos%cumd(atmos%nodes)) else call kdwhereis(t, atmos%nodes, atmos%cumd, 1, i) ! i is such that X(i) > x >=x(i+1) ans
subroutine cconv_prim_e2(comp, E, e_or_p)
Definition: csampPrimary.f:230
subroutine kdwhereis(x, in, a, step, loc)
Definition: kdwhereis.f:27
real * azmmin
Definition: Zflux.h:1
********************block data cblkHeavy ********************integer j data *HeavyG2symbol *data *HeavyG2code kiron data j
Definition: cblkHeavy.h:36
real rigc
Definition: Zflux.h:1
block data cblkEvhnp ! currently usable models data RegMdls ad *special data *Cekaon d0
Definition: cblkEvhnp.h:5
subroutine kdexpintfb(func, a, b, eps, ans, error, icon)
Definition: kdexpIntFb.f:10
dE dx *! Nuc Int sampling table d
Definition: cblkMuInt.h:130
subroutine inteprim2(comp, i1, i2, ans)
Definition: intePrim2.f:2
subroutine cmkptc(code, subcode, charge, p)
Definition: cmkptc.f:15
real azmmax
Definition: Zflux.h:1
Definition: Zptcl.h:75
float eth[nth]
Definition: Zprivate.h:8
Here is the call graph for this function:
Here is the caller graph for this function:

◆ primdn()

real*8 function primdn ( real*8  eorp)

Definition at line 246 of file getST.f.

References e, k16pgaussleg(), zen1, and zen2.

Referenced by inteflux(), and primdn().

246  implicit none
247 
248 #include "Zglobalc.h"
249 #include "Zptcl.h"
250 #include "Zprimary.h"
251 ! primary flux at E
252  real*8 eorp
253 
254  include 'Zflux.h'
255 
256  real*8 funczen, ans
257  external funczen
258 
259  e = eorp
260 ! integral on zenith
261  call k16pgaussleg(funczen, zen1, zen2, 16, ans)
262  primdn = ans
real zen2
Definition: Zflux.h:1
real *8 function primdn(eorp)
Definition: getST.f:246
real zen1
Definition: Zflux.h:1
dE dx *! Nuc Int sampling table e
Definition: cblkMuInt.h:130
atmos%rho(atmos%nodes) **exp(-(z-atmos%z(atmos%nodes))/Hinf) elseif(z .lt. atmos%z(1)) then ans=atmos%rho(1) **exp((atmos%z(1) -z)/atmos%H(1)) else call kdwhereis(z, atmos%nodes, atmos%z, 1, i) a=atmos%a(i) if(a .ne. 0.d0) then ans=atmos%rho(i) **(1+a *(z-atmos%z(i))/atmos%H(i)) **(-1.0d0-1.d0/a) else ans=*atmos%rho(i) *exp(-(z-atmos%z(i))/atmos%H(i)) endif endif ! zsave=z ! endif cvh2den=ans end ! ---------------------------------- real *8 function cvh2temp(z) implicit none ! vettical height to temperatur(Kelvin) real *8 z ! input. vertical height in m ! output is temperature of the atmospher in Kelvin real *8 ans integer i if(z .gt. atmos%z(atmos%nodes)) then ans=atmos%T(atmos%nodes) elseif(z .lt. atmos%z(1)) then ans=atmos%T(1)+atmos%b(1) *(z - atmos%z(1)) else call kdwhereis(z, atmos%nodes, atmos%z, 1, i) ans=atmos%T(i)+atmos%b(i) *(z-atmos%z(i)) endif cvh2temp=ans end !--------------------------------------------- real *8 function cthick2h(t) implicit none real *8 t ! input. air thickness in kg/m^2 real *8 logt, ans integer i real *8 dod0, fd, a logt=log(t) if(t .ge. atmos%cumd(1)) then ans=atmos%z(1) - *(logt - atmos%logcumd(1)) *atmos%H(1) elseif(t .le. atmos%cumd(atmos%nodes)) then ans=atmos%z(atmos%nodes) - *Hinf *log(t/atmos%cumd(atmos%nodes)) else call kdwhereis(t, atmos%nodes, atmos%cumd, 1, i) ! i is such that X(i) > x >=x(i+1) ans
real *8 function funczen(zenx)
Definition: getST.f:266
subroutine k16pgaussleg(func, a, b, n, ans)
Definition: k16pGaussLeg.f:20
Here is the call graph for this function:
Here is the caller graph for this function: