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.

769 lines
30 KiB

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