V3FIT
r8splbrk.f
1 C--------------------------------------------------------------------
2 C SPLBRK -- make a spline with a break (C0 only) at specified locn
3 C
4  SUBROUTINE r8splbrk (IOPT, N, NBRK, X, Y, B, C, D)
5 C
6 C Spline the whole interval, and then respline a subinterval, saving
7 C the endpt coeffs from the original spline.
8 C
9 C Result is a spline that is C2 everywhere except C0 only at one
10 C interior break point.
11 C
12 C IOPT=0 use SPLAAN for dy/dx=0 at LHS bc
13 C IOPT=1 use SPLINE for standard bc
14 C
15 C N -- no. of data pts
16 C NBRK -- break point
17 C
18 !============
19 ! idecl: explicitize implicit INTEGER declarations:
20  IMPLICIT NONE
21  INTEGER, PARAMETER :: R8=selected_real_kind(12,100)
22  INTEGER n,nbrk,iopt
23 !============
24 ! idecl: explicitize implicit REAL declarations:
25  real*8 bsave,csave,dsave
26 !============
27  real*8 x(n),y(n),b(n),c(n),d(n)
28 C
29  if(iopt.eq.0) then
30  call r8splaan(n, x, y, b, c, d)
31  else
32  call r8spline(n, x, y, b, c, d)
33  endif
34 C
35  bsave=b(nbrk)
36  csave=c(nbrk)
37  dsave=d(nbrk)
38 C
39  call r8nspline(nbrk, x, y, b, c, d)
40 C
41  b(nbrk)=bsave
42  c(nbrk)=csave
43  d(nbrk)=dsave
44 C
45  return
46  end