OMS-NetZero / FAIR

Finite-amplitude Impulse Response simple climate model
https://docs.fairmodel.net
Apache License 2.0
123 stars 62 forks source link

Steady state emissions from concentrations tool #34

Closed chrisroadmap closed 6 years ago

chrisroadmap commented 6 years ago

This goes some way to helping with #28 as it provides a simple way to calculate natural emissions of CH4 and N2O for varying lifetime runs.

Example for a pulse emission of methane:

import numpy as np
from fair.forward import fair_scm
from fair.constants import lifetime
from fair.tools import steady

# get steady state natural emissions for a 4-year methane lifetime and 
# preindustrial concentration of 722ppb
steady_ch4_4yr = steady.emissions(species="CH4", lifetime=4, C=722.)
steady_n2o     = steady.emissions(species="N2O", C=275.)

# load up default lifetimes but override methane to 4 years
lt = lifetime.aslist
lt[1] = 4.0

# 10 Gt methane pulse
emissions = np.zeros((100, 40))
emissions[0,3] = 10000.

# turn off forcing for everything except methane
scale = np.zeros(13)
scale[1] = 1.0
C_pi = np.zeros((31))
C_pi[0:3] = [278., 722., 275.]

# run FAIR
C,F,T = fair_scm(emissions, lifetimes=lt, natural = [steady_ch4_4yr, steady_n2o], F_volcanic=0., F_solar=0., scale=scale, fixPre1850RCP=False)