      PROGRAM LMAIN
C     NONLINEAR RESPONSE  --  OHSAKI & HARA MODEL  --
C     21-JAN-83
C
C     SUBROUTINES AND FUNCTION SUBPROGRAMS REQUIRED
C       SWREAD  SOILIN  (SDIN  EIGN  OHYS  SKEL) WRITWV
C
      PARAMETER (ND1=60, ND2=6100)
      DIMENSION UW(ND1), TH(ND1), G0(ND1), DAMP(ND1), SU(ND1),
     *STF(ND1), RA(ND2,ND1), ACMAX(ND1), SRMAX(ND1), STMAX(ND1)
      DIMENSION AA(ND2),SR(ND2,ND1)
      CHARACTER*50 TITL
C
      CALL CLOCK
C
      CALL READWV(ND2,TITL,N,DT,AA)
      CALL SOILIN(UW,G0,DAMP,TH,L,ND1,STF)
C
      CALL SUBD(L,UW,TH,G0,DAMP,STF,ND1)
C
      DO 10  I = 1, L
      SU(I) = G0(I)/(600.+500.*STF(I))
  10  CONTINUE
      WRITE(6,1000)
      DO 11 I=1,L
      WRITE(6,1100)I,TH(I),UW(I),G0(I),DAMP(I),SU(I),STF(I)
  11  CONTINUE
C
1000   FORMAT(/' *** INFORMATION OF LAYERS ***')
1100   FORMAT(' IL=',I3,' DEP=',F7.3,' DNS=',F7.3,' G=',F10.0,
     *       ' h=',F7.5,' SU=',F7.3,' STIF=',F7.3)
C
C              NONLINEAR RESPONSE
C       WRITE(6,*) ' FROM MAIN-SDIN '
      CALL SDIN(L,UW,TH,STF,G0,SU,ND1,DT,N,AA,RA,ND2,
     *          ACMAX,SRMAX,STMAX,SR,0)
C
      WRITE(6,220) (I,ACMAX(I),SRMAX(I),STMAX(I),I=1,L)
 220  FORMAT(1H1//11X,'MAX DISTRIBUTION'//11X,'LAYER',10X,'ACC',
     *10X,'STRAIN',9X,'STRESS'//(1H ,11X,I5,5X,1PE10.3,
     *2E15.3))
C
30    WRITE(6,*) 'ENTER LAYER NO. TO STORE FILE'
      READ(4,*) LL
          WRITE(5,*) ' LAYER NO = ',LL
        WRITE(5,3100) TITL
        WRITE(5,3200) N,DT
          DO 98 II=1,N,4
            WRITE(5,3300)(SR(((II-1)+I),LL),I=1,4)
98        CONTINUE
3100   FORMAT(A50)
3200   FORMAT(I10,F10.6)
3300   FORMAT(4E18.10)
C
       CALL CLOCK(TIME)
       WRITE(6,4000) TIME
4000   FORMAT(//,20X,10H CPU TIME=,F10.5)
C
      STOP
      END
