	PROGRAM PCW ! BENCHMARK
C	PCW December 1980 pp59-61
C
C	Compile with /D_LINES (or eqvt) to include a WHILE loop
	COMMON//J
	INTEGER J,K,L
	REAL X,Y,T,ST
	DOUBLE PRECISION DX,DY
	INTEGER MATRIX(0:10)
C
	T=SECNDS(0.)
	DO 10 K=1,10000
 10	CONTINUE
	TYPE *,'Magnifier	',SECNDS(T)
C
	DO 20 K=1,10000
	DO 20 J=1,10
 20	CONTINUE
	TYPE *,'FOR loop	',SECNDS(T)
C
	J=0
D	T=SECNDS(0.)
D	DO 26 K=1,10000
D	  J=1
D	  DO 25 WHILE (J.LT.10)
D	  J=J+1
D 25	CONTINUE
D 26	CONTINUE
D	TYPE *,'WHILE loop	',SECNDS(T)
C
	IF(J.EQ.0) TYPE *,'No WHILE loop'
C
	T=SECNDS(0.)
	DO 40 K=1,10000
	  J=1
 30	  J=J+1
	  IF(J.LT.10) GOTO 30
 40	CONTINUE
	TYPE *,'GOTO loop	',SECNDS(T)
C
	T=SECNDS(0.)
	DO 50 K=1,10000
	DO 50 J=1,10
 50	L=0
	TYPE *,'Literal assign	',SECNDS(T)
C
	T=SECNDS(0.)
	DO 60 K=1,10000
	DO 60 J=1,10
 60	L=J
	TYPE *,'Memory access	',SECNDS(T)
C
	T=SECNDS(0.)
	DO 70 K=1,10000
 70	X=K/2.*3.+4.-5.
	ST=SECNDS(T)
	T=SECNDS(0.)
	DO 71 K=1,10000
 71	DX=K/2.*3.+4.-5.
	TYPE *,'Real arithmetic	',ST,'(SP)',SECNDS(T),'(DP)'
C
	T=SECNDS(0.)
	DO 80 K=1,10000
 80	X=K/FLOAT(K)*FLOAT(K)+K-K
	ST=SECNDS(T)
	T=SECNDS(0.)
	DO 81 K=1,10000
 81	DX=K/DFLOAT(K)*DFLOAT(K)+K-K
	TYPE *,'Real algebra	',ST,'(SP)',SECNDS(T),'(DP)'
C
	T=SECNDS(0.)
	MATRIX(0)=1
	DO 90 K=1,10000
	DO 90 J=1,10
 90	MATRIX(J)=MATRIX(J-1)
	TYPE *,'Vector		',SECNDS(T)
C
	T=SECNDS(0.)
	DO 100 K=1,10000
	DO 100 J=1,10
	IF(J.LT.6) THEN
	  L=1
	ELSE
	  L=0
	ENDIF
 100	CONTINUE
	TYPE *,'Equal IF	',SECNDS(T)
C
	T=SECNDS(0.)
	DO 110 K=1,10000
	DO 110 J=1,10
	IF(J.LT.2) THEN
	  L=1
	ELSE
	  L=0
	ENDIF
 110	CONTINUE
	TYPE *,'Unequal IF	',SECNDS(T)
C
	T=SECNDS(0.)
	J=0
	DO 120 K=1,10000
	  CALL NONE1
 120	CONTINUE
	TYPE *,'No parameters	',SECNDS(T)
C
	TYPE *,'No passing by value'
C
	T=SECNDS(0.)
	J=0
	DO 140 K=1,10000
	  CALL REFER1(J)
 140	CONTINUE
	TYPE *,'Reference	',SECNDS(T)
C
	T=SECNDS(0.)
	DO 150 K=1,10000
	  X=EXP(FLOAT(K)/1000.)
	  Y=SIN(FLOAT(K))
 150	CONTINUE
	ST=SECNDS(T)
	T=SECNDS(0.)
	DO 151 K=1,10000
	  DX=DEXP(DFLOAT(K)/1000.)
	  DY=DSIN(DFLOAT(K))
 151	CONTINUE
	TYPE *,'Maths		',ST,'(SP)',SECNDS(T),'(DP)'
C
	TYPE *,'End of PCW benchmark'
	END
C
	SUBROUTINE NONE5
	COMMON//J
	J=1
	RETURN
	END
	SUBROUTINE NONE4
	CALL NONE5
	RETURN
	END
	SUBROUTINE NONE3
	CALL NONE4
	RETURN
	END
	SUBROUTINE NONE2
	CALL NONE3
	RETURN
	END
	SUBROUTINE NONE1
	CALL NONE2
	RETURN
	END
C
	SUBROUTINE REFER5(I)
	I=1
	RETURN
	END
	SUBROUTINE REFER4(I)
	CALL REFER5(I)
	RETURN
	END
	SUBROUTINE REFER3(I)
	CALL REFER4(I)
	RETURN
	END
	SUBROUTINE REFER2(I)
	CALL REFER3(I)
	RETURN
	END
	SUBROUTINE REFER1(I)
	CALL REFER2(I)
	RETURN
	END
