Skip to main content

sea_level_rise_function.py


"""
This program calculate by how much the sea level would rise (roughly)
if the Greenland ice was to completely melt.
Author: Lauren Gregoire
Date: 21 Dec 2013
"""
def sea_level_rise(V_ice=2.93E15,frac=1.0):
    A_ocean   = 3.61E14  # m2
    rho_ice   =  917.   # kg/m3
    rho_water = 1000.   # km/m3
    V_water=V_ice * (rho_ice/rho_water)
    return frac*V_water/A_ocean
print "If Greenland melts, the sea level rise in meters will be: "
print sea_level_rise()
print "If all of Antarctica melts, the sea level rise in meters will be: "
print sea_level_rise(26E15)
print "If 1% of Antarctica melts, the sea level rise in meters will be: "
print sea_level_rise(26E15,0.01)