D02 Chapter Contents
D02 Chapter Introduction
NAG Library Manual

# NAG Library Routine DocumentD02NYF

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

D02NYF is a diagnostic routine which you may call either after any user-specified exit or after a mid-integration error exit from any of those integrators in Sub-chapter D02M–N that use methods set up by calls to D02MVF, D02NVF or D02NWF.

## 2  Specification

 SUBROUTINE D02NYF ( NEQ, NEQMAX, HU, H, TCUR, TOLSF, RWORK, NST, NRE, NJE, NQU, NQ, NITER, IMXER, ALGEQU, INFORM, IFAIL)
 INTEGER NEQ, NEQMAX, NST, NRE, NJE, NQU, NQ, NITER, IMXER, INFORM(23), IFAIL REAL (KIND=nag_wp) HU, H, TCUR, TOLSF, RWORK(50+4*NEQ) LOGICAL ALGEQU(NEQ)

## 3  Description

D02NYF permits you to inspect statistics produced by any integrator in this sub-chapter that has been set up a call to one of D02MVF, D02NVF or D02NWF. These statistics concern the integration only.

## 4  References

See the D02M–N Sub-chapter Introduction.

## 5  Arguments

1:     $\mathrm{NEQ}$ – INTEGERInput
On entry: the value used for the argument NEQ when calling the integrator.
Constraint: ${\mathbf{NEQ}}\ge 1$.
2:     $\mathrm{NEQMAX}$ – INTEGERInput
On entry: the value used for the argument NEQMAX when calling the integrator.
Constraint: ${\mathbf{NEQMAX}}\ge {\mathbf{NEQ}}$.
3:     $\mathrm{HU}$ – REAL (KIND=nag_wp)Output
On exit: the last successful step size.
4:     $\mathrm{H}$ – REAL (KIND=nag_wp)Output
On exit: the proposed next step size for continuing the integration.
5:     $\mathrm{TCUR}$ – REAL (KIND=nag_wp)Output
On exit: $t$, the value of the independent variable which the integrator has actually reached. TCUR will always be at least as far as the output value of the argument $t$ in the direction of integration, but may be further (if overshooting and interpolation at TOUT was specified, e.g., see D02NBF).
6:     $\mathrm{TOLSF}$ – REAL (KIND=nag_wp)Output
On exit: a tolerance scale factor, ${\mathbf{TOLSF}}\ge 1.0$, which is computed when a request for too much accuracy is detected by the integrator (indicated by a return with ${\mathbf{IFAIL}}={\mathbf{3}}$ or ${\mathbf{14}}$). If ITOL is left unaltered but RTOL and ATOL are uniformly scaled up by a factor of TOLSF the next call to the integrator is deemed likely to succeed.
7:     $\mathrm{RWORK}\left(50+4×{\mathbf{NEQ}}\right)$ – REAL (KIND=nag_wp) arrayCommunication Array
On entry: contains information supplied by the integrator.
8:     $\mathrm{NST}$ – INTEGEROutput
On exit: the number of steps taken in the integration so far.
9:     $\mathrm{NRE}$ – INTEGEROutput
On exit: the number of function or residual evaluations (FCN (e.g., see D02NBF) or RESID (e.g., see D02NGF) calls) used in the integration so far.
10:   $\mathrm{NJE}$ – INTEGEROutput
On exit: the number of Jacobian evaluations used in the integration so far. This equals the number of matrix $LU$ decompositions.
11:   $\mathrm{NQU}$ – INTEGEROutput
On exit: the order of the method last used (successfully) in the integration.
12:   $\mathrm{NQ}$ – INTEGEROutput
On exit: the proposed order of the method for continuing the integration.
13:   $\mathrm{NITER}$ – INTEGEROutput
On exit: the number of iterations performed in the integration so far by the nonlinear equation solver.
14:   $\mathrm{IMXER}$ – INTEGEROutput
On exit: the index of the component of largest magnitude in the weighted local error vector $\left({e}_{\mathit{i}}/{w}_{\mathit{i}}\right)$, for $\mathit{i}=1,2,\dots ,{\mathbf{NEQ}}$.
15:   $\mathrm{ALGEQU}\left({\mathbf{NEQ}}\right)$ – LOGICAL arrayOutput
On exit: ${\mathbf{ALGEQU}}\left(\mathit{i}\right)=\mathrm{.TRUE.}$ if the $\mathit{i}$th equation integrated was detected to be algebraic, otherwise ${\mathbf{ALGEQU}}\left(\mathit{i}\right)=\mathrm{.FALSE.}$. Note that when the integrators for explicit equations are being used, then ${\mathbf{ALGEQU}}\left(\mathit{i}\right)=\mathrm{.FALSE.}$, for $\mathit{i}=1,2,\dots ,{\mathbf{NEQ}}$.
16:   $\mathrm{INFORM}\left(23\right)$ – INTEGER arrayCommunication Array
On entry: contains information supplied by the integrator.
17:   $\mathrm{IFAIL}$ – INTEGERInput/Output
On entry: IFAIL must be set to $0$, $-1\text{​ 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\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 argument, 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}}=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{NEQ}}<1$, or ${\mathbf{NEQMAX}}<1$, or ${\mathbf{NEQ}}>{\mathbf{NEQMAX}}$.
${\mathbf{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.
${\mathbf{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.
${\mathbf{IFAIL}}=-999$
Dynamic memory allocation failed.
See Section 3.7 in How to Use the NAG Library and its Documentation for further information.

Not applicable.

## 8  Parallelism and Performance

D02NYF is not threaded in any implementation.

## 9  Further Comments

Statistics for sparse matrix linear algebra calls (if appropriate) may be determined by a call to D02NXF.

## 10  Example

See Section 10 in D02NBF.