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

Go to the source code of this file.

Functions/Subroutines

subroutine kroundrv (u, am, j, un)
 

Function/Subroutine Documentation

◆ kroundrv()

subroutine kroundrv ( real  u,
real  am,
integer  j,
real  un 
)

Definition at line 10 of file kroundrv.f.

10  implicit none
11 !
12 ! Let u be m*10**n in normalzed form. this program adjusts m so
13 ! that it is an integral of am as follows. The adjusted value
14 ! is put in un.
15 !
16  real u ! input. real value to be adjusted
17  real am ! input. reference constant used for adjusting as follows
18 ! am may be 0.5, 1., 1.5, 2., 5., 10. or other values
19 ! if am=0.5, new m will be one of 1, 1.5, 2,...9.5, 10
20 ! 1. // 1,2,3,.... 10
21 ! 2. // 1,2,4,6,8,10
22 ! 5. // 1,5,10
23  integer j ! input. one of -1,0 or 1
24 ! to signify that 1) un be <= u, 2) un be neares
25 ! to u, or 3) un be >= u, respectively.
26  real un ! adjusted value of u.
27 !
28 ! the new value of m will be adjusted by reference to j.
29 ! if u is negative, absolute is taken for adjusting and sign is added
30 ! after adjustment.
31 ! if u=0, un=0 results. if am<=0, result is not guaranteed.
32 !
33 !
34  logical small
35  real ua, an, em, tmp, atmp, ux
36  integer n
37 !
38  if(u .eq. 0.) then
39  un = 0.
40  else
41  small=(j .lt. 0 .and. u .gt. 0.) .or.
42  * (j .gt. 0 .and. u .lt. 0.)
43  ua = abs(u)
44 ! decompose u
45  an = log10(ua)
46  if(an .lt. 0.) an = an-1.
47  n = an
48  em = ua/10.**n
49 !
50  tmp = em/am
51  atmp = aint(tmp)
52  if(j .eq. 0) then
53  if(tmp .ne. atmp) em = aint(tmp+.5)*am
54  elseif(small) then
55  em = atmp*am
56  else
57  if(tmp .ne. atmp) em = aint(tmp+1.)*am
58  endif
59  if(em .eq. 0.) em = 1.
60  ux = em*10.**n
61  if(u .lt. 0.) ux = -ux
62  un=ux
63  endif
********************block data cblkHeavy ********************integer j data *HeavyG2symbol *data *HeavyG2code kiron data j
Definition: cblkHeavy.h:36
*************************block data cblkTracking *************************implicit none data *ExactThick *Freec *RatioToE0 *MagChgDist *TimeStructure *Truncn *Truncx data *IncMuonPolari *KEminObs *ThinSampling *EthinRatio *Generate em
Definition: cblkTracking.h:9
integer n
Definition: Zcinippxc.h:1