We outline a method of inferring rooting depth from a Terrestrial Biosphere Model by maximizing the benefit of the vegetation within the model. This corresponds to the evolutionary principle that vegetation has adapted to make best use of its local environment. We demonstrate this method with a simple coupled biosphere/soil hydrology model and find that deep rooted vegetation is predicted in most parts of the tropics. Even with a simple model like the one we use, it is possible to reproduce biome averages of observations fairly well. By using the optimized rooting depths global Annual Net Primary Production (and transpiration) increases substantially compared to a standard rooting depth of one meter, especially in tropical regions that have a dry season. The decreased river discharge due to the enhanced evaporation complies better with observations. We also found that the optimization process is primarily driven by the water deficit/surplus during the dry/wet season for humid and arid regions, respectively. Climate variability further enhances rooting depth estimates. In a sensitivity analysis where we simulate changes in the water use efficiency of the vegetation we find that vegetation with an optimized rooting depth is less vulnerable to variations in the forcing. We see the main application of this method in the modelling communities of land surface schemes of General Circulation Models and of global Terrestrial Biosphere Models. We conclude that in these models, the increased soil water storage is likely to have a significant impact on the simulated climate and the carbon budget, respectively. Also, effects of land use change like tropical deforestation are likely to be larger than previously thought.