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,j 14 15 do j=1,m 16 y(j) = acols(j,1)*x(icols(j,1)) 17 end do 18 19 do i=2,rmax 20 do j=1,m 21 y(j) = y(j) + acols(j,i)*x(icols(j,i)) 22 end do 23 end do 24end subroutine FortranMultCRL 25