xref: /petsc/src/mat/impls/aij/seq/crl/ftn-kernels/fmultcrl.F90 (revision f7243fda4f70acf8416ce2a83a22bcbfa57fb3c8)
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  implicit none (type, external)
9  PetscInt, intent(in) :: m,rmax,icols(m,rmax)
10  PetscScalar, intent(in) :: x(0:m-1), acols(m,rmax)
11  PetscScalar, intent(out) :: y(m)
12
13  PetscInt :: i
14
15  y(1:m) = acols(1:m,1)*x(icols(1:m,1))
16  do i=2,rmax
17    y(1:m) = y(1:m) + acols(1:m,i)*x(icols(1:m,i))
18  end do
19end subroutine FortranMultCRL
20