xref: /petsc/src/mat/impls/aij/seq/crl/ftn-kernels/fmultcrl.F90 (revision 58ad77e8b9ee6fdbdfef97ebcff79a2d98620aab)
1!
2!
3!    Fortran kernel for sparse matrix-vector product in the AIJ/CRL format
4!
5#include <petsc/finclude/petscsys.h>
6!
7pure subroutine FortranMultCRL(m,rmax,x,y,icols,acols)
8  use, intrinsic :: ISO_C_binding
9  implicit none (type, external)
10  PetscInt, intent(in) :: m,rmax,icols(m,rmax)
11  PetscScalar, intent(in) :: x(0:m-1), acols(m,rmax)
12  PetscScalar, intent(out) :: y(m)
13
14  PetscInt :: i
15
16  y(1:m) = acols(1:m,1)*x(icols(1:m,1))
17  do i=2,rmax
18    y(1:m) = y(1:m) + acols(1:m,i)*x(icols(1:m,i))
19  end do
20end subroutine FortranMultCRL
21