In [1]:
from IPython.display import Image
Image(url='https://vesg.ipsl.upmc.fr/thredds/fileServer/IPSLFS/jservon/CliMAF_Notebooks_html/CliMAF-logo-small.png') 
Out[1]:

A science-oriented framework to ease the analysis of climate model simulations

WP5 ANR Convergence
Development team: Stéphane Sénési (CNRM-GAME), Gaëlle Rigoudy (CNRM-GAME), Jérôme Servonnat (LSCE-IPSL), Ludivine Vignon (CNRM-GAME), Laurent Franchisteguy (CNRM-GAME), Patrick Brockmann (LSCE-IPSL)
Beta-testing: Olivier Marti (LSCE-IPSL), Marie-Pierre Moine (CERFACS), Emilia Sanchez-Gomez (CERFACS)

contact: climaf@meteo.fr
users list: climaf-users@meteo.fr

Foreword: why working with CliMAF ensembles?

A CliMAF ensemble is basically:

  • a python dictionnary
  • with additionnal features such as a given order of the elements
  • recognized by the CliMAF operators to:
    • automatically apply the operator on all the members in one command line (for those that normally take one single dataset)
    • compute ensemble statistics (using ccdo_ens, among others)
    • do multiplots with cpage and plot

All the members are tagged with a name, or 'key'. This name will be used automatically by the operators that include ${labels} in the cscript declaration, such as plot.

Working with CliMAF ensembles

In this notebook we will see how to:

    1. make a CMIP5 ensemble with explore('ensemble')
    1. make a basic CMIP6 ensemble: all realizations of one model
    1. make an ensemble with eds: specify explicitly the content of the ensemble
    1. Quick example of treatments and multiplot with cpage
    1. Modify its content and set the order of the members
    1. Make an ensemble by hand with cens
    1. Use ensemble_intersection to create a list of ensembles with only their common members
    1. Merge ensembles
    1. Get the path/filenames of all my pretreated files with tagnames

CMIP6 and CORDEX are treated more specifically in two additionnal notebooks:

  • CMIP6_ensembles_analysis_with_CliMAF.ipynb
  • CORDEX_ensembles_analysis_with_CliMAF.ipynb #

First, import climaf

In [2]:
from climaf.api import *
CliMAF version = 1.2.13
CliMAF install => /ciclad-home/jservon/Evaluation/CliMAF/climaf_installs/climaf_V1.2.13_post
python => /modfs/modtools-phw/miniconda2/envs/analyse_2.7/bin/python
---
Required softwares to run CliMAF => you are using the following versions/installations:
ncl 6.6.2 => /modfs/modtools-phw/miniconda2/envs/analyse_2.7/bin/ncl
cdo 1.9.6 => /opt/nco/1.9/bin/cdo
nco (ncks) 4.5.2 => /opt/nco-4.5.2/bin/ncks
ncdump fichier => /modfs/modtools-phw/miniconda2/envs/analyse_2.7/bin/ncdump
Check stamping requirements
nco (ncatted) found -> /opt/nco-4.5.2/bin/ncatted
convert found -> /usr/bin/convert
pdftk found -> /usr/bin/pdftk
exiv2 found -> /ciclad-home/jservon/Evaluation/CliMAF/climaf_installs/climaf_V1.2.13_post/bin/exiv2
---
Cache directory set to : /data/jservon/climafcache (use $CLIMAF_CACHE if set) 
Cache directory for remote data set to : /data/jservon/climafcache/remote_data (use $CLIMAF_REMOTE_CACHE if set) 
warning  : When defining temp_penalty : duplicate declaration for input #0
warning  : When defining cquantile : duplicate declaration for input #0
warning  : When defining cquantile : duplicate declaration for input #0
Available macros read from ~/.climaf.macros are : []

And set verbosity ('critical' -> minimum ; 'debug' -> maximum)

In [3]:
clog('critical') # min verbosity = critical < warning < info < debug = max verbosity

... and dont' forget to open the documentation in case you have questions.

http://climaf.readthedocs.org/

-> Use the "Quick search" space to search for what you are interested in, it is really powerfull!

1. how to make a CMIP5 ensemble with explore('ensemble')

The .explore() method is a very easy way to:

  • retrieve all the available models for a request
  • or realizations

Here we want to make a multi-model ensemble, with one realization (r1i1p1 by default)

In [4]:
# -- CMIP5: how to get all the models 
req_cmip5 = ds(project='CMIP5',
               model='*',
               variable='tos',
               experiment='historical',
               period='1980-2000',
               frequency='monthly',
               version='latest'
               )

# -- We use .explore('choices') to see all the possible values taken by model
req_cmip5.explore('choices')
Out[4]:
{'model': ['ACCESS1-0',
  'ACCESS1-3',
  'CCSM4',
  'CESM1-BGC',
  'CESM1-CAM5',
  'CESM1-CAM5-1-FV2',
  'CESM1-FASTCHEM',
  'CESM1-WACCM',
  'CMCC-CESM',
  'CMCC-CM',
  'CMCC-CMS',
  'CNRM-CM5',
  'CNRM-CM5-2',
  'CSIRO-Mk3-6-0',
  'CanCM4',
  'CanESM2',
  'EC-EARTH',
  'FGOALS-g2',
  'GFDL-CM2p1',
  'GFDL-CM3',
  'GFDL-ESM2G',
  'GFDL-ESM2M',
  'GISS-E2-H',
  'GISS-E2-H-CC',
  'GISS-E2-R',
  'GISS-E2-R-CC',
  'HadCM3',
  'HadGEM2-AO',
  'HadGEM2-CC',
  'HadGEM2-ES',
  'IPSL-CM5A-LR',
  'IPSL-CM5A-MR',
  'IPSL-CM5B-LR',
  'MIROC-ESM',
  'MIROC-ESM-CHEM',
  'MIROC5',
  'MRI-CGCM3',
  'MRI-ESM1',
  'NorESM1-M',
  'NorESM1-ME',
  'bcc-csm1-1',
  'bcc-csm1-1-m',
  'inmcm4'],
 'realm': 'ocean',
 'table': 'Omon'}

We can see that we have only one key (model) that has a list of values. Note that if we have more than one key with a list of values, we can't use directly explore('ensemble').

In [5]:
ens_cmip5 = req_cmip5.explore('ensemble')
summary(ens_cmip5)
Keys - values:
{'domain': 'global', 'realm': 'ocean', 'version': 'latest', 'period': 1980-2000, 'simulation': '', 'project': 'CMIP5', 'experiment': 'historical', 'frequency': 'monthly', 'realization': 'r1i1p1', 'variable': 'tos', 'table': 'Omon', 'model': 'ACCESS1-0', 'root': '/bdd'}
-- Ensemble members:
ACCESS1-0
/bdd/CMIP5/output/CSIRO-BOM/ACCESS1-0/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_ACCESS1-0_historical_r1i1p1_185001-200512.nc
--
ACCESS1-3
/bdd/CMIP5/output/CSIRO-BOM/ACCESS1-3/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_ACCESS1-3_historical_r1i1p1_185001-200512.nc
--
CCSM4
/bdd/CMIP5/output/NCAR/CCSM4/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_CCSM4_historical_r1i1p1_185001-200512.nc
--
CESM1-BGC
/bdd/CMIP5/output/NSF-DOE-NCAR/CESM1-BGC/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_CESM1-BGC_historical_r1i1p1_185001-200512.nc
--
CESM1-CAM5
/bdd/CMIP5/output/NSF-DOE-NCAR/CESM1-CAM5/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_CESM1-CAM5_historical_r1i1p1_185001-200512.nc
--
CESM1-CAM5-1-FV2
/bdd/CMIP5/output/NSF-DOE-NCAR/CESM1-CAM5-1-FV2/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_CESM1-CAM5-1-FV2_historical_r1i1p1_185001-200512.nc
--
CESM1-FASTCHEM
/bdd/CMIP5/output/NSF-DOE-NCAR/CESM1-FASTCHEM/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_CESM1-FASTCHEM_historical_r1i1p1_185001-200512.nc
--
CESM1-WACCM
/bdd/CMIP5/output/NSF-DOE-NCAR/CESM1-WACCM/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_CESM1-WACCM_historical_r1i1p1_185001-200512.nc
--
CMCC-CESM
/bdd/CMIP5/output/CMCC/CMCC-CESM/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_CMCC-CESM_historical_r1i1p1_197601-198112.nc
/bdd/CMIP5/output/CMCC/CMCC-CESM/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_CMCC-CESM_historical_r1i1p1_198201-198712.nc
/bdd/CMIP5/output/CMCC/CMCC-CESM/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_CMCC-CESM_historical_r1i1p1_198801-199312.nc
/bdd/CMIP5/output/CMCC/CMCC-CESM/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_CMCC-CESM_historical_r1i1p1_199401-199912.nc
/bdd/CMIP5/output/CMCC/CMCC-CESM/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_CMCC-CESM_historical_r1i1p1_200001-200512.nc
--
CMCC-CM
/bdd/CMIP5/output/CMCC/CMCC-CM/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_CMCC-CM_historical_r1i1p1_198001-198912.nc
/bdd/CMIP5/output/CMCC/CMCC-CM/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_CMCC-CM_historical_r1i1p1_199001-199912.nc
/bdd/CMIP5/output/CMCC/CMCC-CM/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_CMCC-CM_historical_r1i1p1_200001-200512.nc
--
CMCC-CMS
/bdd/CMIP5/output/CMCC/CMCC-CMS/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_CMCC-CMS_historical_r1i1p1_198001-198912.nc
/bdd/CMIP5/output/CMCC/CMCC-CMS/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_CMCC-CMS_historical_r1i1p1_199001-199912.nc
/bdd/CMIP5/output/CMCC/CMCC-CMS/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_CMCC-CMS_historical_r1i1p1_200001-200512.nc
--
CNRM-CM5
/bdd/CMIP5/output/CNRM-CERFACS/CNRM-CM5/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_CNRM-CM5_historical_r1i1p1_198001-198912.nc
/bdd/CMIP5/output/CNRM-CERFACS/CNRM-CM5/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_CNRM-CM5_historical_r1i1p1_199001-199912.nc
/bdd/CMIP5/output/CNRM-CERFACS/CNRM-CM5/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_CNRM-CM5_historical_r1i1p1_200001-200512.nc
--
CNRM-CM5-2
/bdd/CMIP5/output/CNRM-CERFACS/CNRM-CM5-2/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_CNRM-CM5-2_historical_r1i1p1_198001-198912.nc
/bdd/CMIP5/output/CNRM-CERFACS/CNRM-CM5-2/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_CNRM-CM5-2_historical_r1i1p1_199001-199912.nc
/bdd/CMIP5/output/CNRM-CERFACS/CNRM-CM5-2/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_CNRM-CM5-2_historical_r1i1p1_200001-200512.nc
--
CSIRO-Mk3-6-0
/bdd/CMIP5/output/CSIRO-QCCCE/CSIRO-Mk3-6-0/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_CSIRO-Mk3-6-0_historical_r1i1p1_185001-200512.nc
--
CanCM4
/bdd/CMIP5/output/CCCma/CanCM4/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_CanCM4_historical_r1i1p1_196101-200512.nc
--
CanESM2
/bdd/CMIP5/output/CCCma/CanESM2/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_CanESM2_historical_r1i1p1_185001-200512.nc
--
EC-EARTH
/bdd/CMIP5/output/ICHEC/EC-EARTH/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_EC-EARTH_historical_r1i1p1_198001-198912.nc
/bdd/CMIP5/output/ICHEC/EC-EARTH/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_EC-EARTH_historical_r1i1p1_199001-199912.nc
/bdd/CMIP5/output/ICHEC/EC-EARTH/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_EC-EARTH_historical_r1i1p1_200001-200512.nc
--
FGOALS-g2
/bdd/CMIP5/output/LASG-CESS/FGOALS-g2/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_FGOALS-g2_historical_r1i1p1_195001-199912.nc
/bdd/CMIP5/output/LASG-CESS/FGOALS-g2/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_FGOALS-g2_historical_r1i1p1_200001-200512.nc
--
GFDL-CM2p1
/bdd/CMIP5/output/NOAA-GFDL/GFDL-CM2p1/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_GFDL-CM2p1_historical_r1i1p1_197601-198012.nc
/bdd/CMIP5/output/NOAA-GFDL/GFDL-CM2p1/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_GFDL-CM2p1_historical_r1i1p1_198101-198512.nc
/bdd/CMIP5/output/NOAA-GFDL/GFDL-CM2p1/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_GFDL-CM2p1_historical_r1i1p1_198601-199012.nc
/bdd/CMIP5/output/NOAA-GFDL/GFDL-CM2p1/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_GFDL-CM2p1_historical_r1i1p1_199101-199512.nc
/bdd/CMIP5/output/NOAA-GFDL/GFDL-CM2p1/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_GFDL-CM2p1_historical_r1i1p1_199601-200012.nc
--
GFDL-CM3
/bdd/CMIP5/output/NOAA-GFDL/GFDL-CM3/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_GFDL-CM3_historical_r1i1p1_198001-198412.nc
/bdd/CMIP5/output/NOAA-GFDL/GFDL-CM3/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_GFDL-CM3_historical_r1i1p1_198501-198912.nc
/bdd/CMIP5/output/NOAA-GFDL/GFDL-CM3/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_GFDL-CM3_historical_r1i1p1_199001-199412.nc
/bdd/CMIP5/output/NOAA-GFDL/GFDL-CM3/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_GFDL-CM3_historical_r1i1p1_199501-199912.nc
/bdd/CMIP5/output/NOAA-GFDL/GFDL-CM3/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_GFDL-CM3_historical_r1i1p1_200001-200412.nc
--
GFDL-ESM2G
/bdd/CMIP5/output/NOAA-GFDL/GFDL-ESM2G/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_GFDL-ESM2G_historical_r1i1p1_197601-198012.nc
/bdd/CMIP5/output/NOAA-GFDL/GFDL-ESM2G/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_GFDL-ESM2G_historical_r1i1p1_198101-198512.nc
/bdd/CMIP5/output/NOAA-GFDL/GFDL-ESM2G/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_GFDL-ESM2G_historical_r1i1p1_198601-199012.nc
/bdd/CMIP5/output/NOAA-GFDL/GFDL-ESM2G/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_GFDL-ESM2G_historical_r1i1p1_199101-199512.nc
/bdd/CMIP5/output/NOAA-GFDL/GFDL-ESM2G/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_GFDL-ESM2G_historical_r1i1p1_199601-200012.nc
--
GFDL-ESM2M
/bdd/CMIP5/output/NOAA-GFDL/GFDL-ESM2M/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_GFDL-ESM2M_historical_r1i1p1_197601-198012.nc
/bdd/CMIP5/output/NOAA-GFDL/GFDL-ESM2M/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_GFDL-ESM2M_historical_r1i1p1_198101-198512.nc
/bdd/CMIP5/output/NOAA-GFDL/GFDL-ESM2M/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_GFDL-ESM2M_historical_r1i1p1_198601-199012.nc
/bdd/CMIP5/output/NOAA-GFDL/GFDL-ESM2M/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_GFDL-ESM2M_historical_r1i1p1_199101-199512.nc
/bdd/CMIP5/output/NOAA-GFDL/GFDL-ESM2M/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_GFDL-ESM2M_historical_r1i1p1_199601-200012.nc
--
GISS-E2-H
/bdd/CMIP5/output/NASA-GISS/GISS-E2-H/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_GISS-E2-H_historical_r1i1p1_195101-200512.nc
--
GISS-E2-H-CC
/bdd/CMIP5/output/NASA-GISS/GISS-E2-H-CC/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_GISS-E2-H-CC_historical_r1i1p1_195101-201012.nc
--
GISS-E2-R
/bdd/CMIP5/output/NASA-GISS/GISS-E2-R/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_GISS-E2-R_historical_r1i1p1_197601-200012.nc
--
GISS-E2-R-CC
/bdd/CMIP5/output/NASA-GISS/GISS-E2-R-CC/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_GISS-E2-R-CC_historical_r1i1p1_197601-200012.nc
--
HadCM3
/bdd/CMIP5/output/MOHC/HadCM3/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_HadCM3_historical_r1i1p1_195912-198411.nc
/bdd/CMIP5/output/MOHC/HadCM3/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_HadCM3_historical_r1i1p1_198412-200512.nc
--
HadGEM2-AO
/bdd/CMIP5/output/NIMR-KMA/HadGEM2-AO/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_HadGEM2-AO_historical_r1i1p1_186001-200512.nc
--
HadGEM2-CC
/bdd/CMIP5/output/MOHC/HadGEM2-CC/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_HadGEM2-CC_historical_r1i1p1_195912-200511.nc
--
HadGEM2-ES
/bdd/CMIP5/output/MOHC/HadGEM2-ES/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_HadGEM2-ES_historical_r1i1p1_195912-200512.nc
--
IPSL-CM5A-LR
/bdd/CMIP5/output/IPSL/IPSL-CM5A-LR/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_IPSL-CM5A-LR_historical_r1i1p1_185001-200512.nc
--
IPSL-CM5A-MR
/bdd/CMIP5/output/IPSL/IPSL-CM5A-MR/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_IPSL-CM5A-MR_historical_r1i1p1_185001-200512.nc
--
IPSL-CM5B-LR
/bdd/CMIP5/output/IPSL/IPSL-CM5B-LR/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_IPSL-CM5B-LR_historical_r1i1p1_185001-200512.nc
--
MIROC-ESM
/bdd/CMIP5/output/MIROC/MIROC-ESM/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_MIROC-ESM_historical_r1i1p1_185001-200512.nc
--
MIROC-ESM-CHEM
/bdd/CMIP5/output/MIROC/MIROC-ESM-CHEM/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_MIROC-ESM-CHEM_historical_r1i1p1_185001-200512.nc
--
MIROC5
/bdd/CMIP5/output/MIROC/MIROC5/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_MIROC5_historical_r1i1p1_185001-201212.nc
--
MRI-CGCM3
/bdd/CMIP5/output/MRI/MRI-CGCM3/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_MRI-CGCM3_historical_r1i1p1_185001-200512.nc
--
MRI-ESM1
/bdd/CMIP5/output/MRI/MRI-ESM1/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_MRI-ESM1_historical_r1i1p1_185101-200512.nc
--
NorESM1-M
/bdd/CMIP5/output/NCC/NorESM1-M/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_NorESM1-M_historical_r1i1p1_185001-200512.nc
--
NorESM1-ME
/bdd/CMIP5/output/NCC/NorESM1-ME/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_NorESM1-ME_historical_r1i1p1_185001-200512.nc
--
bcc-csm1-1
/bdd/CMIP5/output/BCC/bcc-csm1-1/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_bcc-csm1-1_historical_r1i1p1_185001-201212.nc
--
bcc-csm1-1-m
/bdd/CMIP5/output/BCC/bcc-csm1-1-m/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_bcc-csm1-1-m_historical_r1i1p1_185001-201212.nc
--
inmcm4
/bdd/CMIP5/output/INM/inmcm4/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_inmcm4_historical_r1i1p1_185001-200512.nc
--

==> We have created a CliMAF ensemble called ens_cmip5, which means that I can (among others):

  • apply automatically an operator to all the members
  • compute ensemble statistics on this ensemble (for instance, with ccdo_ens)
In [6]:
# -- Let's compute the annual mean of all the members
anm_ens_cmip5 = clim_average(ens_cmip5, 'ANM')
# -> Note that anm_ens_cmip5 is also a CliMAF ensemble

# -- Now I can use anm_ens_cmip5 to compute an ensemble average
ensavg_anm_ens_cmip5 = ccdo_ens(anm_ens_cmip5, operator='ensavg')

2. Multi-realization CMIP6 CliMAF ensemble on one model

The CMIP6 project is addressed in details in an additionnal notebook: CMIP6_analysis_with_CliMAF.ipynb

The CMIP6 archive is slightly different from the CMIP5 archive.

The key 'institute' and the new key 'grid' implies that we can't build a CMIP6 multi-model ensemble in one move with .explore('ensemble') (example and solution below), since we easily have more than one key with multiple values.

Building a multi-realization ensemble on one model still remains an easy task.

In [7]:
# -- Let's start with an easy example, with the same behavior as described
#    for the CMIP5 multi-model ensemble
req_cmip6 = ds(project='CMIP6', variable='pr', period='*',
               table='Amon', model='CNRM-CM6-1',
               realization='*'
              )

req_cmip6.explore('choices')
Out[7]:
{'grid': 'gr',
 'institute': 'CNRM-CERFACS',
 'mip': 'CMIP',
 'period': [1850-2014],
 'realization': ['r10i1p1f2',
  'r11i1p1f2',
  'r12i1p1f2',
  'r13i1p1f2',
  'r14i1p1f2',
  'r15i1p1f2',
  'r16i1p1f2',
  'r17i1p1f2',
  'r18i1p1f2',
  'r19i1p1f2',
  'r1i1p1f2',
  'r20i1p1f2',
  'r21i1p1f2',
  'r22i1p1f2',
  'r24i1p1f2',
  'r25i1p1f2',
  'r26i1p1f2',
  'r28i1p1f2',
  'r29i1p1f2',
  'r2i1p1f2',
  'r3i1p1f2',
  'r4i1p1f2',
  'r5i1p1f2',
  'r6i1p1f2',
  'r7i1p1f2',
  'r8i1p1f2',
  'r9i1p1f2']}
In [8]:
# -- realization is the only key with a list of values, we can thus use .explore('ensemble')
#    to create an ensemble
multirealization_cmip6 = req_cmip6.explore('ensemble')

summary(multirealization_cmip6)
Keys - values:
{'domain': 'global', 'version': 'latest', 'institute': 'CNRM-CERFACS', 'realization': 'r26i1p1f2', 'period': 1850-2014, 'simulation': '', 'project': 'CMIP6', 'experiment': 'historical', 'grid': 'gr', 'table': 'Amon', 'variable': 'pr', 'mip': 'CMIP', 'model': 'CNRM-CM6-1', 'root': '/bdd'}
-- Ensemble members:
r10i1p1f2
/bdd/CMIP6/CMIP/CNRM-CERFACS/CNRM-CM6-1/historical/r10i1p1f2/Amon/pr/gr/latest/pr_Amon_CNRM-CM6-1_historical_r10i1p1f2_gr_185001-201412.nc
--
r11i1p1f2
/bdd/CMIP6/CMIP/CNRM-CERFACS/CNRM-CM6-1/historical/r11i1p1f2/Amon/pr/gr/latest/pr_Amon_CNRM-CM6-1_historical_r11i1p1f2_gr_185001-201412.nc
--
r12i1p1f2
/bdd/CMIP6/CMIP/CNRM-CERFACS/CNRM-CM6-1/historical/r12i1p1f2/Amon/pr/gr/latest/pr_Amon_CNRM-CM6-1_historical_r12i1p1f2_gr_185001-201412.nc
--
r13i1p1f2
/bdd/CMIP6/CMIP/CNRM-CERFACS/CNRM-CM6-1/historical/r13i1p1f2/Amon/pr/gr/latest/pr_Amon_CNRM-CM6-1_historical_r13i1p1f2_gr_185001-201412.nc
--
r14i1p1f2
/bdd/CMIP6/CMIP/CNRM-CERFACS/CNRM-CM6-1/historical/r14i1p1f2/Amon/pr/gr/latest/pr_Amon_CNRM-CM6-1_historical_r14i1p1f2_gr_185001-201412.nc
--
r15i1p1f2
/bdd/CMIP6/CMIP/CNRM-CERFACS/CNRM-CM6-1/historical/r15i1p1f2/Amon/pr/gr/latest/pr_Amon_CNRM-CM6-1_historical_r15i1p1f2_gr_185001-201412.nc
--
r16i1p1f2
/bdd/CMIP6/CMIP/CNRM-CERFACS/CNRM-CM6-1/historical/r16i1p1f2/Amon/pr/gr/latest/pr_Amon_CNRM-CM6-1_historical_r16i1p1f2_gr_185001-201412.nc
--
r17i1p1f2
/bdd/CMIP6/CMIP/CNRM-CERFACS/CNRM-CM6-1/historical/r17i1p1f2/Amon/pr/gr/latest/pr_Amon_CNRM-CM6-1_historical_r17i1p1f2_gr_185001-201412.nc
--
r18i1p1f2
/bdd/CMIP6/CMIP/CNRM-CERFACS/CNRM-CM6-1/historical/r18i1p1f2/Amon/pr/gr/latest/pr_Amon_CNRM-CM6-1_historical_r18i1p1f2_gr_185001-201412.nc
--
r19i1p1f2
/bdd/CMIP6/CMIP/CNRM-CERFACS/CNRM-CM6-1/historical/r19i1p1f2/Amon/pr/gr/latest/pr_Amon_CNRM-CM6-1_historical_r19i1p1f2_gr_185001-201412.nc
--
r1i1p1f2
/bdd/CMIP6/CMIP/CNRM-CERFACS/CNRM-CM6-1/historical/r1i1p1f2/Amon/pr/gr/latest/pr_Amon_CNRM-CM6-1_historical_r1i1p1f2_gr_185001-201412.nc
--
r20i1p1f2
/bdd/CMIP6/CMIP/CNRM-CERFACS/CNRM-CM6-1/historical/r20i1p1f2/Amon/pr/gr/latest/pr_Amon_CNRM-CM6-1_historical_r20i1p1f2_gr_185001-201412.nc
--
r21i1p1f2
/bdd/CMIP6/CMIP/CNRM-CERFACS/CNRM-CM6-1/historical/r21i1p1f2/Amon/pr/gr/latest/pr_Amon_CNRM-CM6-1_historical_r21i1p1f2_gr_185001-201412.nc
--
r22i1p1f2
/bdd/CMIP6/CMIP/CNRM-CERFACS/CNRM-CM6-1/historical/r22i1p1f2/Amon/pr/gr/latest/pr_Amon_CNRM-CM6-1_historical_r22i1p1f2_gr_185001-201412.nc
--
r24i1p1f2
/bdd/CMIP6/CMIP/CNRM-CERFACS/CNRM-CM6-1/historical/r24i1p1f2/Amon/pr/gr/latest/pr_Amon_CNRM-CM6-1_historical_r24i1p1f2_gr_185001-201412.nc
--
r25i1p1f2
/bdd/CMIP6/CMIP/CNRM-CERFACS/CNRM-CM6-1/historical/r25i1p1f2/Amon/pr/gr/latest/pr_Amon_CNRM-CM6-1_historical_r25i1p1f2_gr_185001-201412.nc
--
r26i1p1f2
/bdd/CMIP6/CMIP/CNRM-CERFACS/CNRM-CM6-1/historical/r26i1p1f2/Amon/pr/gr/latest/pr_Amon_CNRM-CM6-1_historical_r26i1p1f2_gr_185001-201412.nc
--
r28i1p1f2
/bdd/CMIP6/CMIP/CNRM-CERFACS/CNRM-CM6-1/historical/r28i1p1f2/Amon/pr/gr/latest/pr_Amon_CNRM-CM6-1_historical_r28i1p1f2_gr_185001-201412.nc
--
r29i1p1f2
/bdd/CMIP6/CMIP/CNRM-CERFACS/CNRM-CM6-1/historical/r29i1p1f2/Amon/pr/gr/latest/pr_Amon_CNRM-CM6-1_historical_r29i1p1f2_gr_185001-201412.nc
--
r2i1p1f2
/bdd/CMIP6/CMIP/CNRM-CERFACS/CNRM-CM6-1/historical/r2i1p1f2/Amon/pr/gr/latest/pr_Amon_CNRM-CM6-1_historical_r2i1p1f2_gr_185001-201412.nc
--
r3i1p1f2
/bdd/CMIP6/CMIP/CNRM-CERFACS/CNRM-CM6-1/historical/r3i1p1f2/Amon/pr/gr/latest/pr_Amon_CNRM-CM6-1_historical_r3i1p1f2_gr_185001-201412.nc
--
r4i1p1f2
/bdd/CMIP6/CMIP/CNRM-CERFACS/CNRM-CM6-1/historical/r4i1p1f2/Amon/pr/gr/latest/pr_Amon_CNRM-CM6-1_historical_r4i1p1f2_gr_185001-201412.nc
--
r5i1p1f2
/bdd/CMIP6/CMIP/CNRM-CERFACS/CNRM-CM6-1/historical/r5i1p1f2/Amon/pr/gr/latest/pr_Amon_CNRM-CM6-1_historical_r5i1p1f2_gr_185001-201412.nc
--
r6i1p1f2
/bdd/CMIP6/CMIP/CNRM-CERFACS/CNRM-CM6-1/historical/r6i1p1f2/Amon/pr/gr/latest/pr_Amon_CNRM-CM6-1_historical_r6i1p1f2_gr_185001-201412.nc
--
r7i1p1f2
/bdd/CMIP6/CMIP/CNRM-CERFACS/CNRM-CM6-1/historical/r7i1p1f2/Amon/pr/gr/latest/pr_Amon_CNRM-CM6-1_historical_r7i1p1f2_gr_185001-201412.nc
--
r8i1p1f2
/bdd/CMIP6/CMIP/CNRM-CERFACS/CNRM-CM6-1/historical/r8i1p1f2/Amon/pr/gr/latest/pr_Amon_CNRM-CM6-1_historical_r8i1p1f2_gr_185001-201412.nc
--
r9i1p1f2
/bdd/CMIP6/CMIP/CNRM-CERFACS/CNRM-CM6-1/historical/r9i1p1f2/Amon/pr/gr/latest/pr_Amon_CNRM-CM6-1_historical_r9i1p1f2_gr_185001-201412.nc
--

3. make an ensemble with eds (instead of ds()): specify explicitly the members of the ensemble

In [9]:
ens_cmip5 = eds(project='CMIP5',
               model=['IPSL-CM5A-MR','CNRM-CM5'],
               variable='tos',
               experiment='historical',
               period='1980-2000',
               frequency='monthly',
               realization='r1i1p1',
               )
summary(ens_cmip5)
Keys - values:
{'domain': 'global', 'realm': '*', 'version': 'latest', 'period': 1980-2000, 'simulation': '', 'project': 'CMIP5', 'experiment': 'historical', 'frequency': 'monthly', 'realization': 'r1i1p1', 'variable': 'tos', 'table': '*', 'model': 'CNRM-CM5', 'root': '/bdd'}
-- Ensemble members:
IPSL-CM5A-MR
/bdd/CMIP5/output/IPSL/IPSL-CM5A-MR/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_IPSL-CM5A-MR_historical_r1i1p1_185001-200512.nc
--
CNRM-CM5
/bdd/CMIP5/output/CNRM-CERFACS/CNRM-CM5/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_CNRM-CM5_historical_r1i1p1_198001-198912.nc
/bdd/CMIP5/output/CNRM-CERFACS/CNRM-CM5/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_CNRM-CM5_historical_r1i1p1_199001-199912.nc
/bdd/CMIP5/output/CNRM-CERFACS/CNRM-CM5/historical/mon/ocean/Omon/r1i1p1/latest/tos/tos_Omon_CNRM-CM5_historical_r1i1p1_200001-200512.nc
--

4. Quick example to illustrate the pretreatments and multiplot with cpage

In [10]:
# -- On every member I will apply:

# --   - a DJF average
djf_ens_cmip5 = clim_average(ens_cmip5, 'DJF')

# --   - a regridding on a common grid
rgrd_djf_ens_cmip5 = regridn(djf_ens_cmip5, cdogrid='r360x180')
    
# --   - a selection of geographical domain
NAtl_rgrd_djf_ens_cmip5 = llbox(rgrd_djf_ens_cmip5, lonmin=-80, lonmax=40, latmin=20, latmax=80)

# -- And do a multiplot (warning: limited to 24 plots...)
pp = dict(focus='ocean', offset=-273.15, contours=1)
#   -> see plot() documentation: https://climaf.readthedocs.io/en/latest/scripts/plot.html
mp = cpage( plot(NAtl_rgrd_djf_ens_cmip5, **pp) )

iplot(mp)
Out[10]: