D02NSF (PDF version)
D02 Chapter Contents
D02 Chapter Introduction
NAG Library Manual

NAG Library Routine Document


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.

+ Contents

    1  Purpose
    7  Accuracy
    9  Example

1  Purpose

D02NSF is a setup routine which must be called prior to an integrator in sub-chapter D02M–N, if full matrix linear algebra is required.

2  Specification

REAL (KIND=nag_wp)  RWORK(50+4*NEQMAX)

3  Description

D02NSF defines the linear algebra to be used as full 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: 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.
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 D02NBF or D02NGF must be either D02NBZ or D02NGZ respectively.
You must supply a (sub)program to evaluate the Jacobian on a call to the integrator.
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 D02NSF; hence it is permissible for the actual argument to be more descriptive ‘Numerical’, ‘Analytical’ or ‘Default’ on a call to D02NSF.
Constraint: JCEVAL='N', 'A' or 'D'.
4:     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 D02NSF is called.
5:     RWORK(50+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.
6:     IFAIL – INTEGERInput/Output
On entry: IFAIL must be set to 0, -1​ 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​ 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 -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:
On entry,NEQ<1,
orJCEVAL'N', 'A' or 'D'.

7  Accuracy

Not applicable.

8  Further Comments

D02NSF must be called as a setup routine before a call to either D02NBF or D02NGF and may be called as the linear algebra setup routine before a call to either D02NMF or D02NNF.

9  Example

See Section 9 in D02NBF, D02NGF and D02NMF.

D02NSF (PDF version)
D02 Chapter Contents
D02 Chapter Introduction
NAG Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2012