      PROGRAM INSERT
      PARAMETER (NLYRS1=38,NLYRS2=50,NBLCKS=3,NSTND=14)
      PARAMETER (NINTFC=NLYRS2+1,NLM1=NLYRS2-1,NLM2=NLYRS2-2)
C     PARAMETER (NLDBL2=2*NLYRS2,NIDBL=2*NINTFC)
      REAL DETX(NLYRS1),DETNEW(25),DETA(NLYRS2),DETH(NLYRS2)
      REAL EINTFC(NINTFC),AETA(NLYRS2),STNDPR(NSTND),DETAB(NLYRS2)
C     REAL AETDBL(NLDBL2),EINDBL(NIDBL)
      REAL DRAW1(NINTFC)
      INTEGER LSTRT(NBLCKS),LEND(NBLCKS),NEWL(NBLCKS),LDT1(NLYRS2)
      DATA LSTRT/7,10,21/,LEND/9,20,33/,NEWL/2,3,7/
      DATA PTOP/25./,PTROP/250./,NPASS/6/
      DATA STNDPR/20.,30.,50.,70.,100.,150.,200.,250.,300.,400.
     1,           500.,700.,850.,1000./
      DATA DETA/NLYRS2*0./
C----------------------------------------------------------------------
C***
C***  THIS PROGRAM WILL INSERT ADDITIONAL LAYERS INTO A GIVEN
C***  INPUT DISTRIBUTION OF LAYERS.  NBLCKS IS THE NUMBER OF BLOCKS
C***  OF INSERTIONS THAT WILL BE MADE.  LSTRT HOLDS THE LAYER 
C***  INDICES OF THE TOP OF EACH INSERTION BLOCK WHILE LEND HOLDS
C***  THE LAYER INDICES OF THE BOTTOM OF EACH BLOCK BASED UPON THE
C***  INPUT DISTRIBUTION OF LAYERS.  NEWL HOLDS THE NUMBER OF NEW 
C***  LAYERS THAT WILL BE INSERTED INTO EACH BLOCK.
C***
C----------------------------------------------------------------------
C***
C***  READ IN THE ORIGINAL DETA DISTRIBUTION.
C***
      REWIND 12
      DO 25 L=1,NLYRS2
      READ(12,*)DETA(L)
   25 CONTINUE

      REWIND 13
      DO 35 L=51,1,-1
      READ(13,*)EINTFC(L)
   35 CONTINUE

      REWIND 14
      READ(14)DETAB,LDT1

      DO 550 N=1,NINTFC
      NI=N-1
      IF(N.EQ.1)THEN
        WRITE(6,450)NI,EINTFC(N)
  450   FORMAT(' INTFC=',I3,'  ETA=',E13.6)
      ELSE
        AETA(NI)=EINTFC(N-1)+0.5*DETA(N-1)
        WRITE(6,460)NI,EINTFC(N),DETA(N-1),AETA(NI)
  460   FORMAT(' INTFC=',I3,'  ETA=',E13.6,'  DETA=',E13.6,
     1         '  AETA=',E13.6)
      ENDIF
  550 CONTINUE
      WRITE(23)(AETA(N),N=NLYRS2,1,-1)
      WRITE(23)(EINTFC(N),N=NINTFC,1,-1)
      WRITE(24)DETA,LDT1

      STOP
      END
