This routine computes the residuals vector, using subroutine f
for the right-hand
sides.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=rk), | intent(in) | :: | t | |||
real(kind=rk), | intent(in) | :: | c(*) | |||
real(kind=rk), | intent(in) | :: | cdot(*) | |||
real(kind=rk), | intent(in) | :: | cj | |||
real(kind=rk), | intent(out) | :: | delta(*) | |||
integer, | intent(inout) | :: | ires | |||
real(kind=rk), | intent(inout) | :: | rpar(*) | |||
integer, | intent(inout) | :: | ipar(*) |
pure subroutine res(t, c, cdot, cj, delta, ires, rpar, ipar) !! This routine computes the residuals vector, using subroutine `f` for the right-hand !! sides. use web_par, only: ns, np, mx, my, mxns real(rk), intent(in) :: t real(rk), intent(in) :: c(*) real(rk), intent(in) :: cdot(*) real(rk), intent(in) :: cj real(rk), intent(out) :: delta(*) integer, intent(inout) :: ires real(rk), intent(inout) :: rpar(*) integer, intent(inout) :: ipar(*) integer :: i, ic0, ici, iyoff, jx, jy call f(t, c, delta, rpar) do jy = 1, my iyoff = mxns*(jy - 1) do jx = 1, mx ic0 = iyoff + ns*(jx - 1) do i = 1, ns ici = ic0 + i if (i > np) then delta(ici) = -delta(ici) else delta(ici) = cdot(ici) - delta(ici) end if end do end do end do end subroutine res