C
C *** OUTPUT OF RAYLEIGH WAVE PHASE AND GROUP VELOCITY AND 
C     AMPLITUDE SPECTRUM ON SCREEN
C
      SUBROUTINE RAYOTN(DOM,NOM,MOM,ML,NL,VS
     *                 ,CFOM,NCFOM,CC,NSMD,MMD,UU,ARK,UW0)
C
C ** INPUT DATA **
C DOM     : DELTA OMEGA
C NOM     : TOTAL NUMBER OF CIRCULAR FREQUENCY
C MOM     : NOM IN MAIN PROGRAM DIMENSION
C         : IF MOM > 2**13(=8192), CAN NOT USE IN SUBROUTINE !!!
C CFOM(I) : CUT-OFF OMEGA OF Ith MODE RAYLEIGH WAVE
C NCFOM   : NUMBER OF CUT-OFF OMEGA
C CC(I,J) : RAYLEIGH WAVE PHASE VELOCITY OF Jth MODE AT Ith OMEGA
C NSMD    : OUTPUT START RAYLEIGH MODE
C MMD     : NMD IN MAIN PROGRAM DIMENSION
C UU(I,J) : GROUP VELOCITY OF Jth MODE RAYLEIGH WAVE AT Ith OMEGA
C ARK(I,J): AMPLITUDE SPECTRUM (AL/K) OF Jth MODE RAYLEIGH WAVE 
C           AT Ith OMEGA
C UW0(I,J): AMPLITUDE RATIO ( IMAG(U0/W0 ) OF Jth MODE RAYLEIGH WAVE 
C           AT Ith OMEGA
C
      IMPLICIT REAL*8 (A-H,O-Z)
      DIMENSION CFOM(0:MMD),CC(MOM,0:MMD)
     *         ,UU(MOM,0:MMD),ARK(MOM,0:MMD),UW0(MOM,0:MMD)
     *         ,VS(ML)
      COMMON / MINMAX / VSMIN,VSMAX,CCMIN,CCMAX,MINIL,MAXIL
C
      WRITE(*,1000)
      WRITE(*,1010)NCFOM
 1000 FORMAT(/' From SUBROUTINE RAYOTN :')
 1010 FORMAT(/' Highest Mode of Cut-Off Omega =',I5)
C
      DO 100 MODE=NSMD,NCFOM
C
        CFCC=VS(NL)
        IF(MODE.EQ.0)CFCC=CCMAX
        WRITE(*,1100)MODE
        WRITE(*,1110)CFOM(MODE),CFCC
        WRITE(*,1120)
C
        IOMMAX=0
        ARKMAX=0.D0
        DO 110 IOM=1,NOM
          ARKI=DABS(ARK(IOM,MODE))
          IF(ARKI.GT.ARKMAX)THEN
          IOMMAX=IOM
          ARKMAX=ARKI
          END IF
  110   CONTINUE
C
        ICN=1
        DO 120 IOM=1,NOM
C
         OM=DOM*FLOAT(IOM)
         IF(OM.LT.CFOM(MODE))GOTO 120
         ARKRTO=ARK(IOM,MODE)/ARK(IOMMAX,MODE)
         PER=6.2831853070D0/OM
         WRITE(*,1130)ICN,OM,PER,CC(IOM,MODE),UU(IOM,MODE)
     *          ,ARK(IOM,MODE),ARKRTO,UW0(IOM,MODE),ARKRTO*UW0(IOM,MODE)
         ICN=ICN+1
C
  120   CONTINUE
C
  100 CONTINUE
C
 1100 FORMAT(//' Rayleigh Mode =',I5)
 1110 FORMAT(' Cut-Off Omega =',F10.5,',  Phase and Group Vel. =',F9.3/)
 1120 FORMAT(' Num,Omega,Period, Phase V., Group V., Amp.Spec'
     *       ,',Amp(Max=1),IMAG(U/W),Amp*(U/W)'/)
 1130 FORMAT(I3,F7.3,F7.2,F10.2,F10.2,1X,D9.3,F8.3,D13.3,F8.3)  
C
      WRITE(*,*)
C
      RETURN
      END
