This routine interfaces to subroutines jac_rbdpre or jac_rbgpre, depending on the
flag jbg = ipar(2)
, to generate and preprocess the block-diagonal Jacobian corresponding
to the reaction term.
jbg == 0
, we call jac_rbdpre, without block-grouping.jbg == 1
, we call jac_rbgpre, with block-grouping.Array rpar
, containing the current vector, is passed to jac_rbdpre and
jac_rbgpre as argument r0
, consistent with the loading of rpar
in subroutine f
.
The procedure name rates
is passed as the name of the routine which computes the individual
blocks of .
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
procedure(res_t) | :: | res | ||||
integer, | intent(out) | :: | ires | |||
integer, | intent(in) | :: | neq | |||
real(kind=rk), | intent(in) | :: | t | |||
real(kind=rk), | intent(inout) | :: | c(*) | |||
real(kind=rk), | intent(in) | :: | cdot(*) | |||
real(kind=rk), | intent(in) | :: | rewt(*) | |||
real(kind=rk), | intent(inout) | :: | savr(*) | |||
real(kind=rk), | intent(inout) | :: | wk(*) | |||
real(kind=rk), | intent(in) | :: | h | |||
real(kind=rk), | intent(in) | :: | cj | |||
real(kind=rk), | intent(inout) | :: | rwp(*) | |||
integer, | intent(inout) | :: | iwp(*) | |||
integer, | intent(inout) | :: | ierr | |||
real(kind=rk), | intent(inout) | :: | rpar(*) | |||
integer, | intent(inout) | :: | ipar(*) |
subroutine jac(res, ires, neq, t, c, cdot, rewt, savr, wk, h, cj, rwp, iwp, ierr, rpar, ipar) !! This routine interfaces to subroutines [[jac_rbdpre]] or [[jac_rbgpre]], depending on the !! flag `jbg = ipar(2)`, to generate and preprocess the block-diagonal Jacobian corresponding !! to the reaction term. !! !! * If `jbg == 0`, we call [[jac_rbdpre]], without block-grouping. !! * If `jbg == 1`, we call [[jac_rbgpre]], with block-grouping. !! !! Array `rpar`, containing the current \(R\) vector, is passed to [[jac_rbdpre]] and !! [[jac_rbgpre]] as argument `r0`, consistent with the loading of `rpar` in subroutine `f`. !! The procedure name `rates` is passed as the name of the routine which computes the individual !! blocks of \(R\). use daskr_rbdpre, only: jac_rbdpre use daskr_rbgpre, only: jac_rbgpre use daskr, only: res_t procedure(res_t) :: res integer, intent(out) :: ires integer, intent(in) :: neq real(rk), intent(in) :: t real(rk), intent(inout) :: c(*) real(rk), intent(in) :: cdot(*) real(rk), intent(in) :: rewt(*) real(rk), intent(inout) :: savr(*) real(rk), intent(inout) :: wk(*) real(rk), intent(in) :: h real(rk), intent(in) :: cj real(rk), intent(inout) :: rwp(*) integer, intent(inout) :: iwp(*) integer, intent(inout) :: ierr real(rk), intent(inout) :: rpar(*) integer, intent(inout) :: ipar(*) integer :: jbg jbg = ipar(2) if (jbg == 0) then call jac_rbdpre(t, c, rpar, rates, wk, rewt, cj, rwp, iwp, ierr) else call jac_rbgpre(t, c, rpar, rates, wk, rewt, cj, rwp, iwp, ierr) end if end subroutine jac