SUBROUTINE S8S(N,K,L,T,D,A,IA) c cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c c This subroutine generates the random data for the large sparse c matrix version of Benchmark #8. c c Parameters: c c Provided by calling routine: c N = The size of the A matrices c K = The number of A matrices c L = The number of non-zero rows and columns in each A matrix c T = The length of the D array c c Returned by this routine: c D = An array of length T, holding integers mod K c A = K real NxN matrices of positive real numbers c IA = An integer array of indices of the non-zero entries in A c cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c INTEGER T REAL A(N,L,K) INTEGER IA(N,L) INTEGER D(T) EXTERNAL IRAND PARAMETER (MASK=Z'7FFFFFFF') c C--CVS variable declaration TYPE CVS sequence character( 160 ) string integer stringend END TYPE CVS C--CVS initilaize variables TYPE( CVS ),save :: CVS_INFO = \$ CVS("BMARKGRP \$Date: 2005/01/07 23:07:11 \$ \$Revision: 1.2 \$" // \$ "\$RCSfile: s8s.f,v \$ \$Name: rel_5 \$", 0) c Generate the A arrays with entries between 0 and 1 c DO 70 I=1,K DO 30 J=1,L CALL VRAND(0,IA(1,1),N) DO 10 KK = 1,N A(KK,J,I) = IAND(MASK,IA(KK,1))*0.5**31 10 CONTINUE CALL VRAND(0,IA(1,1),N) DO 20 KK=1,N A(KK,J,I) = IAND(MASK,IA(KK,1))*0.5**62 20 CONTINUE 30 CONTINUE c DO 60 KK = 1,N TMP = A(KK,1,I) DO 40 J=2,L TMP = TMP + A(KK,J,I) 40 CONTINUE DO 50 J=1,L A(KK,J,I) = A(KK,J,I)/TMP 50 CONTINUE 60 CONTINUE 70 CONTINUE c c Generate the array of indices of the non-zero entries in A DO 90 J = 1,L DO 80 M = 1,N IA(M,J) = M 80 CONTINUE 90 CONTINUE c c Randomly permute the array IA 100 CONTINUE DO 130 I=1, 5 DO 120 J=1,L DO 110 M = 1,N JJ = MOD(IRAND(0), L)+1 MM = MOD(IRAND(0), N)+1 ITEMP = IA(M,J) IA(M,J) = IA(MM,JJ) IA(MM,JJ) = ITEMP 110 CONTINUE 120 CONTINUE 130 CONTINUE c c Make final adjustments to prevent repeats in the index in a column DO 170 M=1,N 140 CONTINUE DO 160 J=2,L DO 150 JJ=1,J-1 IF(IA(M,J) .EQ. IA(M,JJ)) THEN IF(M .NE. N) THEN ITEMP = IA(M,J) IA(M,J) = IA(M+1,J) IA(M+1,J) = ITEMP GOTO 140 ELSE GOTO 100 ENDIF ENDIF 150 CONTINUE 160 CONTINUE 170 CONTINUE c c Generate the D array CALL VRAND(0,D,T) DO 180 I = 1,T D(I) = MOD(D(I),K) + 1 180 CONTINUE c RETURN END