A new supercomputer is to be built by 2022 to improve the accuracy of weather forecasting.