import PISM import numpy as np config = PISM.Context().config # list of converters converters = { "Default": PISM.EnthalpyConverter(config), "Glint2 (Kirchhoff)": PISM.KirchhoffEnthalpyConverter(config), "verification (cold)": PISM.ColdEnthalpyConverter(config), "linear-in-temp C(T)": PISM.varcEnthalpyConverter(config) } def try_all_converters(test): print "" for name, converter in converters.items(): print "Testing '%s' converter..." % name, test(name, converter) print "done" def reversibility_test(): "Converting from (E, P) to (T, omega, P)" def run(name, EC): # for a fixed pressure... H = 1000.0 P = EC.pressure(H) # cold ice