China has endured a summer of extreme weather and heat waves across much of its north and west.