C
      SUBROUTINE DATIN2(DOM,NOM,ML,NL,DNS,VP,VS,THK,LS,SDEP,LO,ODEP)
C
      IMPLICIT REAL*8(A-H,O-Z)
      CHARACTER FNAME*30
      COMPLEX*16 VP(ML),VS(ML)
      DIMENSION DNS(ML),THK(ML)
      COMMON / CN / C1,N1,C2,N2
C
C *** SOIL DATA INPUT FROM FILE DATA ***
C
      WRITE(*,*)
      WRITE(*,1000)
   10 WRITE(*,1010)
      READ(*,'(A)')FNAME
      IF(FNAME(1:1).EQ.' ')GOTO 10
 1000 FORMAT( ' From SUBROUTINE DATAIN :')
 1010 FORMAT(/' Enter Soil Data File Name ',\)

      OPEN (7,FILE=FNAME)
      READ(7,1200)NL
      DO 100 IL=1,NL
        READ(7,1210)DNS(IL),VPP,VSS,THK(IL),QF
        VP(IL)=VPP*DCMPLX(1.D0,0.5D0/QF)
        VS(IL)=VSS*DCMPLX(1.D0,0.5D0/QF)
  100 CONTINUE
      CLOSE(7)
 1200 FORMAT(I10)
 1210 FORMAT(5F10.0)
C
C *** DATA ECHO ***
C
      WRITE(*,2000)NL
      DO 200 IL=1,NL
        WRITE(*,2010)IL,DNS(IL),VP(IL),VS(IL),THK(IL)
  200 CONTINUE
 2000 FORMAT(/' Total Layers Number            =',I5/
     *       /' Layer Num., Density , Vp(real), Vp(imag)'
     *        ', Vs(real), Vs(imag),Thickness')
 2010 FORMAT(I5,5X,6F10.3)
C
   20 WRITE(*,3000)
      READ(*,*)DOM,NOM
 3000 FORMAT(/' Enter Delta Omega and Omega Number        ? :',\)
C
      WRITE(*,4000)
      READ(*,*)C1
      WRITE(*,4010)
      READ(*,*)C2
      WRITE(*,4020)
      READ(*,*)N1
      WRITE(*,4030)
      READ(*,*)N2
C
 4000 FORMAT(/' Enter the lowest phase vel. C1        : ',\)
 4010 FORMAT( ' Enter the second phase vel. C2(>C1)   : ',\)
 4020 FORMAT( ' Enter div. num. for int. (0-OM/C2)    : ',\)
 4030 FORMAT( ' Enter div. num. for int. (OM/C2-OM/C1): ',\)
C
C *** ENTER OF SOURCE DEPTH IN ANY LAYER ***
C
   30 WRITE(*,5000)NL
      READ(*,*)LS
      IF(LS.EQ.0)GOTO 30
      IF(LS.GT.NL)GOTO 30
      WRITE(*,5010)THK(LS)
      READ(*,*)SDEP
 5000 FORMAT(/' Total layers number =',I5,
     *       /' Enter source layer number (from top layer) : ',\)
 5010 FORMAT( ' Source layer thickness =',F10.4,
     *       /' Enter source depth from upper boundary     : ',\)
C
C *** ENTER OF OP DEPTH IN ANY LAYER ***
C
   40 WRITE(*,5100)NL
      READ(*,*)LO
      IF(LO.EQ.0)GOTO 40
      IF(LO.GT.NL)GOTO 40
      WRITE(*,5110)THK(LO)
      READ(*,*)ODEP
 5100 FORMAT(/' Total layers number =',I5,
     *       /' Enter OP layer number (from top layer)     : ',\)
 5110 FORMAT( ' Source layer thickness =',F10.4,
     *       /' Enter OP depth from upper boundary         : ',\)
C
      WRITE(*,6000)
      READ(*,*)IY
      IF(IY.NE.0)GOTO 20
 6000 FORMAT(/' All data OK? (Yes=0 enter) : ',\)
C
      WRITE(*,*)
C
      RETURN
      END
