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

Go to the source code of this file.

Modules

module  nrl_atmos
 

Functions/Subroutines

real(8) function cvh2den (vh)
 
real(8) function cvh2temp (vh)
 
real(8) function cvh2denp (vh)
 
real(8) function cvh2den2p (vh)
 
subroutine cnrldataread (devno, filename)
 
subroutine cnrlheaderread (io)
 
subroutine cnrlheaderwrite (io)
 
subroutine cnrlheaderw0 (io)
 
subroutine cnrllatlongcheck (lat, long)
 
subroutine cnrldatawrite (io, filename)
 
subroutine cnrlgendata (lat, long, period)
 
subroutine cnrlalloc
 
subroutine cnrldatamanip
 
real(8) function cthick2h (t)
 
real(8) function cthick2den (t)
 
real(8) function cvh2thick (vh)
 
real(8) function cvh2scaleh (vh)
 

Variables

integer, save nsize
 
integer, save nsizem
 
logical, save first =.true.
 
real(4), save glat
 
real(4), save glong
 
integer, save gday1
 
integer, save gday2
 
integer, save ghour1
 
integer, save ghour2
 
real(8) drhodh2
 
real(4), save heightx =499d3
 
real(4), save thickx
 
real(4), save a =3.6399d-09
 
real(4), save b =63000.0
 
real(4), save al
 
real(4), save bl
 
real(8), parameter heightspace =1000.d3
 
real(4), dimension(:), allocatable, save h
 
real(4), dimension(:), allocatable, save den
 
real(4), dimension(:), allocatable, save thick
 
real(4), dimension(:), allocatable, save temp
 
real(4), dimension(:,:), allocatable, save h2dencoef
 
real(4), dimension(:,:), allocatable, save h2thickcoef
 
real(4), dimension(:,:), allocatable, save h2tempcoef
 
real(4), dimension(:,:), allocatable, save thick2hcoef
 
real(4), dimension(:,:), allocatable, save thick2dencoef
 

Function/Subroutine Documentation

◆ cnrlalloc()

subroutine cnrlalloc ( )

Definition at line 512 of file cNRLAtmos.f.

References nrl_atmos::den, nrl_atmos::h, nrl_atmos::h2dencoef, nrl_atmos::h2tempcoef, nrl_atmos::h2thickcoef, nrl_atmos::nsize, nrl_atmos::nsizem, nrl_atmos::temp, nrl_atmos::thick, nrl_atmos::thick2dencoef, and nrl_atmos::thick2hcoef.

Referenced by cnrldataread(), and cnrlgendata().

512  use nrl_atmos
513  implicit none
514  if( allocated( h ) ) return ! !!!!
515  allocate( h(nsize) )
516  allocate( den(nsize) )
517  allocate( temp(nsize) )
518 !! allocate( denp(nsize) )
519  allocate( thick(nsize) )
520  allocate( h2dencoef(nsizem,3) )
521  allocate( h2tempcoef(nsizem,3) )
522 !! allocate( h2denpCoef(nsizem,3) )
523  allocate( h2thickcoef(nsizem,3) )
524  allocate( thick2dencoef(nsizem,3) )
525  allocate( thick2hcoef(nsizem,3) )
real(4), dimension(:), allocatable, save thick
Definition: cNRLAtmos.f:28
real(4), dimension(:,:), allocatable, save h2thickcoef
Definition: cNRLAtmos.f:31
real(4), dimension(:), allocatable, save h
Definition: cNRLAtmos.f:28
real(4), dimension(:,:), allocatable, save thick2dencoef
Definition: cNRLAtmos.f:34
integer, save nsizem
Definition: cNRLAtmos.f:7
real(4), dimension(:,:), allocatable, save thick2hcoef
Definition: cNRLAtmos.f:33
real(4), dimension(:), allocatable, save temp
Definition: cNRLAtmos.f:29
real(4), dimension(:), allocatable, save den
Definition: cNRLAtmos.f:28
real(4), dimension(:,:), allocatable, save h2tempcoef
Definition: cNRLAtmos.f:32
real(4), dimension(:,:), allocatable, save h2dencoef
Definition: cNRLAtmos.f:30
integer, save nsize
Definition: cNRLAtmos.f:7
Here is the caller graph for this function:

◆ cnrldatamanip()

subroutine cnrldatamanip ( )

Definition at line 529 of file cNRLAtmos.f.

References nrl_atmos::a, nrl_atmos::al, nrl_atmos::b, nrl_atmos::bl, nrl_atmos::den, e3, nrl_atmos::h, nrl_atmos::h2dencoef, nrl_atmos::h2tempcoef, nrl_atmos::h2thickcoef, nrl_atmos::heightx, kscsplcoef(), kscsplinteg(), nrl_atmos::nsize, nrl_atmos::nsizem, nrl_atmos::temp, nrl_atmos::thick, nrl_atmos::thick2dencoef, nrl_atmos::thick2hcoef, and nrl_atmos::thickx.

Referenced by cnrlgendata().

529  use nrl_atmos
530  implicit none
531  integer:: i
532 
533  real(4)::dum
534 
536 
537 
538  do i = nsize/2, nsize
539  if( h(i) > heightx-50.0e3 ) exit
540  enddo
541  b = (h(nsize)-h(i)) /log(den(i)/den(nsize))
542  a = den(i)*exp(h(i)/b)
543  write(0,*) ' a,b=',a,b
544 
545  bl = (h(2)-h(1))/log(den(1)/den(2))
546  al = den(1)*exp(h(1)/bl)
547 ! integral of den at each segment
548  thick(:) = 0.
549  do i = 1, nsizem
551  * h(i), h(i+1), thick(i) )
552  enddo
553  ! thickness above h> h(nsize)
554  ! ~ 3.e-3 thickness at h(nsize) kg/m^2. very rough
555  thickx = a*b*exp(-h(nsize)/b)
556  thick(nsize) = thickx
557 ! make cummulative
558  do i = nsizem, 1, -1
559  thick(i) = thick(i) + thick(i+1)
560  enddo
561 
real(4), dimension(:), allocatable, save thick
Definition: cNRLAtmos.f:28
real(4), save thickx
Definition: cNRLAtmos.f:19
real(4), dimension(:,:), allocatable, save h2thickcoef
Definition: cNRLAtmos.f:31
nodes i
subroutine kscsplcoef(x, y, n, coef, nc)
Definition: kScsplCoef.f:2
real(4), dimension(:), allocatable, save h
Definition: cNRLAtmos.f:28
real(4), dimension(:,:), allocatable, save thick2dencoef
Definition: cNRLAtmos.f:34
integer, save nsizem
Definition: cNRLAtmos.f:7
real(4), save al
Definition: cNRLAtmos.f:22
real(4), dimension(:,:), allocatable, save thick2hcoef
Definition: cNRLAtmos.f:33
real(4), dimension(:), allocatable, save temp
Definition: cNRLAtmos.f:29
subroutine kscsplinteg(x, y, n, coef, nc, a, b, s)
Definition: kScsplInteg.f:2
real(4), dimension(:), allocatable, save den
Definition: cNRLAtmos.f:28
real(4), dimension(:,:), allocatable, save h2tempcoef
Definition: cNRLAtmos.f:32
block data cblkElemag data *AnihiE e3
Definition: cblkElemag.h:7
real(4), dimension(:,:), allocatable, save h2dencoef
Definition: cNRLAtmos.f:30
real(4), save a
Definition: cNRLAtmos.f:20
real(4), save heightx
Definition: cNRLAtmos.f:16
real(4), save b
Definition: cNRLAtmos.f:21
real(4), save bl
Definition: cNRLAtmos.f:22
integer, save nsize
Definition: cNRLAtmos.f:7
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cnrldataread()

subroutine cnrldataread ( integer, intent(in)  devno,
character(*), intent(in)  filename 
)

Definition at line 140 of file cNRLAtmos.f.

References cnrlalloc(), cnrlheaderread(), copenf(), cskipcomment(), nrl_atmos::den, nrl_atmos::h, nrl_atmos::nsize, nrl_atmos::nsizem, nrl_atmos::temp, and true.

140  use nrl_atmos
141  implicit none
142  integer,intent(in):: devno ! temporary logical dev. # of NRL data
143  ! container
144  character(*),intent(in)::filename ! file name of the container
145  ! file should contain height (m) vs density (kg/m3) table
146  ! first h is -400 m. step h should be ~ 500 m. (100 m is
147  ! too small and spline interpolation becomes NG for the
148  ! 2nd derivative 500 m gives as good as 100 m in the stable
149  ! region.
150  character(len=64):: line ! 1 line should be <= 64 cha.
151 
152  integer:: i, icon
153  call copenf(devno, filename, icon)
154  if(icon /= 0 ) then
155  write(0,*) ' file=',filename
156  write(0,*) ' cannot be opened for cNRLdataRead'
157  stop
158  endif
159  call cnrlheaderread(devno)
160 
161  call cskipcomment(devno, icon)
162 ! find # of lines
163  if(icon /= 0 ) then
164  write(0,*) ' filename=',trim(filename)
165  write(0,*) ' has no #------------- line'
166  stop
167  endif
168  nsize=0
169  do while ( .true. )
170  read(devno,'(a)', end=100) line
171  nsize = nsize + 1
172  enddo
173  100 continue
174 
175  rewind devno
176 
177  nsizem = nsize - 1
178  write(0,*) ' nsize=',nsize
179  call cnrlalloc ! allocate arrays
180 
181  call cskipcomment(devno, icon)
182  do i = 1, nsize
183  read(devno, *) h(i), den(i), temp(i)
184  enddo
185  close(devno)
186  write(0,*) ' NRL atmospheric data has been read from'
187  write(0,*) filename
nodes i
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
Definition: cblkElemag.h:7
subroutine cnrlheaderread(io)
Definition: cNRLAtmos.f:191
real(4), dimension(:), allocatable, save h
Definition: cNRLAtmos.f:28
integer, save nsizem
Definition: cNRLAtmos.f:7
real(4), dimension(:), allocatable, save temp
Definition: cNRLAtmos.f:29
subroutine copenf(io, fnin, icon)
Definition: copenf.f:8
subroutine cnrlalloc
Definition: cNRLAtmos.f:512
real(4), dimension(:), allocatable, save den
Definition: cNRLAtmos.f:28
subroutine cskipcomment(io, icon)
Definition: cskipComment.f:19
integer, save nsize
Definition: cNRLAtmos.f:7
Here is the call graph for this function:

◆ cnrldatawrite()

subroutine cnrldatawrite ( integer, intent(in)  io,
character(*), intent(in)  filename 
)

Definition at line 329 of file cNRLAtmos.f.

References cnrlheaderwrite(), copenfw(), nrl_atmos::den, nrl_atmos::h, nrl_atmos::nsize, and nrl_atmos::temp.

329  use nrl_atmos
330  implicit none
331  integer,intent(in):: io ! write dev #. If this is 6,
332  ! filename is not referred.
333  character(*),intent(in):: filename ! filename path
334 
335  integer:: i, icon
336 
337  if( io /= 6) then
338  call copenfw(io, filename, icon)
339  if( icon /= 0 ) then
340  write(0,*) ' file=',trim(filename)
341  write(0,*) 'cannot be opened for cNRLdataWrite'
342  stop
343  endif
344  endif
345  call cnrlheaderwrite(io)
346  do i = 1, nsize
347  write(io, '(i7, 1p, E12.5, 0p, f8.1)')
348  * int( h(i) ), den(i), temp(i)
349  enddo
350  if( io /= 6 ) then
351  close(io)
352  endif
nodes i
real(4), dimension(:), allocatable, save h
Definition: cNRLAtmos.f:28
real(4), dimension(:), allocatable, save temp
Definition: cNRLAtmos.f:29
subroutine cnrlheaderwrite(io)
Definition: cNRLAtmos.f:259
real(4), dimension(:), allocatable, save den
Definition: cNRLAtmos.f:28
subroutine copenfw(io, fnin, icon)
Definition: copenf.f:122
integer, save nsize
Definition: cNRLAtmos.f:7
Here is the call graph for this function:

◆ cnrlgendata()

subroutine cnrlgendata ( real(8), intent(in)  lat,
real(8), intent(in)  long,
integer, dimension(4), intent(in)  period 
)

Definition at line 356 of file cNRLAtmos.f.

References cnrlalloc(), cnrldatamanip(), nrl_atmos::den, nrl_atmos::gday1, nrl_atmos::gday2, nrl_atmos::ghour1, nrl_atmos::ghour2, nrl_atmos::glat, nrl_atmos::glong, nrl_atmos::h, nrl_atmos::heightx, nrl_atmos::nsize, nrl_atmos::nsizem, and nrl_atmos::temp.

356  use nrl_atmos
357 ! get the average of height vs air density table of the atmosphere
358 ! at a given place during the given period specified by
359 ! starting time and ending time.
360  implicit none
361  real(8),intent(in):: lat ! latitute in deg. of the place
362  real(8),intent(in):: long ! longitude in deg. of the place
363 ! time info below is for the local time of the place
364  integer,intent(in):: period(4) ! period(1): starting day (Jan.1 is 1)
365  ! Dec. 31 is 365 (366 for leap
366  ! year. but at present, year
367  ! is not considered. so 365 is
368  ! better?)
369  ! period(2): endign day 1 ~ 365
370  ! period(3): starting hours
371  ! 0,24 is midnight. 12 is noon.
372  ! period(4) same for ending hour
373  !
374 ! Let dayi=period(i) (i=1,2), hourj-2=period(j) (j=3,4)
375 ! If day1 > day2, the period is understood as straddling Dec. to Jan.
376 ! If hour1 > hour2, the period is understood as straddling midnight
377 !
378 ! The data is generated by taking the average of data for sampled
379 ! times in the period:
380 ! a) Samples days from day1 to day2 (7 day step; day1 and day2 is always
381 ! included. If the last but one day is close to day2 (< nearday)
382 ! such day is skipped.
383 ! b) For each sampled day, get data for sampled hours between
384 !  hour1 and hour2. (4 hour step; hour1 and hour2 are always included.
385 ! If the last but one hour is close to hour2 (< nearhour) such hour
386 ! is skipped.
387 ! The user can generate data, e.g,
388 ! the average during day time of the winter season (say, from Dec to Feb),
389 ! or night time of the same period. Also it is possible to take the
390 ! average of whole days during the summer season etc.
391 ! As to the height, data is generated from lowh to heightx,
392 ! above heightx extrapolation by exp formula is used.
393 ! Also below lowh, extrapolation is made but it must not be large.
394 
395  real(8),parameter:: lowh=-400d0 ! generate data from this height (m a.s.l)
396  real(8),parameter:: step=500d0 ! height step m. this is enough
397  real(8),parameter:: dayinsec = 24*3600
398  integer,parameter:: daystep = 7 !7 day step in whole days
399  integer,parameter:: nearday = 3 !
400  integer,parameter:: hourstep = 4 ! 4 hour step in each day
401  integer,parameter:: nearhour = 2
402  integer,save::iday, day, tempday
403  integer,save::hour, temphour
404  real(8):: dalti
405 
406  real(4):: totalden(9), tempera(2)
407 
408  integer::nsum
409 ! usec: UT in sec in the day
410 ! stl: apparent local soloar time in the day in hours
411 ! alti: atltitude in km
412  real(4),save::usec, stl, alti
413  integer::i
414 
415  nsize = (heightx-lowh)/step+1
416  nsizem = nsize - 1
417 
418  call cnrlalloc ! allocate arrays
419 
420  den(:) = 0. ! clear rho and temperature area
421  temp(:) = 0.
422 
423  glat = lat ! save lat, long
424  glong = long
425 
426  gday1 = period(1)
427  gday2 = period(2)
428  ghour1 = period(3)
429  ghour2 = period(4)
430 
431  nsum = 0
432  day=gday1
433 
434  if(day > gday2) then
435  day = day-366
436  endif
437 
438  do while ( day <= gday2 )
439  hour = ghour1
440  if( hour > ghour2) then
441  hour = hour - 24
442  endif
443 
444  do while ( hour <= ghour2 )
445  if( day > 0 ) then
446  tempday = day
447  elseif( day < 0 ) then
448  tempday = day+366
449  elseif( day == 0 ) then
450  tempday = 1
451  endif
452 
453  if( hour > 0 ) then
454  temphour = hour
455  else
456  temphour = hour + 24
457  endif
458  ! local apparent solar time in hours
459  stl = temphour
460  ! STL=UT(sec)/3600+GLONG/15 hours
461  usec = (3600*stl - long*240) ! UT in sec
462  iday = tempday ! day; year may be added; if y2015, 15*1000 may be
463  ! added
464  dalti = lowh ! lowest height
465  nsum = nsum + 1
466  ! for given place and time, compute
467  ! density at all heights
468  do i=1, nsize
469  alti = dalti/1000. ! to km
470 ! day UT(sec) km deg deg hours
471  call gtd7(iday, usec, alti, glat, glong, stl,
472  & 150., 150., 4., 48, totalden, tempera)
473  den(i) = den(i) + totalden(6) ! g/cm3
474  temp(i) = temp(i) + tempera(2) ! K
475  dalti = dalti + step
476  enddo
477 
478  if( hour == ghour2 ) exit
479 
480  hour = hour + hourstep
481  if( ghour2 - hour <= nearhour) then
482  hour = ghour2
483  endif
484  enddo
485 
486  if( day == gday2 ) exit
487 
488  day = day + daystep
489  if( gday2 - day <= nearday ) then
490  day = gday2
491  endif
492  enddo
493 ! get average
494  den(:) = den(:)*1000./nsum ! kg/m3
495  temp(:) = temp(:) / nsum ! K
496 
497 ! make height table
498  dalti = lowh
499  do i=1, nsize
500  h(i) = dalti ! m
501  dalti = dalti + step
502  enddo
503 ! generate other data.
504  call cnrldatamanip
505  write(0,*) 'NRL atmospheric data has been made for'
506  write(0,*) 'Latitute=',glat, ' Londitude=',glong, ' deg'
507  write(0,*) 'for period=',period(:)
nodes i
latitude latitude this system is used *****************************************************************! type coord sequence union map real z z in m endmap xyz map real * lat
Definition: Zcoord.h:25
subroutine cnrldatamanip
Definition: cNRLAtmos.f:529
latitude latitude this system is used *****************************************************************! type coord sequence union map real z z in m endmap xyz map real ! latitude in deg is to the north * long
Definition: Zcoord.h:25
integer, save gday1
Definition: cNRLAtmos.f:11
real(4), save glat
Definition: cNRLAtmos.f:10
integer, save ghour1
Definition: cNRLAtmos.f:12
real(4), dimension(:), allocatable, save h
Definition: cNRLAtmos.f:28
integer, save nsizem
Definition: cNRLAtmos.f:7
real(4), dimension(:), allocatable, save temp
Definition: cNRLAtmos.f:29
block data cblkEvhnp ! currently usable models data RegMdls ad *special data *Cekaon d0
Definition: cblkEvhnp.h:5
subroutine cnrlalloc
Definition: cNRLAtmos.f:512
real(4), dimension(:), allocatable, save den
Definition: cNRLAtmos.f:28
integer, save ghour2
Definition: cNRLAtmos.f:12
real(4), save glong
Definition: cNRLAtmos.f:10
real(4), save heightx
Definition: cNRLAtmos.f:16
integer, save gday2
Definition: cNRLAtmos.f:11
integer, save nsize
Definition: cNRLAtmos.f:7
Here is the call graph for this function:

◆ cnrlheaderread()

subroutine cnrlheaderread ( integer, intent(in)  io)

Definition at line 191 of file cNRLAtmos.f.

References nrl_atmos::gday1, nrl_atmos::gday2, nrl_atmos::ghour1, nrl_atmos::ghour2, nrl_atmos::glat, and nrl_atmos::glong.

Referenced by cnrldataread().

191  use nrl_atmos
192  implicit none
193  integer,intent(in):: io ! read dev #
194 
195  character(len=10)::term1, term2
196  character(len=20)::term3
197 
198  read(io,*) term1, term2, term3
199  if( term2 /= "NRL") then
200  write(0,*)
201  * 'NRL data is needed since ATMOSPHERE 3 is specified'
202  write(0,*)
203  * 'in Zcondc.h '
204  write(0,*)
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)
209  stop
210  endif
211  read(io,*) term1, term2, glat
212  if( term2 /= "lat") then
213  write(0,*)
214  * 'Atmosphere data for NRL: 2nd line must be like'
215  write(0,*) '# lat 32.0'
216  stop
217  endif
218  read(io,*) term1, term2, glong
219  if( term2 /= "long") then
220  write(0,*)
221  * 'Atmosphere data for NRL: 3rd line must be like'
222  write(0,*) '# long 132.0'
223  stop
224  endif
225  read(io,*) term1, term2, gday1
226  if( term2 /= "day1") then
227  write(0,*)
228  * 'Atmosphere data for NRL: 4th line must be like'
229  write(0,*) '# day1 125'
230  stop
231  endif
232 
233  read(io,*) term1, term2, gday2
234  if( term2 /= "day2") then
235  write(0,*)
236  * 'Atmosphere data for NRL: 6th line must be like'
237  write(0,*) '# day2 135'
238  stop
239  endif
240 
241  read(io,*) term1, term2, ghour1
242  if( term2 /= "hour1") then
243  write(0,*)
244  * 'Atmosphere data for NRL: 5th line must be like'
245  write(0,*) '# hour1 3'
246  stop
247  endif
248 
249  read(io,*) term1, term2, ghour2
250  if( term2 /= "hour2") then
251  write(0,*)
252  * 'Atmosphere data for NRL: 7th line must be like'
253  write(0,*) '# hour2 1.0'
254  stop
255  endif
integer, save gday1
Definition: cNRLAtmos.f:11
real(4), save glat
Definition: cNRLAtmos.f:10
integer, save ghour1
Definition: cNRLAtmos.f:12
integer, save ghour2
Definition: cNRLAtmos.f:12
real(4), save glong
Definition: cNRLAtmos.f:10
integer, save gday2
Definition: cNRLAtmos.f:11
Here is the caller graph for this function:

◆ cnrlheaderw0()

subroutine cnrlheaderw0 ( integer, intent(in)  io)

Definition at line 277 of file cNRLAtmos.f.

References nrl_atmos::gday1, nrl_atmos::gday2, nrl_atmos::ghour1, nrl_atmos::ghour2, nrl_atmos::glat, and nrl_atmos::glong.

Referenced by cnrlheaderwrite(), and main().

277  use nrl_atmos
278  implicit none
279 
280  integer,intent(in):: io ! write dev #
281 
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
integer, save gday1
Definition: cNRLAtmos.f:11
real(4), save glat
Definition: cNRLAtmos.f:10
integer, save ghour1
Definition: cNRLAtmos.f:12
integer, save ghour2
Definition: cNRLAtmos.f:12
real(4), save glong
Definition: cNRLAtmos.f:10
integer, save gday2
Definition: cNRLAtmos.f:11
Here is the caller graph for this function:

◆ cnrlheaderwrite()

subroutine cnrlheaderwrite ( integer, intent(in)  io)

Definition at line 259 of file cNRLAtmos.f.

References cnrlheaderw0().

Referenced by cnrldatawrite().

259  use nrl_atmos
260  implicit none
261 
262  integer,intent(in):: io ! write dev #
263 
264  call cnrlheaderw0(io)
265 
266  write(io,'(a)')
267  * "# 3 terms of the 1st 7 lines must be as above (except numbers)"
268  write(io,'(a)')
269  * "# any comment may be put after 3 terms. and lines below"
270  write(io,'(a)')
271  * "# until #----------------- line "
272  write(io,'(a)') "# h(m) den(kg/m3) T(K)"
273  write(io,'(a)') "#-------------------------------"
subroutine cnrlheaderw0(io)
Definition: cNRLAtmos.f:277
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cnrllatlongcheck()

subroutine cnrllatlongcheck ( real(8), intent(in)  lat,
real(8), intent(in)  long 
)

Definition at line 292 of file cNRLAtmos.f.

References nrl_atmos::glat, and nrl_atmos::glong.

Referenced by ciniatmos().

292 ! should be called when AtmosFile /= " "
293 ! for ATMOSPHERE 3 (NRL atmosphere)
294 ! if lat, long in AtmosFile differ from
295 ! this input, stop is made.
296  use nrl_atmos
297  implicit none
298  real(8),intent(in):: lat ! LatitOfSite in deg.
299  real(8),intent(in):: long ! LongitOfSite in deg
300 ! these two should be the same those in the Namlist input.
301 ! and if differ from glat glong stop is made.
302 ! We may replace lat and long by glat glong to keep
303 ! consisency with Namelist input. But we worry about
304 ! doing so. (future program update may use LatitOfSite
305 ! and LongitOfSite before this rouine is called. etc).
306 !
307  logical::warning
308  warning = abs(lat -glat) > 1.0
309  warning= warning .or. abs(long -glong) > 2.0
310  if( warning ) then
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 '
317  write(0,*) 'AtmosFile ', glat, glong
318  write(0,*) 'param ', sngl(lat), sngl(long)
319  write(0,*)
320  * 'Give LatitOfSite and LongitOfSite values close to'
321  write(0,*) 'those in AtmosFile; Or '
322  write(0,*)
323  * 'Consider using NRL_period without using AtmosFile'
324  stop
325  endif
latitude latitude this system is used *****************************************************************! type coord sequence union map real z z in m endmap xyz map real * lat
Definition: Zcoord.h:25
latitude latitude this system is used *****************************************************************! type coord sequence union map real z z in m endmap xyz map real ! latitude in deg is to the north * long
Definition: Zcoord.h:25
real(4), save glat
Definition: cNRLAtmos.f:10
real(4), save glong
Definition: cNRLAtmos.f:10
Here is the caller graph for this function:

◆ cthick2den()

real(8) function cthick2den ( real(8), intent(in)  t)

Definition at line 591 of file cNRLAtmos.f.

References nrl_atmos::al, nrl_atmos::b, nrl_atmos::bl, nrl_atmos::den, nrl_atmos::h, kscsplintp(), nrl_atmos::nsize, nrl_atmos::nsizem, nrl_atmos::thick, nrl_atmos::thick2dencoef, and nrl_atmos::thickx.

Referenced by __atmosd2.f__(), __atmosd4.f__(), cthick2den(), and main().

591  use nrl_atmos
592  implicit none
593  real(8),intent(in):: t ! kg/m2
594 
595  real(8)::ans ! kg/m3
596 
597  real(4):: sans, st
598  if( t > thickx ) then
599  if( t<= thick(1) ) then
600  st = t
602  * st, sans)
603  ans = sans
604  else
605  ans= (t-thick(1))/bl + al*exp(-h(1)/bl)
606  endif
607  else
608  ! ans = a*exp( b*log(t/a/b)/b) =a t/(ab) = t/b
609  ans = t/b
610  endif
real(4), dimension(:), allocatable, save thick
Definition: cNRLAtmos.f:28
real(4), save thickx
Definition: cNRLAtmos.f:19
subroutine kscsplintp(x, y, n, coef, nc, v, f)
Definition: kScsplIntp.f:2
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(4), dimension(:), allocatable, save h
Definition: cNRLAtmos.f:28
real(4), dimension(:,:), allocatable, save thick2dencoef
Definition: cNRLAtmos.f:34
integer, save nsizem
Definition: cNRLAtmos.f:7
real(4), save al
Definition: cNRLAtmos.f:22
real(4), dimension(:), allocatable, save den
Definition: cNRLAtmos.f:28
nodes t
real(4), save b
Definition: cNRLAtmos.f:21
real(4), save bl
Definition: cNRLAtmos.f:22
integer, save nsize
Definition: cNRLAtmos.f:7
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cthick2h()

real(8) function cthick2h ( real(8), intent(in)  t)

Definition at line 569 of file cNRLAtmos.f.

References nrl_atmos::a, nrl_atmos::al, nrl_atmos::b, nrl_atmos::bl, nrl_atmos::h, kscsplintp(), nrl_atmos::nsize, nrl_atmos::nsizem, nrl_atmos::thick, nrl_atmos::thick2hcoef, and nrl_atmos::thickx.

569  use nrl_atmos
570  implicit none
571  real(8),intent(in)::t ! kg/m2
572  real(8)::ans
573 
574  real(4):: sans, st
575 
576  if( t > thickx ) then
577  if( t <= thick(1) ) then
578  st = t
579  call kscsplintp(thick, h, nsize, thick2hcoef, nsizem, st,
580  * sans)
581  ans = sans
582  else
583  ans = -bl* log( (t-thick(1))/al/bl + exp(-h(1)/bl ))
584  endif
585  else
586  ans = -b*log(t/a/b)
587  endif
real(4), dimension(:), allocatable, save thick
Definition: cNRLAtmos.f:28
real(4), save thickx
Definition: cNRLAtmos.f:19
subroutine kscsplintp(x, y, n, coef, nc, v, f)
Definition: kScsplIntp.f:2
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(4), dimension(:), allocatable, save h
Definition: cNRLAtmos.f:28
integer, save nsizem
Definition: cNRLAtmos.f:7
real(4), save al
Definition: cNRLAtmos.f:22
real(4), dimension(:,:), allocatable, save thick2hcoef
Definition: cNRLAtmos.f:33
real(4), save a
Definition: cNRLAtmos.f:20
nodes t
real(4), save b
Definition: cNRLAtmos.f:21
real(4), save bl
Definition: cNRLAtmos.f:22
integer, save nsize
Definition: cNRLAtmos.f:7
Here is the call graph for this function:

◆ cvh2den()

real(8) function cvh2den ( real(8), intent(in)  vh)

Definition at line 39 of file cNRLAtmos.f.

References nrl_atmos::a, nrl_atmos::al, nrl_atmos::b, nrl_atmos::bl, nrl_atmos::den, nrl_atmos::h, nrl_atmos::h2dencoef, nrl_atmos::heightx, kscsplintp(), nrl_atmos::nsize, and nrl_atmos::nsizem.

39  use nrl_atmos
40  implicit none
41  real(8),intent(in)::vh ! m
42  real(8)::ans
43 
44  real(4):: svh, sans
45 
46  svh = vh
47  if( vh < heightx ) then
48  if( vh >= h(1) ) then
49  call kscsplintp(h, den, nsize, h2dencoef, nsizem, svh, sans)
50  ans = sans
51  else
52  ans = al*exp(-vh/bl)
53  endif
54  else
55  ans = a*exp(-vh/b)
56  endif
57 
subroutine kscsplintp(x, y, n, coef, nc, v, f)
Definition: kScsplIntp.f:2
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(4), dimension(:), allocatable, save h
Definition: cNRLAtmos.f:28
integer, save nsizem
Definition: cNRLAtmos.f:7
real(4), save al
Definition: cNRLAtmos.f:22
real(4), dimension(:), allocatable, save den
Definition: cNRLAtmos.f:28
real(4), dimension(:,:), allocatable, save h2dencoef
Definition: cNRLAtmos.f:30
real(4), save a
Definition: cNRLAtmos.f:20
real(4), save heightx
Definition: cNRLAtmos.f:16
real(4), save b
Definition: cNRLAtmos.f:21
real(4), save bl
Definition: cNRLAtmos.f:22
integer, save nsize
Definition: cNRLAtmos.f:7
Here is the call graph for this function:

◆ cvh2den2p()

real(8) function cvh2den2p ( real(8), intent(in)  vh)

Definition at line 129 of file cNRLAtmos.f.

References nrl_atmos::drhodh2.

129 ! this must be called after cvh2denp
130  use nrl_atmos
131  implicit none
132  real(8),intent(in)::vh ! m
133  real(8)::ans
134 
135  ans = drhodh2
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) drhodh2
Definition: cNRLAtmos.f:15

◆ cvh2denp()

real(8) function cvh2denp ( real(8), intent(in)  vh)

Definition at line 84 of file cNRLAtmos.f.

References nrl_atmos::a, nrl_atmos::al, nrl_atmos::b, nrl_atmos::bl, d3, nrl_atmos::drhodh2, nrl_atmos::h, nrl_atmos::h2dencoef, nrl_atmos::heightx, kscspldif(), nrl_atmos::nsize, and nrl_atmos::nsizem.

84 ! get drho/dh and its derivative
85  use nrl_atmos
86  implicit none
87  real(8),intent(in)::vh ! m
88  real(8)::ans
89 
90  real(4)::svh, sans, dum
91  real(8):: rho
92  svh = vh
93  if( vh < heightx ) then
94  if( vh >= h(1) ) then
95  call kscspldif(h, nsize, h2dencoef, nsizem, svh, sans, dum)
96  drhodh2 = dum
97  ans = sans
98  if( vh > 65.0d3) then
99 !
100 ! 2nd derivative (dum) is not stable at ~ 72 km or so.
101 ! and h> 200km
102 ! This is rather due to original data.
103 !!
104 ! It's very small (|d(drho/dh)/dh| ~ 10^-(3~4)|(drho/dh)|)
105 ! so we put it 0 over 65 km. Also if we take small
106 ! h step (100 m ), result becomes worse than 500 m step
107 ! so we use 500 m step. single precision and double
108 ! precision does not change the situaiton. So we use
109 ! single precision. Also taking log of density cannot
110 ! improve the situaiton.
111 
112 !!!! drhodh2 = 0. ! at prsent don't do this
113  endif
114  else
115  call kscspldif(h, nsize, h2dencoef, nsizem, h(1), sans, dum)
116  ! not so good but don't care
117  ans = -al/bl*exp(-vh/bl) + al/bl*exp(-h(1)/bl) + sans
118  drhodh2 = al/bl/bl*(exp(-vh/bl) - exp(-h(1)/bl))
119  * + dum
120  endif
121  else
122  ans = -a/b*exp(-vh/b)
123  drhodh2 = -ans/b
124  endif
125 
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 cblkIncident data *Za1ry *HeightOfInj d3
Definition: cblkIncident.h:7
subroutine kscspldif(x, n, coef, nc, v, d1, d2)
Definition: kScsplDif.f:2
real(4), dimension(:), allocatable, save h
Definition: cNRLAtmos.f:28
integer, save nsizem
Definition: cNRLAtmos.f:7
real(8) drhodh2
Definition: cNRLAtmos.f:15
real(4), save al
Definition: cNRLAtmos.f:22
real(4), dimension(:,:), allocatable, save h2dencoef
Definition: cNRLAtmos.f:30
real(4), save a
Definition: cNRLAtmos.f:20
real(4), save heightx
Definition: cNRLAtmos.f:16
real(4), save b
Definition: cNRLAtmos.f:21
real(4), save bl
Definition: cNRLAtmos.f:22
integer, save nsize
Definition: cNRLAtmos.f:7
Here is the call graph for this function:

◆ cvh2scaleh()

real(8) function cvh2scaleh ( real(8), intent(in)  vh)

Definition at line 635 of file cNRLAtmos.f.

Referenced by __atmosd2.f__(), cvh2scaleh(), and main().

635  use nrl_atmos
636  implicit none
637  real(8),intent(in):: vh ! m
638  real(8)::ans ! m
639 
640  real(8),external:: cvh2den, cvh2denp
641 !
642  ans = - cvh2den(vh)/ cvh2denp(vh)
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
real *8 function cvh2den(z)
Definition: ciniSegAtoms.f:54
Here is the caller graph for this function:

◆ cvh2temp()

real(8) function cvh2temp ( real(8), intent(in)  vh)

Definition at line 61 of file cNRLAtmos.f.

References nrl_atmos::h, nrl_atmos::h2tempcoef, nrl_atmos::heightx, kscsplintp(), nrl_atmos::nsize, nrl_atmos::nsizem, and nrl_atmos::temp.

Referenced by __atmosd2.f__().

61  use nrl_atmos
62  implicit none
63  real(8),intent(in):: vh ! m
64  real(8):: ans ! temperature Kelvin
65 
66  real(4):: svh, sans
67 
68  svh = vh
69  if( vh < heightx ) then
70  if( vh >= h(1) ) then
72  * svh, sans)
73  ans = sans
74  else
75  ans = temp(1)-(vh-h(1))*0.3/100.
76  endif
77  else
78  ans = temp(nsize)
79  endif
subroutine kscsplintp(x, y, n, coef, nc, v, f)
Definition: kScsplIntp.f:2
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(4), dimension(:), allocatable, save h
Definition: cNRLAtmos.f:28
integer, save nsizem
Definition: cNRLAtmos.f:7
real(4), dimension(:), allocatable, save temp
Definition: cNRLAtmos.f:29
real(4), dimension(:,:), allocatable, save h2tempcoef
Definition: cNRLAtmos.f:32
real(4), save heightx
Definition: cNRLAtmos.f:16
integer, save nsize
Definition: cNRLAtmos.f:7
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cvh2thick()

real(8) function cvh2thick ( real(8), intent(in)  vh)

Definition at line 614 of file cNRLAtmos.f.

References nrl_atmos::a, nrl_atmos::al, nrl_atmos::b, nrl_atmos::bl, nrl_atmos::h, nrl_atmos::h2thickcoef, nrl_atmos::heightx, kscsplintp(), nrl_atmos::nsize, nrl_atmos::nsizem, and nrl_atmos::thick.

614  use nrl_atmos
615  implicit none
616  real(8),intent(in):: vh ! m
617  real(8)::ans ! kg/m2
618 
619  real(4):: sans, svh
620  if( vh < heightx ) then
621  if( vh >= h(1) ) then
622  svh = vh
624  * svh, sans)
625  ans = sans
626  else
627  ans = al*bl*(exp(-vh/bl) -exp(-h(1)/bl)) + thick(1)
628  endif
629  else
630  ans = a*b*exp(-vh/b)
631  endif
real(4), dimension(:), allocatable, save thick
Definition: cNRLAtmos.f:28
subroutine kscsplintp(x, y, n, coef, nc, v, f)
Definition: kScsplIntp.f:2
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(4), dimension(:,:), allocatable, save h2thickcoef
Definition: cNRLAtmos.f:31
real(4), dimension(:), allocatable, save h
Definition: cNRLAtmos.f:28
integer, save nsizem
Definition: cNRLAtmos.f:7
real(4), save al
Definition: cNRLAtmos.f:22
real(4), save a
Definition: cNRLAtmos.f:20
real(4), save heightx
Definition: cNRLAtmos.f:16
real(4), save b
Definition: cNRLAtmos.f:21
real(4), save bl
Definition: cNRLAtmos.f:22
integer, save nsize
Definition: cNRLAtmos.f:7
Here is the call graph for this function: