Searching an algorithm.

Hi:
I am making a program, and I need an algorithm to calculate the watershed basin
upstream of a outlet point. I know an algorithm that was documented in GRASS
manuals but doesn't exist, this algorithm was named r.water.outlet.

I would like to have the source code or the A* Search Algorithm to Develop
Hydrologic Models from Digital Elevation Data (Charles Ehlschlaeger, U.S. Army
Construction Engineering Research Laboratory)

                                       Thanks in advance.

Gonzalo Carrero Perez.