This routine checks for the presence of a root in the vicinity of the current T, in a manner depending on the input flag JOB. It calls Subroutine DROOTS to locate the root as precisely as possible.
In addition to variables described previously, DRCHEK uses the following for communication:
integer flag indicating type of call:
JOB | Description |
---|---|
1 | means the problem is being initialized, and DRCHEK |
is to look for a root at or very near the initial T. | |
! | |
2 | means a continuation call to the solver was just |
made, and DRCHEK is to check for a root in the | |
relevant part of the step dlsr taken. | |
! | |
3 | means a successful step was just taken, and DRCHEK |
is to look for a root in the interval of the step. |
array of length NG, containing the value of g at T = T0. G0 is input for JOB .ge. 2, and output in all cases.
arrays of length NG for work space.
completion flag:
IRT | Description |
---|---|
0 | means no root was found. |
-1 | means JOB = 1 and a root was found too near to T. |
1 | means a legitimate root was found (JOB = 2 or 3). |
On return, T0 is the root location, and Y is the corresponding solution vector.
value of T at one endpoint of interval of interest. Only roots beyond T0 in the direction of integration are sought.
T0 is input if JOB .ge. 2, and output in all cases.
T0 is updated by DRCHEK, whether a root is found or not.
dlsr value of T returned by the solver (input only).
copy of TOUT (input only).
input flag showing whether the dlsr step taken had a root. IRFND = 1 if it did, = 0 if not.
copy of ITASK (input only).
copy of NG (input only).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | Job | |||
real | :: | g_sub | ||||
integer | :: | Neq(*) | ||||
real(kind=dp) | :: | Y(*) | ||||
real(kind=dp) | :: | Yh(Nyh,*) | ||||
integer, | intent(in) | :: | Nyh | |||
real(kind=dp) | :: | G0(*) | ||||
real(kind=dp) | :: | G1(*) | ||||
real(kind=dp) | :: | Gx(*) | ||||
integer | :: | Jroot(*) | ||||
integer, | intent(out) | :: | Irt |