@@ -0,0 +1,1042 @@
+import numpy as np%0Afrom ..constants import molwt, radeff%0Afrom ..constants.general import M_ATMOS%0A%0Adef gwp(H, tau, re, wt, f=0., a=np.array(%5B0.2173, 0.2240, 0.2824, 0.2763%5D),%0A    tau_co2=np.array(%5Bnp.inf, 394.4, 36.54, 4.304%5D)):%0A%0A    %22%22%22Calculates Global Warming Potentials%0A%0A    Inputs:%0A        H: Time horizon (years)%0A        tau: lifetime of gas%0A        re: radiative efficiency of gas%0A        wt: molecular weight of gas%0A%0A    Keywords:%0A        f: feedback factor. f=0.65 for methane and -0.071874 for N2O%0A        a: impulse response partition for CO2%0A        tau_co2: lifetimes for impulse response partition for CO2%0A%0A    Outputs:%0A        global warming potential, scalar%0A%0A    TODO: recognise gas from list and select tau, re, wt, f accordingly%0A    %22%22%22%0A%0A    agwp_co2 = radeff.CO2 * (%0A      a%5B0%5D*H + np.sum(a%5B1:%5D*tau_co2%5B1:%5D*(1-np.exp(-H/tau_co2%5B1:%5D)))) * (%0A      molwt.AIR/molwt.CO2 * 1e9/M_ATMOS)%0A%0A    agwp_gas = re * (1.0+f) * tau * (1.0 - np.exp(-H/tau)) * (%0A      molwt.AIR/wt * 1e9/M_ATMOS)%0A%0A    gwp = agwp_gas/agwp_co2%0A    return gwp%0A

Add GWP calculator