drchek Subroutine

public subroutine drchek(Job, g_sub, Neq, Y, Yh, Nyh, G0, G1, Gx, Jroot, Irt)

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:

JOB

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.
G0

array of length NG, containing the value of g at T = T0. G0 is input for JOB .ge. 2, and output in all cases.

G1,GX

arrays of length NG for work space.

IRT

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.

T0

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.

TLAST

dlsr value of T returned by the solver (input only).

TOUTC

copy of TOUT (input only).

IRFND

input flag showing whether the dlsr step taken had a root. IRFND = 1 if it did, = 0 if not.

ITASKC

copy of ITASK (input only).

NGC

copy of NG (input only).

Arguments

Type IntentOptional 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

Calls

proc~~drchek~~CallsGraph proc~drchek M_odepack::drchek proc~dintdy~2 M_odepack::dintdy proc~drchek->proc~dintdy~2 proc~xerrwd~2 M_odepack::xerrwd proc~dintdy~2->proc~xerrwd~2

Called by

proc~~drchek~~CalledByGraph proc~drchek M_odepack::drchek proc~dlsodar~2 M_odepack::dlsodar proc~dlsodar~2->proc~drchek proc~dlsodkr~2 M_odepack::dlsodkr proc~dlsodkr~2->proc~drchek