DPREPJI is called by DSTODI to compute and process the matrix P = A - HEL(1)J, where J is an approximation to the Jacobian dr/dy, where r = g(t,y) - A(t,y)*s.
Here J is computed by the user-supplied routine JAC if MITER = 1 or 4, or by finite differencing if MITER = 2 or 5.
J is stored in WM, rescaled, and ADDA is called to generate P.
P is then subjected to LU decomposition in preparation for later solution of linear systems with P as coefficient matrix. This is done by DGEFA if MITER = 1 or 2, and by DGBFA if MITER = 4 or 5.
In addition to variables described previously, communication with DPREPJI uses the following:
array containing predicted values on entry.
work array of length N (ACOR in DSTODI).
array used for output only. On output it contains the residual evaluated at current values of t and y.
array containing predicted values of dy/dt (SAVF in DSTODI).
real work space for matrices. On output it contains the LU decomposition of P. Storage of matrix elements starts at WM(3). WM also contains the following matrix-related data: WM(1) = SQRT(UROUND), used in numerical Jacobian increments.
integer work space containing pivot information, starting at IWM(21). IWM also contains the band parameters ML = IWM(1) and MU = IWM(2) if MITER is 4 or 5.
el(1) (input).
output error flag. = 0 if no trouble occurred, = 1 if the P matrix was found to be singular, = IRES (= 2 or 3) if RES returned IRES = 2 or 3.
output flag = 1 to indicate that the Jacobian matrix (or approximation) is now current.
This routine also uses the Common variables EL0, H, TN, UROUND, MITER, N, NFE, and NJE.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer | :: | Neq(*) | ||||
real(kind=dp), | intent(inout) | :: | Y(*) | |||
real(kind=dp), | intent(in) | :: | Yh(Nyh,*) | |||
integer, | intent(in) | :: | Nyh | |||
real(kind=dp), | intent(in) | :: | Ewt(*) | |||
real(kind=dp) | :: | Rtem(*) | ||||
real(kind=dp) | :: | Savr(*) | ||||
real(kind=dp) | :: | S(*) | ||||
real(kind=dp), | intent(inout) | :: | Wm(*) | |||
integer | :: | Iwm(*) | ||||
real | :: | res | ||||
integer | :: | jac | ||||
real | :: | adda |