openairclim.core.calc_co2

Calculates CO2 response.

openairclim.core.calc_co2.calc_co2_concentration(config: dict, emis_dict: dict) → dict[source]

Calculates the CO2 concentration values in ppmv for emitted CO2 in Tg.

Gets the method from config and executes the corresponding subroutine.

Parameters:
  • config (dict) – Configuration dictionary from config

  • emis_dict (dict) – Dictionary with arrays of emissions for time range as defined in config, keys are species

Returns:

Dictionary with array of CO2 concentration in ppmv for time range as defined in config, key is species CO2

Return type:

dict

openairclim.core.calc_co2.calc_co2_drf_dconc(conc_dict: dict, config: dict) → dict[source]

Calculates the derivative of CO2 radiative forcing w.r.t. concentration.

This is used for the differential and marginal RF attribution methods. The CO2 method is taken from the config file.

Parameters:
  • conc_dict (dict) – Dictionary with array of concentrations between the starting and ending years, key is species

  • config (dict) – Configuration dictionary from config

Raises:

ValueError – if CO2.rf.method not valid or the derivative undefined

Returns:

Dictionary with numpy.ndarray of CO2 radiative forcing derivative values between the starting and ending years, key is species CO2

Return type:

dict

openairclim.core.calc_co2.calc_co2_drf_dconc_etminan_2016(conc_dict: dict, conc_n2o_bg_dict: dict) → dict[source]

Calculates the derivative of CO2 radiative forcing w.r.t. concentration.

Reference: Etminan, M., Myhre, G., Highwood, E. J., & Shine, K. P. (2016). Radiative forcing of carbon dioxide, methane, and nitrous oxide: A significant revision of the methane radiative forcing. Geophysical Research Letters, 43(24), 12-614. https://doi.org/10.1002/2016GL071930.

Parameters:
  • conc_dict (dict) – Dictionary with array of concentrations (not including background) between the starting and ending years, keys is species

  • conc_n2o_bg_dict (dict) – Dictionary of numpy.ndarray of background N2O concentrations between the starting and ending years, key is species

Returns:

Dictionary with numpy.ndarray of dRF(CO2)/dconc values between the starting and ending years, key is species CO2

Return type:

dict

openairclim.core.calc_co2.calc_co2_rf(conc_dict: dict, config: dict) → dict[source]

Calculates the radiative forcing values for emitted CO2 concentrations.

The CO2 method is taken from the config file.

Parameters:
  • conc_dict (dict) – Dictionary with array of concentrations (not including background) between the starting and ending years, keys is species

  • config (dict) – Configuration dictionary from config

Raises:

ValueError – if CO2.rf.method not valid

Returns:

Dictionary with numpy.ndarray of CO2 radiative forcing values between the starting and ending years, key is species CO2

Return type:

dict

openairclim.core.calc_co2.calc_co2_rf_etminan_2016(conc_dict: dict, conc_n2o_bg_dict: dict) → dict[source]

Calculates the CO2 radiative forcing values for emitted concentrations.

Reference: Etminan, M., Myhre, G., Highwood, E. J., & Shine, K. P. (2016). Radiative forcing of carbon dioxide, methane, and nitrous oxide: A significant revision of the methane radiative forcing. Geophysical Research Letters, 43(24), 12-614. https://doi.org/10.1002/2016GL071930.

Parameters:
  • conc_dict (dict) – Dictionary with array of concentrations (not including background) between the starting and ending years, keys is species

  • conc_n2o_bg_dict (dict) – Dictionary of numpy.ndarray of background N2O concentrations between the starting and ending years, key is species

Returns:

Dictionary with numpy.ndarray of CO2 radiative forcing values between the starting and ending years, key is species CO2

Return type:

dict

openairclim.core.calc_co2.calc_co2_rf_ipcc_2001_1(conc_dict: dict) → dict[source]

Calculates the radiative forcing values for emitted CO2 concentrations.

After IPCC 2001, Table 6.2, first row.

Parameters:

conc_dict (dict) – Dictionary with array of concentrations (not including background) between the starting and ending years, keys is species

Returns:

Dictionary with array of CO2 radiative forcing values between the starting and ending years, key is species CO2

Return type:

dict

openairclim.core.calc_co2.calc_co2_rf_ipcc_2001_2(conc_dict: dict) → dict[source]

Calculates the radiative forcing values for emitted CO2 concentrations.

After IPCC 2001, Table 6.2, second row.

Parameters:

conc_dict (dict) – Dictionary with array of concentrations (not including background) between the starting and ending years, keys is species

Returns:

Dictionary with array of CO2 radiative forcing values between the starting and ending years, key is species CO2

Return type:

dict

openairclim.core.calc_co2.calc_co2_rf_ipcc_2001_3(conc_dict: dict) → dict[source]

Calculates the radiative forcing values for emitted CO2 concentrations.

After IPCC 2001, Table 6.2, third row.

Parameters:

conc_dict (dict) – Dictionary with array of concentrations (not including background) between the starting and ending years, keys is species

Returns:

Dictionary with array of CO2 radiative forcing values between the starting and ending years, key is species CO2

Return type:

dict

openairclim.core.calc_co2.calc_co2_ss(config: dict, emis_dict: dict) → dict[source]

Calculates the CO2 concentration values in ppmv for emitted CO2 in Tg.

After Sausen & Schumann (2000), formulas (4) and (5).

Parameters:
  • config (dict) – Configuration dictionary from config

  • emis_dict (dict) – Dictionary with arrays of emissions for time range as defined in config, keys are species

Returns:

Dictionary with array of CO2 concentration in ppmv for time range as defined in config, key is species CO2

Return type:

dict

openairclim.core.calc_co2.get_co2_emissions(inv_dict: dict) → dict[source]

Get total CO2 emissions in Tg for each inventory.

Parameters:

inv_dict (dict) – Dictionary of emission inventory xarrays, keys are inventory years

Returns:

Dictionary with array of CO2 emissions in Tg

Return type:

dict

openairclim.core.calc_co2.greens_c(time: float) → float[source]

Green’s function / Impulse response for CO2 concentration.

After equation (5) in Sausen & Schumann (2000).

Parameters:

time (float) – Time

Returns:

Impulse response for a certain point in time

Return type:

float