You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1065 lines
44 KiB

  1. *> \brief \b DBLAT1
  2. *
  3. * =========== DOCUMENTATION ===========
  4. *
  5. * Online html documentation available at
  6. * http://www.netlib.org/lapack/explore-html/
  7. *
  8. * Definition:
  9. * ===========
  10. *
  11. * PROGRAM DBLAT1
  12. *
  13. *
  14. *> \par Purpose:
  15. * =============
  16. *>
  17. *> \verbatim
  18. *>
  19. *> Test program for the DOUBLE PRECISION Level 1 BLAS.
  20. *>
  21. *> Based upon the original BLAS test routine together with:
  22. *> F06EAF Example Program Text
  23. *> \endverbatim
  24. *
  25. * Authors:
  26. * ========
  27. *
  28. *> \author Univ. of Tennessee
  29. *> \author Univ. of California Berkeley
  30. *> \author Univ. of Colorado Denver
  31. *> \author NAG Ltd.
  32. *
  33. *> \date April 2012
  34. *
  35. *> \ingroup double_blas_testing
  36. *
  37. * =====================================================================
  38. PROGRAM DBLAT1
  39. *
  40. * -- Reference BLAS test routine (version 3.4.1) --
  41. * -- Reference BLAS is a software package provided by Univ. of Tennessee, --
  42. * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
  43. * April 2012
  44. *
  45. * =====================================================================
  46. *
  47. * .. Parameters ..
  48. INTEGER NOUT
  49. PARAMETER (NOUT=6)
  50. * .. Scalars in Common ..
  51. INTEGER ICASE, INCX, INCY, N
  52. LOGICAL PASS
  53. * .. Local Scalars ..
  54. DOUBLE PRECISION SFAC
  55. INTEGER IC
  56. * .. External Subroutines ..
  57. EXTERNAL CHECK0, CHECK1, CHECK2, CHECK3, HEADER
  58. * .. Common blocks ..
  59. COMMON /COMBLA/ICASE, N, INCX, INCY, PASS
  60. * .. Data statements ..
  61. DATA SFAC/9.765625D-4/
  62. * .. Executable Statements ..
  63. WRITE (NOUT,99999)
  64. DO 20 IC = 1, 13
  65. ICASE = IC
  66. CALL HEADER
  67. *
  68. * .. Initialize PASS, INCX, and INCY for a new case. ..
  69. * .. the value 9999 for INCX or INCY will appear in the ..
  70. * .. detailed output, if any, for cases that do not involve ..
  71. * .. these parameters ..
  72. *
  73. PASS = .TRUE.
  74. INCX = 9999
  75. INCY = 9999
  76. IF (ICASE.EQ.3 .OR. ICASE.EQ.11) THEN
  77. CALL CHECK0(SFAC)
  78. ELSE IF (ICASE.EQ.7 .OR. ICASE.EQ.8 .OR. ICASE.EQ.9 .OR.
  79. + ICASE.EQ.10) THEN
  80. CALL CHECK1(SFAC)
  81. ELSE IF (ICASE.EQ.1 .OR. ICASE.EQ.2 .OR. ICASE.EQ.5 .OR.
  82. + ICASE.EQ.6 .OR. ICASE.EQ.12 .OR. ICASE.EQ.13) THEN
  83. CALL CHECK2(SFAC)
  84. ELSE IF (ICASE.EQ.4) THEN
  85. CALL CHECK3(SFAC)
  86. END IF
  87. * -- Print
  88. IF (PASS) WRITE (NOUT,99998)
  89. 20 CONTINUE
  90. STOP
  91. *
  92. 99999 FORMAT (' Real BLAS Test Program Results',/1X)
  93. 99998 FORMAT (' ----- PASS -----')
  94. END
  95. SUBROUTINE HEADER
  96. * .. Parameters ..
  97. INTEGER NOUT
  98. PARAMETER (NOUT=6)
  99. * .. Scalars in Common ..
  100. INTEGER ICASE, INCX, INCY, N
  101. LOGICAL PASS
  102. * .. Local Arrays ..
  103. CHARACTER*6 L(13)
  104. * .. Common blocks ..
  105. COMMON /COMBLA/ICASE, N, INCX, INCY, PASS
  106. * .. Data statements ..
  107. DATA L(1)/' DDOT '/
  108. DATA L(2)/'DAXPY '/
  109. DATA L(3)/'DROTG '/
  110. DATA L(4)/' DROT '/
  111. DATA L(5)/'DCOPY '/
  112. DATA L(6)/'DSWAP '/
  113. DATA L(7)/'DNRM2 '/
  114. DATA L(8)/'DASUM '/
  115. DATA L(9)/'DSCAL '/
  116. DATA L(10)/'IDAMAX'/
  117. DATA L(11)/'DROTMG'/
  118. DATA L(12)/'DROTM '/
  119. DATA L(13)/'DSDOT '/
  120. * .. Executable Statements ..
  121. WRITE (NOUT,99999) ICASE, L(ICASE)
  122. RETURN
  123. *
  124. 99999 FORMAT (/' Test of subprogram number',I3,12X,A6)
  125. END
  126. SUBROUTINE CHECK0(SFAC)
  127. * .. Parameters ..
  128. INTEGER NOUT
  129. PARAMETER (NOUT=6)
  130. * .. Scalar Arguments ..
  131. DOUBLE PRECISION SFAC
  132. * .. Scalars in Common ..
  133. INTEGER ICASE, INCX, INCY, N
  134. LOGICAL PASS
  135. * .. Local Scalars ..
  136. DOUBLE PRECISION SA, SB, SC, SS, D12
  137. INTEGER I, K
  138. * .. Local Arrays ..
  139. DOUBLE PRECISION DA1(8), DATRUE(8), DB1(8), DBTRUE(8), DC1(8),
  140. $ DS1(8), DAB(4,9), DTEMP(9), DTRUE(9,9)
  141. * .. External Subroutines ..
  142. EXTERNAL DROTG, DROTMG, STEST1
  143. * .. Common blocks ..
  144. COMMON /COMBLA/ICASE, N, INCX, INCY, PASS
  145. * .. Data statements ..
  146. DATA DA1/0.3D0, 0.4D0, -0.3D0, -0.4D0, -0.3D0, 0.0D0,
  147. + 0.0D0, 1.0D0/
  148. DATA DB1/0.4D0, 0.3D0, 0.4D0, 0.3D0, -0.4D0, 0.0D0,
  149. + 1.0D0, 0.0D0/
  150. DATA DC1/0.6D0, 0.8D0, -0.6D0, 0.8D0, 0.6D0, 1.0D0,
  151. + 0.0D0, 1.0D0/
  152. DATA DS1/0.8D0, 0.6D0, 0.8D0, -0.6D0, 0.8D0, 0.0D0,
  153. + 1.0D0, 0.0D0/
  154. DATA DATRUE/0.5D0, 0.5D0, 0.5D0, -0.5D0, -0.5D0,
  155. + 0.0D0, 1.0D0, 1.0D0/
  156. DATA DBTRUE/0.0D0, 0.6D0, 0.0D0, -0.6D0, 0.0D0,
  157. + 0.0D0, 1.0D0, 0.0D0/
  158. * INPUT FOR MODIFIED GIVENS
  159. DATA DAB/ .1D0,.3D0,1.2D0,.2D0,
  160. A .7D0, .2D0, .6D0, 4.2D0,
  161. B 0.D0,0.D0,0.D0,0.D0,
  162. C 4.D0, -1.D0, 2.D0, 4.D0,
  163. D 6.D-10, 2.D-2, 1.D5, 10.D0,
  164. E 4.D10, 2.D-2, 1.D-5, 10.D0,
  165. F 2.D-10, 4.D-2, 1.D5, 10.D0,
  166. G 2.D10, 4.D-2, 1.D-5, 10.D0,
  167. H 4.D0, -2.D0, 8.D0, 4.D0 /
  168. * TRUE RESULTS FOR MODIFIED GIVENS
  169. DATA DTRUE/0.D0,0.D0, 1.3D0, .2D0, 0.D0,0.D0,0.D0, .5D0, 0.D0,
  170. A 0.D0,0.D0, 4.5D0, 4.2D0, 1.D0, .5D0, 0.D0,0.D0,0.D0,
  171. B 0.D0,0.D0,0.D0,0.D0, -2.D0, 0.D0,0.D0,0.D0,0.D0,
  172. C 0.D0,0.D0,0.D0, 4.D0, -1.D0, 0.D0,0.D0,0.D0,0.D0,
  173. D 0.D0, 15.D-3, 0.D0, 10.D0, -1.D0, 0.D0, -1.D-4,
  174. E 0.D0, 1.D0,
  175. F 0.D0,0.D0, 6144.D-5, 10.D0, -1.D0, 4096.D0, -1.D6,
  176. G 0.D0, 1.D0,
  177. H 0.D0,0.D0,15.D0,10.D0,-1.D0, 5.D-5, 0.D0,1.D0,0.D0,
  178. I 0.D0,0.D0, 15.D0, 10.D0, -1. D0, 5.D5, -4096.D0,
  179. J 1.D0, 4096.D-6,
  180. K 0.D0,0.D0, 7.D0, 4.D0, 0.D0,0.D0, -.5D0, -.25D0, 0.D0/
  181. * 4096 = 2 ** 12
  182. DATA D12 /4096.D0/
  183. DTRUE(1,1) = 12.D0 / 130.D0
  184. DTRUE(2,1) = 36.D0 / 130.D0
  185. DTRUE(7,1) = -1.D0 / 6.D0
  186. DTRUE(1,2) = 14.D0 / 75.D0
  187. DTRUE(2,2) = 49.D0 / 75.D0
  188. DTRUE(9,2) = 1.D0 / 7.D0
  189. DTRUE(1,5) = 45.D-11 * (D12 * D12)
  190. DTRUE(3,5) = 4.D5 / (3.D0 * D12)
  191. DTRUE(6,5) = 1.D0 / D12
  192. DTRUE(8,5) = 1.D4 / (3.D0 * D12)
  193. DTRUE(1,6) = 4.D10 / (1.5D0 * D12 * D12)
  194. DTRUE(2,6) = 2.D-2 / 1.5D0
  195. DTRUE(8,6) = 5.D-7 * D12
  196. DTRUE(1,7) = 4.D0 / 150.D0
  197. DTRUE(2,7) = (2.D-10 / 1.5D0) * (D12 * D12)
  198. DTRUE(7,7) = -DTRUE(6,5)
  199. DTRUE(9,7) = 1.D4 / D12
  200. DTRUE(1,8) = DTRUE(1,7)
  201. DTRUE(2,8) = 2.D10 / (1.5D0 * D12 * D12)
  202. DTRUE(1,9) = 32.D0 / 7.D0
  203. DTRUE(2,9) = -16.D0 / 7.D0
  204. * .. Executable Statements ..
  205. *
  206. * Compute true values which cannot be prestored
  207. * in decimal notation
  208. *
  209. DBTRUE(1) = 1.0D0/0.6D0
  210. DBTRUE(3) = -1.0D0/0.6D0
  211. DBTRUE(5) = 1.0D0/0.6D0
  212. *
  213. DO 20 K = 1, 8
  214. * .. Set N=K for identification in output if any ..
  215. N = K
  216. IF (ICASE.EQ.3) THEN
  217. * .. DROTG ..
  218. IF (K.GT.8) GO TO 40
  219. SA = DA1(K)
  220. SB = DB1(K)
  221. CALL DROTG(SA,SB,SC,SS)
  222. CALL STEST1(SA,DATRUE(K),DATRUE(K),SFAC)
  223. CALL STEST1(SB,DBTRUE(K),DBTRUE(K),SFAC)
  224. CALL STEST1(SC,DC1(K),DC1(K),SFAC)
  225. CALL STEST1(SS,DS1(K),DS1(K),SFAC)
  226. ELSEIF (ICASE.EQ.11) THEN
  227. * .. DROTMG ..
  228. DO I=1,4
  229. DTEMP(I)= DAB(I,K)
  230. DTEMP(I+4) = 0.0
  231. END DO
  232. DTEMP(9) = 0.0
  233. CALL DROTMG(DTEMP(1),DTEMP(2),DTEMP(3),DTEMP(4),DTEMP(5))
  234. CALL STEST(9,DTEMP,DTRUE(1,K),DTRUE(1,K),SFAC)
  235. ELSE
  236. WRITE (NOUT,*) ' Shouldn''t be here in CHECK0'
  237. STOP
  238. END IF
  239. 20 CONTINUE
  240. 40 RETURN
  241. END
  242. SUBROUTINE CHECK1(SFAC)
  243. * .. Parameters ..
  244. INTEGER NOUT
  245. PARAMETER (NOUT=6)
  246. * .. Scalar Arguments ..
  247. DOUBLE PRECISION SFAC
  248. * .. Scalars in Common ..
  249. INTEGER ICASE, INCX, INCY, N
  250. LOGICAL PASS
  251. * .. Local Scalars ..
  252. INTEGER I, LEN, NP1
  253. * .. Local Arrays ..
  254. DOUBLE PRECISION DTRUE1(5), DTRUE3(5), DTRUE5(8,5,2), DV(8,5,2),
  255. + SA(10), STEMP(1), STRUE(8), SX(8)
  256. INTEGER ITRUE2(5)
  257. * .. External Functions ..
  258. DOUBLE PRECISION DASUM, DNRM2
  259. INTEGER IDAMAX
  260. EXTERNAL DASUM, DNRM2, IDAMAX
  261. * .. External Subroutines ..
  262. EXTERNAL ITEST1, DSCAL, STEST, STEST1
  263. * .. Intrinsic Functions ..
  264. INTRINSIC MAX
  265. * .. Common blocks ..
  266. COMMON /COMBLA/ICASE, N, INCX, INCY, PASS
  267. * .. Data statements ..
  268. DATA SA/0.3D0, -1.0D0, 0.0D0, 1.0D0, 0.3D0, 0.3D0,
  269. + 0.3D0, 0.3D0, 0.3D0, 0.3D0/
  270. DATA DV/0.1D0, 2.0D0, 2.0D0, 2.0D0, 2.0D0, 2.0D0,
  271. + 2.0D0, 2.0D0, 0.3D0, 3.0D0, 3.0D0, 3.0D0, 3.0D0,
  272. + 3.0D0, 3.0D0, 3.0D0, 0.3D0, -0.4D0, 4.0D0,
  273. + 4.0D0, 4.0D0, 4.0D0, 4.0D0, 4.0D0, 0.2D0,
  274. + -0.6D0, 0.3D0, 5.0D0, 5.0D0, 5.0D0, 5.0D0,
  275. + 5.0D0, 0.1D0, -0.3D0, 0.5D0, -0.1D0, 6.0D0,
  276. + 6.0D0, 6.0D0, 6.0D0, 0.1D0, 8.0D0, 8.0D0, 8.0D0,
  277. + 8.0D0, 8.0D0, 8.0D0, 8.0D0, 0.3D0, 9.0D0, 9.0D0,
  278. + 9.0D0, 9.0D0, 9.0D0, 9.0D0, 9.0D0, 0.3D0, 2.0D0,
  279. + -0.4D0, 2.0D0, 2.0D0, 2.0D0, 2.0D0, 2.0D0,
  280. + 0.2D0, 3.0D0, -0.6D0, 5.0D0, 0.3D0, 2.0D0,
  281. + 2.0D0, 2.0D0, 0.1D0, 4.0D0, -0.3D0, 6.0D0,
  282. + -0.5D0, 7.0D0, -0.1D0, 3.0D0/
  283. DATA DTRUE1/0.0D0, 0.3D0, 0.5D0, 0.7D0, 0.6D0/
  284. DATA DTRUE3/0.0D0, 0.3D0, 0.7D0, 1.1D0, 1.0D0/
  285. DATA DTRUE5/0.10D0, 2.0D0, 2.0D0, 2.0D0, 2.0D0,
  286. + 2.0D0, 2.0D0, 2.0D0, -0.3D0, 3.0D0, 3.0D0,
  287. + 3.0D0, 3.0D0, 3.0D0, 3.0D0, 3.0D0, 0.0D0, 0.0D0,
  288. + 4.0D0, 4.0D0, 4.0D0, 4.0D0, 4.0D0, 4.0D0,
  289. + 0.20D0, -0.60D0, 0.30D0, 5.0D0, 5.0D0, 5.0D0,
  290. + 5.0D0, 5.0D0, 0.03D0, -0.09D0, 0.15D0, -0.03D0,
  291. + 6.0D0, 6.0D0, 6.0D0, 6.0D0, 0.10D0, 8.0D0,
  292. + 8.0D0, 8.0D0, 8.0D0, 8.0D0, 8.0D0, 8.0D0,
  293. + 0.09D0, 9.0D0, 9.0D0, 9.0D0, 9.0D0, 9.0D0,
  294. + 9.0D0, 9.0D0, 0.09D0, 2.0D0, -0.12D0, 2.0D0,
  295. + 2.0D0, 2.0D0, 2.0D0, 2.0D0, 0.06D0, 3.0D0,
  296. + -0.18D0, 5.0D0, 0.09D0, 2.0D0, 2.0D0, 2.0D0,
  297. + 0.03D0, 4.0D0, -0.09D0, 6.0D0, -0.15D0, 7.0D0,
  298. + -0.03D0, 3.0D0/
  299. DATA ITRUE2/0, 1, 2, 2, 3/
  300. * .. Executable Statements ..
  301. DO 80 INCX = 1, 2
  302. DO 60 NP1 = 1, 5
  303. N = NP1 - 1
  304. LEN = 2*MAX(N,1)
  305. * .. Set vector arguments ..
  306. DO 20 I = 1, LEN
  307. SX(I) = DV(I,NP1,INCX)
  308. 20 CONTINUE
  309. *
  310. IF (ICASE.EQ.7) THEN
  311. * .. DNRM2 ..
  312. STEMP(1) = DTRUE1(NP1)
  313. CALL STEST1(DNRM2(N,SX,INCX),STEMP(1),STEMP,SFAC)
  314. ELSE IF (ICASE.EQ.8) THEN
  315. * .. DASUM ..
  316. STEMP(1) = DTRUE3(NP1)
  317. CALL STEST1(DASUM(N,SX,INCX),STEMP(1),STEMP,SFAC)
  318. ELSE IF (ICASE.EQ.9) THEN
  319. * .. DSCAL ..
  320. CALL DSCAL(N,SA((INCX-1)*5+NP1),SX,INCX)
  321. DO 40 I = 1, LEN
  322. STRUE(I) = DTRUE5(I,NP1,INCX)
  323. 40 CONTINUE
  324. CALL STEST(LEN,SX,STRUE,STRUE,SFAC)
  325. ELSE IF (ICASE.EQ.10) THEN
  326. * .. IDAMAX ..
  327. CALL ITEST1(IDAMAX(N,SX,INCX),ITRUE2(NP1))
  328. ELSE
  329. WRITE (NOUT,*) ' Shouldn''t be here in CHECK1'
  330. STOP
  331. END IF
  332. 60 CONTINUE
  333. 80 CONTINUE
  334. RETURN
  335. END
  336. SUBROUTINE CHECK2(SFAC)
  337. * .. Parameters ..
  338. INTEGER NOUT
  339. PARAMETER (NOUT=6)
  340. * .. Scalar Arguments ..
  341. DOUBLE PRECISION SFAC
  342. * .. Scalars in Common ..
  343. INTEGER ICASE, INCX, INCY, N
  344. LOGICAL PASS
  345. * .. Local Scalars ..
  346. DOUBLE PRECISION SA
  347. INTEGER I, J, KI, KN, KNI, KPAR, KSIZE, LENX, LENY,
  348. $ MX, MY
  349. * .. Local Arrays ..
  350. DOUBLE PRECISION DT10X(7,4,4), DT10Y(7,4,4), DT7(4,4),
  351. $ DT8(7,4,4), DX1(7),
  352. $ DY1(7), SSIZE1(4), SSIZE2(14,2), SSIZE(7),
  353. $ STX(7), STY(7), SX(7), SY(7),
  354. $ DPAR(5,4), DT19X(7,4,16),DT19XA(7,4,4),
  355. $ DT19XB(7,4,4), DT19XC(7,4,4),DT19XD(7,4,4),
  356. $ DT19Y(7,4,16), DT19YA(7,4,4),DT19YB(7,4,4),
  357. $ DT19YC(7,4,4), DT19YD(7,4,4), DTEMP(5)
  358. INTEGER INCXS(4), INCYS(4), LENS(4,2), NS(4)
  359. * .. External Functions ..
  360. DOUBLE PRECISION DDOT, DSDOT
  361. EXTERNAL DDOT, DSDOT
  362. * .. External Subroutines ..
  363. EXTERNAL DAXPY, DCOPY, DROTM, DSWAP, STEST, STEST1
  364. * .. Intrinsic Functions ..
  365. INTRINSIC ABS, MIN
  366. * .. Common blocks ..
  367. COMMON /COMBLA/ICASE, N, INCX, INCY, PASS
  368. * .. Data statements ..
  369. EQUIVALENCE (DT19X(1,1,1),DT19XA(1,1,1)),(DT19X(1,1,5),
  370. A DT19XB(1,1,1)),(DT19X(1,1,9),DT19XC(1,1,1)),
  371. B (DT19X(1,1,13),DT19XD(1,1,1))
  372. EQUIVALENCE (DT19Y(1,1,1),DT19YA(1,1,1)),(DT19Y(1,1,5),
  373. A DT19YB(1,1,1)),(DT19Y(1,1,9),DT19YC(1,1,1)),
  374. B (DT19Y(1,1,13),DT19YD(1,1,1))
  375. DATA SA/0.3D0/
  376. DATA INCXS/1, 2, -2, -1/
  377. DATA INCYS/1, -2, 1, -2/
  378. DATA LENS/1, 1, 2, 4, 1, 1, 3, 7/
  379. DATA NS/0, 1, 2, 4/
  380. DATA DX1/0.6D0, 0.1D0, -0.5D0, 0.8D0, 0.9D0, -0.3D0,
  381. + -0.4D0/
  382. DATA DY1/0.5D0, -0.9D0, 0.3D0, 0.7D0, -0.6D0, 0.2D0,
  383. + 0.8D0/
  384. DATA DT7/0.0D0, 0.30D0, 0.21D0, 0.62D0, 0.0D0,
  385. + 0.30D0, -0.07D0, 0.85D0, 0.0D0, 0.30D0, -0.79D0,
  386. + -0.74D0, 0.0D0, 0.30D0, 0.33D0, 1.27D0/
  387. DATA DT8/0.5D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
  388. + 0.0D0, 0.68D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
  389. + 0.0D0, 0.0D0, 0.68D0, -0.87D0, 0.0D0, 0.0D0,
  390. + 0.0D0, 0.0D0, 0.0D0, 0.68D0, -0.87D0, 0.15D0,
  391. + 0.94D0, 0.0D0, 0.0D0, 0.0D0, 0.5D0, 0.0D0,
  392. + 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.68D0,
  393. + 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
  394. + 0.35D0, -0.9D0, 0.48D0, 0.0D0, 0.0D0, 0.0D0,
  395. + 0.0D0, 0.38D0, -0.9D0, 0.57D0, 0.7D0, -0.75D0,
  396. + 0.2D0, 0.98D0, 0.5D0, 0.0D0, 0.0D0, 0.0D0,
  397. + 0.0D0, 0.0D0, 0.0D0, 0.68D0, 0.0D0, 0.0D0,
  398. + 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.35D0, -0.72D0,
  399. + 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.38D0,
  400. + -0.63D0, 0.15D0, 0.88D0, 0.0D0, 0.0D0, 0.0D0,
  401. + 0.5D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
  402. + 0.68D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
  403. + 0.0D0, 0.68D0, -0.9D0, 0.33D0, 0.0D0, 0.0D0,
  404. + 0.0D0, 0.0D0, 0.68D0, -0.9D0, 0.33D0, 0.7D0,
  405. + -0.75D0, 0.2D0, 1.04D0/
  406. DATA DT10X/0.6D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
  407. + 0.0D0, 0.5D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
  408. + 0.0D0, 0.5D0, -0.9D0, 0.0D0, 0.0D0, 0.0D0,
  409. + 0.0D0, 0.0D0, 0.5D0, -0.9D0, 0.3D0, 0.7D0,
  410. + 0.0D0, 0.0D0, 0.0D0, 0.6D0, 0.0D0, 0.0D0, 0.0D0,
  411. + 0.0D0, 0.0D0, 0.0D0, 0.5D0, 0.0D0, 0.0D0, 0.0D0,
  412. + 0.0D0, 0.0D0, 0.0D0, 0.3D0, 0.1D0, 0.5D0, 0.0D0,
  413. + 0.0D0, 0.0D0, 0.0D0, 0.8D0, 0.1D0, -0.6D0,
  414. + 0.8D0, 0.3D0, -0.3D0, 0.5D0, 0.6D0, 0.0D0,
  415. + 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.5D0, 0.0D0,
  416. + 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, -0.9D0,
  417. + 0.1D0, 0.5D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.7D0,
  418. + 0.1D0, 0.3D0, 0.8D0, -0.9D0, -0.3D0, 0.5D0,
  419. + 0.6D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
  420. + 0.5D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
  421. + 0.5D0, 0.3D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
  422. + 0.5D0, 0.3D0, -0.6D0, 0.8D0, 0.0D0, 0.0D0,
  423. + 0.0D0/
  424. DATA DT10Y/0.5D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
  425. + 0.0D0, 0.6D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
  426. + 0.0D0, 0.6D0, 0.1D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
  427. + 0.0D0, 0.6D0, 0.1D0, -0.5D0, 0.8D0, 0.0D0,
  428. + 0.0D0, 0.0D0, 0.5D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
  429. + 0.0D0, 0.0D0, 0.6D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
  430. + 0.0D0, 0.0D0, -0.5D0, -0.9D0, 0.6D0, 0.0D0,
  431. + 0.0D0, 0.0D0, 0.0D0, -0.4D0, -0.9D0, 0.9D0,
  432. + 0.7D0, -0.5D0, 0.2D0, 0.6D0, 0.5D0, 0.0D0,
  433. + 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.6D0, 0.0D0,
  434. + 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, -0.5D0,
  435. + 0.6D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
  436. + -0.4D0, 0.9D0, -0.5D0, 0.6D0, 0.0D0, 0.0D0,
  437. + 0.0D0, 0.5D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
  438. + 0.0D0, 0.6D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
  439. + 0.0D0, 0.6D0, -0.9D0, 0.1D0, 0.0D0, 0.0D0,
  440. + 0.0D0, 0.0D0, 0.6D0, -0.9D0, 0.1D0, 0.7D0,
  441. + -0.5D0, 0.2D0, 0.8D0/
  442. DATA SSIZE1/0.0D0, 0.3D0, 1.6D0, 3.2D0/
  443. DATA SSIZE2/0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
  444. + 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
  445. + 0.0D0, 1.17D0, 1.17D0, 1.17D0, 1.17D0, 1.17D0,
  446. + 1.17D0, 1.17D0, 1.17D0, 1.17D0, 1.17D0, 1.17D0,
  447. + 1.17D0, 1.17D0, 1.17D0/
  448. *
  449. * FOR DROTM
  450. *
  451. DATA DPAR/-2.D0, 0.D0,0.D0,0.D0,0.D0,
  452. A -1.D0, 2.D0, -3.D0, -4.D0, 5.D0,
  453. B 0.D0, 0.D0, 2.D0, -3.D0, 0.D0,
  454. C 1.D0, 5.D0, 2.D0, 0.D0, -4.D0/
  455. * TRUE X RESULTS F0R ROTATIONS DROTM
  456. DATA DT19XA/.6D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  457. A .6D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  458. B .6D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  459. C .6D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  460. D .6D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  461. E -.8D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  462. F -.9D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  463. G 3.5D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  464. H .6D0, .1D0, 0.D0,0.D0,0.D0,0.D0,0.D0,
  465. I -.8D0, 3.8D0, 0.D0,0.D0,0.D0,0.D0,0.D0,
  466. J -.9D0, 2.8D0, 0.D0,0.D0,0.D0,0.D0,0.D0,
  467. K 3.5D0, -.4D0, 0.D0,0.D0,0.D0,0.D0,0.D0,
  468. L .6D0, .1D0, -.5D0, .8D0, 0.D0,0.D0,0.D0,
  469. M -.8D0, 3.8D0, -2.2D0, -1.2D0, 0.D0,0.D0,0.D0,
  470. N -.9D0, 2.8D0, -1.4D0, -1.3D0, 0.D0,0.D0,0.D0,
  471. O 3.5D0, -.4D0, -2.2D0, 4.7D0, 0.D0,0.D0,0.D0/
  472. *
  473. DATA DT19XB/.6D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  474. A .6D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  475. B .6D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  476. C .6D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  477. D .6D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  478. E -.8D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  479. F -.9D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  480. G 3.5D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  481. H .6D0, .1D0, -.5D0, 0.D0,0.D0,0.D0,0.D0,
  482. I 0.D0, .1D0, -3.0D0, 0.D0,0.D0,0.D0,0.D0,
  483. J -.3D0, .1D0, -2.0D0, 0.D0,0.D0,0.D0,0.D0,
  484. K 3.3D0, .1D0, -2.0D0, 0.D0,0.D0,0.D0,0.D0,
  485. L .6D0, .1D0, -.5D0, .8D0, .9D0, -.3D0, -.4D0,
  486. M -2.0D0, .1D0, 1.4D0, .8D0, .6D0, -.3D0, -2.8D0,
  487. N -1.8D0, .1D0, 1.3D0, .8D0, 0.D0, -.3D0, -1.9D0,
  488. O 3.8D0, .1D0, -3.1D0, .8D0, 4.8D0, -.3D0, -1.5D0 /
  489. *
  490. DATA DT19XC/.6D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  491. A .6D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  492. B .6D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  493. C .6D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  494. D .6D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  495. E -.8D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  496. F -.9D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  497. G 3.5D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  498. H .6D0, .1D0, -.5D0, 0.D0,0.D0,0.D0,0.D0,
  499. I 4.8D0, .1D0, -3.0D0, 0.D0,0.D0,0.D0,0.D0,
  500. J 3.3D0, .1D0, -2.0D0, 0.D0,0.D0,0.D0,0.D0,
  501. K 2.1D0, .1D0, -2.0D0, 0.D0,0.D0,0.D0,0.D0,
  502. L .6D0, .1D0, -.5D0, .8D0, .9D0, -.3D0, -.4D0,
  503. M -1.6D0, .1D0, -2.2D0, .8D0, 5.4D0, -.3D0, -2.8D0,
  504. N -1.5D0, .1D0, -1.4D0, .8D0, 3.6D0, -.3D0, -1.9D0,
  505. O 3.7D0, .1D0, -2.2D0, .8D0, 3.6D0, -.3D0, -1.5D0 /
  506. *
  507. DATA DT19XD/.6D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  508. A .6D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  509. B .6D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  510. C .6D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  511. D .6D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  512. E -.8D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  513. F -.9D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  514. G 3.5D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  515. H .6D0, .1D0, 0.D0,0.D0,0.D0,0.D0,0.D0,
  516. I -.8D0, -1.0D0, 0.D0,0.D0,0.D0,0.D0,0.D0,
  517. J -.9D0, -.8D0, 0.D0,0.D0,0.D0,0.D0,0.D0,
  518. K 3.5D0, .8D0, 0.D0,0.D0,0.D0,0.D0,0.D0,
  519. L .6D0, .1D0, -.5D0, .8D0, 0.D0,0.D0,0.D0,
  520. M -.8D0, -1.0D0, 1.4D0, -1.6D0, 0.D0,0.D0,0.D0,
  521. N -.9D0, -.8D0, 1.3D0, -1.6D0, 0.D0,0.D0,0.D0,
  522. O 3.5D0, .8D0, -3.1D0, 4.8D0, 0.D0,0.D0,0.D0/
  523. * TRUE Y RESULTS FOR ROTATIONS DROTM
  524. DATA DT19YA/.5D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  525. A .5D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  526. B .5D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  527. C .5D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  528. D .5D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  529. E .7D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  530. F 1.7D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  531. G -2.6D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  532. H .5D0, -.9D0, 0.D0,0.D0,0.D0,0.D0,0.D0,
  533. I .7D0, -4.8D0, 0.D0,0.D0,0.D0,0.D0,0.D0,
  534. J 1.7D0, -.7D0, 0.D0,0.D0,0.D0,0.D0,0.D0,
  535. K -2.6D0, 3.5D0, 0.D0,0.D0,0.D0,0.D0,0.D0,
  536. L .5D0, -.9D0, .3D0, .7D0, 0.D0,0.D0,0.D0,
  537. M .7D0, -4.8D0, 3.0D0, 1.1D0, 0.D0,0.D0,0.D0,
  538. N 1.7D0, -.7D0, -.7D0, 2.3D0, 0.D0,0.D0,0.D0,
  539. O -2.6D0, 3.5D0, -.7D0, -3.6D0, 0.D0,0.D0,0.D0/
  540. *
  541. DATA DT19YB/.5D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  542. A .5D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  543. B .5D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  544. C .5D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  545. D .5D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  546. E .7D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  547. F 1.7D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  548. G -2.6D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  549. H .5D0, -.9D0, .3D0, 0.D0,0.D0,0.D0,0.D0,
  550. I 4.0D0, -.9D0, -.3D0, 0.D0,0.D0,0.D0,0.D0,
  551. J -.5D0, -.9D0, 1.5D0, 0.D0,0.D0,0.D0,0.D0,
  552. K -1.5D0, -.9D0, -1.8D0, 0.D0,0.D0,0.D0,0.D0,
  553. L .5D0, -.9D0, .3D0, .7D0, -.6D0, .2D0, .8D0,
  554. M 3.7D0, -.9D0, -1.2D0, .7D0, -1.5D0, .2D0, 2.2D0,
  555. N -.3D0, -.9D0, 2.1D0, .7D0, -1.6D0, .2D0, 2.0D0,
  556. O -1.6D0, -.9D0, -2.1D0, .7D0, 2.9D0, .2D0, -3.8D0 /
  557. *
  558. DATA DT19YC/.5D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  559. A .5D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  560. B .5D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  561. C .5D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  562. D .5D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  563. E .7D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  564. F 1.7D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  565. G -2.6D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  566. H .5D0, -.9D0, 0.D0,0.D0,0.D0,0.D0,0.D0,
  567. I 4.0D0, -6.3D0, 0.D0,0.D0,0.D0,0.D0,0.D0,
  568. J -.5D0, .3D0, 0.D0,0.D0,0.D0,0.D0,0.D0,
  569. K -1.5D0, 3.0D0, 0.D0,0.D0,0.D0,0.D0,0.D0,
  570. L .5D0, -.9D0, .3D0, .7D0, 0.D0,0.D0,0.D0,
  571. M 3.7D0, -7.2D0, 3.0D0, 1.7D0, 0.D0,0.D0,0.D0,
  572. N -.3D0, .9D0, -.7D0, 1.9D0, 0.D0,0.D0,0.D0,
  573. O -1.6D0, 2.7D0, -.7D0, -3.4D0, 0.D0,0.D0,0.D0/
  574. *
  575. DATA DT19YD/.5D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  576. A .5D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  577. B .5D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  578. C .5D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  579. D .5D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  580. E .7D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  581. F 1.7D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  582. G -2.6D0, 0.D0,0.D0,0.D0,0.D0,0.D0,0.D0,
  583. H .5D0, -.9D0, .3D0, 0.D0,0.D0,0.D0,0.D0,
  584. I .7D0, -.9D0, 1.2D0, 0.D0,0.D0,0.D0,0.D0,
  585. J 1.7D0, -.9D0, .5D0, 0.D0,0.D0,0.D0,0.D0,
  586. K -2.6D0, -.9D0, -1.3D0, 0.D0,0.D0,0.D0,0.D0,
  587. L .5D0, -.9D0, .3D0, .7D0, -.6D0, .2D0, .8D0,
  588. M .7D0, -.9D0, 1.2D0, .7D0, -1.5D0, .2D0, 1.6D0,
  589. N 1.7D0, -.9D0, .5D0, .7D0, -1.6D0, .2D0, 2.4D0,
  590. O -2.6D0, -.9D0, -1.3D0, .7D0, 2.9D0, .2D0, -4.0D0 /
  591. *
  592. * .. Executable Statements ..
  593. *
  594. DO 120 KI = 1, 4
  595. INCX = INCXS(KI)
  596. INCY = INCYS(KI)
  597. MX = ABS(INCX)
  598. MY = ABS(INCY)
  599. *
  600. DO 100 KN = 1, 4
  601. N = NS(KN)
  602. KSIZE = MIN(2,KN)
  603. LENX = LENS(KN,MX)
  604. LENY = LENS(KN,MY)
  605. * .. Initialize all argument arrays ..
  606. DO 20 I = 1, 7
  607. SX(I) = DX1(I)
  608. SY(I) = DY1(I)
  609. 20 CONTINUE
  610. *
  611. IF (ICASE.EQ.1) THEN
  612. * .. DDOT ..
  613. CALL STEST1(DDOT(N,SX,INCX,SY,INCY),DT7(KN,KI),SSIZE1(KN)
  614. + ,SFAC)
  615. ELSE IF (ICASE.EQ.2) THEN
  616. * .. DAXPY ..
  617. CALL DAXPY(N,SA,SX,INCX,SY,INCY)
  618. DO 40 J = 1, LENY
  619. STY(J) = DT8(J,KN,KI)
  620. 40 CONTINUE
  621. CALL STEST(LENY,SY,STY,SSIZE2(1,KSIZE),SFAC)
  622. ELSE IF (ICASE.EQ.5) THEN
  623. * .. DCOPY ..
  624. DO 60 I = 1, 7
  625. STY(I) = DT10Y(I,KN,KI)
  626. 60 CONTINUE
  627. CALL DCOPY(N,SX,INCX,SY,INCY)
  628. CALL STEST(LENY,SY,STY,SSIZE2(1,1),1.0D0)
  629. ELSE IF (ICASE.EQ.6) THEN
  630. * .. DSWAP ..
  631. CALL DSWAP(N,SX,INCX,SY,INCY)
  632. DO 80 I = 1, 7
  633. STX(I) = DT10X(I,KN,KI)
  634. STY(I) = DT10Y(I,KN,KI)
  635. 80 CONTINUE
  636. CALL STEST(LENX,SX,STX,SSIZE2(1,1),1.0D0)
  637. CALL STEST(LENY,SY,STY,SSIZE2(1,1),1.0D0)
  638. ELSE IF (ICASE.EQ.12) THEN
  639. * .. DROTM ..
  640. KNI=KN+4*(KI-1)
  641. DO KPAR=1,4
  642. DO I=1,7
  643. SX(I) = DX1(I)
  644. SY(I) = DY1(I)
  645. STX(I)= DT19X(I,KPAR,KNI)
  646. STY(I)= DT19Y(I,KPAR,KNI)
  647. END DO
  648. *
  649. DO I=1,5
  650. DTEMP(I) = DPAR(I,KPAR)
  651. END DO
  652. *
  653. DO I=1,LENX
  654. SSIZE(I)=STX(I)
  655. END DO
  656. * SEE REMARK ABOVE ABOUT DT11X(1,2,7)
  657. * AND DT11X(5,3,8).
  658. IF ((KPAR .EQ. 2) .AND. (KNI .EQ. 7))
  659. $ SSIZE(1) = 2.4D0
  660. IF ((KPAR .EQ. 3) .AND. (KNI .EQ. 8))
  661. $ SSIZE(5) = 1.8D0
  662. *
  663. CALL DROTM(N,SX,INCX,SY,INCY,DTEMP)
  664. CALL STEST(LENX,SX,STX,SSIZE,SFAC)
  665. CALL STEST(LENY,SY,STY,STY,SFAC)
  666. END DO
  667. ELSE IF (ICASE.EQ.13) THEN
  668. * .. DSDOT ..
  669. CALL TESTDSDOT(REAL(DSDOT(N,REAL(SX),INCX,REAL(SY),INCY)),
  670. $ REAL(DT7(KN,KI)),REAL(SSIZE1(KN)), .3125E-1)
  671. ELSE
  672. WRITE (NOUT,*) ' Shouldn''t be here in CHECK2'
  673. STOP
  674. END IF
  675. 100 CONTINUE
  676. 120 CONTINUE
  677. RETURN
  678. END
  679. SUBROUTINE CHECK3(SFAC)
  680. * .. Parameters ..
  681. INTEGER NOUT
  682. PARAMETER (NOUT=6)
  683. * .. Scalar Arguments ..
  684. DOUBLE PRECISION SFAC
  685. * .. Scalars in Common ..
  686. INTEGER ICASE, INCX, INCY, N
  687. LOGICAL PASS
  688. * .. Local Scalars ..
  689. DOUBLE PRECISION SC, SS
  690. INTEGER I, K, KI, KN, KSIZE, LENX, LENY, MX, MY
  691. * .. Local Arrays ..
  692. DOUBLE PRECISION COPYX(5), COPYY(5), DT9X(7,4,4), DT9Y(7,4,4),
  693. + DX1(7), DY1(7), MWPC(11), MWPS(11), MWPSTX(5),
  694. + MWPSTY(5), MWPTX(11,5), MWPTY(11,5), MWPX(5),
  695. + MWPY(5), SSIZE2(14,2), STX(7), STY(7), SX(7),
  696. + SY(7)
  697. INTEGER INCXS(4), INCYS(4), LENS(4,2), MWPINX(11),
  698. + MWPINY(11), MWPN(11), NS(4)
  699. * .. External Subroutines ..
  700. EXTERNAL DROT, STEST
  701. * .. Intrinsic Functions ..
  702. INTRINSIC ABS, MIN
  703. * .. Common blocks ..
  704. COMMON /COMBLA/ICASE, N, INCX, INCY, PASS
  705. * .. Data statements ..
  706. DATA INCXS/1, 2, -2, -1/
  707. DATA INCYS/1, -2, 1, -2/
  708. DATA LENS/1, 1, 2, 4, 1, 1, 3, 7/
  709. DATA NS/0, 1, 2, 4/
  710. DATA DX1/0.6D0, 0.1D0, -0.5D0, 0.8D0, 0.9D0, -0.3D0,
  711. + -0.4D0/
  712. DATA DY1/0.5D0, -0.9D0, 0.3D0, 0.7D0, -0.6D0, 0.2D0,
  713. + 0.8D0/
  714. DATA SC, SS/0.8D0, 0.6D0/
  715. DATA DT9X/0.6D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
  716. + 0.0D0, 0.78D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
  717. + 0.0D0, 0.0D0, 0.78D0, -0.46D0, 0.0D0, 0.0D0,
  718. + 0.0D0, 0.0D0, 0.0D0, 0.78D0, -0.46D0, -0.22D0,
  719. + 1.06D0, 0.0D0, 0.0D0, 0.0D0, 0.6D0, 0.0D0,
  720. + 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.78D0,
  721. + 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
  722. + 0.66D0, 0.1D0, -0.1D0, 0.0D0, 0.0D0, 0.0D0,
  723. + 0.0D0, 0.96D0, 0.1D0, -0.76D0, 0.8D0, 0.90D0,
  724. + -0.3D0, -0.02D0, 0.6D0, 0.0D0, 0.0D0, 0.0D0,
  725. + 0.0D0, 0.0D0, 0.0D0, 0.78D0, 0.0D0, 0.0D0,
  726. + 0.0D0, 0.0D0, 0.0D0, 0.0D0, -0.06D0, 0.1D0,
  727. + -0.1D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.90D0,
  728. + 0.1D0, -0.22D0, 0.8D0, 0.18D0, -0.3D0, -0.02D0,
  729. + 0.6D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
  730. + 0.78D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
  731. + 0.0D0, 0.78D0, 0.26D0, 0.0D0, 0.0D0, 0.0D0,
  732. + 0.0D0, 0.0D0, 0.78D0, 0.26D0, -0.76D0, 1.12D0,
  733. + 0.0D0, 0.0D0, 0.0D0/
  734. DATA DT9Y/0.5D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
  735. + 0.0D0, 0.04D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
  736. + 0.0D0, 0.0D0, 0.04D0, -0.78D0, 0.0D0, 0.0D0,
  737. + 0.0D0, 0.0D0, 0.0D0, 0.04D0, -0.78D0, 0.54D0,
  738. + 0.08D0, 0.0D0, 0.0D0, 0.0D0, 0.5D0, 0.0D0,
  739. + 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.04D0,
  740. + 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.7D0,
  741. + -0.9D0, -0.12D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
  742. + 0.64D0, -0.9D0, -0.30D0, 0.7D0, -0.18D0, 0.2D0,
  743. + 0.28D0, 0.5D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
  744. + 0.0D0, 0.0D0, 0.04D0, 0.0D0, 0.0D0, 0.0D0,
  745. + 0.0D0, 0.0D0, 0.0D0, 0.7D0, -1.08D0, 0.0D0,
  746. + 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.64D0, -1.26D0,
  747. + 0.54D0, 0.20D0, 0.0D0, 0.0D0, 0.0D0, 0.5D0,
  748. + 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
  749. + 0.04D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
  750. + 0.0D0, 0.04D0, -0.9D0, 0.18D0, 0.0D0, 0.0D0,
  751. + 0.0D0, 0.0D0, 0.04D0, -0.9D0, 0.18D0, 0.7D0,
  752. + -0.18D0, 0.2D0, 0.16D0/
  753. DATA SSIZE2/0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
  754. + 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0, 0.0D0,
  755. + 0.0D0, 1.17D0, 1.17D0, 1.17D0, 1.17D0, 1.17D0,
  756. + 1.17D0, 1.17D0, 1.17D0, 1.17D0, 1.17D0, 1.17D0,
  757. + 1.17D0, 1.17D0, 1.17D0/
  758. * .. Executable Statements ..
  759. *
  760. DO 60 KI = 1, 4
  761. INCX = INCXS(KI)
  762. INCY = INCYS(KI)
  763. MX = ABS(INCX)
  764. MY = ABS(INCY)
  765. *
  766. DO 40 KN = 1, 4
  767. N = NS(KN)
  768. KSIZE = MIN(2,KN)
  769. LENX = LENS(KN,MX)
  770. LENY = LENS(KN,MY)
  771. *
  772. IF (ICASE.EQ.4) THEN
  773. * .. DROT ..
  774. DO 20 I = 1, 7
  775. SX(I) = DX1(I)
  776. SY(I) = DY1(I)
  777. STX(I) = DT9X(I,KN,KI)
  778. STY(I) = DT9Y(I,KN,KI)
  779. 20 CONTINUE
  780. CALL DROT(N,SX,INCX,SY,INCY,SC,SS)
  781. CALL STEST(LENX,SX,STX,SSIZE2(1,KSIZE),SFAC)
  782. CALL STEST(LENY,SY,STY,SSIZE2(1,KSIZE),SFAC)
  783. ELSE
  784. WRITE (NOUT,*) ' Shouldn''t be here in CHECK3'
  785. STOP
  786. END IF
  787. 40 CONTINUE
  788. 60 CONTINUE
  789. *
  790. MWPC(1) = 1
  791. DO 80 I = 2, 11
  792. MWPC(I) = 0
  793. 80 CONTINUE
  794. MWPS(1) = 0
  795. DO 100 I = 2, 6
  796. MWPS(I) = 1
  797. 100 CONTINUE
  798. DO 120 I = 7, 11
  799. MWPS(I) = -1
  800. 120 CONTINUE
  801. MWPINX(1) = 1
  802. MWPINX(2) = 1
  803. MWPINX(3) = 1
  804. MWPINX(4) = -1
  805. MWPINX(5) = 1
  806. MWPINX(6) = -1
  807. MWPINX(7) = 1
  808. MWPINX(8) = 1
  809. MWPINX(9) = -1
  810. MWPINX(10) = 1
  811. MWPINX(11) = -1
  812. MWPINY(1) = 1
  813. MWPINY(2) = 1
  814. MWPINY(3) = -1
  815. MWPINY(4) = -1
  816. MWPINY(5) = 2
  817. MWPINY(6) = 1
  818. MWPINY(7) = 1
  819. MWPINY(8) = -1
  820. MWPINY(9) = -1
  821. MWPINY(10) = 2
  822. MWPINY(11) = 1
  823. DO 140 I = 1, 11
  824. MWPN(I) = 5
  825. 140 CONTINUE
  826. MWPN(5) = 3
  827. MWPN(10) = 3
  828. DO 160 I = 1, 5
  829. MWPX(I) = I
  830. MWPY(I) = I
  831. MWPTX(1,I) = I
  832. MWPTY(1,I) = I
  833. MWPTX(2,I) = I
  834. MWPTY(2,I) = -I
  835. MWPTX(3,I) = 6 - I
  836. MWPTY(3,I) = I - 6
  837. MWPTX(4,I) = I
  838. MWPTY(4,I) = -I
  839. MWPTX(6,I) = 6 - I
  840. MWPTY(6,I) = I - 6
  841. MWPTX(7,I) = -I
  842. MWPTY(7,I) = I
  843. MWPTX(8,I) = I - 6
  844. MWPTY(8,I) = 6 - I
  845. MWPTX(9,I) = -I
  846. MWPTY(9,I) = I
  847. MWPTX(11,I) = I - 6
  848. MWPTY(11,I) = 6 - I
  849. 160 CONTINUE
  850. MWPTX(5,1) = 1
  851. MWPTX(5,2) = 3
  852. MWPTX(5,3) = 5
  853. MWPTX(5,4) = 4
  854. MWPTX(5,5) = 5
  855. MWPTY(5,1) = -1
  856. MWPTY(5,2) = 2
  857. MWPTY(5,3) = -2
  858. MWPTY(5,4) = 4
  859. MWPTY(5,5) = -3
  860. MWPTX(10,1) = -1
  861. MWPTX(10,2) = -3
  862. MWPTX(10,3) = -5
  863. MWPTX(10,4) = 4
  864. MWPTX(10,5) = 5
  865. MWPTY(10,1) = 1
  866. MWPTY(10,2) = 2
  867. MWPTY(10,3) = 2
  868. MWPTY(10,4) = 4
  869. MWPTY(10,5) = 3
  870. DO 200 I = 1, 11
  871. INCX = MWPINX(I)
  872. INCY = MWPINY(I)
  873. DO 180 K = 1, 5
  874. COPYX(K) = MWPX(K)
  875. COPYY(K) = MWPY(K)
  876. MWPSTX(K) = MWPTX(I,K)
  877. MWPSTY(K) = MWPTY(I,K)
  878. 180 CONTINUE
  879. CALL DROT(MWPN(I),COPYX,INCX,COPYY,INCY,MWPC(I),MWPS(I))
  880. CALL STEST(5,COPYX,MWPSTX,MWPSTX,SFAC)
  881. CALL STEST(5,COPYY,MWPSTY,MWPSTY,SFAC)
  882. 200 CONTINUE
  883. RETURN
  884. END
  885. SUBROUTINE STEST(LEN,SCOMP,STRUE,SSIZE,SFAC)
  886. * ********************************* STEST **************************
  887. *
  888. * THIS SUBR COMPARES ARRAYS SCOMP() AND STRUE() OF LENGTH LEN TO
  889. * SEE IF THE TERM BY TERM DIFFERENCES, MULTIPLIED BY SFAC, ARE
  890. * NEGLIGIBLE.
  891. *
  892. * C. L. LAWSON, JPL, 1974 DEC 10
  893. *
  894. * .. Parameters ..
  895. INTEGER NOUT
  896. DOUBLE PRECISION ZERO
  897. PARAMETER (NOUT=6, ZERO=0.0D0)
  898. * .. Scalar Arguments ..
  899. DOUBLE PRECISION SFAC
  900. INTEGER LEN
  901. * .. Array Arguments ..
  902. DOUBLE PRECISION SCOMP(LEN), SSIZE(LEN), STRUE(LEN)
  903. * .. Scalars in Common ..
  904. INTEGER ICASE, INCX, INCY, N
  905. LOGICAL PASS
  906. * .. Local Scalars ..
  907. DOUBLE PRECISION SD
  908. INTEGER I
  909. * .. External Functions ..
  910. DOUBLE PRECISION SDIFF
  911. EXTERNAL SDIFF
  912. * .. Intrinsic Functions ..
  913. INTRINSIC ABS
  914. * .. Common blocks ..
  915. COMMON /COMBLA/ICASE, N, INCX, INCY, PASS
  916. * .. Executable Statements ..
  917. *
  918. DO 40 I = 1, LEN
  919. SD = SCOMP(I) - STRUE(I)
  920. IF (ABS(SFAC*SD) .LE. ABS(SSIZE(I))*EPSILON(ZERO))
  921. + GO TO 40
  922. *
  923. * HERE SCOMP(I) IS NOT CLOSE TO STRUE(I).
  924. *
  925. IF ( .NOT. PASS) GO TO 20
  926. * PRINT FAIL MESSAGE AND HEADER.
  927. PASS = .FALSE.
  928. WRITE (NOUT,99999)
  929. WRITE (NOUT,99998)
  930. 20 WRITE (NOUT,99997) ICASE, N, INCX, INCY, I, SCOMP(I),
  931. + STRUE(I), SD, SSIZE(I)
  932. 40 CONTINUE
  933. RETURN
  934. *
  935. 99999 FORMAT (' FAIL')
  936. 99998 FORMAT (/' CASE N INCX INCY I ',
  937. + ' COMP(I) TRUE(I) DIFFERENCE',
  938. + ' SIZE(I)',/1X)
  939. 99997 FORMAT (1X,I4,I3,2I5,I3,2D36.8,2D12.4)
  940. END
  941. SUBROUTINE TESTDSDOT(SCOMP,STRUE,SSIZE,SFAC)
  942. * ********************************* STEST **************************
  943. *
  944. * THIS SUBR COMPARES ARRAYS SCOMP() AND STRUE() OF LENGTH LEN TO
  945. * SEE IF THE TERM BY TERM DIFFERENCES, MULTIPLIED BY SFAC, ARE
  946. * NEGLIGIBLE.
  947. *
  948. * C. L. LAWSON, JPL, 1974 DEC 10
  949. *
  950. * .. Parameters ..
  951. INTEGER NOUT
  952. REAL ZERO
  953. PARAMETER (NOUT=6, ZERO=0.0E0)
  954. * .. Scalar Arguments ..
  955. REAL SFAC, SCOMP, SSIZE, STRUE
  956. * .. Scalars in Common ..
  957. INTEGER ICASE, INCX, INCY, N
  958. LOGICAL PASS
  959. * .. Local Scalars ..
  960. REAL SD
  961. * .. Intrinsic Functions ..
  962. INTRINSIC ABS
  963. * .. Common blocks ..
  964. COMMON /COMBLA/ICASE, N, INCX, INCY, PASS
  965. * .. Executable Statements ..
  966. *
  967. SD = SCOMP - STRUE
  968. IF (ABS(SFAC*SD) .LE. ABS(SSIZE) * EPSILON(ZERO))
  969. + GO TO 40
  970. *
  971. * HERE SCOMP(I) IS NOT CLOSE TO STRUE(I).
  972. *
  973. IF ( .NOT. PASS) GO TO 20
  974. * PRINT FAIL MESSAGE AND HEADER.
  975. PASS = .FALSE.
  976. WRITE (NOUT,99999)
  977. WRITE (NOUT,99998)
  978. 20 WRITE (NOUT,99997) ICASE, N, INCX, INCY, SCOMP,
  979. + STRUE, SD, SSIZE
  980. 40 CONTINUE
  981. RETURN
  982. *
  983. 99999 FORMAT (' FAIL')
  984. 99998 FORMAT (/' CASE N INCX INCY ',
  985. + ' COMP(I) TRUE(I) DIFFERENCE',
  986. + ' SIZE(I)',/1X)
  987. 99997 FORMAT (1X,I4,I3,1I5,I3,2E36.8,2E12.4)
  988. END
  989. SUBROUTINE STEST1(SCOMP1,STRUE1,SSIZE,SFAC)
  990. * ************************* STEST1 *****************************
  991. *
  992. * THIS IS AN INTERFACE SUBROUTINE TO ACCOMODATE THE FORTRAN
  993. * REQUIREMENT THAT WHEN A DUMMY ARGUMENT IS AN ARRAY, THE
  994. * ACTUAL ARGUMENT MUST ALSO BE AN ARRAY OR AN ARRAY ELEMENT.
  995. *
  996. * C.L. LAWSON, JPL, 1978 DEC 6
  997. *
  998. * .. Scalar Arguments ..
  999. DOUBLE PRECISION SCOMP1, SFAC, STRUE1
  1000. * .. Array Arguments ..
  1001. DOUBLE PRECISION SSIZE(*)
  1002. * .. Local Arrays ..
  1003. DOUBLE PRECISION SCOMP(1), STRUE(1)
  1004. * .. External Subroutines ..
  1005. EXTERNAL STEST
  1006. * .. Executable Statements ..
  1007. *
  1008. SCOMP(1) = SCOMP1
  1009. STRUE(1) = STRUE1
  1010. CALL STEST(1,SCOMP,STRUE,SSIZE,SFAC)
  1011. *
  1012. RETURN
  1013. END
  1014. DOUBLE PRECISION FUNCTION SDIFF(SA,SB)
  1015. * ********************************* SDIFF **************************
  1016. * COMPUTES DIFFERENCE OF TWO NUMBERS. C. L. LAWSON, JPL 1974 FEB 15
  1017. *
  1018. * .. Scalar Arguments ..
  1019. DOUBLE PRECISION SA, SB
  1020. * .. Executable Statements ..
  1021. SDIFF = SA - SB
  1022. RETURN
  1023. END
  1024. SUBROUTINE ITEST1(ICOMP,ITRUE)
  1025. * ********************************* ITEST1 *************************
  1026. *
  1027. * THIS SUBROUTINE COMPARES THE VARIABLES ICOMP AND ITRUE FOR
  1028. * EQUALITY.
  1029. * C. L. LAWSON, JPL, 1974 DEC 10
  1030. *
  1031. * .. Parameters ..
  1032. INTEGER NOUT
  1033. PARAMETER (NOUT=6)
  1034. * .. Scalar Arguments ..
  1035. INTEGER ICOMP, ITRUE
  1036. * .. Scalars in Common ..
  1037. INTEGER ICASE, INCX, INCY, N
  1038. LOGICAL PASS
  1039. * .. Local Scalars ..
  1040. INTEGER ID
  1041. * .. Common blocks ..
  1042. COMMON /COMBLA/ICASE, N, INCX, INCY, PASS
  1043. * .. Executable Statements ..
  1044. *
  1045. IF (ICOMP.EQ.ITRUE) GO TO 40
  1046. *
  1047. * HERE ICOMP IS NOT EQUAL TO ITRUE.
  1048. *
  1049. IF ( .NOT. PASS) GO TO 20
  1050. * PRINT FAIL MESSAGE AND HEADER.
  1051. PASS = .FALSE.
  1052. WRITE (NOUT,99999)
  1053. WRITE (NOUT,99998)
  1054. 20 ID = ICOMP - ITRUE
  1055. WRITE (NOUT,99997) ICASE, N, INCX, INCY, ICOMP, ITRUE, ID
  1056. 40 CONTINUE
  1057. RETURN
  1058. *
  1059. 99999 FORMAT (' FAIL')
  1060. 99998 FORMAT (/' CASE N INCX INCY ',
  1061. + ' COMP TRUE DIFFERENCE',
  1062. + /1X)
  1063. 99997 FORMAT (1X,I4,I3,2I5,2I36,I12)
  1064. END