D02QYF (PDF version)
D02 Chapter Contents
D02 Chapter Introduction
NAG Library Manual

NAG Library Routine Document

D02QYF

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.

 Contents

    1  Purpose
    7  Accuracy
    10  Example

1  Purpose

D02QYF is a diagnostic routine which may be called after a call to the integrator routines D02QFF or D02QGF.

2  Specification

SUBROUTINE D02QYF ( NEQG, INDEX, ITYPE, EVENTS, RESIDS, RWORK, LRWORK, IWORK, LIWORK, IFAIL)
INTEGER  NEQG, INDEX, ITYPE, EVENTS(NEQG), LRWORK, IWORK(LIWORK), LIWORK, IFAIL
REAL (KIND=nag_wp)  RESIDS(NEQG), RWORK(LRWORK)

3  Description

D02QYF should be called only after a call to D02QFF or D02QGF results in the output value ROOT=.TRUE., indicating that a root has been detected. D02QYF permits you to examine information about the root detected, such as the indices of the event equations for which there is a root, the type of root (odd or even) and the residuals of the event equations.

4  References

None.

5  Arguments

1:     NEQG – INTEGERInput
On entry: the number of event functions defined for the integration routine. It must be the same argument NEQG supplied to the setup routine D02QWF and to the integration routine (D02QFF or D02QGF).
2:     INDEX – INTEGEROutput
On exit: the index k of the event equation gkx,y,y=0 for which the root has been detected.
3:     ITYPE – INTEGEROutput
On exit: information about the root detected for the event equation defined by INDEX. The possible values of ITYPE with their interpretations are as follows:
ITYPE=1
A simple root, or lack of distinguishing information available.
ITYPE=2
A root of even multiplicity is believed to have been detected, that is no change in sign of the event function was found.
ITYPE=3
A high-order root of odd multiplicity.
ITYPE=4
A possible root, but due to high multiplicity or a clustering of roots accurate evaluation of the event function was prohibited by round-off error and/or cancellation.
In general, the accuracy of the root is less reliable for values of ITYPE>1.
4:     EVENTSNEQG – INTEGER arrayOutput
On exit: information about the kth event function on a very small interval containing the root, T (see D02QFF and D02QGF), as output from the integration routine. All roots lying in this interval are considered indistinguishable numerically and therefore should be regarded as defining a root at T. The possible values of EVENTSk with their interpretations are as follows:
EVENTSk=0
The kth event function did not have a root.
EVENTSk=-1
The kth event function changed sign from positive to negative about a root, in the direction of integration.
EVENTSk=1
The kth event function changed sign from negative to positive about a root, in the direction of integration.
EVENTSk=2
A root was identified, but no change in sign was observed.
5:     RESIDSNEQG – REAL (KIND=nag_wp) arrayOutput
On exit: the value of the kth event function computed at the root, T (see D02QFF and D02QGF).
6:     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 D02QYF and therefore the contents of this array must not be changed before calling D02QYF.
7:     LRWORK – INTEGERInput
On entry: the dimension of the array RWORK as declared in the (sub)program from which D02QYF is called.
This must be the same argument LRWORK as supplied to D02QWF.
8:     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 D02QYF and therefore the contents of this array must not be changed before calling D02QYF.
9:     LIWORK – INTEGERInput
On entry: the dimension of the array IWORK as declared in the (sub)program from which D02QYF is called.
This must be the same argument LIWORK as supplied to D02QWF.
10:   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
An integration routine (D02QFF or D02QGF) has not been called, no root was detected or one or more of the arguments LRWORK, LIWORK and NEQG does not match the corresponding values supplied to D02QWF. Values for the arguments INDEX, ITYPE, EVENTS and RESIDS will not have been set.
This error exit may be caused by overwriting elements of IWORK.
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

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

9  Further Comments

None.

10  Example

See Section 10 in D02QFF.

D02QYF (PDF version)
D02 Chapter Contents
D02 Chapter Introduction
NAG Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2016