Simulation of the dynamics of nutrients and moisture in tropical ecosystems