dprepj(3f) - [M_odepack] Compute and process Newton iteration matrix.
DPREPJ is called by DSTODE to compute and process the matrix P = I - hel(1)J , where J is an approximation to the Jacobian.
Here J is computed by the user-supplied routine JAC if MITER = 1 or 4, or by finite differencing if MITER = 2, 3, or 5.
If MITER = 3, a diagonal approximation to J is used.
J is stored in WM and replaced by P. If MITER .ne. 3, 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 in DSTODE and DLSODE prologues, communication with DPREPJ uses the following:
array containing predicted values on entry.
work array of length N (ACOR in DSTODE).
array containing f evaluated at predicted y.
real work space for matrices. On output it contains the inverse diagonal matrix if MITER = 3 and the LU decomposition of P if MITER is 1, 2 , 4, or 5. 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. WM(2) = H*EL0, saved for later use if MITER = 3.
integer work space containing pivot information, starting at IWM(21), if MITER is 1, 2, 4, or 5. IWM also contains 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, .gt. 0 if P matrix found to be singular.
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) | :: | Ewt(*) | ||||
real(kind=dp) | :: | Ftem(*) | ||||
real(kind=dp) | :: | Savf(*) | ||||
real(kind=dp), | intent(inout) | :: | Wm(*) | |||
integer | :: | Iwm(*) | ||||
real | :: | f | ||||
integer | :: | jac |