      subroutine sod_const (xx,vx,mass,den,p,u,hh,gamma,xmax,xmin,partno
     &     ,hfac,n,ientro)

c This subroutine sets up the initial conditions for Sod'd shock tube 
c problem assuming a constant value of the smoothing length.

      real * 4 xx(n),vx(n),mass(n),den(n),p(n),u(n),hh(n)
      real * 4 delx
      real * 4 xmin,xmax,hfac,gamma

      real * 4 denl,denr,pl,pr,mtot

      integer * 4 partno(n)

      pl=1.0
      denl=1.0

c conditions used by herquist + katz

      denr=0.25
      pr=0.2154

c Zalezak problem

c      denr=0.1
c      pr=0.01

      do i=1,n
         partno(i)=i
      end do

      delx=(xmax-xmin)/(n-100)

      delxl=delx
      delxr=delx

c for constant mass particles

      mtot=0.75

      nleft=n/2

      do i=1,n

         if (i.le.nleft) then

            delx=delxl
            den(i)=denl
            mass(i)=den(i)*delx
            vx(i)=0.0
            if (i.gt.1) then
               xx(i)=xx(i-1)+delx
            else
               xx(i)=-delx*50.0
            end if
            hh(i)=hfac*delx
            p(i)=pl
            u(i)=p(i)/den(i)
            u(i)=u(i)/(gamma-1.0)

         else

            delx=delxr
            den(i)=denr
            mass(i)=den(i)*delx
            vx(i)=0.0
            xx(i)=xx(i-1)+delx
            hh(i)=hfac*delx
            p(i)=pr
            u(i)=p(i)/den(i)
            u(i)=u(i)/(gamma-1.0)

         end if

         if (ientro.eq.1) u(i)=p(i)/(den(i)**gamma)

      end do

      xx(51)=0.0

      end subroutine








