# NAG FL Interfaced03pzf (dim1_​parab_​fd_​interp)

## 1Purpose

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.

## 2Specification

Fortran Interface
 Subroutine d03pzf ( npde, m, u, npts, x, xp, up,
 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)
#include <nag.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)
The routine may be called by the names d03pzf or nagf_pde_dim1_parab_fd_interp.

## 3Description

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.

None.

## 5Arguments

Note: the arguments x, m, u, npts and npde must be supplied unchanged from the PDE routine.
1: $\mathbf{npde}$Integer Input
On entry: the number of PDEs.
Constraint: ${\mathbf{npde}}\ge 1$.
2: $\mathbf{m}$Integer Input
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.
${\mathbf{m}}=0$
Indicates Cartesian coordinates.
${\mathbf{m}}=1$
Indicates cylindrical polar coordinates.
${\mathbf{m}}=2$
Indicates spherical polar coordinates.
Constraints:
• $0\le {\mathbf{m}}\le 2$ following a finite difference routine;
• ${\mathbf{m}}=0$ following a Keller box scheme routine.
3: $\mathbf{u}\left({\mathbf{npde}},{\mathbf{npts}}\right)$Real (Kind=nag_wp) array Input
On entry: the PDE part of the original solution returned in the argument u by the PDE routine.
Constraint: ${\mathbf{npde}}\ge 1$.
4: $\mathbf{npts}$Integer Input
On entry: the number of mesh points.
Constraint: ${\mathbf{npts}}\ge 3$.
5: $\mathbf{x}\left({\mathbf{npts}}\right)$Real (Kind=nag_wp) array Input
On entry: ${\mathbf{x}}\left(\mathit{i}\right)$, for $\mathit{i}=1,2,\dots ,{\mathbf{npts}}$, must contain the mesh points as used by the PDE routine.
6: $\mathbf{xp}\left({\mathbf{intpts}}\right)$Real (Kind=nag_wp) array Input
On entry: ${\mathbf{xp}}\left(\mathit{i}\right)$, for $\mathit{i}=1,2,\dots ,{\mathbf{intpts}}$, must contain the spatial interpolation points.
Constraint: ${\mathbf{x}}\left(1\right)\le {\mathbf{xp}}\left(1\right)<{\mathbf{xp}}\left(2\right)<\cdots <{\mathbf{xp}}\left({\mathbf{intpts}}\right)\le {\mathbf{x}}\left({\mathbf{npts}}\right)$.
7: $\mathbf{intpts}$Integer Input
On entry: the number of interpolation points.
Constraint: ${\mathbf{intpts}}\ge 1$.
8: $\mathbf{itype}$Integer Input
On entry: specifies the interpolation to be performed.
${\mathbf{itype}}=1$
The solutions at the interpolation points are computed.
${\mathbf{itype}}=2$
Both the solutions and their first derivatives at the interpolation points are computed.
Constraint: ${\mathbf{itype}}=1$ or $2$.
9: $\mathbf{up}\left({\mathbf{npde}},{\mathbf{intpts}},{\mathbf{itype}}\right)$Real (Kind=nag_wp) array Output
On exit: if ${\mathbf{itype}}=1$, ${\mathbf{up}}\left(\mathit{i},\mathit{j},1\right)$, contains the value of the solution ${U}_{\mathit{i}}\left({x}_{\mathit{j}},{t}_{\mathrm{out}}\right)$, at the interpolation points ${x}_{\mathit{j}}={\mathbf{xp}}\left(\mathit{j}\right)$, for $\mathit{j}=1,2,\dots ,{\mathbf{intpts}}$ and $\mathit{i}=1,2,\dots ,{\mathbf{npde}}$.
If ${\mathbf{itype}}=2$, ${\mathbf{up}}\left(\mathit{i},\mathit{j},1\right)$ contains ${U}_{\mathit{i}}\left({x}_{\mathit{j}},{t}_{\mathrm{out}}\right)$ and ${\mathbf{up}}\left(\mathit{i},\mathit{j},2\right)$ contains $\frac{\partial {U}_{\mathit{i}}}{\partial x}$ at these points.
10: $\mathbf{ifail}$Integer Input/Output
On entry: ifail must be set to $0$, $-1$ or $1$ to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of $0$ causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of $-1$ means that an error message is printed while a value of $1$ means that it is not.
If halting is not appropriate, the value $-1$ or $1$ is recommended. If message printing is undesirable, then the value $1$ is recommended. Otherwise, the value $0$ is recommended. When the value $-\mathbf{1}$ or $\mathbf{1}$ is used it is essential to test the value of ifail on exit.
On exit: ${\mathbf{ifail}}={\mathbf{0}}$ unless the routine detects an error or a warning has been flagged (see Section 6).

## 6Error Indicators and Warnings

If on entry ${\mathbf{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:
${\mathbf{ifail}}=1$
On entry, $\mathit{i}=〈\mathit{\text{value}}〉$, ${\mathbf{x}}\left(\mathit{i}\right)=〈\mathit{\text{value}}〉$, $\mathit{j}=〈\mathit{\text{value}}〉$ and ${\mathbf{x}}\left(\mathit{j}\right)=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{x}}\left(1\right)<{\mathbf{x}}\left(2\right)<\cdots <{\mathbf{x}}\left({\mathbf{npts}}\right)$.
On entry, ${\mathbf{intpts}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{intpts}}\ge 1$.
On entry, ${\mathbf{itype}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{itype}}=1$ or $2$.
On entry, ${\mathbf{m}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{m}}=0$, $1$ or $2$.
On entry, ${\mathbf{npde}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{npde}}>0$.
On entry, ${\mathbf{npts}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{npts}}>2$.
${\mathbf{ifail}}=2$
On entry, $\mathit{i}=〈\mathit{\text{value}}〉$, ${\mathbf{xp}}\left(\mathit{i}\right)=〈\mathit{\text{value}}〉$, $\mathit{j}=〈\mathit{\text{value}}〉$ and ${\mathbf{xp}}\left(\mathit{j}\right)=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{x}}\left(1\right)\le {\mathbf{xp}}\left(1\right)<{\mathbf{xp}}\left(2\right)<\cdots <{\mathbf{xp}}\left({\mathbf{intpts}}\right)\le {\mathbf{x}}\left({\mathbf{npts}}\right)$.
${\mathbf{ifail}}=3$
On entry, interpolating point $〈\mathit{\text{value}}〉$ with the value $〈\mathit{\text{value}}〉$ is outside the x range.
${\mathbf{ifail}}=-99$
See Section 7 in the Introduction to the NAG Library FL Interface for further information.
${\mathbf{ifail}}=-399$
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library FL Interface for further information.
${\mathbf{ifail}}=-999$
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface for further information.

## 7Accuracy

See the PDE routine documents.

## 8Parallelism and Performance

d03pzf is not threaded in any implementation.