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