dprepj Subroutine

public subroutine dprepj(Neq, Y, Yh, Nyh, Ewt, Ftem, Savf, Wm, Iwm, f, jac)

NAME

dprepj(3f) - [M_odepack] Compute and process Newton iteration matrix.

DESCRIPTION

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:

Y

array containing predicted values on entry.

FTEM

work array of length N (ACOR in DSTODE).

SAVF

array containing f evaluated at predicted y.

WM

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.

IWM

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.

EL0

EL(1) (input).

IERPJ

output error flag, = 0 if no trouble, .gt. 0 if P matrix found to be singular.

JCUR

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.

Arguments

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

Calls

proc~~dprepj~2~~CallsGraph proc~dprepj~2 M_odepack::dprepj proc~daxpy~2 M_odepack::daxpy proc~dprepj~2->proc~daxpy~2 proc~dgefa~2 M_odepack::dgefa proc~dprepj~2->proc~dgefa~2 proc~dscal M_odepack::dscal proc~dprepj~2->proc~dscal proc~dvnorm~2 M_odepack::dvnorm proc~dprepj~2->proc~dvnorm~2 proc~dgefa~2->proc~daxpy~2 proc~dgefa~2->proc~dscal