Optimal carbon storage during drought