How to access and load TRACMIP data from the Pangeo cloud

This notebook presents two approaches of accessing TRACMIP data in the Pangeo cloud from your own computer. Both appraoches access zarr-based data in the Google Cloud and in the example provided here result in a dictionary of monthly-mean precipitation in the aquaControl from all TRACMIP models.

As a proof of concept, the notebook closes with plotting the time-averaged precipitation for one of the TRACMIP models using the dictionaries generated by both approaches. Naturally, and in fact naecessarily, the plot is the same for both dictionaries.

Approach 1 via tracmip.csv

Based on "Way 2: Do the same thing with the Google Cloud Zarr-based data (still from your laptop)" described in Ryan Abernathey's blog post "CMIP6 in the Cloud Five Ways", https://medium.com/pangeo/cmip6-in-the-cloud-five-ways-96b177abe396

In [1]:
import numpy as np
import pandas as pd
import xarray as xr
import zarr
import gcsfs

Browse Catalog: The data catatalog is stored as a CSV file. Here we read it with Pandas.

In [2]:
df = pd.read_csv('https://storage.googleapis.com/cmip6/tracmip.csv')
df.head()
Out[2]:
frequency experiment model variable version source
0 A3hr aqua4xCO2 AM21 hur v20190116 gs://cmip6/tracmip/A3hr/aqua4xCO2/AM21/hur/v20...
1 A3hr aqua4xCO2 AM21 hus v20190116 gs://cmip6/tracmip/A3hr/aqua4xCO2/AM21/hus/v20...
2 A3hr aqua4xCO2 AM21 ta v20190116 gs://cmip6/tracmip/A3hr/aqua4xCO2/AM21/ta/v201...
3 A3hr aqua4xCO2 AM21 ua v20190116 gs://cmip6/tracmip/A3hr/aqua4xCO2/AM21/ua/v201...
4 A3hr aqua4xCO2 AM21 va v20190116 gs://cmip6/tracmip/A3hr/aqua4xCO2/AM21/va/v201...

For the purpose of this example, we filter the data to find monthly precipitation for the aquaControl simulation.

In [3]:
df_pr = df.query("frequency == 'Amon' & variable == 'pr' & experiment == 'aquaControl'")

We check the content of the dataframe. As desired it contains monthly precipitation for the 14 TRACMIP models. The entries in the source column point to the data location in the Google Cloud and are needed to read the data.

In [4]:
df_pr
Out[4]:
frequency experiment model variable version source
4844 Amon aquaControl AM21 pr v20190116 gs://cmip6/tracmip/Amon/aquaControl/AM21/pr/v2...
4879 Amon aquaControl CALTECH pr v20181025 gs://cmip6/tracmip/Amon/aquaControl/CALTECH/pr...
4913 Amon aquaControl CAM3 pr v20190129 gs://cmip6/tracmip/Amon/aquaControl/CAM3/pr/v2...
4953 Amon aquaControl CAM4 pr v20190409 gs://cmip6/tracmip/Amon/aquaControl/CAM4/pr/v2...
4996 Amon aquaControl CAM5Nor pr v20190305 gs://cmip6/tracmip/Amon/aquaControl/CAM5Nor/pr...
5032 Amon aquaControl CNRM-AM5 pr v20180423 gs://cmip6/tracmip/Amon/aquaControl/CNRM-AM5/p...
5067 Amon aquaControl ECHAM61 pr v20180423 gs://cmip6/tracmip/Amon/aquaControl/ECHAM61/pr...
5110 Amon aquaControl ECHAM63 pr v20190129 gs://cmip6/tracmip/Amon/aquaControl/ECHAM63/pr...
5153 Amon aquaControl GISS-ModelE2 pr v20190114 gs://cmip6/tracmip/Amon/aquaControl/GISS-Model...
5199 Amon aquaControl LMDZ5A pr v20190114 gs://cmip6/tracmip/Amon/aquaControl/LMDZ5A/pr/...
5242 Amon aquaControl MIROC5 pr v20181025 gs://cmip6/tracmip/Amon/aquaControl/MIROC5/pr/...
5284 Amon aquaControl MPAS pr v20190131 gs://cmip6/tracmip/Amon/aquaControl/MPAS/pr/v2...
5324 Amon aquaControl MetUM-CTL pr v20180423 gs://cmip6/tracmip/Amon/aquaControl/MetUM-CTL/...
5365 Amon aquaControl MetUM-ENT pr v20180423 gs://cmip6/tracmip/Amon/aquaControl/MetUM-ENT/...

We are now going to read the data into a dictionary of xarray datasets.

In [5]:
# this only needs to be created once
gcs = gcsfs.GCSFileSystem(token='anon')

# initialize an empty dictionary
ds_dict1=dict()

To this end, we loop over the source values to read the data of the individual models and to fill the dictionary. As for the dictionary keys we use the model names.

In [6]:
for zstore in df_pr.source.values:
    mapper = gcs.get_mapper(zstore)
    ds = xr.open_zarr(mapper, consolidated=True)
    ds_dict1[ds.attrs['model_id']] = ds

For the sake of demonstration, we print the dictionary content for the ECHAM61 model.

In [7]:
ds_dict1['ECHAM61']
Out[7]:
Show/Hide data repr Show/Hide attributes
xarray.Dataset
    • bnds: 2
    • lat: 96
    • lon: 192
    • time: 360
    • lat
      (lat)
      float64
      -88.57 -86.72 ... 86.72 88.57
      axis :
      Y
      bounds :
      lat_bnds
      long_name :
      latitude
      standard_name :
      latitude
      units :
      degrees_north
      array([-88.572169, -86.722531, -84.86197 , -82.998942, -81.134977, -79.270559,
             -77.405888, -75.541061, -73.676132, -71.811132, -69.946081, -68.080991,
             -66.215872, -64.35073 , -62.485571, -60.620396, -58.755209, -56.890013,
             -55.024808, -53.159595, -51.294377, -49.429154, -47.563926, -45.698694,
             -43.833459, -41.96822 , -40.102979, -38.237736, -36.372491, -34.507243,
             -32.641994, -30.776744, -28.911492, -27.046239, -25.180986, -23.315731,
             -21.450475, -19.585219, -17.719962, -15.854704, -13.989446, -12.124187,
             -10.258928,  -8.393669,  -6.528409,  -4.66315 ,  -2.79789 ,  -0.93263 ,
               0.93263 ,   2.79789 ,   4.66315 ,   6.528409,   8.393669,  10.258928,
              12.124187,  13.989446,  15.854704,  17.719962,  19.585219,  21.450475,
              23.315731,  25.180986,  27.046239,  28.911492,  30.776744,  32.641994,
              34.507243,  36.372491,  38.237736,  40.102979,  41.96822 ,  43.833459,
              45.698694,  47.563926,  49.429154,  51.294377,  53.159595,  55.024808,
              56.890013,  58.755209,  60.620396,  62.485571,  64.35073 ,  66.215872,
              68.080991,  69.946081,  71.811132,  73.676132,  75.541061,  77.405888,
              79.270559,  81.134977,  82.998942,  84.86197 ,  86.722531,  88.572169])
    • lon
      (lon)
      float64
      0.0 1.875 3.75 ... 356.2 358.1
      axis :
      X
      bounds :
      lon_bnds
      long_name :
      longitude
      standard_name :
      longitude
      units :
      degrees_east
      array([  0.   ,   1.875,   3.75 ,   5.625,   7.5  ,   9.375,  11.25 ,  13.125,
              15.   ,  16.875,  18.75 ,  20.625,  22.5  ,  24.375,  26.25 ,  28.125,
              30.   ,  31.875,  33.75 ,  35.625,  37.5  ,  39.375,  41.25 ,  43.125,
              45.   ,  46.875,  48.75 ,  50.625,  52.5  ,  54.375,  56.25 ,  58.125,
              60.   ,  61.875,  63.75 ,  65.625,  67.5  ,  69.375,  71.25 ,  73.125,
              75.   ,  76.875,  78.75 ,  80.625,  82.5  ,  84.375,  86.25 ,  88.125,
              90.   ,  91.875,  93.75 ,  95.625,  97.5  ,  99.375, 101.25 , 103.125,
             105.   , 106.875, 108.75 , 110.625, 112.5  , 114.375, 116.25 , 118.125,
             120.   , 121.875, 123.75 , 125.625, 127.5  , 129.375, 131.25 , 133.125,
             135.   , 136.875, 138.75 , 140.625, 142.5  , 144.375, 146.25 , 148.125,
             150.   , 151.875, 153.75 , 155.625, 157.5  , 159.375, 161.25 , 163.125,
             165.   , 166.875, 168.75 , 170.625, 172.5  , 174.375, 176.25 , 178.125,
             180.   , 181.875, 183.75 , 185.625, 187.5  , 189.375, 191.25 , 193.125,
             195.   , 196.875, 198.75 , 200.625, 202.5  , 204.375, 206.25 , 208.125,
             210.   , 211.875, 213.75 , 215.625, 217.5  , 219.375, 221.25 , 223.125,
             225.   , 226.875, 228.75 , 230.625, 232.5  , 234.375, 236.25 , 238.125,
             240.   , 241.875, 243.75 , 245.625, 247.5  , 249.375, 251.25 , 253.125,
             255.   , 256.875, 258.75 , 260.625, 262.5  , 264.375, 266.25 , 268.125,
             270.   , 271.875, 273.75 , 275.625, 277.5  , 279.375, 281.25 , 283.125,
             285.   , 286.875, 288.75 , 290.625, 292.5  , 294.375, 296.25 , 298.125,
             300.   , 301.875, 303.75 , 305.625, 307.5  , 309.375, 311.25 , 313.125,
             315.   , 316.875, 318.75 , 320.625, 322.5  , 324.375, 326.25 , 328.125,
             330.   , 331.875, 333.75 , 335.625, 337.5  , 339.375, 341.25 , 343.125,
             345.   , 346.875, 348.75 , 350.625, 352.5  , 354.375, 356.25 , 358.125])
    • time
      (time)
      object
      0016-01-16 00:00:00 ... 0045-12-16 00:00:00
      axis :
      T
      bounds :
      time_bnds
      long_name :
      time
      standard_name :
      time
      array([cftime.Datetime360Day(0016-01-16 00:00:00),
             cftime.Datetime360Day(0016-02-16 00:00:00),
             cftime.Datetime360Day(0016-03-16 00:00:00), ...,
             cftime.Datetime360Day(0045-10-16 00:00:00),
             cftime.Datetime360Day(0045-11-16 00:00:00),
             cftime.Datetime360Day(0045-12-16 00:00:00)], dtype=object)
    • lat_bnds
      (lat, bnds)
      float64
      dask.array<chunksize=(96, 2), meta=np.ndarray>
      Array Chunk
      Bytes 1.54 kB 1.54 kB
      Shape (96, 2) (96, 2)
      Count 2 Tasks 1 Chunks
      Type float64 numpy.ndarray
      2 96
    • lon_bnds
      (lon, bnds)
      float64
      dask.array<chunksize=(192, 2), meta=np.ndarray>
      Array Chunk
      Bytes 3.07 kB 3.07 kB
      Shape (192, 2) (192, 2)
      Count 2 Tasks 1 Chunks
      Type float64 numpy.ndarray
      2 192
    • pr
      (time, lat, lon)
      float32
      dask.array<chunksize=(360, 96, 192), meta=np.ndarray>
      associated_files :
      baseURL: https://www.sites.google.com/site/tracmip/ gridspecFile: gridspec_atmos_fx_ECHAM61_aquaControlTRACMIP_r0i0p0.nc areacella: areacella_fx_ECHAM61_aquaControlTRACMIP_r0i0p0.nc
      cell_measures :
      area: areacella
      cell_methods :
      time: mean
      comment :
      at surface; includes both liquid and solid phases from all types of clouds (both large-scale and convective)
      history :
      2018-02-25T12:21:01Z altered by CMOR: replaced missing value flag (-9e+33) with standard missing value (1e+20). 2018-02-25T12:21:01Z altered by CMOR: Inverted axis: lat.
      long_name :
      Precipitation
      original_name :
      pr
      standard_name :
      precipitation_flux
      units :
      kg m-2 s-1
      Array Chunk
      Bytes 26.54 MB 26.54 MB
      Shape (360, 96, 192) (360, 96, 192)
      Count 2 Tasks 1 Chunks
      Type float32 numpy.ndarray
      192 96 360
    • time_bnds
      (time, bnds)
      object
      dask.array<chunksize=(360, 2), meta=np.ndarray>
      Array Chunk
      Bytes 5.76 kB 5.76 kB
      Shape (360, 2) (360, 2)
      Count 2 Tasks 1 Chunks
      Type object numpy.ndarray
      2 360
  • Conventions :
    CF-1.4
    branch_time :
    0.0
    cmor_version :
    2.9.1
    comment :
    aqua planet control of TRACMIP; for TRACMIP see Voigt et al., 2016, The Tropical Rain belts with an Annual cycle and a Continent Model Intercomparison Project: TRACMIP, 9, 1868–1891, doi:10.1002/2016MS000748
    contact :
    aiko@ldeo.columbia.edu; aiko.voigt@kit.edu
    creation_date :
    2018-02-25T12:21:01Z
    experiment :
    aqua planet control of TRACMIP
    experiment_id :
    aquaControlTRACMIP
    forcing :
    CTRL
    frequency :
    mon
    history :
    N/A 2018-02-25T12:21:01Z CMOR rewrote data to comply with CF standards and TRACMIP requirements.
    initialization_method :
    1
    institute_id :
    LDEO
    institution :
    Lamont-Doherty Earth Observatory, Columbia University; Karlsruhe Institute of Technology
    model_id :
    ECHAM61
    modeling_realm :
    atmos
    parent_experiment :
    N/A
    parent_experiment_id :
    N/A
    parent_experiment_rip :
    N/A
    physics_version :
    1
    product :
    output
    project_id :
    TRACMIP
    realization :
    1
    references :
    ECHAM6.1: Stevens et al., 2013, Atmospheric component of the MPI-M Earth System Model: ECHAM6, JAMES, 5, 146-172, doi:10.1002/jame.2015;
    source :
    ECHAM61, 2013, T63, 47 levels;
    table_id :
    Table Amon (11 September 2017) b0abd1a83fe45ef2ed9e415b249165bd
    title :
    ECHAM61 model output prepared for TRACMIP aqua planet control of TRACMIP
    tracking_id :
    a6042360-356a-4d4e-8357-9699f6c18da1

Aproach 2 via intake

This approach was developed with help by Charles Christopher Blackmon Luca.

In [8]:
from intake import open_catalog
In [9]:
# get the entire Pangeo catalogue ...
cat = open_catalog("https://raw.githubusercontent.com/pangeo-data/pangeo-datastore/master/intake-catalogs/climate.yaml")
# ... and select TRACMIP collection
col = cat.tracmip()

For illustration, we look at some basic information of the TRACMIP collection. AS expected, there is 3 output frequencies (monthly-mean, daily-mean, 3-hr snapshots), 11 experiments (6 are due to the CALTECH model with changed atmosperic opacity), and 47 variables

In [10]:
col
Out[10]:

pangeo-tracmip catalog with 187 dataset(s) from 7067 asset(s):

unique
frequency 3
experiment 11
model 14
variable 47
version 10
source 7067

To make ourselves a bit more familiar with the collection we print its starting and end portion to screen. This looks just as for appraoch 1, as it must be.

In [11]:
col.df.head()
Out[11]:
frequency experiment model variable version source
0 A3hr aqua4xCO2 AM21 hur v20190116 gs://cmip6/tracmip/A3hr/aqua4xCO2/AM21/hur/v20...
1 A3hr aqua4xCO2 AM21 hus v20190116 gs://cmip6/tracmip/A3hr/aqua4xCO2/AM21/hus/v20...
2 A3hr aqua4xCO2 AM21 ta v20190116 gs://cmip6/tracmip/A3hr/aqua4xCO2/AM21/ta/v201...
3 A3hr aqua4xCO2 AM21 ua v20190116 gs://cmip6/tracmip/A3hr/aqua4xCO2/AM21/ua/v201...
4 A3hr aqua4xCO2 AM21 va v20190116 gs://cmip6/tracmip/A3hr/aqua4xCO2/AM21/va/v201...
In [12]:
col.df.tail()
Out[12]:
frequency experiment model variable version source
7062 Amon landOrbit MetUM-ENT uas v20180423 gs://cmip6/tracmip/Amon/landOrbit/MetUM-ENT/ua...
7063 Amon landOrbit MetUM-ENT va v20180423 gs://cmip6/tracmip/Amon/landOrbit/MetUM-ENT/va...
7064 Amon landOrbit MetUM-ENT vas v20180423 gs://cmip6/tracmip/Amon/landOrbit/MetUM-ENT/va...
7065 Amon landOrbit MetUM-ENT wap v20180423 gs://cmip6/tracmip/Amon/landOrbit/MetUM-ENT/wa...
7066 Amon landOrbit MetUM-ENT zg v20180423 gs://cmip6/tracmip/Amon/landOrbit/MetUM-ENT/zg...

Now we load the monthly-mean precip data for the aquaControl experiment into a dictionary, in analogy to what we did for approach 1.

Note: the option "zarr_kwargs={'consolidated': True}" for to_dataset_dicts does not seem necessary but is still included here.

In [13]:
ds_dict2 = col.search(frequency="Amon", experiment="aquaControl",
                     variable="pr").to_dataset_dict(zarr_kwargs={'consolidated': True})
Dataset(s):   0%|                                       | 0/14 [00:00<?, ?it/s]
--> The keys in the returned dictionary of datasets are constructed as follows:
	'model.experiment.frequency'
Dataset(s): 100%|██████████████████████████████| 14/14 [00:07<00:00,  1.79it/s]

For the sake of demonstration, we print the dictionary content for the ECHAM61 model. Note that the keys are now 'model.experiment.frequency'.

In [14]:
ds_dict2['ECHAM61.aquaControl.Amon']
Out[14]:
Show/Hide data repr Show/Hide attributes
xarray.Dataset
    • bnds: 2
    • lat: 96
    • lon: 192
    • time: 360
    • lat
      (lat)
      float64
      -88.57 -86.72 ... 86.72 88.57
      axis :
      Y
      bounds :
      lat_bnds
      long_name :
      latitude
      standard_name :
      latitude
      units :
      degrees_north
      array([-88.572169, -86.722531, -84.86197 , -82.998942, -81.134977, -79.270559,
             -77.405888, -75.541061, -73.676132, -71.811132, -69.946081, -68.080991,
             -66.215872, -64.35073 , -62.485571, -60.620396, -58.755209, -56.890013,
             -55.024808, -53.159595, -51.294377, -49.429154, -47.563926, -45.698694,
             -43.833459, -41.96822 , -40.102979, -38.237736, -36.372491, -34.507243,
             -32.641994, -30.776744, -28.911492, -27.046239, -25.180986, -23.315731,
             -21.450475, -19.585219, -17.719962, -15.854704, -13.989446, -12.124187,
             -10.258928,  -8.393669,  -6.528409,  -4.66315 ,  -2.79789 ,  -0.93263 ,
               0.93263 ,   2.79789 ,   4.66315 ,   6.528409,   8.393669,  10.258928,
              12.124187,  13.989446,  15.854704,  17.719962,  19.585219,  21.450475,
              23.315731,  25.180986,  27.046239,  28.911492,  30.776744,  32.641994,
              34.507243,  36.372491,  38.237736,  40.102979,  41.96822 ,  43.833459,
              45.698694,  47.563926,  49.429154,  51.294377,  53.159595,  55.024808,
              56.890013,  58.755209,  60.620396,  62.485571,  64.35073 ,  66.215872,
              68.080991,  69.946081,  71.811132,  73.676132,  75.541061,  77.405888,
              79.270559,  81.134977,  82.998942,  84.86197 ,  86.722531,  88.572169])
    • lon
      (lon)
      float64
      0.0 1.875 3.75 ... 356.2 358.1
      axis :
      X
      bounds :
      lon_bnds
      long_name :
      longitude
      standard_name :
      longitude
      units :
      degrees_east
      array([  0.   ,   1.875,   3.75 ,   5.625,   7.5  ,   9.375,  11.25 ,  13.125,
              15.   ,  16.875,  18.75 ,  20.625,  22.5  ,  24.375,  26.25 ,  28.125,
              30.   ,  31.875,  33.75 ,  35.625,  37.5  ,  39.375,  41.25 ,  43.125,
              45.   ,  46.875,  48.75 ,  50.625,  52.5  ,  54.375,  56.25 ,  58.125,
              60.   ,  61.875,  63.75 ,  65.625,  67.5  ,  69.375,  71.25 ,  73.125,
              75.   ,  76.875,  78.75 ,  80.625,  82.5  ,  84.375,  86.25 ,  88.125,
              90.   ,  91.875,  93.75 ,  95.625,  97.5  ,  99.375, 101.25 , 103.125,
             105.   , 106.875, 108.75 , 110.625, 112.5  , 114.375, 116.25 , 118.125,
             120.   , 121.875, 123.75 , 125.625, 127.5  , 129.375, 131.25 , 133.125,
             135.   , 136.875, 138.75 , 140.625, 142.5  , 144.375, 146.25 , 148.125,
             150.   , 151.875, 153.75 , 155.625, 157.5  , 159.375, 161.25 , 163.125,
             165.   , 166.875, 168.75 , 170.625, 172.5  , 174.375, 176.25 , 178.125,
             180.   , 181.875, 183.75 , 185.625, 187.5  , 189.375, 191.25 , 193.125,
             195.   , 196.875, 198.75 , 200.625, 202.5  , 204.375, 206.25 , 208.125,
             210.   , 211.875, 213.75 , 215.625, 217.5  , 219.375, 221.25 , 223.125,
             225.   , 226.875, 228.75 , 230.625, 232.5  , 234.375, 236.25 , 238.125,
             240.   , 241.875, 243.75 , 245.625, 247.5  , 249.375, 251.25 , 253.125,
             255.   , 256.875, 258.75 , 260.625, 262.5  , 264.375, 266.25 , 268.125,
             270.   , 271.875, 273.75 , 275.625, 277.5  , 279.375, 281.25 , 283.125,
             285.   , 286.875, 288.75 , 290.625, 292.5  , 294.375, 296.25 , 298.125,
             300.   , 301.875, 303.75 , 305.625, 307.5  , 309.375, 311.25 , 313.125,
             315.   , 316.875, 318.75 , 320.625, 322.5  , 324.375, 326.25 , 328.125,
             330.   , 331.875, 333.75 , 335.625, 337.5  , 339.375, 341.25 , 343.125,
             345.   , 346.875, 348.75 , 350.625, 352.5  , 354.375, 356.25 , 358.125])
    • time
      (time)
      object
      0016-01-16 00:00:00 ... 0045-12-16 00:00:00
      axis :
      T
      bounds :
      time_bnds
      long_name :
      time
      standard_name :
      time
      array([cftime.Datetime360Day(0016-01-16 00:00:00),
             cftime.Datetime360Day(0016-02-16 00:00:00),
             cftime.Datetime360Day(0016-03-16 00:00:00), ...,
             cftime.Datetime360Day(0045-10-16 00:00:00),
             cftime.Datetime360Day(0045-11-16 00:00:00),
             cftime.Datetime360Day(0045-12-16 00:00:00)], dtype=object)
    • lat_bnds
      (lat, bnds)
      float64
      dask.array<chunksize=(96, 2), meta=np.ndarray>
      Array Chunk
      Bytes 1.54 kB 1.54 kB
      Shape (96, 2) (96, 2)
      Count 2 Tasks 1 Chunks
      Type float64 numpy.ndarray
      2 96
    • lon_bnds
      (lon, bnds)
      float64
      dask.array<chunksize=(192, 2), meta=np.ndarray>
      Array Chunk
      Bytes 3.07 kB 3.07 kB
      Shape (192, 2) (192, 2)
      Count 2 Tasks 1 Chunks
      Type float64 numpy.ndarray
      2 192
    • pr
      (time, lat, lon)
      float32
      dask.array<chunksize=(360, 96, 192), meta=np.ndarray>
      associated_files :
      baseURL: https://www.sites.google.com/site/tracmip/ gridspecFile: gridspec_atmos_fx_ECHAM61_aquaControlTRACMIP_r0i0p0.nc areacella: areacella_fx_ECHAM61_aquaControlTRACMIP_r0i0p0.nc
      cell_measures :
      area: areacella
      cell_methods :
      time: mean
      comment :
      at surface; includes both liquid and solid phases from all types of clouds (both large-scale and convective)
      history :
      2018-02-25T12:21:01Z altered by CMOR: replaced missing value flag (-9e+33) with standard missing value (1e+20). 2018-02-25T12:21:01Z altered by CMOR: Inverted axis: lat.
      long_name :
      Precipitation
      original_name :
      pr
      standard_name :
      precipitation_flux
      units :
      kg m-2 s-1
      Array Chunk
      Bytes 26.54 MB 26.54 MB
      Shape (360, 96, 192) (360, 96, 192)
      Count 2 Tasks 1 Chunks
      Type float32 numpy.ndarray
      192 96 360
    • time_bnds
      (time, bnds)
      object
      dask.array<chunksize=(360, 2), meta=np.ndarray>
      Array Chunk
      Bytes 5.76 kB 5.76 kB
      Shape (360, 2) (360, 2)
      Count 2 Tasks 1 Chunks
      Type object numpy.ndarray
      2 360
  • Conventions :
    CF-1.4
    branch_time :
    0.0
    cmor_version :
    2.9.1
    comment :
    aqua planet control of TRACMIP; for TRACMIP see Voigt et al., 2016, The Tropical Rain belts with an Annual cycle and a Continent Model Intercomparison Project: TRACMIP, 9, 1868–1891, doi:10.1002/2016MS000748
    contact :
    aiko@ldeo.columbia.edu; aiko.voigt@kit.edu
    creation_date :
    2018-02-25T12:21:01Z
    experiment :
    aqua planet control of TRACMIP
    experiment_id :
    aquaControlTRACMIP
    forcing :
    CTRL
    frequency :
    mon
    history :
    N/A 2018-02-25T12:21:01Z CMOR rewrote data to comply with CF standards and TRACMIP requirements.
    initialization_method :
    1
    institute_id :
    LDEO
    institution :
    Lamont-Doherty Earth Observatory, Columbia University; Karlsruhe Institute of Technology
    model_id :
    ECHAM61
    modeling_realm :
    atmos
    parent_experiment :
    N/A
    parent_experiment_id :
    N/A
    parent_experiment_rip :
    N/A
    physics_version :
    1
    product :
    output
    project_id :
    TRACMIP
    realization :
    1
    references :
    ECHAM6.1: Stevens et al., 2013, Atmospheric component of the MPI-M Earth System Model: ECHAM6, JAMES, 5, 146-172, doi:10.1002/jame.2015;
    source :
    ECHAM61, 2013, T63, 47 levels;
    table_id :
    Table Amon (11 September 2017) b0abd1a83fe45ef2ed9e415b249165bd
    title :
    ECHAM61 model output prepared for TRACMIP aqua planet control of TRACMIP
    tracking_id :
    a6042360-356a-4d4e-8357-9699f6c18da1
    intake_esm_varname :
    pr
    intake_esm_dataset_key :
    ECHAM61.aquaControl.Amon

Plot zonal-mean time-mean precip for last 20 years for ECHAM61 model using the dictionaries from the two approaches

In [15]:
import matplotlib.pyplot as plt
In [16]:
plt.plot(ds_dict1['ECHAM61'].lat, 
         ds_dict1['ECHAM61']['pr'].isel(time=slice(120,360)).mean(['lon', 'time'])*86400,
        'b', linewidth=3, label='approach 1')
plt.plot(ds_dict2['ECHAM61.aquaControl.Amon'].lat, 
         ds_dict2['ECHAM61.aquaControl.Amon']['pr'].isel(time=slice(120,360)).mean(['lon', 'time'])*86400,
        'r--', linewidth=3, label='approach 2')
plt.xlabel('degree latitude')
plt.ylabel('precipitation (mm/day)')
plt.title('ECHAM61, aquaControl');
plt.legend();

Closing remark

The above hopefully provides a helpful and clear recipe for accessing TRACMIP data from the Pangeo Cloud. It should be straightforward to condense the approaches into wrapper functions.