public static void dcopy_f77 (int n, double dx[], int incx, double
                      dy[], int incy) {

      double dtemp;
      int i,ix,iy,m;

      if (n <= 0) return;

      if ((incx == 1) && (incy == 1)) {

//   both increments equal to 1

         m = n%7;

         for (i = 1; i <= m; i++) {

            dy[i] = dx[i];

         }

         for (i = m+1; i <= n; i += 7) {

            dy[i]   = dx[i];
            dy[i+1] = dx[i+1];
            dy[i+2] = dx[i+2];
            dy[i+3] = dx[i+3];
            dy[i+4] = dx[i+4];
            dy[i+5] = dx[i+5];
            dy[i+6] = dx[i+6];

         }

         return;

      } else {

//   at least one increment not equal to 1

         ix = 1;
         iy = 1;

         if (incx < 0) ix = (-n+1)*incx + 1;
         if (incy < 0) iy = (-n+1)*incy + 1;

         for (i = 1; i <= n; i++) {

            dy[iy] = dx[ix];

            ix += incx;
            iy += incy;

         }

         return;

      }

   }