# NAG FL Interfaced02ntf (ivp_​stiff_​bandjac_​setup)

## ▸▿ Contents

Settings help

FL Name Style:

FL Specification Language:

## 1Purpose

d02ntf is a setup routine which you must call prior to an integrator in Sub-chapter D02M–N, if banded matrix linear algebra is required.

## 2Specification

Fortran Interface
 Subroutine d02ntf ( neq, ml, mu,
 Integer, Intent (In) :: neq, neqmax, ml, mu, nwkjac, njcpvt Integer, Intent (Inout) :: ifail Real (Kind=nag_wp), Intent (Inout) :: rwork(50+4*neqmax) Character (1), Intent (In) :: jceval
#include <nag.h>
 void d02ntf_ (const Integer *neq, const Integer *neqmax, const char *jceval, const Integer *ml, const Integer *mu, const Integer *nwkjac, const Integer *njcpvt, double rwork[], Integer *ifail, const Charlen length_jceval)
The routine may be called by the names d02ntf or nagf_ode_ivp_stiff_bandjac_setup.

## 3Description

d02ntf defines the linear algebra to be used as banded matrix linear algebra, permits you to specify the method for calculating the Jacobian and checks the validity of certain input values.
See the D02M–N Sub-chapter Introduction.

## 5Arguments

1: $\mathbf{neq}$Integer Input
On entry: the number of differential equations.
Constraint: $1\le {\mathbf{neq}}\le {\mathbf{neqmax}}$.
2: $\mathbf{neqmax}$Integer Input
On entry: a bound on the maximum number of differential equations to be solved during the integration.
Constraint: ${\mathbf{neqmax}}\ge {\mathbf{neq}}$.
3: $\mathbf{jceval}$Character(1) Input
On entry: specifies the technique to be used to compute the Jacobian as follows:
${\mathbf{jceval}}=\text{'N'}$
The Jacobian is to be evaluated numerically by the integrator. If this option is used, the actual argument corresponding to jac in the call to d02ncf or d02nhf must be either d02ncz or d02nhz respectively.
${\mathbf{jceval}}=\text{'A'}$
You must supply a (sub)program to evaluate the Jacobian on a call to the integrator.
${\mathbf{jceval}}=\text{'D'}$
The default choice is to be made. In this case 'D' is interpreted as 'N'.
Only the first character of the actual argument jceval is passed to d02ntf; hence it is permissible for the actual argument to be more descriptive, e.g., ‘Numerical’, ‘Analytical’ or ‘Default’, on a call to d02ntf.
Constraint: ${\mathbf{jceval}}=\text{'N'}$, $\text{'A'}$ or $\text{'D'}$.
4: $\mathbf{ml}$Integer Input
On entry: ${m}_{L}$, the number of subdiagonals in the band.
Constraint: $0\le {\mathbf{ml}}\le {\mathbf{neq}}-1$.
5: $\mathbf{mu}$Integer Input
On entry: ${m}_{U}$, the number of superdiagonals in the band.
Constraint: $0\le {\mathbf{mu}}\le {\mathbf{neq}}-1$.
6: $\mathbf{nwkjac}$Integer Input
On entry: the size of the workspace array wkjac, which you are supplying to the integrator, as declared in the (sub)program from which d02ntf is called.
Constraint: ${\mathbf{nwkjac}}\ge \left(2×{\mathbf{ml}}+{\mathbf{mu}}+1\right)×{\mathbf{neqmax}}$.
7: $\mathbf{njcpvt}$Integer Input
On entry: the size of the workspace array jacpvt, which you are supplying to the integrator, as declared in the (sub)program from which d02ntf is called.
Constraint: ${\mathbf{njcpvt}}\ge {\mathbf{neqmax}}$.
8: $\mathbf{rwork}\left(50+4×{\mathbf{neqmax}}\right)$Real (Kind=nag_wp) array Communication Array
This must be the same workspace array as the array rwork supplied to the integrator. It is used to pass information from the setup routine to the integrator and, therefore, the contents of this array must not be changed before calling the integrator.
9: $\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, ${\mathbf{jceval}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{jceval}}=\text{'A'}$, $\text{'N'}$ or $\text{'D'}$.
On entry, ${\mathbf{ml}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{ml}}\ge 0$.
On entry, ${\mathbf{ml}}=⟨\mathit{\text{value}}⟩$ and ${\mathbf{neq}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{ml}}\le {\mathbf{neq}}-1$.
On entry, ${\mathbf{mu}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{mu}}\ge 0$.
On entry, ${\mathbf{mu}}=⟨\mathit{\text{value}}⟩$ and ${\mathbf{neq}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{mu}}\le {\mathbf{neq}}-1$.
On entry, ${\mathbf{neq}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{neq}}\ge 1$.
On entry, ${\mathbf{neq}}=⟨\mathit{\text{value}}⟩$ and ${\mathbf{neqmax}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{neq}}\le {\mathbf{neqmax}}$.
On entry, ${\mathbf{neqmax}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{neqmax}}\ge 1$.
On entry, ${\mathbf{njcpvt}}=⟨\mathit{\text{value}}⟩$ and ${\mathbf{neqmax}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{njcpvt}}\ge {\mathbf{neqmax}}$.
On entry, ${\mathbf{nwkjac}}=⟨\mathit{\text{value}}⟩$, ${\mathbf{ml}}=⟨\mathit{\text{value}}⟩$, ${\mathbf{mu}}=⟨\mathit{\text{value}}⟩$ and ${\mathbf{neqmax}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{nwkjac}}\ge \left(2×{\mathbf{ml}}+{\mathbf{mu}}+1\right)×{\mathbf{neqmax}}$.
${\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.

Not applicable.