NAG FL Interface
d02qyf (ivp_​adams_​rootdiag)

Settings help

FL Name Style:


FL Specification Language:


1 Purpose

d02qyf is a diagnostic routine which may be called after a call to the integrator routines d02qff or d02qgf.

2 Specification

Fortran Interface
Subroutine d02qyf ( neqg, index, itype, events, resids, rwork, lrwork, iwork, liwork, ifail)
Integer, Intent (In) :: neqg, lrwork, iwork(liwork), liwork
Integer, Intent (Inout) :: ifail
Integer, Intent (Out) :: index, itype, events(neqg)
Real (Kind=nag_wp), Intent (In) :: rwork(lrwork)
Real (Kind=nag_wp), Intent (Out) :: resids(neqg)
C Header Interface
#include <nag.h>
void  d02qyf_ (const Integer *neqg, Integer *index, Integer *itype, Integer events[], double resids[], const double rwork[], const Integer *lrwork, const Integer iwork[], const Integer *liwork, Integer *ifail)
The routine may be called by the names d02qyf or nagf_ode_ivp_adams_rootdiag.

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 Integer Input
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 Integer Output
On exit: the index k of the event equation gk(x,y,y)=0 for which the root has been detected.
3: itype Integer Output
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: events(neqg) Integer array Output
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 events(k) with their interpretations are as follows:
events(k)=0
The kth event function did not have a root.
events(k)=−1
The kth event function changed sign from positive to negative about a root, in the direction of integration.
events(k)=1
The kth event function changed sign from negative to positive about a root, in the direction of integration.
events(k)=2
A root was identified, but no change in sign was observed.
5: resids(neqg) Real (Kind=nag_wp) array Output
On exit: the value of the kth event function computed at the root, t (see d02qff and d02qgf).
6: rwork(lrwork) Real (Kind=nag_wp) array Communication 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 Integer Input
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: iwork(liwork) Integer array Communication 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 Integer Input
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 Integer Input/Output
On entry: ifail must be set to 0, −1 or 1 to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of 0 causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of −1 means that an error message is printed while a value of 1 means that it is not.
If halting is not appropriate, the value −1 or 1 is recommended. If message printing is undesirable, then the value 1 is recommended. Otherwise, the value 0 is recommended. 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, neqg=value and neqg=value in d02qwf.
Constraint: neqg=neqg in d02qwf.
The integrator did not end at an event.
ifail=-99
An unexpected error has been triggered by this routine. Please contact NAG.
See Section 7 in the Introduction to the NAG Library FL Interface for further information.
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.
ifail=-999
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface 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 1 in FL Interface Multithreading for more information on thread safety.
d02qyf is not threaded in any implementation.

9 Further Comments

None.

10 Example

See d02qff.