help mayday, little problem

Hello i'm having a problem. This is it:
i have to make a program that can calculate the flow of water on a grid like
123 120 125 122
120 121 120 123
123 122 122 123
122 120 120 120

These nummers are highs in cm, now lets say a want to start te calculation
on the 3 nummer of the second row an the water level there is lets say 200.
so where is the water flowing if the nummer are spacede at 5 meter and i
have 1000 m^3 water. how mutch water is there at the end of the calculation
on the field. The grid i have loadet in a database, the complete grid is in
asscii +/- 5 meg so it hase to bey fast. can some one help me please mail me
at :