NAG Library Routine Document

d02qxf (ivp_adams_diag)

1
Purpose

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

2
Specification

Fortran Interface
Subroutine d02qxf ( neqf, yp, tcurr, hlast, hnext, odlast, odnext, nsucc, nfail, tolfac, badcmp, rwork, lrwork, iwork, liwork, ifail)
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
C Header Interface
#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)

3
Description

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.

4
References

None.

5
Arguments

1:     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:     ypneqf – Real (Kind=nag_wp) arrayOutput
On exit: the approximate derivative of the solution component yi, as supplied in yi on output from the integration routine at the output value of t. These values are obtained by the evaluation of y=fx,y except when the output value of the argument t in the call to the integration routine is tout and tcurrtout, in which case they are obtained by interpolation.
3:     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:     hlast – Real (Kind=nag_wp)Output
On exit: the last successful step size used by the integrator.
5:     hnext – Real (Kind=nag_wp)Output
On exit: the next step size which the integration routine would attempt.
6:     odlast – IntegerOutput
On exit: the order of the method last used (successfully) by the integration routine.
7:     odnext – IntegerOutput
On exit: the order of the method which the integration routine would attempt on the next step.
8:     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:     nfail – IntegerOutput
On exit: the number of steps attempted by the integration routine that have failed since the start of the current problem.
10:   tolfac – Real (Kind=nag_wp)Output
On exit: a tolerance scale factor, tolfac1.0, returned when the integration routine exits with ifail=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:   badcmp – IntegerOutput
On exit: if the integration routine returned with ifail=4, badcmp specifies the index of the component which forced the error exit. Otherwise badcmp is 0.
12:   rworklrwork – 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:   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:   iworkliwork – 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:   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:   ifail – IntegerInput/Output
On entry: ifail must be set to 0, -1 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 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 -1 or 1 is used it is essential to test the value of ifail on exit.
On exit: ifail=0 unless the routine detects an error or a warning has been flagged (see Section 6).

6
Error Indicators and Warnings

If on entry 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:
ifail=1
Neither of the appropriate two integrator routines has been called.
On entry, liwork=value and liwork=value in d02qwf.
Constraint: liwork=liwork in d02qwf.
On entry, lrwork=value and lrwork=value in d02qwf.
Constraint: lrwork=lrwork in d02qwf.
On entry, neqf=value and neqf=value in d02qwf.
Constraint: neqf=neqf in d02qwf.
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.
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.
ifail=-999
Dynamic memory allocation failed.
See Section 3.7 in How to Use the NAG Library and its Documentation for further information.

7
Accuracy

Not applicable.

8
Parallelism 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.

9
Further Comments

You should call d02qyf for information about any roots detected by d02qff or d02qgf.

10
Example

See Section 10 in d02qff.