V3FIT
spgrid.f
1  subroutine spgrid(x_newgrid,nx_new,f_new,nx,xpkg,fspl,iwarn,ier)
2 c
3 c regrid a spline function f defined vs. x as in xpkg
4 c to a new grid, given by x_newgrid.
5 c
6 c set warning flag if the range x_newgrid exceeds the range of the
7 c original xpkg.
8 c
9 c (xpkg -- see genxpkg subroutine)
10 c
11 c input:
12 c
13  real x_newgrid(nx_new) ! new grid
14 c
15 c output:
16 c
17  real f_new(nx_new) ! f evaluated on this grid
18 c
19 c input:
20 c
21  integer nx ! size of old grid
22  real xpkg(nx,4) ! old grid "package"
23  real fspl(4,nx) ! spline coefficients of f
24 c
25 c output:
26 c condition codes, =0 for normal exit
27 c
28  integer iwarn ! =1 if new grid points out of range
29  integer ier ! =1 if there is an argument error
30 c
31 c--------------------------------------------
32 c local
33 c
34  integer ict(3)
35 c
36  data ict/1,0,0/
37 c
38 c--------------------------------------------
39 c
40  call spvec(ict,nx_new,x_newgrid,nx_new,f_new,nx,xpkg,fspl,
41  > iwarn,ier)
42 c
43  return
44  end