rates Subroutine

public pure subroutine rates(t, jx, jy, c, rate)

Uses

  • proc~~rates~~UsesGraph proc~rates rates module~web_par web_par proc~rates->module~web_par module~daskr_kinds daskr_kinds module~web_par->module~daskr_kinds iso_fortran_env iso_fortran_env module~daskr_kinds->iso_fortran_env

This routine computes one block of the rate term of the system , namely block (jx, jy), for use in preconditioning.

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in) :: t
integer, intent(in) :: jx
integer, intent(in) :: jy
real(kind=rk), intent(in) :: c(*)
real(kind=rk), intent(inout) :: rate(*)

Called by

proc~~rates~~CalledByGraph proc~rates rates proc~f~2 f proc~f~2->proc~rates proc~cinit cinit proc~cinit->proc~f~2 proc~res~4 res proc~res~4->proc~f~2 program~example_web example_web program~example_web->proc~cinit

Variables

Type Visibility Attributes Name Initial
integer, public :: i
real(kind=rk), public :: fac
real(kind=rk), public :: x
real(kind=rk), public :: y

Source Code

   pure subroutine rates(t, jx, jy, c, rate)
   !! This routine computes one block of the rate term of the system \(v\), namely block
   !! `(jx, jy)`, for use in preconditioning.
      use web_par, only: alpha, beta, acoef, bcoef, dx, dy, pi, ns
      real(rk), intent(in) :: t
      integer, intent(in) :: jx
      integer, intent(in) :: jy
      real(rk), intent(in) :: c(*)
      real(rk), intent(inout) :: rate(*)

      integer :: i
      real(rk) :: fac, x, y

      y = (jy - 1)*dy
      x = (jx - 1)*dx
      fac = one + alpha*x*y + beta*sin(4*pi*x)*sin(4*pi*y)

      rate(1:ns) = zero
      do i = 1, ns
         rate(1:ns) = rate(1:ns) + c(i)*acoef(1:ns, i)
      end do

      do i = 1, ns
         rate(i) = c(i)*(bcoef(i)*fac + rate(i))
      end do

   end subroutine rates