20 real(4),
save::
a=3.6399
d-09
21 real(4),
save::
b=63000.0
29 real(4),
allocatable,
save::
temp(:)
38 function cvh2den(vh)
result(ans)
41 real(8),
intent(in)::vh
63 real(8),
intent(in):: vh
75 ans =
temp(1)-(vh-
h(1))*0.3/100.
87 real(8),
intent(in)::vh
90 real(4)::svh, sans, dum
122 ans = -
a/
b*exp(-vh/
b)
132 real(8),
intent(in)::vh
142 integer,
intent(in):: devno
144 character(*),
intent(in)::filename
150 character(len=64):: line
153 call copenf(devno, filename, icon)
155 write(0,*)
' file=',filename
156 write(0,*)
' cannot be opened for cNRLdataRead' 164 write(0,*)
' filename=',trim(filename)
165 write(0,*)
' has no #------------- line' 170 read(devno,
'(a)', end=100) line
178 write(0,*)
' nsize=',
nsize 183 read(devno, *)
h(i),
den(i),
temp(i)
186 write(0,*)
' NRL atmospheric data has been read from' 193 integer,
intent(in):: io
195 character(len=10)::term1, term2
196 character(len=20)::term3
198 read(io,*) term1, term2, term3
199 if( term2 /=
"NRL")
then 201 *
'NRL data is needed since ATMOSPHERE 3 is specified' 205 *
'For the NRL atmosphere data: 1st line must be like' 206 write(0,*)
'# NRL atmos... but we have' 207 write(0,
'(a," ", a," ", a)')
208 * trim(term1), trim(term2), trim(term3)
211 read(io,*) term1, term2,
glat 212 if( term2 /=
"lat")
then 214 *
'Atmosphere data for NRL: 2nd line must be like' 215 write(0,*)
'# lat 32.0' 218 read(io,*) term1, term2,
glong 219 if( term2 /=
"long")
then 221 *
'Atmosphere data for NRL: 3rd line must be like' 222 write(0,*)
'# long 132.0' 225 read(io,*) term1, term2,
gday1 226 if( term2 /=
"day1")
then 228 *
'Atmosphere data for NRL: 4th line must be like' 229 write(0,*)
'# day1 125' 233 read(io,*) term1, term2,
gday2 234 if( term2 /=
"day2")
then 236 *
'Atmosphere data for NRL: 6th line must be like' 237 write(0,*)
'# day2 135' 241 read(io,*) term1, term2,
ghour1 242 if( term2 /=
"hour1")
then 244 *
'Atmosphere data for NRL: 5th line must be like' 245 write(0,*)
'# hour1 3' 249 read(io,*) term1, term2,
ghour2 250 if( term2 /=
"hour2")
then 252 *
'Atmosphere data for NRL: 7th line must be like' 253 write(0,*)
'# hour2 1.0' 262 integer,
intent(in):: io
267 *
"# 3 terms of the 1st 7 lines must be as above (except numbers)" 269 *
"# any comment may be put after 3 terms. and lines below" 271 *
"# until #----------------- line " 272 write(io,
'(a)')
"# h(m) den(kg/m3) T(K)" 273 write(io,
'(a)')
"#-------------------------------" 280 integer,
intent(in):: io
282 write(io,
'(a)')
"# NRL atmosphere: # 3" 283 write(io,
'(a,f10.1)')
"# lat ",
glat 284 write(io,
'(a, f10.1)')
"# long ",
glong 285 write(io,
'(a, i3)')
"# day1 ",
gday1 286 write(io,
'(a, i3)')
"# day2 ",
gday2 287 write(io,
'(a, i3)')
"# hour1 ",
ghour1 288 write(io,
'(a, i3)')
"# hour2 ",
ghour2 298 real(8),
intent(in):: lat
299 real(8),
intent(in):: long
308 warning = abs(lat -
glat) > 1.0
309 warning= warning .or. abs(long -
glong) > 2.0
311 write(0,*)
'ATMOSPHERE 3 (NRL atmosphere) is being used' 312 write(0,*)
'and AtmosFile contains filename in which ' 313 write(0,*)
'latitude and longitude are gvien.' 314 write(0,*)
'They differ from LatitOfSite and LongitOfSite' 315 write(0,*)
'more than 1 or 2 deg.;diff must be < 1 or 2 deg' 316 write(0,*)
' latitude longitude ' 318 write(0,*)
'param ', sngl(lat), sngl(long)
320 *
'Give LatitOfSite and LongitOfSite values close to' 321 write(0,*)
'those in AtmosFile; Or ' 323 *
'Consider using NRL_period without using AtmosFile' 331 integer,
intent(in):: io
333 character(*),
intent(in):: filename
338 call copenfw(io, filename, icon)
340 write(0,*)
' file=',trim(filename)
341 write(0,*)
'cannot be opened for cNRLdataWrite' 347 write(io,
'(i7, 1p, E12.5, 0p, f8.1)')
361 real(8),
intent(in):: lat
362 real(8),
intent(in):: long
364 integer,
intent(in):: period(4)
395 real(8),
parameter:: lowh=-400
d0 396 real(8),
parameter:: step=500
d0 397 real(8),
parameter:: dayinsec = 24*3600
398 integer,
parameter:: daystep = 7
399 integer,
parameter:: nearday = 3
400 integer,
parameter:: hourstep = 4
401 integer,
parameter:: nearhour = 2
402 integer,
save::iday, day, tempday
403 integer,
save::hour, temphour
406 real(4):: totalden(9), tempera(2)
412 real(4),
save::usec, stl, alti
438 do while ( day <=
gday2 )
444 do while ( hour <=
ghour2 )
447 elseif( day < 0 )
then 449 elseif( day == 0 )
then 461 usec = (3600*stl - long*240)
471 call gtd7(iday, usec, alti,
glat,
glong, stl,
472 & 150., 150., 4., 48, totalden, tempera)
473 den(i) =
den(i) + totalden(6)
480 hour = hour + hourstep
481 if(
ghour2 - hour <= nearhour)
then 486 if( day ==
gday2 )
exit 489 if(
gday2 - day <= nearday )
then 494 den(:) =
den(:)*1000./nsum
505 write(0,*)
'NRL atmospheric data has been made for' 506 write(0,*)
'Latitute=',
glat,
' Londitude=',
glong,
' deg' 507 write(0,*)
'for period=',period(:)
514 if(
allocated(
h ) )
return 543 write(0,*)
' a,b=',
a,
b 571 real(8),
intent(in)::t
577 if( t <=
thick(1) )
then 593 real(8),
intent(in):: t
599 if( t<=
thick(1) )
then 616 real(8),
intent(in):: vh
621 if( vh >=
h(1) )
then 637 real(8),
intent(in):: vh
640 real(8),
external:: cvh2den, cvh2denp
642 ans = - cvh2den(vh)/ cvh2denp(vh)
645 include
"../Import/NRL/nrlmsise00_sub.f" real(4), dimension(:), allocatable, save thick
subroutine kscsplintp(x, y, n, coef, nc, v, f)
real *8 function cvh2denp(z)
real(4), dimension(:,:), allocatable, save h2thickcoef
block data cblkIncident data *Za1ry *HeightOfInj d3
subroutine kscspldif(x, n, coef, nc, v, d1, d2)
subroutine cnrldatawrite(io, filename)
block data cblkElemag data *AnihiE ! Eposi< 1 TeV, anihilation considered *X0/365.667/, ! radiation length of air in kg/m2 *Ecrit/81.e-3/, ! critical energy of air in GeV *MaxComptonE/1./, ! compton is considered below 1 GeV *MaxPhotoE/1.e-3/, ! above this, PhotoElectric effect neg. *MinPhotoProdE/153.e-3/, ! below 153 MeV, no gp --> hadrons ! scattering const not MeV *Knockon true
subroutine cnrlheaderread(io)
subroutine kscsplcoef(x, y, n, coef, nc)
real(4), dimension(:), allocatable, save h
real(4), dimension(:,:), allocatable, save thick2dencoef
real(8), parameter heightspace
real(4), dimension(:,:), allocatable, save thick2hcoef
real(4), dimension(:), allocatable, save temp
real(8) function cthick2den(t)
block data cblkEvhnp ! currently usable models data RegMdls ad *special data *Cekaon d0
subroutine copenf(io, fnin, icon)
subroutine kscsplinteg(x, y, n, coef, nc, a, b, s)
real *8 function cvh2den2p(z)
subroutine cnrlheaderwrite(io)
nodes a atmos atmos temp real * cthick2h
real(4), dimension(:), allocatable, save den
dE dx *! Nuc Int sampling table d
subroutine cnrllatlongcheck(lat, long)
real(8) function cvh2scaleh(vh)
real(4), dimension(:,:), allocatable, save h2tempcoef
block data cblkElemag data *AnihiE e3
real *8 function cvh2den(z)
real(4), dimension(:,:), allocatable, save h2dencoef
subroutine copenfw(io, fnin, icon)
subroutine cnrldataread(devno, filename)
subroutine cnrlheaderw0(io)
real *8 function cvh2thick(z)
subroutine cnrlgendata(lat, long, period)
real(8) function cvh2temp(vh)