dcopy
C DCOPY SOURCE CHAT 06/03/29 21:18:23 5360 IMPLICIT INTEGER(I-N) IMPLICIT REAL*8 (A-H,O-Z) C C COPIES A VECTOR, X, TO A VECTOR, Y. C y <- x C USES UNROLLED LOOPS FOR INCREMENTS EQUAL TO ONE. C JACK DONGARRA, LINPACK, 3/11/78. C MODIFIED 12/3/93, ARRAY(1) DECLARATIONS CHANGED TO ARRAY(*) C C modified 16/2/98 double precision -> real*8 C no unrolled loops : compiler can do that C added error handling C -INC PPARAM -INC CCOPTIO REAL*8 DX(*),DY(*) INTEGER I,INCX,INCY,IX,IY,N C IF(N.LE.0) GOTO 9999 IF(INCX.NE.1.OR.INCY.NE.1) THEN C C CODE FOR UNEQUAL INCREMENTS OR EQUAL INCREMENTS C NOT EQUAL TO 1 C IX = 1 IY = 1 IF(INCX.LT.0)IX = (-N+1)*INCX + 1 IF(INCY.LT.0)IY = (-N+1)*INCY + 1 DO 10 I = 1,N DY(IY) = DX(IX) IX = IX + INCX IY = IY + INCY 10 CONTINUE ELSE C C CODE FOR BOTH INCREMENTS EQUAL TO 1 C DO 30 I = 1,N DY(I) = DX (I) 30 CONTINUE ENDIF C C Normal termination C RETURN C C Error handling C 9999 CONTINUE WRITE(IOIMP,*) 'dimension lower than 1 transmitted to' WRITE(IOIMP,*) 'subroutine dcopy : nothing done' RETURN C C End of DCOPY C END
© Cast3M 2003 - Tous droits réservés.
Mentions légales