c
c @(#)advset.f	1.2
c
      subroutine advset

      include'mladv.inc'

      common/parm/kz,m,mm1,mm2,mp1,msq,tim,tmax,tstart,hy,rea,dt,
     +   xbasin,yy(mx0),icalc,kzp1,kzm1,iftop,ifbot,iftvv,ifrel,theta,
     +   ifsbl,ifeva

      kmlmin = lmax
      kmlmax = 0

      do 1 i=1,msq

         call findkml(hdpth(i,mlcur),zml,l,kml)
         ihdpth(i) = kml
         if (kml.gt.kmlmax) kmlmax = kml
         if (kml.lt.kmlmin) kmlmin = kml

  1    continue

      return
      end
