      SUBROUTINE SETLAYERS(kmax,xlayer,maxlayer)

C     SETLAYERS SETS LAYER BOUNDS SURROUNDING A STANDARD DEPTH LAYER

      parameter (kdim=137)
      dimension xlayer(maxlayer,2),dz(kdim)
      call setstandepsfromfile(kmax,dz)

      xlayer(1,1)=dz(1)
      xlayer(1,2)=xlayer(1,1)+0.5*(dz(2)-dz(1))
      do 30 k=2,kmax-1

       xlayer(k,1)=dz(k)- (0.5*(dz(k)-dz(k-1)))
       xlayer(k,2)=dz(k)+ (0.5*(dz(k+1)-dz(k)))

30    continue
      xlayer(kmax,1)=dz(kmax)+ (0.5*(dz(kmax)-dz(kmax-1)))
      xlayer(kmax,2)=dz(kmax)

      return
      end

