Climatic variations on Mars: 2. Evolution of carbon dioxide atmosphere and polar caps