Survey and optimization of nitrogen management in farming and cropping systems