D02 Chapter Contents
D02 Chapter Introduction
NAG Library Manual

# NAG Library Routine DocumentD02LYF

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

D02LYF is a diagnostic routine which may be called after a call of the integrator D02LAF.

## 2  Specification

 SUBROUTINE D02LYF ( NEQ, HNEXT, HUSED, HSTART, NSUCC, NFAIL, NATT, THRES, THRESP, RWORK, LRWORK, IFAIL)
 INTEGER NEQ, NSUCC, NFAIL, NATT, LRWORK, IFAIL REAL (KIND=nag_wp) HNEXT, HUSED, HSTART, THRES(NEQ), THRESP(NEQ), RWORK(LRWORK)

## 3  Description

D02LYF permits you to extract information about the performance of D02LAF and the setting of some optional parameters. It may be called only after a call of D02LAF.

None.

## 5  Parameters

1:     NEQ – INTEGERInput
On entry: the number of second-order ordinary differential equations solved by D02LAF. It must be the same as the parameter NEQ supplied to D02LAF and D02LXF.
2:     HNEXT – REAL (KIND=nag_wp)Output
On exit: the next step size which D02LAF, if called, would attempt.
3:     HUSED – REAL (KIND=nag_wp)Output
On exit: the last successful step size used by D02LAF.
4:     HSTART – REAL (KIND=nag_wp)Output
On exit: the initial step size used on the current integration problem by D02LAF.
5:     NSUCC – INTEGEROutput
On exit: the number of steps attempted by D02LAF that have been successful since the start of the current problem.
6:     NFAIL – INTEGEROutput
On exit: the number of steps attempted by D02LAF that have failed since the start of the current problem.
7:     NATT – INTEGEROutput
On exit: the number of steps attempted before the initial step was successful. Over a large number of problems the cost of an attempted step of this type is approximately half that of a normal attempted step.
8:     THRES(NEQ) – REAL (KIND=nag_wp) arrayOutput
On exit: the $i$th solution threshold value used in the error control strategy. (See D02LXF.)
9:     THRESP(NEQ) – REAL (KIND=nag_wp) arrayOutput
On exit: the $i$th derivative threshold value used in the error control strategy. (See D02LXF.)
10:   RWORK(LRWORK) – REAL (KIND=nag_wp) arrayCommunication Array
On entry: this must be the same parameter RWORK as supplied to D02LAF. It is used to pass information from D02LAF to D02LYF and therefore the contents of this array must not be changed before calling D02LYF.
11:   LRWORK – INTEGERInput
On entry: the dimension of the array RWORK as declared in the (sub)program from which D02LYF is called.
This must be the same parameter LRWORK as supplied to D02LXF.
12:   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$
D02LAF has not been called, or one or both of the parameters NEQ and LRWORK does not match the corresponding parameter supplied to D02LXF.
This error exit can be caused if elements of RWORK have been overwritten.

Not applicable.

None.

## 9  Example

See Section 9 in D02LAF.