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

Go to the source code of this file.

Functions/Subroutines

program __vh2den.f__
 
real *8 function cvh2den (z)
 
real *8 function cthick2h (t)
 
real *8 function cthick2den (t)
 
real *8 function cvh2denp (z)
 
real *8 function cvh2scaleh (z)
 
real *8 function cvh2den2p (z)
 
real *8 function cvh2den3p (z)
 
real *8 function cvh2thick (z)
 

Function/Subroutine Documentation

◆ __vh2den.f__()

program __vh2den.f__ ( )

Definition at line 2 of file vh2den.f.

References cthick2h, and i.

2  real*8 vh, den, vhmin, vhmax, dh
real(4), dimension(:), allocatable, save den
Definition: cNRLAtmos.f:28

◆ cthick2den()

real*8 function cthick2den ( real*8  t)

Definition at line 64 of file vh2den.f.

References cthick2den(), d0, hm, hn, and t0.

64 c -------------------------------------
65  implicit none
66 c---- include 'Zstdatmos.h'
67 #include "Zstdatmos.h"
68  real*8 t
69 
70  if(t .lt. t0) then
71  cthick2den = t/hn
72  else
73  cthick2den =10.d0*hlhmi*
74  * (t/10.d0)**(1.d0 - hm)
75  endif
! common for std atmosphere real *AlmostVacH ! almost vacuum height real *AlmostVacT ! thickness there hm
Definition: Zstdatmos.h:7
real(8) function cthick2den(t)
Definition: cNRLAtmos.f:591
block data cblkEvhnp ! currently usable models data RegMdls ad *special data *Cekaon d0
Definition: cblkEvhnp.h:5
! common for std atmosphere real *AlmostVacH ! almost vacuum height real *AlmostVacT ! thickness there t0
Definition: Zstdatmos.h:7
nodes t
! common for std atmosphere real *AlmostVacH ! almost vacuum height real *AlmostVacT ! thickness there hn
Definition: Zstdatmos.h:7
Here is the call graph for this function:

◆ cthick2h()

real*8 function cthick2h ( real*8  t)

Definition at line 50 of file vh2den.f.

References cthick2h, d0, ha, hb, hl, hm, hn, and t0.

50  implicit none
51  real*8 t
52 #include "Zstdatmos.h"
53  external cblkstdatmos
54 
55 
56  if(t .lt. t0) then
57  cthick2h = hb - log(t/10.d0) * hn ! for t<t0 = 2300
58  else
59  cthick2h = ha - hl * (t/10.d0)**hm ! for t > t0
60  endif
! common for std atmosphere real *AlmostVacH ! almost vacuum height real *AlmostVacT ! thickness there hm
Definition: Zstdatmos.h:7
! common for std atmosphere real *AlmostVacH ! almost vacuum height real *AlmostVacT ! thickness there hb
Definition: Zstdatmos.h:7
! common for std atmosphere real *AlmostVacH ! almost vacuum height real *AlmostVacT ! thickness there hl
Definition: Zstdatmos.h:7
block data cblkEvhnp ! currently usable models data RegMdls ad *special data *Cekaon d0
Definition: cblkEvhnp.h:5
nodes a atmos atmos temp real * cthick2h
! common for std atmosphere real *AlmostVacH ! almost vacuum height real *AlmostVacT ! thickness there hlhmi common comstdatm ha
Definition: Zstdatmos.h:7
! common for std atmosphere real *AlmostVacH ! almost vacuum height real *AlmostVacT ! thickness there t0
Definition: Zstdatmos.h:7
nodes t
! common for std atmosphere real *AlmostVacH ! almost vacuum height real *AlmostVacT ! thickness there hn
Definition: Zstdatmos.h:7

◆ cvh2den()

real*8 function cvh2den ( real*8  z)

Definition at line 26 of file vh2den.f.

References cvh2den(), d0, ha, hb, hc, hl, hmi, and hn.

26 c --------------------------vertical height to density
27 c at z > 50 km, very bad. but ok for our purpose
28  implicit none
29 c---- include 'Zstdatmos.h'
30 #include "Zstdatmos.h"
31  real*8 z
32  real*8 zsave, ans
33  data zsave/-1.d30/
34  save zsave, ans
35 
36 
37  if(z .ne. zsave) then
38  if(z .ge. hc) then
39  ans = 10.d0*exp( (hb-z)/hn)/hn
40  else
41  ans = 10.d0*hlhmi*( (ha-z)/hl)**(hmi-1.d0)
42  endif
43  zsave = z
44  endif
45  cvh2den = ans
nodes 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
! common for std atmosphere real *AlmostVacH ! almost vacuum height real *AlmostVacT ! thickness there hb
Definition: Zstdatmos.h:7
! common for std atmosphere real *AlmostVacH ! almost vacuum height real *AlmostVacT ! thickness there hc
Definition: Zstdatmos.h:7
! common for std atmosphere real *AlmostVacH ! almost vacuum height real *AlmostVacT ! thickness there hl
Definition: Zstdatmos.h:7
block data cblkEvhnp ! currently usable models data RegMdls ad *special data *Cekaon d0
Definition: cblkEvhnp.h:5
! common for std atmosphere real *AlmostVacH ! almost vacuum height real *AlmostVacT ! thickness there hmi
Definition: Zstdatmos.h:7
! common for std atmosphere real *AlmostVacH ! almost vacuum height real *AlmostVacT ! thickness there hlhmi common comstdatm ha
Definition: Zstdatmos.h:7
real *8 function cvh2den(z)
Definition: ciniSegAtoms.f:54
! common for std atmosphere real *AlmostVacH ! almost vacuum height real *AlmostVacT ! thickness there hn
Definition: Zstdatmos.h:7
Here is the call graph for this function:

◆ cvh2den2p()

real*8 function cvh2den2p ( real*8  z)

Definition at line 120 of file vh2den.f.

References cvh2den2p(), d0, ha, hc, hmi, and hn.

120 c -------------------------------------
121 c d(d rho/dz)/dz
122  implicit none
123 c---- include 'Zstdatmos.h'
124 #include "Zstdatmos.h"
125  real*8 z
126 c logical firsttime/.true./
127 c save firsttime
128 c real*8 cnst1, cnst2, cnst3
129 c save cnst1, cnst2, cnst3
130  real*8 zsave, ans, cvh2denp, cvh2den
131  data zsave/-1.d30/
132  save zsave
133 c
134 c if(firsttime) then
135 c cnst1 = 10.d0/hn/hn/hn
136 c cnst2 = 10.d0*hlhmi*(hmi-1.d0)*(hmi-2.d0)
137 c * /hl/hl
138 c cnst3 = hmi -3.d0
139 c firsttime = .false.
140 c endif
141  if(z .ne. zsave) then
142  if(z .ge. hc) then
143 c cvh2den2p = 10.d0*exp( (hb-z)/hn)/hn/hn/hn
144 c cvh2den2p = cnst1*exp( (hb-z)/hn)
145  ans = cvh2den(z)/hn/hn
146  else
147 c cvh2den2p = 10.d0*hlhmi*(hmi-1.d0)*(hmi-2.d0)
148 c * /hl/hl *
149 c * ( (ha-z)/hl)**(hmi-3.d0)
150 c cvh2den2p = cnst2 * ( (ha-z)/hl )** cnst3
151  ans = -(hmi-2.d0)/(ha -z) * cvh2denp(z)
152  endif
153  zsave =z
154  endif
155  cvh2den2p = ans
nodes z
real *8 function cvh2denp(z)
Definition: ciniSegAtoms.f:201
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
! common for std atmosphere real *AlmostVacH ! almost vacuum height real *AlmostVacT ! thickness there hc
Definition: Zstdatmos.h:7
block data cblkEvhnp ! currently usable models data RegMdls ad *special data *Cekaon d0
Definition: cblkEvhnp.h:5
real *8 function cvh2den2p(z)
Definition: ciniSegAtoms.f:251
! common for std atmosphere real *AlmostVacH ! almost vacuum height real *AlmostVacT ! thickness there hmi
Definition: Zstdatmos.h:7
! common for std atmosphere real *AlmostVacH ! almost vacuum height real *AlmostVacT ! thickness there hlhmi common comstdatm ha
Definition: Zstdatmos.h:7
real *8 function cvh2den(z)
Definition: ciniSegAtoms.f:54
! common for std atmosphere real *AlmostVacH ! almost vacuum height real *AlmostVacT ! thickness there hn
Definition: Zstdatmos.h:7
Here is the call graph for this function:

◆ cvh2den3p()

real*8 function cvh2den3p ( real*8  z)

Definition at line 159 of file vh2den.f.

References d0, ha, hc, hmi, and hn.

159 c -------------------------------------
160 c rho'''(z)
161  implicit none
162 c---- include 'Zstdatmos.h'
163 #include "Zstdatmos.h"
164  real*8 z
165 c logical firsttime/.true./
166 c save firsttime
167 c real*8 cnst1, cnst2, cnst3
168 c save cnst1, cnst2, cnst3
169  real*8 zsave, ans, cvh2den2p, cvh2den
170  data zsave/-1.d30/
171  save zsave, ans
172 c
173 c if(firsttime) then
174 c cnst1 = - 10.d0/hn/hn/hn/hn
175 c cnst2 =- 10.d0*hlhmi*(hmi-1.d0)*(hmi-2.d0)*(hmi-3.d0)
176 c * /hl/hl/hl
177 c cnst3 = hmi -4.d0
178 c firsttime = .false.
179 c endif
180  if(z .ne. zsave) then
181  if(z .ge. hc) then
182 c cvh2den3p = - 10.d0*exp( (hb-z)/hn)/hn/hn/hn/hn
183 c cvh2den3p = cnst1*exp( (hb-z)/hn)
184  ans = - cvh2den(z)/hn/hn/hn
185  else
186 c cvh2den3p =- 10.d0*hlhmi*(hmi-1.d0)*(hmi-2.d0)*(hmi-3)
187 c * /hl/hl/hl *
188 c * ( (ha-z)/h1)**(hmi-4.d0)
189 c cvh2den3p = cnst2 * ( (ha-z)/hl )** cnst3
190  ans = -(hmi-3.0d0)/(ha-z) * cvh2den2p(z)
191  endif
192  zsave =z
193  endif
194  cvh2den3p = ans
nodes 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
real *8 function cvh2den3p(z)
Definition: vh2den.f:159
! common for std atmosphere real *AlmostVacH ! almost vacuum height real *AlmostVacT ! thickness there hc
Definition: Zstdatmos.h:7
block data cblkEvhnp ! currently usable models data RegMdls ad *special data *Cekaon d0
Definition: cblkEvhnp.h:5
real *8 function cvh2den2p(z)
Definition: ciniSegAtoms.f:251
! common for std atmosphere real *AlmostVacH ! almost vacuum height real *AlmostVacT ! thickness there hmi
Definition: Zstdatmos.h:7
! common for std atmosphere real *AlmostVacH ! almost vacuum height real *AlmostVacT ! thickness there hlhmi common comstdatm ha
Definition: Zstdatmos.h:7
real *8 function cvh2den(z)
Definition: ciniSegAtoms.f:54
! common for std atmosphere real *AlmostVacH ! almost vacuum height real *AlmostVacT ! thickness there hn
Definition: Zstdatmos.h:7

◆ cvh2denp()

real*8 function cvh2denp ( real*8  z)

Definition at line 79 of file vh2den.f.

References cvh2denp(), d0, ha, hc, hmi, and hn.

79 c -------------------------------------
80 
81 c d rho/dz
82  implicit none
83 c---- include 'Zstdatmos.h'
84 #include "Zstdatmos.h"
85  real*8 z
86  real*8 zsave, ans, cvh2den
87  data zsave /-1.d30/
88  save ans, zsave
89 
90  if(z .ne. zsave) then
91  if(z .ge. hc) then
92 c cvh2denp = - 10.d0*exp( (hb-z)/hn)/hn/hn
93 c cvh2denp = cnst1*exp( (hb-z)/hn)
94  ans = - cvh2den(z)/hn
95  else
96 c cvh2denp =- 10.d0*hlhmi*(hmi-1.d0)/hl*
97 c * ( (ha-z)/hl)**(hmi-2.d0)
98 c cvh2denp =cnst2 *
99 c * ( (ha-z)/hl)**cnst3
100  ans = -(hmi-1.0d0)/(ha-z)*cvh2den(z)
101  endif
102  zsave= z
103  endif
104  cvh2denp = ans
nodes z
real *8 function cvh2denp(z)
Definition: ciniSegAtoms.f:201
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
! common for std atmosphere real *AlmostVacH ! almost vacuum height real *AlmostVacT ! thickness there hc
Definition: Zstdatmos.h:7
block data cblkEvhnp ! currently usable models data RegMdls ad *special data *Cekaon d0
Definition: cblkEvhnp.h:5
! common for std atmosphere real *AlmostVacH ! almost vacuum height real *AlmostVacT ! thickness there hmi
Definition: Zstdatmos.h:7
! common for std atmosphere real *AlmostVacH ! almost vacuum height real *AlmostVacT ! thickness there hlhmi common comstdatm ha
Definition: Zstdatmos.h:7
real *8 function cvh2den(z)
Definition: ciniSegAtoms.f:54
! common for std atmosphere real *AlmostVacH ! almost vacuum height real *AlmostVacT ! thickness there hn
Definition: Zstdatmos.h:7
Here is the call graph for this function:

◆ cvh2scaleh()

real*8 function cvh2scaleh ( real*8  z)

Definition at line 108 of file vh2den.f.

References cvh2scaleh().

108 c ----------------------------------
109 c get scale height defined by
110 c - rho/ (d rho/d z). This has discontinuity at
111 c z = 11.1 km
112  implicit none
113  real*8 z
114  real*8 cvh2den, cvh2denp
115 c
116  cvh2scaleh = - cvh2den(z)/ cvh2denp(z)
nodes z
real *8 function cvh2denp(z)
Definition: ciniSegAtoms.f:201
real(8) function cvh2scaleh(vh)
Definition: cNRLAtmos.f:635
real *8 function cvh2den(z)
Definition: ciniSegAtoms.f:54
Here is the call graph for this function:

◆ cvh2thick()

real*8 function cvh2thick ( real*8  z)

Definition at line 198 of file vh2den.f.

References cvh2thick(), d, d0, d3, ha, hb, hc, hl, hm, hmi, hn, and t0.

198 c ---------------------------------------
199  implicit none
200 c---- include 'Zstdatmos.h'
201 #include "Zstdatmos.h"
202  real*8 z
203 
204  if(z .gt. hc) then
205  cvh2thick = 10.d0* exp( (hb-z)/hn)
206  else
207  cvh2thick = 10.d0* ((ha-z)/hl)**hmi
208 c
209 c the next factor is -1.5d-11 and is neglected.
210 c * - 10.d0* ((ha-hc)/hl)**hmi +
211 c * 10.d0*exp( (hb-hc)/hn)
212 c
213  endif
nodes z
! common for std atmosphere real *AlmostVacH ! almost vacuum height real *AlmostVacT ! thickness there hb
Definition: Zstdatmos.h:7
! common for std atmosphere real *AlmostVacH ! almost vacuum height real *AlmostVacT ! thickness there hc
Definition: Zstdatmos.h:7
! common for std atmosphere real *AlmostVacH ! almost vacuum height real *AlmostVacT ! thickness there hl
Definition: Zstdatmos.h:7
block data cblkEvhnp ! currently usable models data RegMdls ad *special data *Cekaon d0
Definition: cblkEvhnp.h:5
! common for std atmosphere real *AlmostVacH ! almost vacuum height real *AlmostVacT ! thickness there hmi
Definition: Zstdatmos.h:7
! common for std atmosphere real *AlmostVacH ! almost vacuum height real *AlmostVacT ! thickness there hlhmi common comstdatm ha
Definition: Zstdatmos.h:7
! common for std atmosphere real *AlmostVacH ! almost vacuum height real *AlmostVacT ! thickness there hn
Definition: Zstdatmos.h:7
real *8 function cvh2thick(z)
Definition: ciniSegAtoms.f:93
Here is the call graph for this function: