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(*),y3(*)
     25:       PetscInt n

     27:       PetscInt i

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

     33:       return
     34:       end

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

     43:       PetscInt i

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

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

     60:       PetscInt i

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

     66:       return
     67:       end