d02ncf is a general purpose routine for integrating the initial value problem for a stiff system of explicit ordinary differential equations,
It is designed specifically for the case where the Jacobian
$\frac{\partial g}{\partial y}$ is a banded matrix.
Both interval and step oriented modes of operation are available and also modes designed to permit intermediate output within an interval oriented mode.
An outline of a typical calling program for
d02ncf is given below. It calls the banded matrix linear algebra setup routine
d02ntf, the Backward Differentiation Formula (BDF) integrator setup routine
d02nvf, and its diagnostic counterpart
d02nyf.
! Declarations
External fcn, jac, monitr
.
.
.
ifail = 0
Call d02nvf(...,ifail)
Call d02ntf(neq, neqmax, jceval, ml, mu, nwkjac, njcpvt, &
rwork, ifail)
ifail = 1
Call d02ncf(neq, neqmax, t, tout, y, ydot, rwork, rtol, &
atol, itol, inform, fcn, ysave, ny2dim, jac, &
wkjac, nwkjac,jacpvt, njcpvt, monitr, itask, &
itrace, ifail)
If (ifail.eq.1 .or. ifail.ge.14) Stop
ifail = 0
Call d02nyf(...)
.
.
.
Stop
End
The linear algebra setup routine
d02ntf and one of the integrator setup routines,
d02nvf or
d02nwf, must be called prior to the call of
d02ncf. The integrator diagnostic routine
d02nyf may be called after the call to
d02ncf. There is also a routine,
d02nzf, designed to permit you to change step size on a continuation call to
d02ncf without restarting the integration process.
If on entry
${\mathbf{ifail}}=0$ or
$\mathrm{1}$, explanatory error messages are output on the current error message unit (as defined by
x04aaf).
 ${\mathbf{ifail}}=1$

Either the integrator setup routine has not been called prior to the first call of this routine, or a communication array has become corrupted.
Either the linear algebra setup routine has not been called prior to the first call of this routine, or a communication array has become corrupted.
Either the routine was entered on a continuation call without a prior call of this routine, or a communication array has become corrupted.
Either the value of
njcpvt is not the same as the value supplied to the setup routine or a communication array has become corrupted.
${\mathbf{njcpvt}}=\u27e8\mathit{\text{value}}\u27e9$ and
${\mathbf{njcpvt}}=\u27e8\mathit{\text{value}}\u27e9$ in
d02ntf.
Either the value of
nwkjac is not the same as the value supplied to the setup routine or a communication array has become corrupted.
${\mathbf{nwkjac}}=\u27e8\mathit{\text{value}}\u27e9$ and
${\mathbf{nwkjac}}=\u27e8\mathit{\text{value}}\u27e9$ in
d02ntf.
Either the value of
sdysav is not the same as the value supplied to the setup routine or a communication array has become corrupted.
${\mathbf{sdysav}}=\u27e8\mathit{\text{value}}\u27e9$,
sdysav (setup)
$=\u27e8\mathit{\text{value}}\u27e9$.
Failure during internal time interpolation.
tout and the current time are too close.
${\mathbf{itask}}=\u27e8\mathit{\text{value}}\u27e9$ and
${\mathbf{tout}}=\u27e8\mathit{\text{value}}\u27e9$ and the current time is
$\u27e8\mathit{\text{value}}\u27e9$.
${\mathbf{itask}}=3$ and
tout is more than an integration step behind the current time.
${\mathbf{tout}}=\u27e8\mathit{\text{value}}\u27e9$, current time minus step size:
$\u27e8\mathit{\text{value}}\u27e9$.
monitr appears to have overwritten the solution vector.
Further integration will not be attempted.
monitr set
${\mathbf{imon}}=\u27e8\mathit{\text{value}}\u27e9$.
Constraint:
$\mathrm{2}\le {\mathbf{imon}}\le 4$.
monitr set
${\mathbf{inln}}=\u27e8\mathit{\text{value}}\u27e9$.
Constraint:
${\mathbf{inln}}=3$.
On entry, an illegal (negative) maximum number of steps was provided in a prior call to a setup routine. ${\mathbf{maxstp}}=\u27e8\mathit{\text{value}}\u27e9$.
On entry, an illegal (negative) maximum stepsize was provided in a prior call to a setup routine. ${\mathbf{hmax}}=\u27e8\mathit{\text{value}}\u27e9$.
On entry, an illegal (negative) minimum stepsize was provided in a prior call to a setup routine. ${\mathbf{hmin}}=\u27e8\mathit{\text{value}}\u27e9$.
On entry, ${\mathbf{atol}}=\u27e8\mathit{\text{value}}\u27e9$.
Constraint: ${\mathbf{atol}}\ge 0.0$.
On entry, ${\mathbf{itask}}=\u27e8\mathit{\text{value}}\u27e9$.
Constraint: $1\le {\mathbf{itask}}\le 5$.
On entry,
${\mathbf{itask}}=4$ or
$5$ and
tcrit is before the current time in the direction of integration.
${\mathbf{itask}}=\u27e8\mathit{\text{value}}\u27e9$,
${\mathbf{tcrit}}=\u27e8\mathit{\text{value}}\u27e9$ and the current time is
$\u27e8\mathit{\text{value}}\u27e9$.
On entry,
${\mathbf{itask}}=4$ or
$5$ and
tcrit is before
tout in the direction of integration.
${\mathbf{itask}}=\u27e8\mathit{\text{value}}\u27e9$,
${\mathbf{tcrit}}=\u27e8\mathit{\text{value}}\u27e9$ and
${\mathbf{tout}}=\u27e8\mathit{\text{value}}\u27e9$.
On entry, ${\mathbf{itol}}=\u27e8\mathit{\text{value}}\u27e9$.
Constraint: $1\le {\mathbf{itol}}\le 4$.
On entry, ${\mathbf{neq}}=\u27e8\mathit{\text{value}}\u27e9$.
Constraint: ${\mathbf{neq}}\ge 1$.
On entry, ${\mathbf{neq}}=\u27e8\mathit{\text{value}}\u27e9$ and ${\mathbf{ldysav}}=\u27e8\mathit{\text{value}}\u27e9$.
Constraint: ${\mathbf{neq}}\le {\mathbf{ldysav}}$.
On entry, ${\mathbf{rtol}}=\u27e8\mathit{\text{value}}\u27e9$.
Constraint: ${\mathbf{rtol}}\ge 0.0$.
On entry,
tout is less than
t with respect to the direction of integration given by the sign of
h0 in a prior call to a setup routine.
${\mathbf{tout}}=\u27e8\mathit{\text{value}}\u27e9$,
${\mathbf{t}}=\u27e8\mathit{\text{value}}\u27e9$ and
${\mathbf{h0}}=\u27e8\mathit{\text{value}}\u27e9$.
On entry,
tout is too close to
t to start integration.
${\mathbf{tout}}=\u27e8\mathit{\text{value}}\u27e9$ and
${\mathbf{t}}=\u27e8\mathit{\text{value}}\u27e9$.
The initial stepsize, $\u27e8\mathit{\text{value}}\u27e9$, is too small.
The accuracy of the numerical solution may be controlled by a careful choice of the arguments
rtol and
atol, and to a much lesser extent by the choice of norm. You are advised to use scalar error control unless the components of the solution are expected to be poorly scaled. For the type of decaying solution typical of many stiff problems, relative error control with a small absolute error threshold will be most appropriate (that is, you are advised to choose
${\mathbf{itol}}=1$ with
${\mathbf{atol}}\left(1\right)$ small but positive).
Background information to multithreading can be found in the
Multithreading documentation.
d02ncf is not thread safe and should not be called from a multithreaded user program. Please see
Section 1 in FL Interface Multithreading for more information on thread safety.
Please consult the
X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. Please also consult the
Users' Note for your implementation for any additional implementationspecific information.
The cost of computing a solution depends critically on the size of the differential system and to a lesser extent on the degree of stiffness of the problem. For d02ncf the cost is proportional to ${\mathbf{neq}}\times {({\mathbf{ml}}+{\mathbf{mu}}+1)}^{2}$ though for problems which are only mildly nonlinear the cost may be dominated by factors proportional to ${\mathbf{neq}}\times ({\mathbf{ml}}+{\mathbf{mu}}+1)$ except for very large problems.
In general, you are advised to choose the Backward Differentiation Formula option (setup routine
d02nvf) but if efficiency is of great importance and especially if it is suspected that
$\frac{\partial g}{\partial y}$ has complex eigenvalues near the imaginary axis for some part of the integration, you should try the BLEND option (setup routine
d02nwf).
This example solves the wellknown stiff Robertson problem
over the range
$[0,10]$ with initial conditions
$a=1.0$ and
$b=c=0.0$ using scalar relative error control and vector absolute error control
$({\mathbf{itol}}=2)$. The solution is obtained at
${\mathbf{tout}}=5.0$ and
${\mathbf{tout}}=10.0$ by overshooting and internal
${C}^{0}$ interpolation
$({\mathbf{itask}}=1)$.
d02nby is used for
monitr, the BLEND integrator (setup routine
d02nwf) is used and the option of an analytical Jacobian is chosen.