• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1      PROGRAM DCBLAT1
2*     Test program for the DOUBLE PRECISION Level 1 CBLAS.
3*     Based upon the original CBLAS test routine together with:
4*     F06EAF Example Program Text
5*     .. Parameters ..
6      INTEGER          NOUT
7      PARAMETER        (NOUT=6)
8*     .. Scalars in Common ..
9      INTEGER          ICASE, INCX, INCY, MODE, N
10      LOGICAL          PASS
11*     .. Local Scalars ..
12      DOUBLE PRECISION SFAC
13      INTEGER          IC
14*     .. External Subroutines ..
15      EXTERNAL         CHECK0, CHECK1, CHECK2, CHECK3, HEADER
16*     .. Common blocks ..
17      COMMON           /COMBLA/ICASE, N, INCX, INCY, MODE, PASS
18*     .. Data statements ..
19      DATA             SFAC/9.765625D-4/
20*     .. Executable Statements ..
21      WRITE (NOUT,99999)
22      DO 20 IC = 1, 10
23         ICASE = IC
24         CALL HEADER
25*
26*        .. Initialize  PASS,  INCX,  INCY, and MODE for a new case. ..
27*        .. the value 9999 for INCX, INCY or MODE will appear in the ..
28*        .. detailed  output, if any, for cases  that do not involve ..
29*        .. these parameters ..
30*
31         PASS = .TRUE.
32         INCX = 9999
33         INCY = 9999
34         MODE = 9999
35         IF (ICASE.EQ.3) THEN
36            CALL CHECK0(SFAC)
37         ELSE IF (ICASE.EQ.7 .OR. ICASE.EQ.8 .OR. ICASE.EQ.9 .OR.
38     +            ICASE.EQ.10) THEN
39            CALL CHECK1(SFAC)
40         ELSE IF (ICASE.EQ.1 .OR. ICASE.EQ.2 .OR. ICASE.EQ.5 .OR.
41     +            ICASE.EQ.6) THEN
42            CALL CHECK2(SFAC)
43         ELSE IF (ICASE.EQ.4) THEN
44            CALL CHECK3(SFAC)
45         END IF
46*        -- Print
47         IF (PASS) WRITE (NOUT,99998)
48   20 CONTINUE
49      STOP
50*
5199999 FORMAT (' Real CBLAS Test Program Results',/1X)
5299998 FORMAT ('                                    ----- PASS -----')
53      END
54      SUBROUTINE HEADER
55*     .. Parameters ..
56      INTEGER          NOUT
57      PARAMETER        (NOUT=6)
58*     .. Scalars in Common ..
59      INTEGER          ICASE, INCX, INCY, MODE, N
60      LOGICAL          PASS
61*     .. Local Arrays ..
62      CHARACTER*15      L(10)
63*     .. Common blocks ..
64      COMMON           /COMBLA/ICASE, N, INCX, INCY, MODE, PASS
65*     .. Data statements ..
66      DATA             L(1)/'CBLAS_DDOT'/
67      DATA             L(2)/'CBLAS_DAXPY '/
68      DATA             L(3)/'CBLAS_DROTG '/
69      DATA             L(4)/'CBLAS_DROT '/
70      DATA             L(5)/'CBLAS_DCOPY '/
71      DATA             L(6)/'CBLAS_DSWAP '/
72      DATA             L(7)/'CBLAS_DNRM2 '/
73      DATA             L(8)/'CBLAS_DASUM '/
74      DATA             L(9)/'CBLAS_DSCAL '/
75      DATA             L(10)/'CBLAS_IDAMAX'/
76*     .. Executable Statements ..
77      WRITE (NOUT,99999) ICASE, L(ICASE)
78      RETURN
79*
8099999 FORMAT (/' Test of subprogram number',I3,9X,A15)
81      END
82      SUBROUTINE CHECK0(SFAC)
83*     .. Parameters ..
84      INTEGER           NOUT
85      PARAMETER         (NOUT=6)
86*     .. Scalar Arguments ..
87      DOUBLE PRECISION  SFAC
88*     .. Scalars in Common ..
89      INTEGER           ICASE, INCX, INCY, MODE, N
90      LOGICAL           PASS
91*     .. Local Scalars ..
92      DOUBLE PRECISION  SA, SB, SC, SS
93      INTEGER           K
94*     .. Local Arrays ..
95      DOUBLE PRECISION  DA1(8), DATRUE(8), DB1(8), DBTRUE(8), DC1(8),
96     +                  DS1(8)
97*     .. External Subroutines ..
98      EXTERNAL          DROTGTEST, STEST1
99*     .. Common blocks ..
100      COMMON            /COMBLA/ICASE, N, INCX, INCY, MODE, PASS
101*     .. Data statements ..
102      DATA              DA1/0.3D0, 0.4D0, -0.3D0, -0.4D0, -0.3D0, 0.0D0,
103     +                  0.0D0, 1.0D0/
104      DATA              DB1/0.4D0, 0.3D0, 0.4D0, 0.3D0, -0.4D0, 0.0D0,
105     +                  1.0D0, 0.0D0/
106      DATA              DC1/0.6D0, 0.8D0, -0.6D0, 0.8D0, 0.6D0, 1.0D0,
107     +                  0.0D0, 1.0D0/
108      DATA              DS1/0.8D0, 0.6D0, 0.8D0, -0.6D0, 0.8D0, 0.0D0,
109     +                  1.0D0, 0.0D0/
110      DATA              DATRUE/0.5D0, 0.5D0, 0.5D0, -0.5D0, -0.5D0,
111     +                  0.0D0, 1.0D0, 1.0D0/
112      DATA              DBTRUE/0.0D0, 0.6D0, 0.0D0, -0.6D0, 0.0D0,
113     +                  0.0D0, 1.0D0, 0.0D0/
114*     .. Executable Statements ..
115*
116*     Compute true values which cannot be prestored
117*     in decimal notation
118*
119      DBTRUE(1) = 1.0D0/0.6D0
120      DBTRUE(3) = -1.0D0/0.6D0
121      DBTRUE(5) = 1.0D0/0.6D0
122*
123      DO 20 K = 1, 8
124*        .. Set N=K for identification in output if any ..
125         N = K
126         IF (ICASE.EQ.3) THEN
127*           .. DROTGTEST ..
128            IF (K.GT.8) GO TO 40
129            SA = DA1(K)
130            SB = DB1(K)
131            CALL DROTGTEST(SA,SB,SC,SS)
132            CALL STEST1(SA,DATRUE(K),DATRUE(K),SFAC)
133            CALL STEST1(SB,DBTRUE(K),DBTRUE(K),SFAC)
134            CALL STEST1(SC,DC1(K),DC1(K),SFAC)
135            CALL STEST1(SS,DS1(K),DS1(K),SFAC)
136         ELSE
137            WRITE (NOUT,*) ' Shouldn''t be here in CHECK0'
138            STOP
139         END IF
140   20 CONTINUE
141   40 RETURN
142      END
143      SUBROUTINE CHECK1(SFAC)
144*     .. Parameters ..
145      INTEGER           NOUT
146      PARAMETER         (NOUT=6)
147*     .. Scalar Arguments ..
148      DOUBLE PRECISION  SFAC
149*     .. Scalars in Common ..
150      INTEGER           ICASE, INCX, INCY, MODE, N
151      LOGICAL           PASS
152*     .. Local Scalars ..
153      INTEGER           I, LEN, NP1
154*     .. Local Arrays ..
155      DOUBLE PRECISION  DTRUE1(5), DTRUE3(5), DTRUE5(8,5,2), DV(8,5,2),
156     +                  SA(10), STEMP(1), STRUE(8), SX(8)
157      INTEGER           ITRUE2(5)
158*     .. External Functions ..
159      DOUBLE PRECISION  DASUMTEST, DNRM2TEST
160      INTEGER           IDAMAXTEST
161      EXTERNAL          DASUMTEST, DNRM2TEST, IDAMAXTEST
162*     .. External Subroutines ..
163      EXTERNAL          ITEST1, DSCALTEST, STEST, STEST1
164*     .. Intrinsic Functions ..
165      INTRINSIC         MAX
166*     .. Common blocks ..
167      COMMON            /COMBLA/ICASE, N, INCX, INCY, MODE, PASS
168*     .. Data statements ..
169      DATA              SA/0.3D0, -1.0D0, 0.0D0, 1.0D0, 0.3D0, 0.3D0,
170     +                  0.3D0, 0.3D0, 0.3D0, 0.3D0/
171      DATA              DV/0.1D0, 2.0D0, 2.0D0, 2.0D0, 2.0D0, 2.0D0,
172     +                  2.0D0, 2.0D0, 0.3D0, 3.0D0, 3.0D0, 3.0D0, 3.0D0,
173     +                  3.0D0, 3.0D0, 3.0D0, 0.3D0, -0.4D0, 4.0D0,
174     +                  4.0D0, 4.0D0, 4.0D0, 4.0D0, 4.0D0, 0.2D0,
175     +                  -0.6D0, 0.3D0, 5.0D0, 5.0D0, 5.0D0, 5.0D0,
176     +                  5.0D0, 0.1D0, -0.3D0, 0.5D0, -0.1D0, 6.0D0,
177     +                  6.0D0, 6.0D0, 6.0D0, 0.1D0, 8.0D0, 8.0D0, 8.0D0,
178     +                  8.0D0, 8.0D0, 8.0D0, 8.0D0, 0.3D0, 9.0D0, 9.0D0,
179     +                  9.0D0, 9.0D0, 9.0D0, 9.0D0, 9.0D0, 0.3D0, 2.0D0,
180     +                  -0.4D0, 2.0D0, 2.0D0, 2.0D0, 2.0D0, 2.0D0,
181     +                  0.2D0, 3.0D0, -0.6D0, 5.0D0, 0.3D0, 2.0D0,
182     +                  2.0D0, 2.0D0, 0.1D0, 4.0D0, -0.3D0, 6.0D0,
183     +                  -0.5D0, 7.0D0, -0.1D0, 3.0D0/
184      DATA              DTRUE1/0.0D0, 0.3D0, 0.5D0, 0.7D0, 0.6D0/
185      DATA              DTRUE3/0.0D0, 0.3D0, 0.7D0, 1.1D0, 1.0D0/
186      DATA              DTRUE5/0.10D0, 2.0D0, 2.0D0, 2.0D0, 2.0D0,
187     +                  2.0D0, 2.0D0, 2.0D0, -0.3D0, 3.0D0, 3.0D0,
188     +                  3.0D0, 3.0D0, 3.0D0, 3.0D0, 3.0D0, 0.0D0, 0.0D0,
189     +                  4.0D0, 4.0D0, 4.0D0, 4.0D0, 4.0D0, 4.0D0,
190     +                  0.20D0, -0.60D0, 0.30D0, 5.0D0, 5.0D0, 5.0D0,
191     +                  5.0D0, 5.0D0, 0.03D0, -0.09D0, 0.15D0, -0.03D0,
192     +                  6.0D0, 6.0D0, 6.0D0, 6.0D0, 0.10D0, 8.0D0,
193     +                  8.0D0, 8.0D0, 8.0D0, 8.0D0, 8.0D0, 8.0D0,
194     +                  0.09D0, 9.0D0, 9.0D0, 9.0D0, 9.0D0, 9.0D0,
195     +                  9.0D0, 9.0D0, 0.09D0, 2.0D0, -0.12D0, 2.0D0,
196     +                  2.0D0, 2.0D0, 2.0D0, 2.0D0, 0.06D0, 3.0D0,
197     +                  -0.18D0, 5.0D0, 0.09D0, 2.0D0, 2.0D0, 2.0D0,
198     +                  0.03D0, 4.0D0, -0.09D0, 6.0D0, -0.15D0, 7.0D0,
199     +                  -0.03D0, 3.0D0/
200      DATA              ITRUE2/0, 1, 2, 2, 3/
201*     .. Executable Statements ..
202      DO 80 INCX = 1, 2
203         DO 60 NP1 = 1, 5
204            N = NP1 - 1
205            LEN = 2*MAX(N,1)
206*           .. Set vector arguments ..
207            DO 20 I = 1, LEN
208               SX(I) = DV(I,NP1,INCX)
209   20       CONTINUE
210*
211            IF (ICASE.EQ.7) THEN
212*              .. DNRM2TEST ..
213               STEMP(1) = DTRUE1(NP1)
214               CALL STEST1(DNRM2TEST(N,SX,INCX),STEMP,STEMP,SFAC)
215            ELSE IF (ICASE.EQ.8) THEN
216*              .. DASUMTEST ..
217               STEMP(1) = DTRUE3(NP1)
218               CALL STEST1(DASUMTEST(N,SX,INCX),STEMP,STEMP,SFAC)
219            ELSE IF (ICASE.EQ.9) THEN
220*              .. DSCALTEST ..
221               CALL DSCALTEST(N,SA((INCX-1)*5+NP1),SX,INCX)
222               DO 40 I = 1, LEN
223                  STRUE(I) = DTRUE5(I,NP1,INCX)
224   40          CONTINUE
225               CALL STEST(LEN,SX,STRUE,STRUE,SFAC)
226            ELSE IF (ICASE.EQ.10) THEN
227*              .. IDAMAXTEST ..
228               CALL ITEST1(IDAMAXTEST(N,SX,INCX),ITRUE2(NP1))
229            ELSE
230               WRITE (NOUT,*) ' Shouldn''t be here in CHECK1'
231               STOP
232            END IF
233   60    CONTINUE
234   80 CONTINUE
235      RETURN
236      END
237      SUBROUTINE CHECK2(SFAC)
238*     .. Parameters ..
239      INTEGER           NOUT
240      PARAMETER         (NOUT=6)
241*     .. Scalar Arguments ..
242      DOUBLE PRECISION  SFAC
243*     .. Scalars in Common ..
244      INTEGER           ICASE, INCX, INCY, MODE, N
245      LOGICAL           PASS
246*     .. Local Scalars ..
247      DOUBLE PRECISION  SA
248      INTEGER           I, J, KI, KN, KSIZE, LENX, LENY, MX, MY
249*     .. Local Arrays ..
250      DOUBLE PRECISION  DT10X(7,4,4), DT10Y(7,4,4), DT7(4,4),
251     +                  DT8(7,4,4), DX1(7),
252     +                  DY1(7), SSIZE1(4), SSIZE2(14,2), STX(7), STY(7),
253     +                  SX(7), SY(7)
254      INTEGER           INCXS(4), INCYS(4), LENS(4,2), NS(4)
255*     .. External Functions ..
256      EXTERNAL          DDOTTEST
257      DOUBLE PRECISION  DDOTTEST
258*     .. External Subroutines ..
259      EXTERNAL          DAXPYTEST, DCOPYTEST, DSWAPTEST, STEST, STEST1
260*     .. Intrinsic Functions ..
261      INTRINSIC         ABS, MIN
262*     .. Common blocks ..
263      COMMON            /COMBLA/ICASE, N, INCX, INCY, MODE, PASS
264*     .. Data statements ..
265      DATA              SA/0.3D0/
266      DATA              INCXS/1, 2, -2, -1/
267      DATA              INCYS/1, -2, 1, -2/
268      DATA              LENS/1, 1, 2, 4, 1, 1, 3, 7/
269      DATA              NS/0, 1, 2, 4/
270      DATA              DX1/0.6D0, 0.1D0, -0.5D0, 0.8D0, 0.9D0, -0.3D0,
271     +                  -0.4D0/
272      DATA              DY1/0.5D0, -0.9D0, 0.3D0, 0.7D0, -0.6D0, 0.2D0,
273     +                  0.8D0/
274      DATA              DT7/0.0D0, 0.30D0, 0.21D0, 0.62D0, 0.0D0,
275     +                  0.30D0, -0.07D0, 0.85D0, 0.0D0, 0.30D0, -0.79D0,
276     +                  -0.74D0, 0.0D0, 0.30D0, 0.33D0, 1.27D0/
277      DATA              DT8/0.5D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
278     +                  0.0D0, 0.68D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
279     +                  0.0D0, 0.0D0, 0.68D0, -0.87D0, 0.0D0, 0.0D0,
280     +                  0.0D0, 0.0D0, 0.0D0, 0.68D0, -0.87D0, 0.15D0,
281     +                  0.94D0, 0.0D0, 0.0D0, 0.0D0, 0.5D0, 0.0D0,
282     +                  0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.68D0,
283     +                  0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
284     +                  0.35D0, -0.9D0, 0.48D0, 0.0D0, 0.0D0, 0.0D0,
285     +                  0.0D0, 0.38D0, -0.9D0, 0.57D0, 0.7D0, -0.75D0,
286     +                  0.2D0, 0.98D0, 0.5D0, 0.0D0, 0.0D0, 0.0D0,
287     +                  0.0D0, 0.0D0, 0.0D0, 0.68D0, 0.0D0, 0.0D0,
288     +                  0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.35D0, -0.72D0,
289     +                  0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.38D0,
290     +                  -0.63D0, 0.15D0, 0.88D0, 0.0D0, 0.0D0, 0.0D0,
291     +                  0.5D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
292     +                  0.68D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
293     +                  0.0D0, 0.68D0, -0.9D0, 0.33D0, 0.0D0, 0.0D0,
294     +                  0.0D0, 0.0D0, 0.68D0, -0.9D0, 0.33D0, 0.7D0,
295     +                  -0.75D0, 0.2D0, 1.04D0/
296      DATA              DT10X/0.6D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
297     +                  0.0D0, 0.5D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
298     +                  0.0D0, 0.5D0, -0.9D0, 0.0D0, 0.0D0, 0.0D0,
299     +                  0.0D0, 0.0D0, 0.5D0, -0.9D0, 0.3D0, 0.7D0,
300     +                  0.0D0, 0.0D0, 0.0D0, 0.6D0, 0.0D0, 0.0D0, 0.0D0,
301     +                  0.0D0, 0.0D0, 0.0D0, 0.5D0, 0.0D0, 0.0D0, 0.0D0,
302     +                  0.0D0, 0.0D0, 0.0D0, 0.3D0, 0.1D0, 0.5D0, 0.0D0,
303     +                  0.0D0, 0.0D0, 0.0D0, 0.8D0, 0.1D0, -0.6D0,
304     +                  0.8D0, 0.3D0, -0.3D0, 0.5D0, 0.6D0, 0.0D0,
305     +                  0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.5D0, 0.0D0,
306     +                  0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, -0.9D0,
307     +                  0.1D0, 0.5D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.7D0,
308     +                  0.1D0, 0.3D0, 0.8D0, -0.9D0, -0.3D0, 0.5D0,
309     +                  0.6D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
310     +                  0.5D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
311     +                  0.5D0, 0.3D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
312     +                  0.5D0, 0.3D0, -0.6D0, 0.8D0, 0.0D0, 0.0D0,
313     +                  0.0D0/
314      DATA              DT10Y/0.5D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
315     +                  0.0D0, 0.6D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
316     +                  0.0D0, 0.6D0, 0.1D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
317     +                  0.0D0, 0.6D0, 0.1D0, -0.5D0, 0.8D0, 0.0D0,
318     +                  0.0D0, 0.0D0, 0.5D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
319     +                  0.0D0, 0.0D0, 0.6D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
320     +                  0.0D0, 0.0D0, -0.5D0, -0.9D0, 0.6D0, 0.0D0,
321     +                  0.0D0, 0.0D0, 0.0D0, -0.4D0, -0.9D0, 0.9D0,
322     +                  0.7D0, -0.5D0, 0.2D0, 0.6D0, 0.5D0, 0.0D0,
323     +                  0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.6D0, 0.0D0,
324     +                  0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, -0.5D0,
325     +                  0.6D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
326     +                  -0.4D0, 0.9D0, -0.5D0, 0.6D0, 0.0D0, 0.0D0,
327     +                  0.0D0, 0.5D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
328     +                  0.0D0, 0.6D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
329     +                  0.0D0, 0.6D0, -0.9D0, 0.1D0, 0.0D0, 0.0D0,
330     +                  0.0D0, 0.0D0, 0.6D0, -0.9D0, 0.1D0, 0.7D0,
331     +                  -0.5D0, 0.2D0, 0.8D0/
332      DATA              SSIZE1/0.0D0, 0.3D0, 1.6D0, 3.2D0/
333      DATA              SSIZE2/0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
334     +                  0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
335     +                  0.0D0, 1.17D0, 1.17D0, 1.17D0, 1.17D0, 1.17D0,
336     +                  1.17D0, 1.17D0, 1.17D0, 1.17D0, 1.17D0, 1.17D0,
337     +                  1.17D0, 1.17D0, 1.17D0/
338*     .. Executable Statements ..
339*
340      DO 120 KI = 1, 4
341         INCX = INCXS(KI)
342         INCY = INCYS(KI)
343         MX = ABS(INCX)
344         MY = ABS(INCY)
345*
346         DO 100 KN = 1, 4
347            N = NS(KN)
348            KSIZE = MIN(2,KN)
349            LENX = LENS(KN,MX)
350            LENY = LENS(KN,MY)
351*           .. Initialize all argument arrays ..
352            DO 20 I = 1, 7
353               SX(I) = DX1(I)
354               SY(I) = DY1(I)
355   20       CONTINUE
356*
357            IF (ICASE.EQ.1) THEN
358*              .. DDOTTEST ..
359               CALL STEST1(DDOTTEST(N,SX,INCX,SY,INCY),DT7(KN,KI),
360     +                     SSIZE1(KN),SFAC)
361            ELSE IF (ICASE.EQ.2) THEN
362*              .. DAXPYTEST ..
363               CALL DAXPYTEST(N,SA,SX,INCX,SY,INCY)
364               DO 40 J = 1, LENY
365                  STY(J) = DT8(J,KN,KI)
366   40          CONTINUE
367               CALL STEST(LENY,SY,STY,SSIZE2(1,KSIZE),SFAC)
368            ELSE IF (ICASE.EQ.5) THEN
369*              .. DCOPYTEST ..
370               DO 60 I = 1, 7
371                  STY(I) = DT10Y(I,KN,KI)
372   60          CONTINUE
373               CALL DCOPYTEST(N,SX,INCX,SY,INCY)
374               CALL STEST(LENY,SY,STY,SSIZE2(1,1),1.0D0)
375            ELSE IF (ICASE.EQ.6) THEN
376*              .. DSWAPTEST ..
377               CALL DSWAPTEST(N,SX,INCX,SY,INCY)
378               DO 80 I = 1, 7
379                  STX(I) = DT10X(I,KN,KI)
380                  STY(I) = DT10Y(I,KN,KI)
381   80          CONTINUE
382               CALL STEST(LENX,SX,STX,SSIZE2(1,1),1.0D0)
383               CALL STEST(LENY,SY,STY,SSIZE2(1,1),1.0D0)
384            ELSE
385               WRITE (NOUT,*) ' Shouldn''t be here in CHECK2'
386               STOP
387            END IF
388  100    CONTINUE
389  120 CONTINUE
390      RETURN
391      END
392      SUBROUTINE CHECK3(SFAC)
393*     .. Parameters ..
394      INTEGER           NOUT
395      PARAMETER         (NOUT=6)
396*     .. Scalar Arguments ..
397      DOUBLE PRECISION  SFAC
398*     .. Scalars in Common ..
399      INTEGER           ICASE, INCX, INCY, MODE, N
400      LOGICAL           PASS
401*     .. Local Scalars ..
402      DOUBLE PRECISION  SC, SS
403      INTEGER           I, K, KI, KN, KSIZE, LENX, LENY, MX, MY
404*     .. Local Arrays ..
405      DOUBLE PRECISION  COPYX(5), COPYY(5), DT9X(7,4,4), DT9Y(7,4,4),
406     +                  DX1(7), DY1(7), MWPC(11), MWPS(11), MWPSTX(5),
407     +                  MWPSTY(5), MWPTX(11,5), MWPTY(11,5), MWPX(5),
408     +                  MWPY(5), SSIZE2(14,2), STX(7), STY(7), SX(7),
409     +                  SY(7)
410      INTEGER           INCXS(4), INCYS(4), LENS(4,2), MWPINX(11),
411     +                  MWPINY(11), MWPN(11), NS(4)
412*     .. External Subroutines ..
413      EXTERNAL          STEST,DROTTEST
414*     .. Intrinsic Functions ..
415      INTRINSIC         ABS, MIN
416*     .. Common blocks ..
417      COMMON            /COMBLA/ICASE, N, INCX, INCY, MODE, PASS
418*     .. Data statements ..
419      DATA              INCXS/1, 2, -2, -1/
420      DATA              INCYS/1, -2, 1, -2/
421      DATA              LENS/1, 1, 2, 4, 1, 1, 3, 7/
422      DATA              NS/0, 1, 2, 4/
423      DATA              DX1/0.6D0, 0.1D0, -0.5D0, 0.8D0, 0.9D0, -0.3D0,
424     +                  -0.4D0/
425      DATA              DY1/0.5D0, -0.9D0, 0.3D0, 0.7D0, -0.6D0, 0.2D0,
426     +                  0.8D0/
427      DATA              SC, SS/0.8D0, 0.6D0/
428      DATA              DT9X/0.6D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
429     +                  0.0D0, 0.78D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
430     +                  0.0D0, 0.0D0, 0.78D0, -0.46D0, 0.0D0, 0.0D0,
431     +                  0.0D0, 0.0D0, 0.0D0, 0.78D0, -0.46D0, -0.22D0,
432     +                  1.06D0, 0.0D0, 0.0D0, 0.0D0, 0.6D0, 0.0D0,
433     +                  0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.78D0,
434     +                  0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
435     +                  0.66D0, 0.1D0, -0.1D0, 0.0D0, 0.0D0, 0.0D0,
436     +                  0.0D0, 0.96D0, 0.1D0, -0.76D0, 0.8D0, 0.90D0,
437     +                  -0.3D0, -0.02D0, 0.6D0, 0.0D0, 0.0D0, 0.0D0,
438     +                  0.0D0, 0.0D0, 0.0D0, 0.78D0, 0.0D0, 0.0D0,
439     +                  0.0D0, 0.0D0, 0.0D0, 0.0D0, -0.06D0, 0.1D0,
440     +                  -0.1D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.90D0,
441     +                  0.1D0, -0.22D0, 0.8D0, 0.18D0, -0.3D0, -0.02D0,
442     +                  0.6D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
443     +                  0.78D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
444     +                  0.0D0, 0.78D0, 0.26D0, 0.0D0, 0.0D0, 0.0D0,
445     +                  0.0D0, 0.0D0, 0.78D0, 0.26D0, -0.76D0, 1.12D0,
446     +                  0.0D0, 0.0D0, 0.0D0/
447      DATA              DT9Y/0.5D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
448     +                  0.0D0, 0.04D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
449     +                  0.0D0, 0.0D0, 0.04D0, -0.78D0, 0.0D0, 0.0D0,
450     +                  0.0D0, 0.0D0, 0.0D0, 0.04D0, -0.78D0, 0.54D0,
451     +                  0.08D0, 0.0D0, 0.0D0, 0.0D0, 0.5D0, 0.0D0,
452     +                  0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.04D0,
453     +                  0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.7D0,
454     +                  -0.9D0, -0.12D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
455     +                  0.64D0, -0.9D0, -0.30D0, 0.7D0, -0.18D0, 0.2D0,
456     +                  0.28D0, 0.5D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
457     +                  0.0D0, 0.0D0, 0.04D0, 0.0D0, 0.0D0, 0.0D0,
458     +                  0.0D0, 0.0D0, 0.0D0, 0.7D0, -1.08D0, 0.0D0,
459     +                  0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.64D0, -1.26D0,
460     +                  0.54D0, 0.20D0, 0.0D0, 0.0D0, 0.0D0, 0.5D0,
461     +                  0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
462     +                  0.04D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
463     +                  0.0D0, 0.04D0, -0.9D0, 0.18D0, 0.0D0, 0.0D0,
464     +                  0.0D0, 0.0D0, 0.04D0, -0.9D0, 0.18D0, 0.7D0,
465     +                  -0.18D0, 0.2D0, 0.16D0/
466      DATA              SSIZE2/0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
467     +                  0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
468     +                  0.0D0, 1.17D0, 1.17D0, 1.17D0, 1.17D0, 1.17D0,
469     +                  1.17D0, 1.17D0, 1.17D0, 1.17D0, 1.17D0, 1.17D0,
470     +                  1.17D0, 1.17D0, 1.17D0/
471*     .. Executable Statements ..
472*
473      DO 60 KI = 1, 4
474         INCX = INCXS(KI)
475         INCY = INCYS(KI)
476         MX = ABS(INCX)
477         MY = ABS(INCY)
478*
479         DO 40 KN = 1, 4
480            N = NS(KN)
481            KSIZE = MIN(2,KN)
482            LENX = LENS(KN,MX)
483            LENY = LENS(KN,MY)
484*
485            IF (ICASE.EQ.4) THEN
486*              .. DROTTEST ..
487               DO 20 I = 1, 7
488                  SX(I) = DX1(I)
489                  SY(I) = DY1(I)
490                  STX(I) = DT9X(I,KN,KI)
491                  STY(I) = DT9Y(I,KN,KI)
492   20          CONTINUE
493               CALL DROTTEST(N,SX,INCX,SY,INCY,SC,SS)
494               CALL STEST(LENX,SX,STX,SSIZE2(1,KSIZE),SFAC)
495               CALL STEST(LENY,SY,STY,SSIZE2(1,KSIZE),SFAC)
496            ELSE
497               WRITE (NOUT,*) ' Shouldn''t be here in CHECK3'
498               STOP
499            END IF
500   40    CONTINUE
501   60 CONTINUE
502*
503      MWPC(1) = 1
504      DO 80 I = 2, 11
505         MWPC(I) = 0
506   80 CONTINUE
507      MWPS(1) = 0.0
508      DO 100 I = 2, 6
509         MWPS(I) = 1.0
510  100 CONTINUE
511      DO 120 I = 7, 11
512         MWPS(I) = -1.0
513  120 CONTINUE
514      MWPINX(1) = 1
515      MWPINX(2) = 1
516      MWPINX(3) = 1
517      MWPINX(4) = -1
518      MWPINX(5) = 1
519      MWPINX(6) = -1
520      MWPINX(7) = 1
521      MWPINX(8) = 1
522      MWPINX(9) = -1
523      MWPINX(10) = 1
524      MWPINX(11) = -1
525      MWPINY(1) = 1
526      MWPINY(2) = 1
527      MWPINY(3) = -1
528      MWPINY(4) = -1
529      MWPINY(5) = 2
530      MWPINY(6) = 1
531      MWPINY(7) = 1
532      MWPINY(8) = -1
533      MWPINY(9) = -1
534      MWPINY(10) = 2
535      MWPINY(11) = 1
536      DO 140 I = 1, 11
537         MWPN(I) = 5
538  140 CONTINUE
539      MWPN(5) = 3
540      MWPN(10) = 3
541      DO 160 I = 1, 5
542         MWPX(I) = I
543         MWPY(I) = I
544         MWPTX(1,I) = I
545         MWPTY(1,I) = I
546         MWPTX(2,I) = I
547         MWPTY(2,I) = -I
548         MWPTX(3,I) = 6 - I
549         MWPTY(3,I) = I - 6
550         MWPTX(4,I) = I
551         MWPTY(4,I) = -I
552         MWPTX(6,I) = 6 - I
553         MWPTY(6,I) = I - 6
554         MWPTX(7,I) = -I
555         MWPTY(7,I) = I
556         MWPTX(8,I) = I - 6
557         MWPTY(8,I) = 6 - I
558         MWPTX(9,I) = -I
559         MWPTY(9,I) = I
560         MWPTX(11,I) = I - 6
561         MWPTY(11,I) = 6 - I
562  160 CONTINUE
563      MWPTX(5,1) = 1
564      MWPTX(5,2) = 3
565      MWPTX(5,3) = 5
566      MWPTX(5,4) = 4
567      MWPTX(5,5) = 5
568      MWPTY(5,1) = -1
569      MWPTY(5,2) = 2
570      MWPTY(5,3) = -2
571      MWPTY(5,4) = 4
572      MWPTY(5,5) = -3
573      MWPTX(10,1) = -1
574      MWPTX(10,2) = -3
575      MWPTX(10,3) = -5
576      MWPTX(10,4) = 4
577      MWPTX(10,5) = 5
578      MWPTY(10,1) = 1
579      MWPTY(10,2) = 2
580      MWPTY(10,3) = 2
581      MWPTY(10,4) = 4
582      MWPTY(10,5) = 3
583      DO 200 I = 1, 11
584         INCX = MWPINX(I)
585         INCY = MWPINY(I)
586         DO 180 K = 1, 5
587            COPYX(K) = MWPX(K)
588            COPYY(K) = MWPY(K)
589            MWPSTX(K) = MWPTX(I,K)
590            MWPSTY(K) = MWPTY(I,K)
591  180    CONTINUE
592         CALL DROTTEST(MWPN(I),COPYX,INCX,COPYY,INCY,MWPC(I),MWPS(I))
593         CALL STEST(5,COPYX,MWPSTX,MWPSTX,SFAC)
594         CALL STEST(5,COPYY,MWPSTY,MWPSTY,SFAC)
595  200 CONTINUE
596      RETURN
597      END
598      SUBROUTINE STEST(LEN,SCOMP,STRUE,SSIZE,SFAC)
599*     ********************************* STEST **************************
600*
601*     THIS SUBR COMPARES ARRAYS  SCOMP() AND STRUE() OF LENGTH LEN TO
602*     SEE IF THE TERM BY TERM DIFFERENCES, MULTIPLIED BY SFAC, ARE
603*     NEGLIGIBLE.
604*
605*     C. L. LAWSON, JPL, 1974 DEC 10
606*
607*     .. Parameters ..
608      INTEGER          NOUT
609      PARAMETER        (NOUT=6)
610*     .. Scalar Arguments ..
611      DOUBLE PRECISION SFAC
612      INTEGER          LEN
613*     .. Array Arguments ..
614      DOUBLE PRECISION SCOMP(LEN), SSIZE(LEN), STRUE(LEN)
615*     .. Scalars in Common ..
616      INTEGER          ICASE, INCX, INCY, MODE, N
617      LOGICAL          PASS
618*     .. Local Scalars ..
619      DOUBLE PRECISION SD
620      INTEGER          I
621*     .. External Functions ..
622      DOUBLE PRECISION SDIFF
623      EXTERNAL         SDIFF
624*     .. Intrinsic Functions ..
625      INTRINSIC        ABS
626*     .. Common blocks ..
627      COMMON           /COMBLA/ICASE, N, INCX, INCY, MODE, PASS
628*     .. Executable Statements ..
629*
630      DO 40 I = 1, LEN
631         SD = SCOMP(I) - STRUE(I)
632         IF (SDIFF(ABS(SSIZE(I))+ABS(SFAC*SD),ABS(SSIZE(I))).EQ.0.0D0)
633     +       GO TO 40
634*
635*                             HERE    SCOMP(I) IS NOT CLOSE TO STRUE(I).
636*
637         IF ( .NOT. PASS) GO TO 20
638*                             PRINT FAIL MESSAGE AND HEADER.
639         PASS = .FALSE.
640         WRITE (NOUT,99999)
641         WRITE (NOUT,99998)
642   20    WRITE (NOUT,99997) ICASE, N, INCX, INCY, MODE, I, SCOMP(I),
643     +     STRUE(I), SD, SSIZE(I)
644   40 CONTINUE
645      RETURN
646*
64799999 FORMAT ('                                       FAIL')
64899998 FORMAT (/' CASE  N INCX INCY MODE  I                            ',
649     +       ' COMP(I)                             TRUE(I)  DIFFERENCE',
650     +       '     SIZE(I)',/1X)
65199997 FORMAT (1X,I4,I3,3I5,I3,2D36.8,2D12.4)
652      END
653      SUBROUTINE STEST1(SCOMP1,STRUE1,SSIZE,SFAC)
654*     ************************* STEST1 *****************************
655*
656*     THIS IS AN INTERFACE SUBROUTINE TO ACCOMODATE THE FORTRAN
657*     REQUIREMENT THAT WHEN A DUMMY ARGUMENT IS AN ARRAY, THE
658*     ACTUAL ARGUMENT MUST ALSO BE AN ARRAY OR AN ARRAY ELEMENT.
659*
660*     C.L. LAWSON, JPL, 1978 DEC 6
661*
662*     .. Scalar Arguments ..
663      DOUBLE PRECISION  SCOMP1, SFAC, STRUE1
664*     .. Array Arguments ..
665      DOUBLE PRECISION  SSIZE(*)
666*     .. Local Arrays ..
667      DOUBLE PRECISION  SCOMP(1), STRUE(1)
668*     .. External Subroutines ..
669      EXTERNAL          STEST
670*     .. Executable Statements ..
671*
672      SCOMP(1) = SCOMP1
673      STRUE(1) = STRUE1
674      CALL STEST(1,SCOMP,STRUE,SSIZE,SFAC)
675*
676      RETURN
677      END
678      DOUBLE PRECISION FUNCTION SDIFF(SA,SB)
679*     ********************************* SDIFF **************************
680*     COMPUTES DIFFERENCE OF TWO NUMBERS.  C. L. LAWSON, JPL 1974 FEB 15
681*
682*     .. Scalar Arguments ..
683      DOUBLE PRECISION                SA, SB
684*     .. Executable Statements ..
685      SDIFF = SA - SB
686      RETURN
687      END
688      SUBROUTINE ITEST1(ICOMP,ITRUE)
689*     ********************************* ITEST1 *************************
690*
691*     THIS SUBROUTINE COMPARES THE VARIABLES ICOMP AND ITRUE FOR
692*     EQUALITY.
693*     C. L. LAWSON, JPL, 1974 DEC 10
694*
695*     .. Parameters ..
696      INTEGER           NOUT
697      PARAMETER         (NOUT=6)
698*     .. Scalar Arguments ..
699      INTEGER           ICOMP, ITRUE
700*     .. Scalars in Common ..
701      INTEGER           ICASE, INCX, INCY, MODE, N
702      LOGICAL           PASS
703*     .. Local Scalars ..
704      INTEGER           ID
705*     .. Common blocks ..
706      COMMON            /COMBLA/ICASE, N, INCX, INCY, MODE, PASS
707*     .. Executable Statements ..
708*
709      IF (ICOMP.EQ.ITRUE) GO TO 40
710*
711*                            HERE ICOMP IS NOT EQUAL TO ITRUE.
712*
713      IF ( .NOT. PASS) GO TO 20
714*                             PRINT FAIL MESSAGE AND HEADER.
715      PASS = .FALSE.
716      WRITE (NOUT,99999)
717      WRITE (NOUT,99998)
718   20 ID = ICOMP - ITRUE
719      WRITE (NOUT,99997) ICASE, N, INCX, INCY, MODE, ICOMP, ITRUE, ID
720   40 CONTINUE
721      RETURN
722*
72399999 FORMAT ('                                       FAIL')
72499998 FORMAT (/' CASE  N INCX INCY MODE                               ',
725     +       ' COMP                                TRUE     DIFFERENCE',
726     +       /1X)
72799997 FORMAT (1X,I4,I3,3I5,2I36,I12)
728      END
729