      SUBROUTINE SCALE(FII,NDIM,NMODES)
CDEP  
      IMPLICIT REAL (A-H,O-Z)
      DIMENSION FII(NDIM,NMODES)
      EXTERNAL DOTVEC
C     
      WRITE(6,*)'NORMALIZING MODES TO A UNIT LENGTH...'
      DO 210 J=1,NMODES
         RECIP=1/SQRT(DOTVEC(FII(1,J),FII(1,J),NDIM))
         DO 200 I=1,NDIM
            FII(I,J)=FII(I,J)*RECIP
 200     CONTINUE
 210  CONTINUE
C     
      WRITE(6,*)'CHECKING ORTHOGONALITY OF THE MODES...'
      DO 110 I=1,NMODES
         DO 100 J=I,NMODES
            PRODCT=DOTVEC(FII(1,I),FII(1,J),NDIM)
            WRITE(6,1000)I,J,PRODCT
 100     CONTINUE
 110  CONTINUE
 1000 FORMAT(5X,'MODE ',I5,' BY MODE ',I5,' = ',1P,G13.5)
      END          
