D02 Chapter Contents
D02 Chapter Introduction
NAG Library Manual

# NAG Library Routine DocumentD02NTF

Note:  before using this routine, please read the Users' Note for your implementation to check the interpretation of bold italicised terms and other implementation-dependent details.

## 1  Purpose

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.

## 2  Specification

 SUBROUTINE D02NTF ( NEQ, NEQMAX, JCEVAL, ML, MU, NWKJAC, NJCPVT, RWORK, IFAIL)
 INTEGER NEQ, NEQMAX, ML, MU, NWKJAC, NJCPVT, IFAIL REAL (KIND=nag_wp) RWORK(50+4*NEQMAX) CHARACTER(1) JCEVAL

## 3  Description

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.

## 4  References

See the D02M–N sub-chapter Introduction.

## 5  Parameters

1:     NEQ – INTEGERInput
On entry: the number of differential equations.
Constraint: $1\le {\mathbf{NEQ}}\le {\mathbf{NEQMAX}}$.
2:     NEQMAX – INTEGERInput
On entry: a bound on the maximum number of differential equations to be solved during the integration.
Constraint: ${\mathbf{NEQMAX}}\ge {\mathbf{NEQ}}$.
3:     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, then 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 parameter 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:     ML – INTEGERInput
On entry: ${m}_{L}$, the number of subdiagonals in the band.
Constraint: $0\le {\mathbf{ML}}\le {\mathbf{NEQ}}-1$.
5:     MU – INTEGERInput
On entry: ${m}_{U}$, the number of superdiagonals in the band.
Constraint: $0\le {\mathbf{MU}}\le {\mathbf{NEQ}}-1$.
6:     NWKJAC – INTEGERInput
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:     NJCPVT – INTEGERInput
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:     RWORK($50+4×{\mathbf{NEQMAX}}$) – REAL (KIND=nag_wp) arrayCommunication 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:     IFAIL – INTEGERInput/Output
On entry: IFAIL must be set to $0$, $-1\text{​ or ​}1$. If you are unfamiliar with this parameter you should refer to Section 3.3 in the Essential Introduction for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value $-1\text{​ 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 parameter, the recommended value is $0$. When the value $-\mathbf{1}\text{​ 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).

## 6  Error Indicators and Warnings

If on entry ${\mathbf{IFAIL}}={\mathbf{0}}$ or $-{\mathbf{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}}\ne \text{'N'}$, $\text{'A'}$ or $\text{'D'}$, or ${\mathbf{NEQ}}<1$, or ${\mathbf{ML}}<0$ or ${\mathbf{ML}}>{\mathbf{NEQ}}-1$, or ${\mathbf{MU}}<0$ or ${\mathbf{MU}}>{\mathbf{NEQ}}-1$, or ${\mathbf{NEQ}}>{\mathbf{NEQMAX}}$, or ${\mathbf{NJCPVT}}<{\mathbf{NEQMAX}}$, or ${\mathbf{NWKJAC}}<\left(2×{\mathbf{ML}}+{\mathbf{MU}}+1\right)×{\mathbf{NEQMAX}}$.

## 7  Accuracy

Not applicable.

D02NTF must be called as a setup routine before a call to either D02NCF or D02NHF and may be called as the linear algebra setup routine before a call to either D02NMF or D02NNF.

## 9  Example

See Section 9 in D02NCF and D02NHF.