# NAG Library Routine Document

## 1Purpose

d02lyf is a diagnostic routine which may be called after a call of the integrator d02laf.

## 2Specification

Fortran Interface
 Subroutine d02lyf ( neq, natt,
 Integer, Intent (In) :: neq, lrwork Integer, Intent (Inout) :: ifail Integer, Intent (Out) :: nsucc, nfail, natt Real (Kind=nag_wp), Intent (In) :: rwork(lrwork) Real (Kind=nag_wp), Intent (Out) :: hnext, hused, hstart, thres(neq), thresp(neq)
#include nagmk26.h
 void d02lyf_ (const Integer *neq, double *hnext, double *hused, double *hstart, Integer *nsucc, Integer *nfail, Integer *natt, double thres[], double thresp[], const double rwork[], const Integer *lrwork, Integer *ifail)

## 3Description

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.

## 5Arguments

1:     $\mathbf{neq}$ – IntegerInput
On entry: the number of second-order ordinary differential equations solved by d02laf. It must be the same as the argument neq supplied to d02laf and d02lxf.
2:     $\mathbf{hnext}$ – Real (Kind=nag_wp)Output
On exit: the next step size which d02laf, if called, would attempt.
3:     $\mathbf{hused}$ – Real (Kind=nag_wp)Output
On exit: the last successful step size used by d02laf.
4:     $\mathbf{hstart}$ – Real (Kind=nag_wp)Output
On exit: the initial step size used on the current integration problem by d02laf.
5:     $\mathbf{nsucc}$ – IntegerOutput
On exit: the number of steps attempted by d02laf that have been successful since the start of the current problem.
6:     $\mathbf{nfail}$ – IntegerOutput
On exit: the number of steps attempted by d02laf that have failed since the start of the current problem.
7:     $\mathbf{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:     $\mathbf{thres}\left({\mathbf{neq}}\right)$ – Real (Kind=nag_wp) arrayOutput
On exit: the $i$th solution threshold value used in the error control strategy. (See d02lxf.)
9:     $\mathbf{thresp}\left({\mathbf{neq}}\right)$ – Real (Kind=nag_wp) arrayOutput
On exit: the $i$th derivative threshold value used in the error control strategy. (See d02lxf.)
10:   $\mathbf{rwork}\left({\mathbf{lrwork}}\right)$ – Real (Kind=nag_wp) arrayCommunication Array
On entry: this must be the same argument 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:   $\mathbf{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 argument lrwork as supplied to d02lxf.
12:   $\mathbf{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).

## 6Error 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$
d02laf has not been called, or one or both of the arguments neq and lrwork does not match the corresponding argument supplied to d02lxf.
This error exit can be caused if elements of rwork have been overwritten.
${\mathbf{ifail}}=-99$
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.

## 8Parallelism and Performance

d02lyf 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.
d02lyf is not threaded in any implementation.