# NAG Library Routine Document

## 1Purpose

d02qxf is a diagnostic routine which may be called after a call to either of the integration routines d02qff and d02qgf.

## 2Specification

Fortran Interface
 Subroutine d02qxf ( neqf, yp,
 Integer, Intent (In) :: neqf, lrwork, iwork(liwork), liwork Integer, Intent (Inout) :: ifail Integer, Intent (Out) :: odlast, odnext, nsucc, nfail, badcmp Real (Kind=nag_wp), Intent (In) :: rwork(lrwork) Real (Kind=nag_wp), Intent (Out) :: yp(neqf), tcurr, hlast, hnext, tolfac
#include nagmk26.h
 void d02qxf_ (const Integer *neqf, double yp[], double *tcurr, double *hlast, double *hnext, Integer *odlast, Integer *odnext, Integer *nsucc, Integer *nfail, double *tolfac, Integer *badcmp, const double rwork[], const Integer *lrwork, const Integer iwork[], const Integer *liwork, Integer *ifail)

## 3Description

d02qxf permits you to extract information about the performance of d02qff or d02qgf. It may only be called after a call to d02qff or d02qgf.

None.

## 5Arguments

1:     $\mathbf{neqf}$ – IntegerInput
On entry: the number of first-order ordinary differential equations solved by the integration routine. It must be the same argument neqf supplied to the setup routine d02qwf and the integration routines d02qff or d02qgf.
2:     $\mathbf{yp}\left({\mathbf{neqf}}\right)$ – Real (Kind=nag_wp) arrayOutput
On exit: the approximate derivative of the solution component ${y}_{i}$, as supplied in ${y}_{i}$ on output from the integration routine at the output value of t. These values are obtained by the evaluation of ${y}^{\prime }=f\left(x,y\right)$ except when the output value of the argument t in the call to the integration routine is tout and ${\mathbf{tcurr}}\ne {\mathbf{tout}}$, in which case they are obtained by interpolation.
3:     $\mathbf{tcurr}$ – Real (Kind=nag_wp)Output
On exit: the value of the independent variable which the integrator has actually reached. tcurr will always be at least as far as the output value of the argument t (from the integration routine) in the direction of integration, but may be further.
4:     $\mathbf{hlast}$ – Real (Kind=nag_wp)Output
On exit: the last successful step size used by the integrator.
5:     $\mathbf{hnext}$ – Real (Kind=nag_wp)Output
On exit: the next step size which the integration routine would attempt.
6:     $\mathbf{odlast}$ – IntegerOutput
On exit: the order of the method last used (successfully) by the integration routine.
7:     $\mathbf{odnext}$ – IntegerOutput
On exit: the order of the method which the integration routine would attempt on the next step.
8:     $\mathbf{nsucc}$ – IntegerOutput
On exit: the number of steps attempted by the integration routine that have been successful since the start of the current problem.
9:     $\mathbf{nfail}$ – IntegerOutput
On exit: the number of steps attempted by the integration routine that have failed since the start of the current problem.
10:   $\mathbf{tolfac}$ – Real (Kind=nag_wp)Output
On exit: a tolerance scale factor, ${\mathbf{tolfac}}\ge 1.0$, returned when the integration routine exits with ${\mathbf{ifail}}={\mathbf{3}}$. If rtol and atol are uniformly scaled up by a factor of tolfac and d02qwf is called, the next call to the integration routine is deemed likely to succeed.
11:   $\mathbf{badcmp}$ – IntegerOutput
On exit: if the integration routine returned with ${\mathbf{ifail}}={\mathbf{4}}$, badcmp specifies the index of the component which forced the error exit. Otherwise badcmp is $0$.
12:   $\mathbf{rwork}\left({\mathbf{lrwork}}\right)$ – Real (Kind=nag_wp) arrayCommunication Array
On entry: this must be the same argument rwork as supplied to d02qff or d02qgf. It is used to pass information from the integration routine to d02qxf and therefore the contents of this array must not be changed before calling d02qxf.
13:   $\mathbf{lrwork}$ – IntegerInput
On entry: the dimension of the array rwork as declared in the (sub)program from which d02qxf is called.
This must be the same argument lrwork as supplied to d02qwf.
14:   $\mathbf{iwork}\left({\mathbf{liwork}}\right)$ – Integer arrayCommunication Array
On entry: this must be the same argument iwork as supplied to d02qff or d02qgf. It is used to pass information from the integration routine to d02qxf and therefore the contents of this array must not be changed before calling d02qxf.
15:   $\mathbf{liwork}$ – IntegerInput
On entry: the dimension of the array iwork as declared in the (sub)program from which d02qxf is called.
This must be the same argument liwork as supplied to d02qwf.
16:   $\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$
An integration routine (d02qff or d02qgf) has not been called or one or more of the arguments lrwork, liwork and neqf does not match the corresponding argument supplied to d02qwf.
This error exit may be caused by overwriting elements of rwork.
${\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

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