anchor.diff:  
       integer, parameter :: MAX_ITER = 250
   
  -    integer :: iter, iter_mass, num_iters
  +    integer :: iter, iter_mass
   
       integer :: icutoff
   
  
positive.code: 
      double precision :: temp_base, delta
  
      double precision :: xzn_hse(nx), xznl(nx), xznr(nx), M_enclosed(nx), cs_hse(nx)
  
      integer :: i, n
  
  
negative.code: 
               do iter = 1, MAX_ITER
  
                  ! The core is isothermal, so we just need to constrain
                  ! the density and pressure to agree with the EOS and HSE.
  
                  ! We difference HSE about the interface between the current
                  ! zone and the one just inside.
                  p_want = model_hse(i-1,ipres_model) + &
                       delx*0.5*(dens_zone + model_hse(i-1,idens_model))*g_zone
  
                  eos_state%T     = temp_zone
                  eos_state%rho   = dens_zone
                  eos_state%xn(:) = xn(:)
  
                  ! (T, rho) -> (p, s)
                  call eos(eos_input_rt, eos_state, .false.)
  
                  entropy = eos_state%s
                  pres_zone = eos_state%p
  
                  dpd = eos_state%dpdr
  
                  drho = (p_want - pres_zone)/(dpd - 0.5*delx*g_zone)
  
                  dens_zone = max(0.9*dens_zone, &
                       min(dens_zone + drho, 1.1*dens_zone))
  
                  if (abs(drho) < TOL_HSE*dens_zone) then
                     converged_hse = .TRUE.
                     exit
                  endif
  
                  if (dens_zone < ambient_state % rho) then
  
                     icutoff = i
                     dens_zone = ambient_state % rho
                     temp_zone = ambient_state % T
                     converged_hse = .TRUE.
                     fluff = .TRUE.
                     exit
  
                  endif
  
                  if (temp_zone < ambient_state % T .and. isentropic) then
                     temp_zone = ambient_state % T
                     isentropic = .false.
                  endif
  
               enddo
  
  