COSMOS v7.655  COSMOSv7655
(AirShowerMC)
cstdatmos0.fNew1.h
Go to the documentation of this file.
1 ! This is to express atmosphere using cspline function
2 !
3 ! -------------------------------------
4  real*8 function cvh2den(z)
5 ! --------------------------vertical height to density
6  implicit none
7 #include "Zatmos.h"
8  real*8 z ! input. m
9 ! real*8 zsave
10  real*8 temp, ans
11 ! data zsave/-1.d30/
12 ! save zsave, ans
13 
14 ! if(z .ne. zsave) then
15  if( z .gt. atmos%z(atmos%nodes) ) then
16  ans = atmos%rho(atmos%nodes)*
17  * exp(-(z-atmos%z(atmos%nodes))/Hinf)
18  elseif(z .lt. atmos%z(1)) then
19  ans = atmos%rho(1)*
20  * exp( (atmos%z(1)-z)/atmos%H(1) )
21  else
22  call kcsplIntp(atmos%z, atmos%logrho, atmos%nodes,
23  * atmos%coefh2r, maxnodes, z, temp)
24  ans = exp(temp)
25  endif
26 ! zsave = z
27 ! endif
28  cvh2den = ans
29  end
30 ! ----------------------------------
31  real*8 function cvh2temp(z)
32  implicit none
33 #include "Zatmos.h"
34 ! vettical height to temperatur (Kelvin)
35 
36  real*8 z ! input. vertical height in m
37 ! output is temperature of the atmospher in Kelvin
38 
39  real*8 ans
40 
41  if( z .gt. atmos%z(atmos%nodes) ) then
42  ans = atmos%T(atmos%nodes)
43  elseif(z .lt. atmos%z(1)) then
44  ans = atmos%T(1) + atmos%b(1)*(z - atmos%z(1))
45  else
46  call kcsplIntp(atmos%z, atmos%T, atmos%nodes,
47  * atmos%coefh2T, maxnodes, z, ans)
48  endif
49  cvh2temp = ans
50  end
51 
52 !---------------------------------------------
53  real*8 function cthick2h(t)
54  implicit none
55 #include "Zatmos.h"
56  real*8 t ! input. air thickness in kg/m^2
57 
58  real*8 logt, ans
59 
60 
61  logt = log(t)
62  if(t .gt. atmos%cumd(1) ) then
63  ans = atmos%z(1) -
64  * (logt - atmos%logcumd(1) )*atmos%H(1)
65  elseif(t .lt. atmos%cumd(atmos%nodes)) then
66  ans = atmos%z(atmos%nodes) -
67  * Hinf* log(t/atmos%cumd(atmos%nodes))
68  else
69  call kcsplIntp(atmos%logcumdi, atmos%zi, atmos%nodes,
70  * atmos%coefd2h, maxnodes, logt, ans)
71  endif
72  cthick2h = ans
73  end
74 
75 !---------------------------------------------
76  real*8 function cthick2den(t)
77  implicit none
78 #include "Zatmos.h"
79  real*8 t ! input. air thickness in kg/m^2
80 
81  real*8 logt, ans, temp
83 
84 
85  logt = log(t)
86  if(t .gt. atmos%cumd(1) ) then
87  temp = cthick2h(t)
88  ans = cvh2den( temp )
89  elseif(t .lt. atmos%cumd(atmos%nodes)) then
90  temp = cthick2h(t)
91  ans = cvh2den( temp )
92  else
93  call kcsplIntp(atmos%logcumdi, atmos%logrhoi,
94  * atmos%nodes,
95  * atmos%coefd2r, maxnodes, logt, ans)
96  ans = exp(ans)
97  endif
98  cthick2den = ans
99  end
100 ! -------------------------------------
101  real*8 function cvh2denp(z)
102 ! -------------------------------------
103 ! d rho/dz
104  implicit none
105 #include "Zatmos.h"
106  real*8 z
107 
108  real*8 d2, ans, temp
109 
110  if( z .gt. atmos%z(atmos%nodes) ) then
111  ans = 0.
112  elseif(z .lt. atmos%z(1)) then
113  ans =- atmos%rho(1)/atmos%H(1)*
114  * exp( (atmos%z(1)-z)/atmos%H(1) )
115  else
116  call kcsplDif(atmos%z, atmos%nodes,
117  * atmos%coefh2r, maxnodes, z, ans, d2)
118  call kcsplIntp(atmos%z, atmos%logrho, atmos%nodes,
119  * atmos%coefh2r, maxnodes, z, temp)
120  ans = exp(temp) * ans
121  endif
122  cvh2denp = ans
123  end
124 ! ----------------------------------
125  real*8 function cvh2scaleh(z)
126 ! ----------------------------------
127  implicit none
128 #include "Zatmos.h"
129  real*8 z
130  real*8 ans
131 
132  if( z .gt. atmos%z(atmos%nodes-1) ) then
133  ans = atmos%H(atmos%nodes-1)
134  elseif(z .lt. atmos%z(1)) then
135  ans = atmos%H(1)
136  else
137  call kcsplIntp(atmos%z, atmos%H, atmos%nodes-1,
138  * atmos%coefh2H, maxnodes, z, ans)
139  endif
140  cvh2scaleh = ans
141  end
142 ! -------------------------------------
143  real*8 function cvh2den2p(z)
144 ! -------------------------------------
145 ! d(d rho/dz)/dz
146  implicit none
147 #include "Zatmos.h"
148  real*8 z
149  real*8 ans, d1, d2, temp
150 
151  if( z .gt. atmos%z(atmos%nodes) ) then
152  ans = 0.
153  elseif(z .lt. atmos%z(1)) then
154  ans = atmos%rho(1)/atmos%H(1)/atmos%H(1)*
155  * exp( (atmos%z(1)-z)/atmos%H(1) )
156  else
157  call kcsplDif(atmos%z, atmos%nodes,
158  * atmos%coefh2r, maxnodes, z, d1, d2)
159  call kcsplIntp(atmos%z, atmos%logrho, atmos%nodes,
160  * atmos%coefh2r, maxnodes, z, temp)
161  ans = exp(temp) * (d2 + d1**2)
162  endif
163  cvh2den2p = ans
164  end
165 ! ---------------------------------------
166  real*8 function cvh2thick(z)
167 ! ---------------------------------------
168  implicit none
169 #include "Zatmos.h"
170  real*8 z
171 
172  real*8 ans, temp
173 
174  if( z .gt. atmos%z(atmos%nodes) ) then
175  ans = atmos%cumd(atmos%nodes) *
176  * exp((atmos%z(atmos%nodes) - z)/Hinf )
177  elseif(z .lt. atmos%z(1)) then
178  ans = atmos%cumd(1)*
179  * exp( (atmos%z(1)-z)/atmos%H(1) )
180  else
181  call kcsplIntp(atmos%z, atmos%logcumd, atmos%nodes,
182  * atmos%coefh2d, maxnodes, z, temp)
183  ans = exp(temp)
184  endif
185  cvh2thick = ans
186  end
187 
real(8), parameter, public m
Definition: cpdgXs.f:13
nodes z
float real
Definition: Zdef.h:2
real *8 function cvh2denp(z)
Definition: ciniSegAtoms.f:201
********************block data cblkHeavy ********************integer j data *HeavyG2symbol H
Definition: cblkHeavy.h:7
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
block data cblkMuInt integer i ! Pair total X sec data(MuPrTX(i), i=1, 38)/1 0.431132E-02
int ne[nl][nth]
Definition: Zprivate.h:11
real(4), dimension(:), allocatable, save temp
Definition: cNRLAtmos.f:29
real(8) function cthick2den(t)
Definition: cNRLAtmos.f:591
integer maxbin nregion c minsave drx2 ! drawing region real maxdep integer maxpos integer to
Definition: Zfit.h:15
*Zfirst p fm *Zfirst p Zfirst p Zfirst p *Zfirst p *Zfirst pos xyz Zfirst pos xyz *Zfirst pos *Zfirst pos Zfirst pos height
Definition: ZavoidUnionMap.h:1
real *8 function cvh2den2p(z)
Definition: ciniSegAtoms.f:251
nodes a atmos atmos temp real * cthick2h
dE dx *! Nuc Int sampling table d
Definition: cblkMuInt.h:130
! type magfield sequence ! Note that position vector where the magnetic field is given ! is not included here ! unit of field strength is in T(1 gauss=10 **-4 T) union map real *8 x
real(8) function cvh2scaleh(vh)
Definition: cNRLAtmos.f:635
real *8 function cvh2den(z)
Definition: ciniSegAtoms.f:54
dE dx *! Nuc Int sampling table b
Definition: cblkMuInt.h:130
nodes t
real *8 function cvh2thick(z)
Definition: ciniSegAtoms.f:93
real(8) function cvh2temp(vh)
Definition: cNRLAtmos.f:61
block data cblkIncident data *Za1ry is
Definition: cblkIncident.h:5