DPRJS is called to compute and process the matrix P = I - HEL(1)J, where J is an approximation to the Jacobian. J is computed by columns, either by the user-supplied routine JAC if MITER = 1, or by finite differencing if MITER = 2.
Alternatively, if MITER = 3, a diagonal approximation to J is used.
if MITER = 1 or 2, and if the existing value of the Jacobian (as contained in P) is considered acceptable, then a new value of P is reconstructed from the old value.
In any case, when MITER is 1 or 2, the P matrix is subjected to LU decomposition in CDRV.
P and its LU decomposition are stored (separately) in WK.
In addition to variables described previously, communication with DPRJS 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 P and its sparse LU decomposition if MITER is 1 or 2. Storage of matrix elements starts at WK(3). WK also contains the following matrix-related data: WK(1) = SQRT(UROUND), used in numerical Jacobian increments. WK(2) = H*EL0, saved for later use if MITER = 3.
integer work space for matrix-related data, assumed to be equivalenced to WK. In addition, WK(IPRSP) and IWK(IPISP) are assumed to have identical locations.
EL(1) (input).
output error flag (in Common). = 0 if no error. = 1 if zero pivot found in CDRV. = 2 if a singular matrix arose with MITER = 3. = -1 if insufficient storage for CDRV (should not occur here). = -2 if other error found in CDRV (should not occur here).
output flag showing status of (approximate) Jacobian matrix: = 1 to indicate that the Jacobian is now current, or = 0 to indicate that a saved value was used.
This routine also uses other variables in Common.
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), | intent(inout) | :: | Ftem(*) | |||
real(kind=dp) | :: | Savf(*) | ||||
real(kind=dp), | intent(inout) | :: | Wk(*) | |||
integer | :: | Iwk(*) | ||||
real | :: | f | ||||
integer | :: | jac |