Nathan -- This is the part of the routine which adds the gravity source term to the energy. I doubt this is going to help much, but the from the output you can see that this addition of (negative) energy to these cells drives the total energy below zero. However, I doubt this is the fundamental issue, as the energy even before this step is positive, but less than 0.5 v^2. All I can say from the output is that this is not due to the gravitational acceleration. I suspect the problem is only detected here, but e is dropping below 0.5 v^2 somewhere earlier. Maybe this comes from your changes somehow modifying the velocity of cells without changing their energy (in PPM, energy is the total specific thermal plus kinetic energy, so e should always be e = ge + 0.5 v^2, which means that if you change v, you need to change e).
Sorry not to be of more help...
Greg