Keeping track of Active Cells

I have some CUDA code that is a simple raster based flood model. The model works by inserting a waterlevel at a single cell and then spreading it over the terrain. The problem that I have is keeping track of which cells are active i.e. contain water. At the moment I am doing a lot of needless calculations as I’m always using the entire domain instead of scaling the up the computation domain as the water spreads. So basically I’m wondering if anyone has scaled their domains dynamically based on data that is already on the GPU. Hope this makes sense, any help much appreciated.

Andy