NAG Library Routine Document

d03pzf (dim1_parab_fd_interp)


    1  Purpose
    7  Accuracy
    10  Example


d03pzf interpolates in the spatial coordinate the solution and derivative of a system of partial differential equations (PDEs). The solution must first be computed using one of the finite difference schemes d03pcf/d03pca, d03phf/d03pha or d03ppf/d03ppa, or one of the Keller box schemes d03pef, d03pkf or d03prf.


Fortran Interface
Subroutine d03pzf ( npde, m, u, npts, x, xp, intpts, itype, up, ifail)
Integer, Intent (In):: npde, m, npts, intpts, itype
Integer, Intent (Inout):: ifail
Real (Kind=nag_wp), Intent (In):: u(npde,npts), x(npts), xp(intpts)
Real (Kind=nag_wp), Intent (Out):: up(npde,intpts,itype)
C Header Interface
#include nagmk26.h
void  d03pzf_ (const Integer *npde, const Integer *m, const double u[], const Integer *npts, const double x[], const double xp[], const Integer *intpts, const Integer *itype, double up[], Integer *ifail)


d03pzf is an interpolation routine for evaluating the solution of a system of partial differential equations (PDEs), at a set of user-specified points. The solution of the system of equations (possibly with coupled ordinary differential equations) must be computed using a finite difference scheme or a Keller box scheme on a set of mesh points. d03pzf can then be employed to compute the solution at a set of points anywhere in the range of the mesh. It can also evaluate the first spatial derivative of the solution. It uses linear interpolation for approximating the solution.




Note: the arguments x, m, u, npts and npde must be supplied unchanged from the PDE routine.
1:     npde – IntegerInput
On entry: the number of PDEs.
Constraint: npde1.
2:     m – IntegerInput
On entry: the coordinate system used. If the call to d03pzf follows one of the finite difference routines then m must be the same argument m as used in that call. For the Keller box scheme only Cartesian coordinate systems are valid and so m must be set to zero. No check will be made by d03pzf in this case.
Indicates Cartesian coordinates.
Indicates cylindrical polar coordinates.
Indicates spherical polar coordinates.
  • 0m2 following a finite difference routine;
  • m=0 following a Keller box scheme routine.
3:     unpdenpts – Real (Kind=nag_wp) arrayInput
On entry: the PDE part of the original solution returned in the argument u by the PDE routine.
Constraint: npde1.
4:     npts – IntegerInput
On entry: the number of mesh points.
Constraint: npts3.
5:     xnpts – Real (Kind=nag_wp) arrayInput
On entry: xi, for i=1,2,,npts, must contain the mesh points as used by the PDE routine.
6:     xpintpts – Real (Kind=nag_wp) arrayInput
On entry: xpi, for i=1,2,,intpts, must contain the spatial interpolation points.
Constraint: x1xp1<xp2<<xpintptsxnpts.
7:     intpts – IntegerInput
On entry: the number of interpolation points.
Constraint: intpts1.
8:     itype – IntegerInput
On entry: specifies the interpolation to be performed.
The solutions at the interpolation points are computed.
Both the solutions and their first derivatives at the interpolation points are computed.
Constraint: itype=1 or 2.
9:     upnpdeintptsitype – Real (Kind=nag_wp) arrayOutput
On exit: if itype=1, upij1, contains the value of the solution Uixj,tout, at the interpolation points xj=xpj, for j=1,2,,intpts and i=1,2,,npde.
If itype=2, upij1 contains Uixj,tout and upij2 contains Ui x  at these points.
10:   ifail – IntegerInput/Output
On entry: ifail must be set to 0, -1​ or ​1. If you are unfamiliar with this argument you should refer to Section 3.4 in How to Use the NAG Library and its Documentation for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value -1​ or ​1 is recommended. If the output of error messages is undesirable, then the value 1 is recommended. Otherwise, if you are not familiar with this argument, the recommended value is 0. When the value -1​ or ​1 is used it is essential to test the value of ifail on exit.
On exit: ifail=0 unless the routine detects an error or a warning has been flagged (see Section 6).

Error Indicators and Warnings

If on entry ifail=0 or -1, explanatory error messages are output on the current error message unit (as defined by x04aaf).
Errors or warnings detected by the routine:
On entry,itype1 or 2,
orm0, 1 or 2,
or the mesh points xi, for i=1,2,,npts, are not in strictly increasing order.
On entry, the interpolation points xpi, for i=1,2,,intpts, are not in strictly increasing order.
You are attempting extrapolation, that is, one of the interpolation points xpi, for some i, lies outside the interval [x1,xnpts]. Extrapolation is not permitted.
An unexpected error has been triggered by this routine. Please contact NAG.
See Section 3.9 in How to Use the NAG Library and its Documentation for further information.
Your licence key may have expired or may not have been installed correctly.
See Section 3.8 in How to Use the NAG Library and its Documentation for further information.
Dynamic memory allocation failed.
See Section 3.7 in How to Use the NAG Library and its Documentation for further information.


See the PDE routine documents.

Parallelism and Performance

d03pzf is not threaded in any implementation.

Further Comments



See Section 10 in d03pcf/d03pca, d03ppf/d03ppa and d03prf.
© The Numerical Algorithms Group Ltd, Oxford, UK. 2017