xref: /petsc/src/sys/utils/ftn-kernels/fcopy.F90 (revision 3c8a51221130302e7602761be2f2295f4aa73e66)
1!
2!
3!    Fortran kernel for the copy vector routine
4!
5#include <petsc/finclude/petscsys.h>
6!
7pure subroutine FortranCopy(n,x,y)
8  implicit none (type, external)
9  PetscScalar, intent(in) :: x(*)
10  PetscScalar, intent(inout) :: y(*)
11  PetscInt, intent(in) :: n
12
13  PETSC_AssertAlignx(16,x(1))
14  PETSC_AssertAlignx(16,y(1))
15
16  y(1:n) = x(1:n)
17end subroutine FortranCopy
18
19pure subroutine FortranZero(n,x)
20  implicit none (type, external)
21  PetscScalar, intent(inout) :: x(*)
22  PetscInt, intent(in) :: n
23
24  PETSC_AssertAlignx(16,x(1))
25
26  x(1:n) = 0.0
27end subroutine FortranZero
28