|
|
1.1 ! root 1: c whetstone benchmark ! 2: c single precision variant of program ! 3: common t,t1,t2,e1(4),j,k,l ! 4: t=0.499975e00 ! 5: t1=0.50025e00 ! 6: t2=2.0e00 ! 7: c execute program twice, once with loopcount i=10, and again with i=20. ! 8: i=10 ! 9: c***** start of timed interval ***** ! 10: 10 btime=secnds(0.0) ! 11: c ! 12: c******** test 1 ******** ! 13: c ! 14: isave=i ! 15: n1=0 ! 16: n2=12*i ! 17: n3=14*i ! 18: n4=345*i ! 19: n5=0 ! 20: n6=210*i ! 21: n7=32*i ! 22: n8=899*i ! 23: n9=616*i ! 24: n10=0 ! 25: n11=93*i ! 26: n12=0 ! 27: x1=1.0e0 ! 28: x2=-1.0e0 ! 29: x3=-1.0e0 ! 30: x4=-1.0e0 ! 31: if(n1)19,19,11 ! 32: 11 do 18 i=1,n1,1 ! 33: x1=(x1+x2+x3-x4)*t ! 34: x2=(x1+x2-x3+x4)*t ! 35: x4=(-x1+x2+x3+x4)*t ! 36: x3=(x1-x2+x3+x4)*t ! 37: 18 continue ! 38: 19 continue ! 39: call pout(n1,n1,n1,x1,x2,x3,x4) ! 40: c ! 41: c******** test 2 ******** ! 42: c ! 43: e1(2)=-1.0e0 ! 44: e1(3)=-1.0e0 ! 45: e1(4)=-1.0e0 ! 46: if(n2)29,29,21 ! 47: 21 do 28 i=1,n2,1 ! 48: e1(1)=(e1(1)+e1(2)+e1(3)-e1(4))*t ! 49: e1(2)=(e1(1)+e1(2)-e1(3)+e1(4))*t ! 50: e1(3)=(e1(1)-e1(2)+e1(3)+e1(4))*t ! 51: e1(4)=(-e1(1)+e1(2)+e1(3)+e1(4))*t ! 52: 28 continue ! 53: 29 continue ! 54: call pout(n2,n3,n2,e1(1),e1(2),e1(3),e1(4)) ! 55: c ! 56: c******** test 3 ******** ! 57: c ! 58: 31 do 38 i=1,n3,1 ! 59: 38 call pa(e1) ! 60: 39 continue ! 61: call pout(n3,n2,n2,e1(1),e1(2),e1(3),e1(4)) ! 62: c ! 63: c******** test 4 ******** ! 64: c ! 65: if(n4)49,49,41 ! 66: 41 do 48 i=1,n4,1 ! 67: if (j-1)43,42,43 ! 68: 42 j=2 ! 69: goto44 ! 70: 43 j=3 ! 71: 44 if(j-2)46,46,45 ! 72: 45 j=0 ! 73: goto47 ! 74: 46 j=1 ! 75: 47 if(j-1)411,412,412 ! 76: 411 j=1 ! 77: goto48 ! 78: 412 j=0 ! 79: 48 continue ! 80: 49 continue ! 81: call pout(n4,j,j,x1,x2,x3,x4) ! 82: c ! 83: c******** test 5 ******** ! 84: c ! 85: j=1 ! 86: k=2 ! 87: l=3 ! 88: if(n6)69,69,61 ! 89: 61 do 68 i=1,n6,1 ! 90: j=j*(k-j)*(l-k) ! 91: k=l*k-(l-j)*k ! 92: l=(l-k)*(k+j) ! 93: e1(l-1)=j+k+l ! 94: e1(k-1)=j+k+l ! 95: 68 continue ! 96: 69 continue ! 97: call pout(n6,j,k,e1(1),e1(2),e1(3),e1(4)) ! 98: c ! 99: c******** test 6 ******** ! 100: c ! 101: x=0.5e0 ! 102: y=0.5e0 ! 103: if(n7)79,79,71 ! 104: 71 do 78 i=1,n7,1 ! 105: x=t*atan(t2*sin(x)+cos(x)/cos(x+y)+cos(x-y)-1.0e0) ! 106: y=t*atan(t2*sin(y)+cos(y)/cos(x+y)+cos(x-y)-1.0e0) ! 107: 78 continue ! 108: 79 continue ! 109: call pout(n7,j,k,x,x,y,y) ! 110: c ! 111: c******** test 7 ******** ! 112: c ! 113: x=1.0e0 ! 114: y=1.0e0 ! 115: z=1.0e0 ! 116: if(n8)89,89,81 ! 117: 81 do 88 i=1,n8,1 ! 118: 88 call p3(x,y,z) ! 119: 89 continue ! 120: call pout(n8,j,k,x,y,z,z) ! 121: c ! 122: c******** test 8 ******** ! 123: c ! 124: j=1 ! 125: k=2 ! 126: l=3 ! 127: e1(1)=1.0e0 ! 128: e1(2)=2.0e0 ! 129: e1(3)=3.0e0 ! 130: if(n9)99,99,91 ! 131: 91 do 98 i=1,n9,1 ! 132: 98 call p0 ! 133: 99 continue ! 134: call pout(n9,j,k,e1(1),e1(2),e1(3),e1(4)) ! 135: c ! 136: c******** test 9 ******** ! 137: c ! 138: j=2 ! 139: k=3 ! 140: if(n10)109,109,101 ! 141: 101 do 108 i=1,n10,1 ! 142: j=j+k ! 143: k=j+k ! 144: j=j-k ! 145: k=k-j-j ! 146: 108 continue ! 147: 109 continue ! 148: call pout(n10,j,k,x1,x2,x3,x4) ! 149: c ! 150: c******** test 10 ******** ! 151: c ! 152: x=0.75e0 ! 153: if(n11)119,119,111 ! 154: 111 do 118 i=1,n11,1 ! 155: 118 x=sqrt(exp(alog(x)/t1)) ! 156: 119 continue ! 157: c ! 158: c******** end of timed interval ******** ! 159: c save time for loopcount i=10 and repeat for i=20 ! 160: delta=secnds(btime)-btime ! 161: if(isave.eq.20) go to 120 ! 162: time1=delta ! 163: i=20 ! 164: goto 10 ! 165: 120 time2=delta ! 166: c calculate whetstone kips ! 167: wkip=(1.0/(time2-time1))*1000 ! 168: write(6, 121) wkip ! 169: 121 format (f10.2,' whetstone kips per second.') ! 170: stop ! 171: end ! 172: ! 173: subroutine pa(e) ! 174: common t,t1,t2 ! 175: dimension e(4) ! 176: j=0 ! 177: 1 e(1)=(e(1)+e(2)+e(3)-e(4))*t ! 178: e(2)=(e(1)+e(2)-e(3)+e(4))*t ! 179: e(3)=(e(1)-e(2)+e(3)+e(4))*t ! 180: e(4)=(-e(1)+e(2)+e(3)+e(4))/t2 ! 181: j=j+1 ! 182: if(j-6)1,2,2 ! 183: 2 continue ! 184: return ! 185: end ! 186: subroutine p0 ! 187: common t,t1,t2,e1(4),j,k,l ! 188: e1(j)=e1(k) ! 189: e1(k)=e1(l) ! 190: e1(l)=e1(j) ! 191: return ! 192: end ! 193: subroutine p3(x,y,z) ! 194: common t,t1,t2 ! 195: x1=x ! 196: y1=y ! 197: x1=t*(x1+y1) ! 198: y1=t*(x1+y1) ! 199: z=(x1+y1)/t2 ! 200: return ! 201: end ! 202: subroutine pout(n,j,k,x1,x2,x3,x4) ! 203: write (6,1) n,j,k,x1,x2,x3,x4 ! 204: 1 format (1h ,3i7,4e12.4) ! 205: return ! 206: end ! 207: ! 208: subroutine prtres(wk) ! 209: return ! 210: end
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.