V3FIT
initspline.f
1  SUBROUTINE initspline(amat, splnot, h, weight, nots)
2  USE vspline
3  IMPLICIT NONE
4 C-----------------------------------------------
5 C D u m m y A r g u m e n t s
6 C-----------------------------------------------
7  INTEGER nots
8  REAL(rprec), DIMENSION(nots,nots) :: amat
9  REAL(rprec), DIMENSION(*) :: splnot, h, weight
10 C-----------------------------------------------
11 C L o c a l V a r i a b l e s
12 C-----------------------------------------------
13  INTEGER i
14  REAL(rprec) :: eps
15 C-----------------------------------------------
16 
17  IF (nots .lt. 3) stop 'nots<3'
18  eps = 1.0/(splnot(nots)-splnot(1))
19 
20  amat = 0.
21  DO i = 1, nots
22  amat(i,i) = weight(i)
23  END DO
24 
25  DO i = 1, nots - 1
26  h(i) = splnot(i+1) - splnot(i)
27  IF (eps*h(i) .le. 1.e-8_dp) stop 'h(i)<1.e-8'
28  END DO
29 
30  END SUBROUTINE initspline