# NAG FL Interfaced02lyf (ivp_​2nd_​rkn_​diag)

## 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 <nag.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)
The routine may be called by the names d02lyf or nagf_ode_ivp_2nd_rkn_diag.

## 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}$Integer Input
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}$Integer Output
On exit: the number of steps attempted by d02laf that have been successful since the start of the current problem.
6: $\mathbf{nfail}$Integer Output
On exit: the number of steps attempted by d02laf that have failed since the start of the current problem.
7: $\mathbf{natt}$Integer Output
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) array Output
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) array Output
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) array Communication 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}$Integer Input
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}$Integer Input/Output
On entry: ifail must be set to $0$, . If you are unfamiliar with this argument you should refer to Section 4 in the Introduction to the NAG Library FL Interface for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value 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 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$
On entry, ${\mathbf{lrwork}}=〈\mathit{\text{value}}〉$, but in a previous call to the setup routine ${\mathbf{lrwork}}=〈\mathit{\text{value}}〉$.
On entry, ${\mathbf{neq}}=〈\mathit{\text{value}}〉$, but in the previous call to the setup routine ${\mathbf{neq}}=〈\mathit{\text{value}}〉$.
The integrator routine d02laf has not been called.
${\mathbf{ifail}}=-99$
See Section 7 in the Introduction to the NAG Library FL Interface for further information.
${\mathbf{ifail}}=-399$
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library FL Interface for further information.
${\mathbf{ifail}}=-999$
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface for further information.

Not applicable.