COSMOS v7.655  COSMOSv7655
(AirShowerMC)
kdmachmnmx.f
Go to the documentation of this file.
1 ! real*8 xmin, xmax
2 ! call kdmachmnmx(xmin, xmax)
3 ! write(*,*) xmin, xmax
4 ! end
5 
6 ! ********************************
7  subroutine kdmachmnmx(xmin, xmax)
8 ! ********************************
9  implicit none
10 ! returns machine min and max of double
11 ! precision floating numbers:
12 ! This is approx one, but will be usable.
13 !
14  real*8 xmin ! machine min. true one will be xmin/1.1 or so.
15  real*8 xmax ! machine max. true one will be xmax*2 or so.
16  real*8 d1, d2
17  integer i
18  character*25 aaa
19 
20  d2 = 1.d-70
21  do i = 1, 10000
22  d1 = d2/5.0
23  write(aaa,'(g25.20)') d1
24  if(index(aaa, '.0') .ne. 0 .or.
25  * index(aaa, '0. ') .ne. 0 ) goto 10
26  d2 = d1
27  enddo
28  10 continue
29  xmin = d2
30  d1 = -log10(xmin)
31  if(d1 .gt. 310.d0) then
32 ! sun, hp.
33  xmax = 1.d0/(xmin*10.5d16) ! for safety against overflow.
34  else
35 ! next, alpha
36  xmax = 1.d0/(xmin*4.d0)
37  endif
38  end
39 
subroutine kdmachmnmx(xmin, xmax)
Definition: kdmachmnmx.f:8
block data cblkEvhnp ! currently usable models data RegMdls ad *special data *Cekaon d0
Definition: cblkEvhnp.h:5
dE dx *! Nuc Int sampling table d
Definition: cblkMuInt.h:130