Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New CH4 lifetime diagnostic #3507

Draft
wants to merge 56 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
ccadb00
first working version of lifetime diagnostic. Note the Todos
FranziskaWinterstein Jul 24, 2023
71a997d
trying to include data on model levels
FranziskaWinterstein Aug 10, 2023
5238a8d
Merge branch 'main' into ch4-lifetime
FranziskaWinterstein Aug 10, 2023
77bf54a
lifetime of tropospheric region
FranziskaWinterstein Sep 13, 2023
9b9fe75
update if modellevels are used
FranziskaWinterstein Sep 14, 2023
59fbe11
changed inclusive tropopause
FranziskaWinterstein Sep 18, 2023
d7bbb23
Merge branch 'main' into ch4-lifetime
FranziskaWinterstein Dec 18, 2023
5da7f8a
added a function to calculate climatological tropopause
FranziskaWinterstein Dec 20, 2023
194b08a
Merge branch 'main' into ch4-lifetime
FranziskaWinterstein Dec 20, 2023
f5e0377
grid dependent calculation fine
FranziskaWinterstein Dec 21, 2023
a10a2b3
modellevels also work with the calculation of air concentration
FranziskaWinterstein Dec 22, 2023
2b6bce5
calculate rho without gridmass and gridvol and code formatting
FranziskaWinterstein Jan 10, 2024
2c29e67
Merge branch 'main' into ch4-lifetime
FranziskaWinterstein Jan 12, 2024
9e0a1b8
implemented a delta pressure and gridmassdry calculation
FranziskaWinterstein Jan 15, 2024
423eba4
Merge branch 'ch4-lifetime' of github.com:ESMValGroup/ESMValTool into…
FranziskaWinterstein Jan 15, 2024
05cf2b4
grmassdry calculation under investigation
FranziskaWinterstein Jan 16, 2024
9d9e250
Merge branch 'ch4-lifetime' of github.com:ESMValGroup/ESMValTool into…
FranziskaWinterstein Jan 16, 2024
efdae9a
no further improvement
FranziskaWinterstein Jan 16, 2024
0fc6094
investigating why it is not working with big data
FranziskaWinterstein Jan 17, 2024
56677f8
tried to get rid of data leak
FranziskaWinterstein Jan 19, 2024
c20257c
added option annual_mean and reduced memory needs
FranziskaWinterstein Jan 23, 2024
4aea8b8
tried to improve memory management
FranziskaWinterstein Jan 23, 2024
7d5a430
Merge branch 'ch4-lifetime' of github.com:ESMValGroup/ESMValTool into…
FranziskaWinterstein Jan 23, 2024
45ee8b8
revoke changes in monitor/multi_dataset.py
FranziskaWinterstein Feb 15, 2024
d0ae625
updated according to flake8 standard and removed unnecessary code
FranziskaWinterstein Feb 15, 2024
a629240
removed block of unnecessary code
FranziskaWinterstein Feb 15, 2024
f2ffbed
removed list comprehension
FranziskaWinterstein Feb 16, 2024
18ee310
import public version of add_model_level
FranziskaWinterstein Feb 19, 2024
677dd6b
Merge branch 'main' into ch4-lifetime
FranziskaWinterstein Feb 19, 2024
f463c3f
Merge branch 'main' into ch4-lifetime
FranziskaWinterstein Mar 12, 2024
1ead4fa
resolving codacy issures and scetch of a recipe
FranziskaWinterstein Mar 12, 2024
4a0e21d
Merge branch 'ch4-lifetime' of github.com:ESMValGroup/ESMValTool into…
FranziskaWinterstein Mar 12, 2024
50c0aae
fix some codacy issures
FranziskaWinterstein Mar 12, 2024
a7f2511
moved calculate_rho to base
FranziskaWinterstein Mar 13, 2024
c748687
no add_stats necessary
FranziskaWinterstein Mar 13, 2024
04dd214
corrected positional arguments for plot_zonalmean*
FranziskaWinterstein Mar 13, 2024
c386ef9
Merge remote-tracking branch 'public/main' into ch4-lifetime
schlunma Mar 26, 2024
05563b7
convert lifetime to dask array
FranziskaWinterstein May 7, 2024
73f9e21
tried to update to dask conformity
FranziskaWinterstein May 17, 2024
c26637c
Merge branch 'main' into ch4-lifetime
FranziskaWinterstein May 17, 2024
701312b
changes for testing
FranziskaWinterstein May 17, 2024
fd52810
merge
FranziskaWinterstein May 17, 2024
43fc9b2
corrected _get_plot_kwargs, usable for timeseries and zonalmean
FranziskaWinterstein Jun 6, 2024
4f9f357
Merge branch 'ch4-lifetime' of github.com:ESMValGroup/ESMValTool into…
FranziskaWinterstein Jun 6, 2024
6ed8c45
steps toward propoer delta pressure calculation
FranziskaWinterstein Jun 6, 2024
40c22a5
Merge branch 'ch4-lifetime' of github.com:ESMValGroup/ESMValTool into…
FranziskaWinterstein Jun 6, 2024
5051a46
introduced new file lifetime_func.py which includes functions for lif…
FranziskaWinterstein Jun 6, 2024
14fdda0
dpres_plevel_4d bug search
FranziskaWinterstein Jun 6, 2024
64f99f0
memory intensive version
FranziskaWinterstein Jun 12, 2024
28d22f6
lifetime calculation without grmass and grvol possible
FranziskaWinterstein Jun 13, 2024
04237f7
Merge branch 'main' into ch4-lifetime
FranziskaWinterstein Jul 18, 2024
b02e3e3
Merge branch 'main' into ch4-lifetime
FranziskaWinterstein Jul 22, 2024
d636e6d
make data real to reduce memory demand later
FranziskaWinterstein Aug 3, 2024
778b38a
Merge branch 'main' into ch4-lifetime
FranziskaWinterstein Sep 10, 2024
79430eb
It is possible to create 1d_profile plots and zonalmean plots
FranziskaWinterstein Sep 16, 2024
9f58655
Merge branch 'main' into ch4-lifetime
FranziskaWinterstein Dec 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. _api.esmvaltool.diag_scripts.lifetime.lifetime:

Calculating and displaying multiple representations of the CH4 lifetime
=======================================================================


.. automodule:: esmvaltool.diag_scripts.lifetime.lifetime
:no-members:
:no-inherited-members:
:no-show-inheritance:
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.. _api.esmvaltool.diag_scripts.lifetime.lifetime_base:

Base class for calculating CH4 lifetime
=======================================

.. automodule:: esmvaltool.diag_scripts.lifetime.lifetime_base
226 changes: 226 additions & 0 deletions doc/sphinx/source/recipes/recipe_lifetime.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,226 @@
.. _recipe_lifetime:

Lifetime
========

Overview
--------

The diagnostic calculates the lifetime of CH4 (or potentially other chemically
active trace gases) and is able to plot it in several different representations.
In addition, a :ref:`base
class<api.esmvaltool.diag_scripts.lifetime.lifetime_base>` is provided that
contains the base calculation functions necessary for the lifetime calculation.


Available recipes and diagnostics
---------------------------------

Recipes are stored in `recipes/liftime`

* recipe_lifetime.yml

Diagnostics are stored in `diag_scripts/lifetime/`

* :ref:`lifetime.py <api.esmvaltool.diag_scripts.lifetime.lifetime>`:
.


User settings
-------------

It is recommended to use a vector graphic file type (e.g., SVG) for the output
files when running this recipe, i.e., run the recipe with the command line
option ``--output_file_type=svg`` or use ``output_file_type: svg`` in your
:ref:`esmvalcore:user configuration file`.
Note that map and profile plots are rasterized by default.
Use ``rasterize_maps: false`` or ``rasterize: false`` (see `Recipe settings`_)
in the recipe to disable this.

Recipe settings
~~~~~~~~~~~~~~~

A list of all possible configuration options that can be specified in the
recipe is given for each diagnostic individually (see previous section).

.. _monitor_config_file:

Monitor configuration file
~~~~~~~~~~~~~~~~~~~~~~~~~~

In addition, the following diagnostics support the use of a dedicated monitor
configuration file:

* monitor.py
* compute_eofs.py

This file is a yaml file that contains map and variable specific options in two
dictionaries ``maps`` and ``variables``.

Each entry in ``maps`` corresponds to a map definition.
Example:

.. code-block:: yaml

maps:
global: # Map name, choose a meaningful one
projection: PlateCarree # Cartopy projection to use
projection_kwargs: # Dictionary with Cartopy's projection keyword arguments.
central_longitude: 285
smooth: true # If true, interpolate values to get smoother maps. If not, all points in a cells will get the exact same color
lon: [-120, -60, 0, 60, 120, 180] # Set longitude ticks
lat: [-90, -60, -30, 0, 30, 60, 90] # Set latitude ticks
colorbar_location: bottom
extent: null # If defined, restrict the projection to a region. Format [lon1, lon2, lat1, lat2]
suptitle_pos: 0.87 # Title position in the figure.

Each entry in ``variables`` corresponds to a variable definition.
Use the default entry to apply generic options to all variables.
Example:

.. code-block:: yaml

variables:
# Define default. Variable definitions completely override the default
# not just the values defined. If you want to override only the defined
# values, use yaml anchors as shown
default: &default
colors: RdYlBu_r # Matplotlib colormap to use for the colorbar
N: 20 # Number of map intervals to plot
bad: [0.9, 0.9, 0.9] # Color to use when no data
pr:
<<: *default
colors: gist_earth_r
# Define bounds of the colorbar, as a list of
bounds: 0-10.5,0.5 # Set colorbar bounds, as a list or in the format min-max,interval
extend: max # Set extend parameter of mpl colorbar. See https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.colorbar.html
sos:
# If default is defined, entries are treated as map specific option.
# Missing values in map definitionas are taken from variable's default
# definition
default:
<<: *default
bounds: 25-41,1
extend: both
arctic:
bounds: 25-40,1
antarctic:
bounds: 30-40,0.5
nao: &nao
<<: *default
extend: both
# Variable definitions can override map parameters. Use with caution.
bounds: [-0.03, -0.025, -0.02, -0.015, -0.01, -0.005, 0., 0.005, 0.01, 0.015, 0.02, 0.025, 0.03]
projection: PlateCarree
smooth: true
lon: [-90, -60, -30, 0, 30]
lat: [20, 40, 60, 80]
colorbar_location: bottom
suptitle_pos: 0.87
sam:
<<: *nao
lat: [-90, -80, -70, -60, -50]
projection: SouthPolarStereo
projection_kwargs:
central_longitude: 270
smooth: true
lon: [-120, -60, 0, 60, 120, 180]

Variables
---------

Any, but the variables' number of dimensions should match the ones expected by each plot.

Example plots
-------------

.. _fig_climglobal:
.. figure:: /recipes/figures/monitor/clim.png
:align: center
:width: 14cm

Global climatology of tas.

.. _fig_seasonclimglobal:
.. figure:: /recipes/figures/monitor/seasonclim.png
:align: center
:width: 14cm

Seasonal climatology of pr, with a custom colorbar.

.. _fig_monthlyclimglobal:
.. figure:: /recipes/figures/monitor/monclim.png
:align: center
:width: 14cm

Monthly climatology of sivol, only for March and September.

.. _fig_timeseries:
.. figure:: /recipes/figures/monitor/timeseries.png
:align: center
:width: 14cm

Timeseries of Niño 3.4 index, computed directly with the preprocessor.

.. _fig_annual_cycle:
.. figure:: /recipes/figures/monitor/annualcycle.png
:align: center
:width: 14cm

Annual cycle of tas.

.. _fig_timeseries_with_ref:
.. figure:: /recipes/figures/monitor/timeseries_with_ref.png
:align: center
:width: 14cm

Timeseries of tas including a reference dataset.

.. _fig_annual_cycle_with_ref:
.. figure:: /recipes/figures/monitor/annualcycle_with_ref.png
:align: center
:width: 14cm

Annual cycle of tas including a reference dataset.

.. _fig_map_with_ref:
.. figure:: /recipes/figures/monitor/map_with_ref.png
:align: center
:width: 14cm

Global climatology of tas including a reference dataset.

.. _fig_zonal_mean_profile_with_ref:
.. figure:: /recipes/figures/monitor/zonalmean_profile_with_ref.png
:align: center
:width: 14cm

Zonal mean profile of ta including a reference dataset.

.. _fig_1d_profile_with_ref:
.. figure:: /recipes/figures/monitor/1d_profile_with_ref.png
:align: center
:width: 14cm

1D profile of ta including a reference dataset.

.. _fig_variable_vs_lat_with_ref:
.. figure:: /recipes/figures/monitor/variable_vs_lat_with_ref.png
:align: center
:width: 14cm

Zonal mean pr including a reference dataset.

.. _fig_hovmoeller_z_vs_time_with_ref:
.. figure:: /recipes/figures/monitor/hovmoeller_z_vs_time_with_ref.png
:align: center
:width: 14cm

Hovmoeller plot (pressure vs. time) of ta including a reference dataset.

.. _fig_hovmoeller_time_vs_lat_with_ref:
.. figure:: /recipes/figures/monitor/hovmoeller_time_vs_lat_with_ref.png
:align: center
:width: 14cm

Hovmoeller plot (time vs. latitude) of tas including a reference dataset
Loading
Loading