COSMOS v7.655  COSMOSv7655
(AirShowerMC)
kcsplIntp.f
Go to the documentation of this file.
1  subroutine kcsplintp(x, y, n, coef, nc, v, f)
2  implicit none
3 ! interpolation by the cubic spline.
4  integer n ! input. size of x, y
5  real*8 x(n) ! input.
6  real*8 y(n) ! input.
7  integer nc ! input. size of coef(nc,3)
8  real*8 coef(nc,3) ! input. which is an output from
9  ! kcsplCoef
10  real*8 v ! input. argument where the interpolated
11  ! value is requested.
12  real*8 f ! output. obtained interpolated values
13 !
14  integer i
15  real*8 v1
16 
17  call kdwhereis(v, n, x, 1, i)
18  if(i .eq. 0) then
19  i = 1
20  elseif(i .eq. n) then
21  i = n - 1
22  endif
23  v1 = v - x(i)
24  f = y(i) +
25  * v1 * (coef(i,1) + v1 * (coef(i,2) + v1 * coef(i,3)))
26  end
subroutine kdwhereis(x, in, a, step, loc)
Definition: kdwhereis.f:27
subroutine kcsplintp(x, y, n, coef, nc, v, f)
Definition: kcsplIntp.f:2