I am not using the DEM. The scope of my work is limited to DPM only. It would be a nice discussion to have perhaps in person, but I don't think here in the forum we can discuss in that much detail.
Thank you for your help though. And please let me know if you can suggest any way to limit the search of cells. May be this is something the development team could look into. If only they could add another macro to implement a conditional cell loop like begin_c_loop_while(xc,d), xc being the coordinate of the current cell and d being the distance. If this could be done in a more efficient way, this could prove extremely useful...Just an idea