NAG Library Routine Document

d02ntf (ivp_stiff_bandjac_setup)

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

Fortran Interface
Subroutine d02ntf ( neq, neqmax, jceval, ml, mu, nwkjac, njcpvt, rwork, ifail)
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
C Header Interface
#include <nagmk26.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)

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
Arguments

1:     neq – IntegerInput
On entry: the number of differential equations.
Constraint: 1neqneqmax.
2:     neqmax – IntegerInput
On entry: a bound on the maximum number of differential equations to be solved during the integration.
Constraint: neqmaxneq.
3:     jceval – Character(1)Input
On entry: specifies the technique to be used to compute the Jacobian as follows:
jceval='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.
jceval='A'
You must supply a (sub)program to evaluate the Jacobian on a call to the integrator.
jceval='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: jceval='N', 'A' or 'D'.
4:     ml – IntegerInput
On entry: mL, the number of subdiagonals in the band.
Constraint: 0mlneq-1.
5:     mu – IntegerInput
On entry: mU, the number of superdiagonals in the band.
Constraint: 0muneq-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: nwkjac2×ml+mu+1×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: njcpvtneqmax.
8:     rwork50+4×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 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).

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:
ifail=1
On entry, jceval=value.
Constraint: jceval='A', 'N' or 'D'.
On entry, ml=value.
Constraint: ml0.
On entry, ml=value and neq=value.
Constraint: mlneq-1.
On entry, mu=value.
Constraint: mu0.
On entry, mu=value and neq=value.
Constraint: muneq-1.
On entry, neq=value.
Constraint: neq1.
On entry, neq=value and neqmax=value.
Constraint: neqneqmax.
On entry, neqmax=value.
Constraint: neqmax1.
On entry, njcpvt=value and neqmax=value.
Constraint: njcpvtneqmax.
On entry, nwkjac=value, ml=value, mu=value and neqmax=value.
Constraint: nwkjac2×ml+mu+1×neqmax.
ifail=-99
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.
ifail=-399
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.
ifail=-999
Dynamic memory allocation failed.
See Section 3.7 in How to Use the NAG Library and its Documentation for further information.

7
Accuracy

Not applicable.

8
Parallelism and Performance

d02ntf is not thread safe and should not be called from a multithreaded user program. Please see Section 3.12.1 in How to Use the NAG Library and its Documentation for more information on thread safety.
d02ntf is not threaded in any implementation.

9
Further Comments

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.

10
Example

See Section 10 in d02ncf and d02nhf.