C
C *** READ OF SOIL DATA FROM DATA FILE
C 
      SUBROUTINE SOILIN(FOM,DOM,NOM,DNS,VS,DEP,QF,NQF,NL,ML,THETA,NSF)
C
C ** FOM    : FIRST CIRCULAR FREQUENCY ( OMEGA )
C ** DOM    : INCREMENT OF CIRCULAR FREQUENCY ( DELTA OMEGA )
C ** NOM    : TOTAL NUMBER OF CIRCULAR FREQUENCY
C ** DNS(I) : DENSITY OF Ith LAYER
C ** VS (I) : VS OF Ith LAYER
C ** DEP(I) : DEPTH ( THICKNESS ) OF Ith LAYER
C ** QF(I)  : QUALITY FACTER = 1/(2*H)
C ** NQF    : = 1 : QF ENTER,   = 0 : QF NOT NOT ENTER
C ** NL     : TOTAL NUMBER OF LAYERS
C ** ML     : NL IN MAIN PROGRAM DIMENSION
C ** THETA  : INCIDENT ANGLE OF SH WAVE ( DEGREE --> RADIAN )
C ** NSF    : =1:OUTPUT POINT IS ON SURFACE, =0:OUTPUT POINT IS IN SOIL
C
      CHARACTER FNAME*30
      DIMENSION DNS(ML),DEP(ML),VS(ML),QF(ML)
C
C *** SOIL DATA INPUT ***
C 
      WRITE(*,10)
   10 FORMAT(' Enter Soil Data File Name ',\)
   11 READ(*,'(A)')FNAME
      IF(FNAME(1:1).EQ.' ')GOTO 11
   
      OPEN (5,FILE=FNAME)
      READ(5,1000)FOM,DOM,NOM
      READ(5,1010)THET1
      READ(5,1020)NSF
      READ(5,1030)NL,NQF
      DO 100 IL=1,NL
      READ(5,1040)DNS(IL),VS(IL),DEP(IL),QF(IL)
  100 CONTINUE
      CLOSE(5)
 1000 FORMAT(2F10.0,I10)
 1010 FORMAT(F10.0)
 1020 FORMAT(I10)
 1030 FORMAT(2I10)
 1040 FORMAT(4F10.0)
C
C *** CHANGE THETA FROM DEGREE TO RADIAN ***
C
      THETA=THET1*0.017453292520
C
C *** DATA ECHO ***
C
      WRITE(*,2000)
      WRITE(*,2010)FOM,DOM,NOM
      WRITE(*,2020)THET1,THETA
      WRITE(*,2030)NSF
      WRITE(*,2040)NL, NQF
      DO 200 IL=1,NL
      WRITE(*,2050)IL,DNS(IL),VS(IL),DEP(IL),QF(IL),0.5/QF(IL)
  200 CONTINUE
      WRITE(*,*)
 2000 FORMAT(/' FROM SUBROUTINE SOILIN : INPUT DATA ECHO')
 2010 FORMAT(' FOM,DOM,NOM    =',2F10.5,I5)
 2020 FORMAT(' THETA (DEG) =',F10.4,'  (RAD) =',F10.4)
 2030 FORMAT(' = 1:OUTPUT POINT IS ON SURFACE, = 0:IN SOIL : ',I3)
 2040 FORMAT(' TOTAL RAYLERS NUMBER =',I5,' QF IN ( =1:IN )=',I3)
 2050 FORMAT(' IL,DNS,VS,DEP,QF,H =',I3,F6.3,3F10.3,F10.6)
C       
      RETURN
      END
