Date: 2016-07-24T16:49:43+00:00

Actual source code: fmaxpy.F
petsc-3.7.3 2016-07-24
Report Typos and Errors

      1: !
      2: !
      3: !    Fortran kernel for the MAXPY() vector routine
      4: !
      5: #include <petsc/finclude/petscsysdef.h>
      6: !

      8:       Subroutine FortranMAXPY4(x, a0, a1, a2, a3, y0, y1, y2, y3, n)
      9:       implicit none
     10:       PetscScalar  a0,a1,a2,a3
     11:       PetscScalar  x(*),y0(*)
     12:       PetscScalar y1(*),y2(*),y3(*)
     13:       PetscInt n, i

     15:       PETSC_AssertAlignx(16,x(1))
     16:       PETSC_AssertAlignx(16,y0(1))
     17:       PETSC_AssertAlignx(16,y1(1))
     18:       PETSC_AssertAlignx(16,Y2(1))
     19:       PETSC_AssertAlignx(16,Y3(1))
     20:       do i=1,n
     21:           x(i)  = x(i) + a0*y0(i) + a1*y1(i) + a2*y2(i) + a3*y3(i)
     22:       enddo
     23:       return
     24:       end

     26:       subroutine FortranMAXPY3(x,a0,a1,a2,y0,y1,y2,n)
     27:       implicit none
     28:       PetscScalar  a0,a1,a2,x(*)
     29:       PetscScalar y0(*),y1(*),y2(*)
     30:       PetscInt n
     31:       PetscInt i
     32:       PETSC_AssertAlignx(16,x(1))
     33:       PETSC_AssertAlignx(16,y0(1))
     34:       PETSC_AssertAlignx(16,y1(1))
     35:       PETSC_AssertAlignx(16,y2(1))
     36:       do 10,i=1,n
     37:          x(i) = x(i) + a0*y0(i) + a1*y1(i) + a2*y2(i)
     38:   10  continue
     39:       return
     40:       end

     42:       Subroutine FortranMAXPY2(x, a0, a1, y0, y1, n)
     43:       implicit none
     44:       PetscScalar  a0,a1,x(*)
     45:       PetscScalar  y0(*),y1(*)
     46:       PetscInt n, i
     47:       PETSC_AssertAlignx(16,x(1))
     48:       PETSC_AssertAlignx(16,y0(1))
     49:       PETSC_AssertAlignx(16,y1(1))
     50:       do i=1,n
     51:           x(i)  = x(i) + a0*y0(i) + a1*y1(i)
     52:       enddo
     53:       return
     54:       end