A solar radiation algorithm for ecosystem dynamic models