	program rms_tyc
c
	open(10,file = 'grading.tyc8',status = 'UNKNOWN')
	open(11,file = 'grading.tyc.rms',status = 'UNKNOWN')
c
	tbar0=0.
	rbar0=0.
	en0 = 0.
	t0 = 0.
	r0 = 0.
c
	t0a = 2.5 * 2.6136
	r0a = 2.5 * 0.0882
c
c	t0a = 999.
c	r0a = 999.
c
  100	read(10,901,end = 200) date,ennt,npaper,theta,rho,sep
  901	format(t2,f9.4,t24,f1.0,t29,i1,t76,f6.2,f8.4,t65,f7.2)
	sep = 1.
	sep=sep*ennt
c
c  	first detemine rms values for all measurements,
c	then for individual papers
c
  	if (abs(theta) .gt. t0a) go to 100
  	if (abs(rho) .gt. r0a) go to 100
  	en0 = en0+sep*ennt
  	t0 = t0+(theta-tbar0)*(theta-tbar0)*sep
  	r0 = r0+rho*rho*sep
c  	t0 = t0+theta
c  	r0 = r0+rho
c
  	go to 100
c
  200	t0 = sqrt(t0/en0)
  	r0 = sqrt(r0/en0)
c
c  200	t0 = (t0/en0)
c  	r0 = (r0/en0)
c
	write(11,902) en0,t0,r0
  902	format(3f12.4)
  	stop
  	end
