Correcting weather and climate models by machine learning nudged historical simulations