COSMOS v7.655  COSMOSv7655
(AirShowerMC)
vh2den.f
Go to the documentation of this file.
1  implicit none
2  real*8 vh, den, vhmin, vhmax, dh
3  real*8 cthick2h
4  integer i
5 
6  vhmin = 20000.
7  vhmax = 1.
8  dh = 10.**0.025
9  vh = vhmin
10  do i = 1, 1000000
11  if(vh .lt. vhmax) goto 100
12  den = cthick2h(vh)
13  write(*, *) vh, den
14  vh = vh/dh
15  enddo
16  100 continue
17  end
18 c Units are in SI.
19 
20 c below cthick2h1 and cthick2h2 are so made that they coincide at
21 c t=230
22 
23 c
24 c -------------------------------------
25  real*8 function cvh2den(z)
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
46  end
47 c
48 c -------------------------------------------------------------
49  real*8 function cthick2h(t)
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
61  end
62 c -------------------------------------
63  real*8 function cthick2den(t)
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
76  end
77 c -------------------------------------
78  real*8 function cvh2denp(z)
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
105  end
106 c ----------------------------------
107  real*8 function cvh2scaleh(z)
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)
117  end
118 c -------------------------------------
119  real*8 function cvh2den2p(z)
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
156  end
157 c -------------------------------------
158  real*8 function cvh2den3p(z)
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
195  end
196 c ---------------------------------------
197  real*8 function cvh2thick(z)
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
214  end
215  block data cblkstdatmos
216 #include "Zstdatmos.h"
217 c main frame cosmos data.
218 c d rho/dz is discontinuous at hc, but others are
219 c continuous. Thickness values are almost the same
220 c as the standard obained by cstdatmos0-multi-seg.f
221 c
222  data ha/4512224.7572830657d-2/, hb/4541933.9782793734d-2/,
223  * hl/1244541.6061892177d-2/, hm/.1854893358365053d0/,
224  * hn/6.3300000000746224d3/, t0/230.000458235099d1/,
225  * hc /10.996296495761545d3/
226  data hmi/5.3911455097420/, hlhmi/4.3318322850207d-04/
227 
228 c coef. to have continuous density values for h=h(t) and its derivative
229 c about t=t0. However, the absolute thickness is little bit larger
230 c than the standard, so that we don't use this one.
231 c
232 c data ha/25289.093750000d0/, hb/48490.145953733/,
233 c * hl/2712.61d0/, hm/0.32397778012688d0/,
234 c * hn/6800 .0/, hmi/3.0866314338235/, hc/11.1d3/,
235 c * hlhmi/1.1378815278872D-03/, t0/2443.3759999999/
236  end
real *8 function cvh2denp(z)
Definition: ciniSegAtoms.f:201
! common for std atmosphere real *AlmostVacH ! almost vacuum height real *AlmostVacT ! thickness there hm
Definition: Zstdatmos.h:7
real *8 function cvh2den3p(z)
Definition: vh2den.f:159
nodes i
! common for std atmosphere real *AlmostVacH ! almost vacuum height real *AlmostVacT ! thickness there hb
Definition: Zstdatmos.h:7
block data cblkIncident data *Za1ry *HeightOfInj d3
Definition: cblkIncident.h:7
! common for std atmosphere real *AlmostVacH ! almost vacuum height real *AlmostVacT ! thickness there hc
Definition: Zstdatmos.h:7
real(8) function cthick2den(t)
Definition: cNRLAtmos.f:591
! 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
real *8 function cvh2den2p(z)
Definition: ciniSegAtoms.f:251
nodes a atmos atmos temp real * cthick2h
! common for std atmosphere real *AlmostVacH ! almost vacuum height real *AlmostVacT ! thickness there hmi
Definition: Zstdatmos.h:7
dE dx *! Nuc Int sampling table d
Definition: cblkMuInt.h:130
real(8) function cvh2scaleh(vh)
Definition: cNRLAtmos.f:635
! 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 t0
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