# Exercise 1: how long would a 40 m thick glacier last at the average loss rate of the ten stake years? BALANCE = [-0.4, -0.9, -0.6, -1.2, -0.3, -1.4, -0.8, -1.1, -0.5, -1.3] RHO_ICE, RHO_WATER = 917, 1000 mean_we = sum(BALANCE) / len(BALANCE) ice_per_year = abs(mean_we) * RHO_WATER / RHO_ICE print(f"Mean balance: {mean_we:.2f} m w.e. a year = {ice_per_year:.3f} m of ice a year") for thickness in (20, 40, 80): print(f"Thickness {thickness:3d} m lasts about {thickness / ice_per_year:5.1f} years") worst = min(BALANCE) print(f"If every year were as bad as the worst ({worst} m w.e.), 40 m would last {40 / (abs(worst) * RHO_WATER / RHO_ICE):.1f} years") # Mean balance: -0.85 m w.e. a year = 0.927 m of ice a year # Thickness 20 m lasts about 21.6 years # Thickness 40 m lasts about 43.2 years # Thickness 80 m lasts about 86.3 years # If every year were as bad as the worst (-1.4 m w.e.), 40 m would last 26.2 years