	PROGRAM CMP
C
C*  This program computes scores, analytic derivative and finite difference
C*  derivatives.
C
	REAL	P(3), B(3)
	REAL    scorcp(3), scorcb(3)
	db = .02
	dp = .02

	WRITE (6,*) ' Enter F, H, O, N'
	READ (5,*) frcs, hits, obs, nn
C*
	alpha = obs / FLOAT (nn)
	bias = frcs / obs
        pod = hits / obs
        rn = FLOAT (nn)
C
	WRITE (6,*) ' B, P, alpha = ', bias, pod, alpha
C
C*  Clayton skill score.
C
	P(1) = pod - dp
	P(2) = pod
	P(3) = pod + dp
	B(1) = bias - db
	B(2) = bias
	B(3) = bias + db
	DO i = 1, 3
	    ddcb = B(2) * ( 1. - alpha*B(2) )
	    ddcp = B(i) * ( 1. - alpha*B(i) )
	    scorcb(i) = ( P(i) - alpha * B(2) ) / ddcb
	    scorcp(i) = ( P(2) - alpha * B(i) ) / ddcp
	    If ( i .eq. 2 ) THEN
	        dd = B(i) * ( 1. - alpha*B(i) )
	        scor = ( P(i) - alpha * B(i) ) / dd
		dsdb = 1. / ( dd * dd )
	        dsdb = dsdb * ( 2.*alpha*P(i)*B(i) - P(i) -
     +		       alpha * alpha * B(i) * B(i) )
		dsdp = 1. / dd
		acpr = P(i)+alpha*alpha*B(i)*B(i)-2.*alpha*P(i)*B(i)
		acpr = acpr / (B(i)*(1.-alpha*B(i)))
	    END IF
	END DO
	fdsdb = (scorcp(3) - scorcp(1)) / (2.*db)
	fdsdp = (scorcb(3) - scorcb(1)) / (2.*dp)
	cprb1 = (P(2) + alpha*alpha - 2.*alpha * P(2)) / (1. - alpha)
C*
	WRITE (6,*) ' Clayton Skill Score = ', scor
	WRITE (6,*) ' Analytic dsdb = ', dsdb
	WRITE (6,*) ' Finite diff dsdb = ', fdsdb
	WRITE (6,*) ' Analytic dsdp = ', dsdp
	WRITE (6,*) ' Finite diff dsdp = ', fdsdp
	WRITE (6,*) ' CPR = ', -dsdb/dsdp
	WRITE (6,*) ' Analytic CPR = ', acpr
	WRITE (6,*) ' CPR (B=1) = ', cprb1
C*
	STOP
	END
