This patch changes the way ghost zones are generated in a subtle but important way. Rather than searching all grids overlapping with the ghost zone region all the way to level 0, this patch changes it so that it first identifies the minimum level at which the entire region is covered, and then it searches only down to that level.
For FLASH datasets this is particularly important, as it is for deeply nested hierarchies with a high covering fraction at high levels. Sam reported a slight slowdown for shallow hierarchies.
I'm accepting. It is a minor slowdown for my data, and a major improvement for every other type tested.