      SUBROUTINE S9(NUMB,NCD)
C
C-----S9 ROUTINE FINDS THE UPPER AND LOWER LIMITS
C     OF THE X,Y VALUES IN BRAY
C
      COMMON/LIMITS/XMIN,XMAX,YMIN,YMAX
      COMMON/AR/BRAY (4,600),STRESS(200,4)
      DO 14 I=1,NCD
      X=BRAY(1,I)
      Y=BRAY(2,I)
      IF(X.GT.XMAX)XMAX=X
      IF(Y.GT.YMAX)YMAX=Y
   14 CONTINUE
      XMIN=XMAX
      YMIN=YMAX
      DO 16 I=1,NCD
      X=BRAY(1,I)
      Y=BRAY(2,I)
      IF(XMIN.GT.X)XMIN=X
      IF(YMIN.GT.Y)YMIN=Y
   16 CONTINUE
      IF(YMAX.GT.XMAX)XMAX=YMAX
      IF(XMIN.GT.YMIN)XMIN=YMIN
      XMAX=XMAX+1.
      YMAX=XMAX
      XMIN=XMIN-1.
      YMIN=XMIN
      RETURN
      END
