1 SUBROUTINE l3interp(y_in,x_in,nr_in,y_out,x_out,nr_out)
7 INTEGER(ITM_I4) :: nr_in,nr_out
8 REAL(R8),
DIMENSION(nr_in),
INTENT(IN) :: y_in,x_in
9 REAL(R8),
DIMENSION(nr_out),
INTENT(IN) :: x_out
10 REAL(R8),
DIMENSION(nr_out),
INTENT(OUT) :: y_out
12 REAL(R8) :: x,aintm,aint0,aint1,aint2,xm,x0,x1,x2
13 INTEGER(ITM_I4) :: j,jm,j0,j1,j2
14 INTEGER :: jstart,jfirst,jlast,jstep
16 IF (x_in(nr_in) > x_in(1))
THEN
29 DO j=jfirst,jlast,jstep
31 DO WHILE (x >= x_in(j1) .AND. j1 < nr_in-1 .AND. j1 > 2)
46 aintm=(x-x0)*(x-x1)*(x-x2)/((xm-x0)*(xm-x1)*(xm-x2))
47 aint0=(x-xm)*(x-x1)*(x-x2)/((x0-xm)*(x0-x1)*(x0-x2))
48 aint1=(x-xm)*(x-x0)*(x-x2)/((x1-xm)*(x1-x0)*(x1-x2))
49 aint2=(x-xm)*(x-x0)*(x-x1)/((x2-xm)*(x2-x0)*(x2-x1))
51 y_out(j)=aintm*y_in(jm)+aint0*y_in(j0) &
52 +aint1*y_in(j1)+aint2*y_in(j2)
59 SUBROUTINE l3deriv(y_in,x_in,nr_in,dydx_out,x_out,nr_out)
65 INTEGER(ITM_I4) :: nr_in,nr_out
66 REAL(R8),
DIMENSION(nr_in),
INTENT(IN) :: y_in,x_in
67 REAL(R8),
DIMENSION(nr_out),
INTENT(IN) :: x_out
68 REAL(R8),
DIMENSION(nr_out),
INTENT(OUT) :: dydx_out
70 REAL(R8) :: x,aintm,aint0,aint1,aint2,xm,x0,x1,x2
71 INTEGER(ITM_I4) :: j,jm,j0,j1,j2
72 INTEGER(ITM_I4) :: jstart,jfirst,jlast,jstep
74 IF (x_in(nr_in) > x_in(1))
THEN
87 DO j=jfirst,jlast,jstep
89 DO WHILE (x >= x_in(j1) .AND. j1 < nr_in-1 .AND. j1 > 2)
104 aintm=((x-x1)*(x-x2)+(x-x0)*(x-x2)+(x-x0)*(x-x1)) &
105 /((xm-x0)*(xm-x1)*(xm-x2))
106 aint0=((x-x1)*(x-x2)+(x-xm)*(x-x2)+(x-xm)*(x-x1)) &
107 /((x0-xm)*(x0-x1)*(x0-x2))
108 aint1=((x-x0)*(x-x2)+(x-xm)*(x-x2)+(x-xm)*(x-x0)) &
109 /((x1-xm)*(x1-x0)*(x1-x2))
110 aint2=((x-x0)*(x-x1)+(x-xm)*(x-x1)+(x-xm)*(x-x0)) &
111 /((x2-xm)*(x2-x0)*(x2-x1))
113 dydx_out(j)=aintm*y_in(jm)+aint0*y_in(j0) &
114 +aint1*y_in(j1)+aint2*y_in(j2)
127 INTEGER(ITM_I4) :: nx
128 REAL(R8) :: dxp,dxm,dx0
129 REAL(R8),
DIMENSION(nx),
INTENT(IN) :: x,y
130 REAL(R8),
DIMENSION(nx),
INTENT(OUT) :: dydx
132 INTEGER(ITM_I4) :: i,ip,im
140 dydx(i)=(dxm*dxm*(y(ip)-y(i))+dxp*dxp*(y(i)-y(im)))/(dxm*dxp*dx0)
142 dydx(1)=2.*dydx(2) - dydx(3)
143 dydx(nx)=2.*dydx(nx-1) - dydx(nx-2)
subroutine l3deriv(y_in, x_in, nr_in, dydx_out, x_out, nr_out)
subroutine l3interp(y_in, x_in, nr_in, y_out, x_out, nr_out)
subroutine lderiv(y, x, dydx, nx)