Actual source code: fmaxpy.F

  1: !
  2: !
  3: !    Fortran kernel for the MAXPY() vector routine
  4: !
 5:  #include include/finclude/petscdef.h
  6: !
  7:       subroutine FortranMAXPY4(x,a1,a2,a3,a4,y1,y2,y3,y4,n)
  8:       implicit none
  9:       PetscScalar a1,a2,a3,a4
 10:       PetscScalar x(*),y1(*),y2(*),y3(*),y4(*)
 11:       PetscInt n

 13:       PetscInt i

 15:       do 10,i=1,n
 16:         x(i) = x(i) + a1*y1(i) + a2*y2(i) + a3*y3(i) + a4*y4(i)
 17:  10   continue

 19:       return
 20:       end

 22:       subroutine FortranMAXPY3(x,a1,a2,a3,y1,y2,y3,n)
 23:       implicit none
 24:       PetscScalar a1,a2,a3,x(*),y1(*),y2(*)
 25:       PetscScalar y3(*)
 26:       PetscInt n

 28:       PetscInt i

 30:       do 10,i=1,n
 31:         x(i) = x(i) + a1*y1(i) + a2*y2(i) + a3*y3(i)
 32:  10   continue

 34:       return
 35:       end



 39:       subroutine FortranMAXPY2(x,a1,a2,y1,y2,n)
 40:       implicit none
 41:       PetscScalar  a1,a2,x(*),y1(*),y2(*)
 42:       PetscInt n

 44:       PetscInt i

 46:       do 10,i=1,n
 47:         x(i) = x(i) + a1*y1(i) + a2*y2(i)
 48:  10   continue

 50:       return
 51:       end
 52: !
 53: !    Fortran kernel for the z = x * y
 54: !
 55: !
 56:       subroutine Fortranxtimesy(x,y,z,n)
 57:       implicit none
 58:       PetscScalar  x(*),y(*),z(*)
 59:       PetscInt n

 61:       PetscInt i

 63:       do 10,i=1,n
 64:         z(i) = x(i) * y(i)
 65:  10   continue

 67:       return
 68:       end