.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/climate/plot_14_myhre_forcing_formulas.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code or to run this example in your browser via JupyterLite. .. rst-class:: sphx-glr-example-title .. _sphx_glr_api_gallery_climate_plot_14_myhre_forcing_formulas.py: Myhre's forcing formulas (1998) =============================== Gunnar Myhre and colleagues fitted simple expressions to line-by-line radiative calculations for the well-mixed greenhouse gases. CO2 forcing is logarithmic, ``5.35 ln(C / C0)``, because its strongest bands are saturated. Methane and nitrous oxide grow with the square root of concentration, less a term for the band near 7.7 μm that they share. The IPCC adopted the formulas in 2001; from 1750 to 1998 they give about 1.46, 0.48 and 0.15 W/m² for the three gases. .. GENERATED FROM PYTHON SOURCE LINES 13-41 .. image-sg:: /api/gallery/climate/images/sphx_glr_plot_14_myhre_forcing_formulas_001.png :alt: Well-mixed greenhouse gases :srcset: /api/gallery/climate/images/sphx_glr_plot_14_myhre_forcing_formulas_001.png :class: sphx-glr-single-img .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from earthsciencekit.climate import co2_forcing, methane_forcing, nitrous_oxide_forcing values = { "CO2": co2_forcing(365, 278, 5.35), "CH4": methane_forcing(1745, 700, 270), "N2O": nitrous_oxide_forcing(314, 270, 700), } np.testing.assert_allclose(list(values.values()), [1.46, 0.48, 0.15], atol=0.01) ratio = np.linspace(1, 3, 101) overlap_free = methane_forcing(700 * ratio, 700, 1e-6) with_overlap = methane_forcing(700 * ratio, 700, 270) assert np.all(with_overlap[1:] < overlap_free[1:]) fig, (left, right) = plt.subplots(1, 2, figsize=(10, 4)) left.bar(list(values), list(values.values()), color=["C0", "C1", "C2"]) left.set(ylabel="forcing 1750-1998 [W/m²]", title="Well-mixed greenhouse gases") right.plot(ratio, co2_forcing(278 * ratio, 278, 5.35), label="CO2, logarithmic") right.plot(ratio, overlap_free, "--", label="CH4 without N2O overlap") right.plot(ratio, with_overlap, label="CH4, square root less overlap") right.set(xlabel="concentration relative to 1750", ylabel="forcing [W/m²]") right.legend() fig.tight_layout() plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.191 seconds) .. _sphx_glr_download_api_gallery_climate_plot_14_myhre_forcing_formulas.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: lite-badge .. image:: images/jupyterlite_badge_logo.svg :target: ../../../lite/lab/index.html?path=api/gallery/climate/plot_14_myhre_forcing_formulas.ipynb :alt: Launch JupyterLite :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_14_myhre_forcing_formulas.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_14_myhre_forcing_formulas.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_14_myhre_forcing_formulas.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_