C 
C *** AMPLITUDE FACTER OF MULTIPLE REFLECTION METHOD OF SH WAVE
C
      PROGRAM MML
C
C INPUT DATA  
C ** FOM    : FIRST CIRCULAR FREQUENCY ( OMEGA )
C ** DOM    : INCREMENT OF CIRCULAR FREQUENCY ( 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 ** DNS(I) : DENSITY OF Ith LAYER
C ** VS (I) : VS OF Ith LAYER
C ** DEP(I) : DEPTH ( THICKNESS ) OF Ith LAYER
C ** NL     : TOTAL NUMBER OF LAYERS
C ** ML     : NL IN MAIN PROGRAM DIMENSION
C ** THETA  : INCIDENT ANGLE OF SH WAVE ( RADIAN )
C OUTPUT DATA  
C ** AMP(I) : AMPLITUDE FACTER ON SURFACE OF Ith OMEGA ( (I-1)*DOM+FOM )
C ** SPCA(I): SPECTRUM AMPLITUDE OF AMP(I)
C
      IMPLICIT REAL*8(A-H,O-Z)
      PARAMETER(ML=50,MOM=500)
      DIMENSION DNS(ML),DEP(ML),VS(ML),QF(ML),SPCA(MOM)
      COMPLEX*16 AMP(MOM)
C
   10 CALL MLIN(FOM,DOM,NOM,DNS,VS,DEP,QF,NQF,NL,ML,THETA,NSF)
C
C *** INPUT DATA CHECK ***
C
      IF(NOM.GT.MOM)THEN
        WRITE(*,*)'NOM (omega number) > MOM !!!, MOM =',MOM
        GOTO 10
      ENDIF
      IF(NL.GT.ML)THEN
        WRITE(*,*)'NL (layer number) > ML !!!, ML =',ML
        GOTO 10
      ENDIF
C
      CALL SBML(FOM,DOM,NOM,MOM,DNS,VS,DEP,QF,NQF,NL,ML,THETA,NSF,AMP)
      CALL SPCOUT(FOM,DOM,NOM,MOM,AMP)
C
      DO 100 I=1,NOM
      SPCA(I)=CDABS(AMP(I))
  100 CONTINUE
      CALL SPAPLT(FOM,DOM,NOM,MOM,SPCA)
C
      STOP
      END
