1 subroutine fpcurf(iopt,x,y,w,m,xb,xe,k,s,nest,tol,maxit,k1,k2,
2 * n,t,c,fp,fpint,z,a,b,g,q,nrdata,ier)
7 integer iopt,m,k,nest,maxit,k1,k2,n,ier
9 real*8 x(m),y(m),w(m),t(nest),c(nest),fpint(nest),
10 * z(nest),a(nest,k1),b(nest,k2),g(nest,k2),q(m,k1)
13 real*8 acc,con1,con4,con9,cos,half,fpart,fpms,fpold,fp0,f1,f2,f3,
14 * one,
p,pinv,piv,p1,p2,p3,rn,sin,store,term,wi,xi,yi
15 integer i,ich1,ich3,it,iter,i1,i2,i3,j,k3,l,l0,
16 * mk1,new,nk1,nmax,nmin,nplus,npl1,nrint,n8
53 if(iopt.lt.0) go to 60
62 if(nmax.gt.nest) go to 420
69 if(k3*2.eq.k) go to 30
77 t(i) = (x(j)+x(j-1))*half
87 45
if(iopt.eq.0) go to 50
88 if(n.eq.nmin) go to 50
100 if(n.eq.nmin) ier = -2
130 85
if(xi.lt.t(l+1) .or. l.eq.nk1) go to 90
134 90 call
fpbspl(t,n,k,xi,l,h)
144 if(piv.eq.0.) go to 110
146 call
fpgivs(piv,a(j,1),cos,sin)
148 call
fprota(cos,sin,yi,z(j))
149 if(i.eq.k1) go to 120
155 call
fprota(cos,sin,h(i1),a(j,i2))
162 if(ier.eq.(-2)) fp0 = fp
167 call
fpback(a,z,nk1,k1,c,nest)
169 if(iopt.lt.0) go to 440
171 if(abs(fpms).lt.acc) go to 440
173 if(fpms.lt.0.) go to 250
175 if(n.eq.nmax) go to 430
179 if(n.eq.nest) go to 420
181 if(ier.eq.0) go to 140
187 if(fpold-fp.gt.acc) npl1 = rn*fpms/(fpold-fp)
188 nplus = min0(nplus*2,max0(npl1,nplus/2,1))
197 if(x(it).lt.t(l) .or. l.gt.nk1) go to 160
204 term = term+c(l0)*q(it,j)
206 term = (w(it)*(term-y(it)))**2
208 if(new.eq.0) go to 180
210 fpint(i) = fpart-store
218 call
fpknot(x,m,t,n,fpint,nrdata,nrint,nest,1)
220 if(n.eq.nmax) go to 10
222 if(n.eq.nest) go to 200
228 250
if(ier.eq.(-2)) go to 440
252 call
fpdisc(t,n,k2,b,nest)
287 call
fpgivs(piv,g(j,1),cos,sin)
289 call
fprota(cos,sin,yi,c(j))
290 if(j.eq.nk1) go to 300
292 if(j.gt.n8) i2 = nk1-j
296 call
fprota(cos,sin,h(i1),g(j,i1))
303 call
fpback(g,c,nk1,k2,c,nest)
308 if(x(it).lt.t(l) .or. l.gt.nk1) go to 310
314 term = term+c(l0)*q(it,j)
316 fp = fp+(w(it)*(term-y(it)))**2
320 if(abs(fpms).lt.acc) go to 440
322 if(iter.eq.maxit) go to 400
326 if(ich3.ne.0) go to 340
327 if((f2-f3).gt.acc) go to 335
332 if(
p.le.p1)
p=p1*con9 + p2*con1
334 335
if(f2.lt.0.) ich3=1
335 340
if(ich1.ne.0) go to 350
336 if((f1-f2).gt.acc) go to 345
341 if(p3.lt.0.) go to 360
342 if(
p.ge.p3)
p = p2*con1 + p3*con9
344 345
if(f2.gt.0.) ich1=1
347 350
if(f2.ge.f1 .or. f2.le.f3) go to 410
subroutine fpdisc(t, n, k2, b, nest)
subroutine fprota(cos, sin, a, b)
subroutine fpknot(x, m, t, n, fpint, nrdata, nrint, nest, istart)
subroutine fpcurf(iopt, x, y, w, m, xb, xe, k, s, nest, tol, maxit, k1, k2, n, t, c, fp, fpint, z, a, b, g, q, nrdata, ier)
real(r8) function p(a, x, xr, xs, yr, ys, psi, psir, F_dia)
subroutine fpback(a, z, n, k, c, nest)
subroutine fpgivs(piv, ww, cos, sin)
real *8 function fprati(p1, f1, p2, f2, p3, f3)
subroutine fpbspl(t, n, k, x, l, h)