1 ! This
is to express atmosphere
using linear interpolation.
2 ! cspline
is not used because it generates some odd behaviour
5 ! -------------------------------------
7 ! --------------------------vertical
height to density
18 !
if(
z .
ne. zsave) then
19 if(
z .gt. atmos%
z(atmos%nodes) ) then
20 ans = atmos%rho(atmos%nodes)*
21 * exp(-(
z-atmos%
z(atmos%nodes))/Hinf)
22 elseif(
z .lt. atmos%
z(1)) then
24 * exp( (atmos%
z(1)-
z)/atmos%
H(1) )
30 * (1+
a*(z-atmos%z(
i))/atmos%
H(
i))**(-1.0
d0-1.
d0/
a)
33 * atmos%rho(
i) * exp(- (z-atmos%z(
i))/atmos%
H(
i))
40 ! ----------------------------------
44 ! vettical
height to temperatur (Kelvin)
47 ! output
is temperature of the atmospher in Kelvin
52 if( z .gt. atmos%z(atmos%nodes) ) then
53 ans = atmos%
T(atmos%nodes)
54 elseif(z .lt. atmos%z(1)) then
55 ans = atmos%
T(1) + atmos%
b(1)*(z - atmos%z(1))
58 ans = atmos%
T(
i) + atmos%
b(
i)*(z-atmos%z(
i))
63 !---------------------------------------------
67 real*8
t ! input. air thickness in kg/
m^2
74 if(
t .ge. atmos%cumd(1) ) then
76 * (logt - atmos%logcumd(1) )*atmos%
H(1)
77 elseif(
t .le. atmos%cumd(atmos%nodes)) then
78 ans = atmos%
z(atmos%nodes) -
79 * Hinf* log(
t/atmos%cumd(atmos%nodes))
84 dod0 =( atmos%cumd(
i) -
t )/ atmos%
d0(
i)
88 ans = (fd**(-
a)- 1.0
d0)*atmos%
H(
i)/
a + atmos%
z(
i)
90 ans = -log(fd)* atmos%
H(
i) + atmos%
z(
i)
93 ! write(0,*)
' t=',
t,
' z=',
ans,
' i=',
i,
' dod0=',
dod0,
' a=',
a 94 ! write(0,*)
' atmos.H,z=', atmos.H(i), atmos.z(i)
101 !---------------------------------------------
105 real*8
t ! input. air thickness in kg/
m^2
112 if(
t .gt. atmos%cumd(1) ) then
115 elseif(
t .lt. atmos%cumd(atmos%nodes)) then
124 ! -------------------------------------
126 ! -------------------------------------
136 if( z .gt. atmos%z(atmos%nodes) ) then
138 elseif(z .lt. atmos%z(1)) then
139 ans =- atmos%rho(1)/atmos%
H(1)*
140 * exp( (atmos%z(1)-z)/atmos%
H(1) )
142 call
kdwhereis(z, atmos%nodes, atmos%z, 1, i)
145 ans = atmos%rho(i)*
a/atmos%
H(i) *
146 * (1.0
d0 +
a*(z-atmos%z(i))/atmos%
H(i) )**(-2.
d0-1.0
d0/
a)
148 ans =- atmos%rho(i)/atmos%
H(i)*
149 * exp(- (z-atmos%z(i)/atmos%
H(i)))
154 ! ----------------------------------
156 ! ----------------------------------
163 if( z .gt. atmos%z(atmos%nodes-1) ) then
164 ans = atmos%
H(atmos%nodes-1)
165 elseif(z .lt. atmos%z(1)) then
168 call
kdwhereis(z, atmos%nodes, atmos%z, 1, i)
169 ans = atmos%
H(i) + atmos%
a(i)*(z-atmos%z(i))
173 ! -------------------------------------
175 ! -------------------------------------
184 if( z .gt. atmos%z(atmos%nodes) ) then
186 elseif(z .lt. atmos%z(1)) then
187 ans = atmos%rho(1)/atmos%
H(1)/atmos%
H(1)*
188 * exp( (atmos%z(1)-z)/atmos%
H(1) )
190 call
kdwhereis(z, atmos%nodes, atmos%z, 1, i)
193 ans = atmos%rho(i)* (
a/atmos%
H(i))**2 *
194 * (1. +
a*(z-atmos%z(i))/atmos%
H(i))**(-3.-1./
a)
196 ans = atmos%rho(i)/atmos%
H(i)**2 *
197 * exp(-(z-atmos%z(i))/atmos%
H(i))
202 ! ---------------------------------------
204 ! ---------------------------------------
214 if( z .gt. atmos%z(atmos%nodes) ) then
215 ans = atmos%cumd(atmos%nodes) *
216 * exp((atmos%
z(atmos%nodes) - z)/Hinf )
217 elseif(z .lt. atmos%z(1)) then
219 * exp( (atmos%z(1)-z)/atmos%
H(1) )
221 call
kdwhereis(z, atmos%nodes, atmos%z, 1, i)
224 ans = atmos%cumd(i) - atmos%
d0(i)*(1.-
225 * (1+
a*(z-atmos%z(i))/atmos%
H(i))**(-1/
a))
227 ans = atmos%cumd(i) - atmos%
d0(i)*(1.-
228 * exp(-(z-atmos%z(i))/atmos%
H(i)))
real(8), parameter, public m
real *8 function cvh2denp(z)
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 kdwhereis(x, in, a, step, loc)
block data cblkMuInt integer i ! Pair total X sec data(MuPrTX(i), i=1, 38)/1 0.431132E-02
real(4), dimension(:), allocatable, save temp
real(8) function cthick2den(t)
integer maxbin nregion c minsave drx2 ! drawing region real maxdep integer maxpos integer to
block data cblkEvhnp ! currently usable models data RegMdls ad *special data *Cekaon d0
*Zfirst p fm *Zfirst p Zfirst p Zfirst p *Zfirst p *Zfirst pos xyz Zfirst pos xyz *Zfirst pos *Zfirst pos Zfirst pos height
real *8 function cvh2den2p(z)
nodes a atmos atmos temp real * cthick2h
dE dx *! Nuc Int sampling table d
! 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)
integer lengid integer lengdir character *dir integer kgetenv2 character *numb character *execid character *msg logical takehist save do nsites tkarspec nsites if(histdep(i) .gt. 0) then takehist
real *8 function cvh2den(z)
dE dx *! Nuc Int sampling table b
real *8 function cvh2thick(z)
real(8) function cvh2temp(vh)
block data cblkIncident data *Za1ry is
! 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