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

Go to the source code of this file.

Functions/Subroutines

subroutine kdwhereis (x, in, a, step, loc)
 
subroutine kwhereis (x, in, a, step, loc)
 

Function/Subroutine Documentation

◆ kdwhereis()

subroutine kdwhereis ( real*8  x,
integer  in,
real*8, dimension(step, in)  a,
integer  step,
integer  loc 
)

Definition at line 27 of file kdwhereis.f.

Referenced by cl2tintp(), cprimflux0(), ct2lt(), cvh2den(), cvh2denp(), cvh2thick(), cvthick2h(), cz2t(), inteflux(), kcspldif(), kcsplintp(), kpolintp2(), kpolintpfe(), kpolintplogfe(), and kpolintplogxyfe().

27 ! *********************************
28 ! x : real*8. input. given double value.
29 ! in : integer. input. number of data in a.
30 ! a : real*8 a(step, in). input array.
31 ! a(1, 1), a(1, 2), a(1, 3)... are examined.
32 ! step: integer. input. see above. give 1 for one dim. array.
33 ! loc: integer. ouput. a(1,loc) <= x < a(1,loc+1) if a is ascending
34 ! (if a(1,in) = x, loc= in)
35 ! a(1, loc) > x >= a(1, loc+1) if a is dscending
36 !c (if a(1,1) = x, loc = 0)
37 ! if loc=0 or loc =in; x is out of range.
38 
39  implicit none
40  integer in, loc, step
41  real*8 x, a(step, in)
42 
43  logical ascending
44  integer i1, i2, im
45 
46  i1 = 0 ! lower and
47  i2 = in + 1 ! upper bound
48 
49  ascending = a(1, in) .gt. a(1, 1)
50  do while (i2 - i1 .gt. 1)
51  im = (i1 + i2)/2
52  if( ascending .eqv. x .ge. a(1, im) ) then
53  i1 = im
54  else
55  i2 = im
56  endif
57  enddo
58  loc = i1
real(4), save a
Definition: cNRLAtmos.f:20
! structure defining a particle at production ! Basic idea of what is to be contained in ! the particle structue is that dynamical ones should be included those derivable from the particle code ! is not included ******************************************************type fmom momentum sequence union map real e endmap map real * x
Definition: Zptcl.h:21
Here is the caller graph for this function:

◆ kwhereis()

subroutine kwhereis ( real*4  x,
integer  in,
real*4, dimension(step, in)  a,
integer  step,
integer  loc 
)

Definition at line 63 of file kdwhereis.f.

Referenced by cgetxxsec(), kpolintp2s(), kpolintpsfe(), kpolintpslogfe(), kpolintpslogxyfe(), kscspldif(), and kscsplintp().

63 ! *********************************
64 ! x : real*4. input. given value.
65 ! in : integer. input. number of data in a.
66 ! a : real*4 a(step, in). input array.
67 ! a(1, 1), a(1, 2), a(1, 3)... are examined.
68 ! step: integer. input. see above. give 1 for one dim. array.
69 ! loc: integer. ouput. a(1,loc) <= x < a(1,loc+1) if a is ascending
70 ! (if a(1,in) = x, loc= in)
71 ! a(1, loc) > x >= a(1, loc+1) if a is dscending
72 !c (if a(1,1) = x, loc = 0)
73 ! if loc=0 or loc =in; x is out of range.
74 
75  implicit none
76  integer in, loc, step
77  real*4 x, a(step, in)
78 
79  logical ascending
80  integer i1, i2, im
81 
82  i1 = 0 ! lower and
83  i2 = in + 1 ! upper bound
84 
85  ascending = a(1, in) .gt. a(1, 1)
86  do while (i2 - i1 .gt. 1)
87  im = (i1 + i2)/2
88  if( ascending .eqv. x .ge. a(1, im) ) then
89  i1 = im
90  else
91  i2 = im
92  endif
93  enddo
94  loc = i1
real(4), save a
Definition: cNRLAtmos.f:20
! structure defining a particle at production ! Basic idea of what is to be contained in ! the particle structue is that dynamical ones should be included those derivable from the particle code ! is not included ******************************************************type fmom momentum sequence union map real e endmap map real * x
Definition: Zptcl.h:21
Here is the caller graph for this function: