How to estimate Solar energy on certain direction pointed surface?

If I mount a flat surface which points to certain constant direction. At certain place of the world. I now need to estimate the maximum amount of Solar radiation energy which this surface can get during certain time.
Is there a PC program or an algorithm that can make this estimate for me?