      subroutine subrmscor(ncor,xx,yy,cor,rms)
C....................................................July 2020
      DIMENSION	xx(372),yy(372)
C
      xav=0.
	yav=0.
	drms=0.
	do k=1,ncor
	xav=xav+xx(k)
	yav=yav+yy(k)
	drms=drms+(yy(k)-xx(k))**2
	enddo
	xav=xav/ncor
	yav=yav/ncor
	rms=sqrt(drms/ncor)
C
      dx=0.
	dy=0.
	dx2=0.
	dy2=0.
	dxy=0.
	do k=1,ncor
	dx=dx-xav
	dy=dy-yav
	dxy=dxy+dx*dy
	dx2=dx2+dx**2
      dy2=dy2+dy**2
	enddo
C
      cor=dxy/(sqrt(dy2)*sqrt(dx2))
	RETURN
	END
