jacrs Subroutine

public subroutine jacrs(res_, ires, neq, t, c, cprime, rewt, savr, wk, h, cj, wp, iwp, ier, rpar, ipar)

This routine interfaces to subroutines DRBDJA or DRBGJA, 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 DRBDJA, with no block-grouping.
  • If jbg==1, we call DRBGJA, and use block-grouping.

Array rpar, containing the current vector, is passed to DRBDJA and DRBGJA as argument R0, consistent with the loading of rpar in f. The procedure name rates is passed as the name of the routine which computes the individual blocks of .

Arguments

Type IntentOptional Attributes Name
real :: res_
integer, intent(in) :: ires
integer, intent(in) :: neq
real(kind=rk), intent(in) :: t
real(kind=rk), intent(in) :: c(*)
real(kind=rk), intent(in) :: cprime(*)
real(kind=rk), intent(in) :: rewt(*)
real(kind=rk), intent(in) :: savr(*)
real(kind=rk), intent(in) :: wk(*)
real(kind=rk), intent(in) :: h
real(kind=rk), intent(in) :: cj
real(kind=rk), intent(in) :: wp(*)
integer, intent(in) :: iwp(*)
integer, intent(in) :: ier
real(kind=rk), intent(in) :: rpar(*)
integer, intent(in) :: ipar(*)

Calls

proc~~jacrs~~CallsGraph proc~jacrs jacrs drbdja drbdja proc~jacrs->drbdja drbgja drbgja proc~jacrs->drbgja

Variables

Type Visibility Attributes Name Initial
integer, public :: jbg

Source Code

   subroutine jacrs(res_, ires, neq, t, c, cprime, rewt, savr, wk, h, cj, wp, iwp, ier, &
                    rpar, ipar)
   !! This routine interfaces to subroutines [[DRBDJA]] or [[DRBGJA]], depending on the flag
   !! `jbg=ipar(2)`, to generate and preprocess the block-diagonal Jacobian corresponding to
   !! the reaction term \(v\).
   !!
   !! * If `jbg==0`, we call [[DRBDJA]], with no block-grouping.
   !! * If `jbg==1`, we call [[DRBGJA]], and use block-grouping.
   !!
   !! Array `rpar`, containing the current \(v\) vector, is passed to [[DRBDJA]] and [[DRBGJA]]
   !! as argument `R0`, consistent with the loading of `rpar` in [[f]]. The procedure        name
   !! [[rates]] is passed as the name of the routine which computes the individual blocks of
   !! \(v\).
      external :: res_
      integer, intent(in) :: ires
      integer, intent(in) :: neq
      real(rk), intent(in) :: t
      real(rk), intent(in) :: c(*)
      real(rk), intent(in) :: cprime(*)
      real(rk), intent(in) :: rewt(*)
      real(rk), intent(in) :: savr(*)
      real(rk), intent(in) :: wk(*)
      real(rk), intent(in) :: h
      real(rk), intent(in) :: cj
      real(rk), intent(in) :: wp(*)
      integer, intent(in) :: iwp(*)
      integer, intent(in) :: ier
      real(rk), intent(in) :: rpar(*)
      integer, intent(in) :: ipar(*)

      integer :: jbg
      external :: drbdja, drbgja

      jbg = ipar(2)
      if (jbg == 0) then
         call drbdja(t, c, rpar, rates, wk, rewt, cj, wp, iwp, ier)
      else
         call drbgja(t, c, rpar, rates, wk, rewt, cj, wp, iwp, ier)
      end if

   end subroutine jacrs