Analyzing the historical and projected changes in the precipitation amounts using CMIP6 model data¶
As an atmospheric data scientist, I would like to process the precipitation variable from the historical and projected CMIP6 climate data to answer specific questions such as:
How can I get a subset of CMIP6 data?
How do the global monthly precipitation amounts change between the historical and projected (ssp585)?
Do we observe any increase or decrease in the yearly total precipitation amounts areally averaged for Turkey?
To what extent our analysis can be questionable?
Open Data¶
For today’s analyses, we will be using the a subset of CMIP6 historical and projection data. The use of intake package (see documentation) makes the data-retrieving process easy for us, therefore we are going to make use of it.
Let’s begin with importing the necessary tools, which we will exploit in our analyses.
import pandas as pd
import intake
import matplotlib.pyplot as plt
import numpy as np
Note that in addition to the packages above you will need the s3fs
and intake-esm
packages installed in your environment beforehand.
The intake package facilitates easily viewing the ESM’s CMIP6 climate model simulations stored at AWS or Google Cloud by making use of the open_esm_datastore
function.
cmip_aws_link = "https://cmip6-pds.s3.amazonaws.com/pangeo-cmip6.json"
cmip_col = intake.open_esm_datastore(cmip_aws_link) # esm cmip6 collection
ERROR! Session/line number was not unique in database. History logging moved to new session 1928
cmip_col
contains a collection of cmip6 model simulations using which you can view the information for each set of CMIP6 simulations
We can view the cmip_col collection as a dataframe
cmip_col.df.head(3)
activity_id | institution_id | source_id | experiment_id | member_id | table_id | variable_id | grid_label | zstore | dcpp_init_year | version | |
---|---|---|---|---|---|---|---|---|---|---|---|
0 | HighResMIP | CMCC | CMCC-CM2-HR4 | highresSST-present | r1i1p1f1 | Amon | va | gn | s3://cmip6-pds/CMIP6/HighResMIP/CMCC/CMCC-CM2-... | NaN | 20170706 |
1 | HighResMIP | CMCC | CMCC-CM2-HR4 | highresSST-present | r1i1p1f1 | Amon | zg | gn | s3://cmip6-pds/CMIP6/HighResMIP/CMCC/CMCC-CM2-... | NaN | 20170706 |
2 | HighResMIP | CMCC | CMCC-CM2-HR4 | highresSST-present | r1i1p1f1 | 6hrPlev | psl | gn | s3://cmip6-pds/CMIP6/HighResMIP/CMCC/CMCC-CM2-... | NaN | 20170706 |
Here you’ll find a lot of different columns, each of which corresponds to a specific information of a particular CMIP6 model simulation. See this documentation to learn more about what each of these column names refer to.
We are going to use a specific monthly CMIP6 precipitation data for both the historical and projection (sssp585) periods. Let’s search for the data we are going to utilize!
col_subsetted = cmip_col.search(require_all_on=['source_id'],
experiment_id=['historical', 'ssp585'],
member_id = 'r1i1p1f1',
table_id='Amon',
variable_id=['pr'],
grid_label='gr')
col_subsetted
pangeo-cmip6 catalog with 16 dataset(s) from 16 asset(s):
unique | |
---|---|
activity_id | 2 |
institution_id | 5 |
source_id | 8 |
experiment_id | 2 |
member_id | 1 |
table_id | 1 |
variable_id | 1 |
grid_label | 1 |
zstore | 16 |
dcpp_init_year | 0 |
version | 13 |
Now it’s time to view the available historical
and projection
datasets for the the search we have made.
ds_dict = col_subsetted.to_dataset_dict(zarr_kwargs={'consolidated': True},
storage_options={'token': 'anon'})
--> The keys in the returned dictionary of datasets are constructed as follows:
'activity_id.institution_id.source_id.experiment_id.table_id.grid_label'
C:\Users\User\anaconda3\envs\cmip6\lib\site-packages\xarray\coding\times.py:527: SerializationWarning: Unable to decode time axis into full numpy.datetime64 objects, continuing using cftime.datetime objects instead, reason: dates out of range
dtype = _decode_cf_datetime_dtype(data, units, calendar, self.use_cftime)
C:\Users\User\anaconda3\envs\cmip6\lib\site-packages\xarray\coding\times.py:527: SerializationWarning: Unable to decode time axis into full numpy.datetime64 objects, continuing using cftime.datetime objects instead, reason: dates out of range
dtype = _decode_cf_datetime_dtype(data, units, calendar, self.use_cftime)
C:\Users\User\anaconda3\envs\cmip6\lib\site-packages\xarray\core\indexing.py:419: SerializationWarning: Unable to decode time axis into full numpy.datetime64 objects, continuing using cftime.datetime objects instead, reason: dates out of range
return np.asarray(array[self.key], dtype=None)
Now that we have a dictionary of CMIP6 xarray data, we will make use of 1 historical and 1 projection model simulation. You can check out the keys of ds_dict
variable to see other available CMIP6 model simulations for the search we’ve made.
# historical model simulation
ds_hist = ds_dict['CMIP.NIMS-KMA.KACE-1-0-G.historical.Amon.gr'].isel(member_id=0, bnds=0)
# projection model simulation
ds_proj = ds_dict['ScenarioMIP.NIMS-KMA.KACE-1-0-G.ssp585.Amon.gr'].isel(member_id=0, bnds=0)
Let’s briefly see the content of our datasets
ds_hist
<xarray.Dataset> Dimensions: (lat: 144, lon: 192, time: 1980) Coordinates: * lat (lat) float64 -89.38 -88.12 -86.88 -85.62 ... 86.88 88.12 89.38 lat_bnds (lat) float64 dask.array<chunksize=(144,), meta=np.ndarray> * lon (lon) float64 0.9375 2.812 4.688 6.562 ... 355.3 357.2 359.1 lon_bnds (lon) float64 dask.array<chunksize=(192,), meta=np.ndarray> * time (time) object 1850-01-16 00:00:00 ... 2014-12-16 00:00:00 time_bnds (time) object dask.array<chunksize=(1980,), meta=np.ndarray> member_id <U8 'r1i1p1f1' Data variables: pr (time, lat, lon) float32 dask.array<chunksize=(563, 144, 192), meta=np.ndarray> Attributes: (12/51) Conventions: CF-1.7 CMIP-6.2 activity_id: CMIP branch_method: standard branch_time_in_child: 0.0 branch_time_in_parent: 0.0 cmor_version: 3.4.0 ... ... variable_id: pr variant_label: r1i1p1f1 netcdf_tracking_ids: hdl:21.14100/8fc44423-1f8a-4780-ac8c-4d6e7fbd8884 version_id: v20190910 intake_esm_varname: ['pr'] intake_esm_dataset_key: CMIP.NIMS-KMA.KACE-1-0-G.historical.Amon.gr
- lat: 144
- lon: 192
- time: 1980
- lat(lat)float64-89.38 -88.12 ... 88.12 89.38
- axis :
- Y
- bounds :
- lat_bnds
- long_name :
- Latitude
- standard_name :
- latitude
- units :
- degrees_north
array([-89.375, -88.125, -86.875, -85.625, -84.375, -83.125, -81.875, -80.625, -79.375, -78.125, -76.875, -75.625, -74.375, -73.125, -71.875, -70.625, -69.375, -68.125, -66.875, -65.625, -64.375, -63.125, -61.875, -60.625, -59.375, -58.125, -56.875, -55.625, -54.375, -53.125, -51.875, -50.625, -49.375, -48.125, -46.875, -45.625, -44.375, -43.125, -41.875, -40.625, -39.375, -38.125, -36.875, -35.625, -34.375, -33.125, -31.875, -30.625, -29.375, -28.125, -26.875, -25.625, -24.375, -23.125, -21.875, -20.625, -19.375, -18.125, -16.875, -15.625, -14.375, -13.125, -11.875, -10.625, -9.375, -8.125, -6.875, -5.625, -4.375, -3.125, -1.875, -0.625, 0.625, 1.875, 3.125, 4.375, 5.625, 6.875, 8.125, 9.375, 10.625, 11.875, 13.125, 14.375, 15.625, 16.875, 18.125, 19.375, 20.625, 21.875, 23.125, 24.375, 25.625, 26.875, 28.125, 29.375, 30.625, 31.875, 33.125, 34.375, 35.625, 36.875, 38.125, 39.375, 40.625, 41.875, 43.125, 44.375, 45.625, 46.875, 48.125, 49.375, 50.625, 51.875, 53.125, 54.375, 55.625, 56.875, 58.125, 59.375, 60.625, 61.875, 63.125, 64.375, 65.625, 66.875, 68.125, 69.375, 70.625, 71.875, 73.125, 74.375, 75.625, 76.875, 78.125, 79.375, 80.625, 81.875, 83.125, 84.375, 85.625, 86.875, 88.125, 89.375])
- lat_bnds(lat)float64dask.array<chunksize=(144,), meta=np.ndarray>
Array Chunk Bytes 1.12 kiB 1.12 kiB Shape (144,) (144,) Count 3 Tasks 1 Chunks Type float64 numpy.ndarray - lon(lon)float640.9375 2.812 4.688 ... 357.2 359.1
- axis :
- X
- bounds :
- lon_bnds
- long_name :
- Longitude
- standard_name :
- longitude
- units :
- degrees_east
array([ 0.9375, 2.8125, 4.6875, 6.5625, 8.4375, 10.3125, 12.1875, 14.0625, 15.9375, 17.8125, 19.6875, 21.5625, 23.4375, 25.3125, 27.1875, 29.0625, 30.9375, 32.8125, 34.6875, 36.5625, 38.4375, 40.3125, 42.1875, 44.0625, 45.9375, 47.8125, 49.6875, 51.5625, 53.4375, 55.3125, 57.1875, 59.0625, 60.9375, 62.8125, 64.6875, 66.5625, 68.4375, 70.3125, 72.1875, 74.0625, 75.9375, 77.8125, 79.6875, 81.5625, 83.4375, 85.3125, 87.1875, 89.0625, 90.9375, 92.8125, 94.6875, 96.5625, 98.4375, 100.3125, 102.1875, 104.0625, 105.9375, 107.8125, 109.6875, 111.5625, 113.4375, 115.3125, 117.1875, 119.0625, 120.9375, 122.8125, 124.6875, 126.5625, 128.4375, 130.3125, 132.1875, 134.0625, 135.9375, 137.8125, 139.6875, 141.5625, 143.4375, 145.3125, 147.1875, 149.0625, 150.9375, 152.8125, 154.6875, 156.5625, 158.4375, 160.3125, 162.1875, 164.0625, 165.9375, 167.8125, 169.6875, 171.5625, 173.4375, 175.3125, 177.1875, 179.0625, 180.9375, 182.8125, 184.6875, 186.5625, 188.4375, 190.3125, 192.1875, 194.0625, 195.9375, 197.8125, 199.6875, 201.5625, 203.4375, 205.3125, 207.1875, 209.0625, 210.9375, 212.8125, 214.6875, 216.5625, 218.4375, 220.3125, 222.1875, 224.0625, 225.9375, 227.8125, 229.6875, 231.5625, 233.4375, 235.3125, 237.1875, 239.0625, 240.9375, 242.8125, 244.6875, 246.5625, 248.4375, 250.3125, 252.1875, 254.0625, 255.9375, 257.8125, 259.6875, 261.5625, 263.4375, 265.3125, 267.1875, 269.0625, 270.9375, 272.8125, 274.6875, 276.5625, 278.4375, 280.3125, 282.1875, 284.0625, 285.9375, 287.8125, 289.6875, 291.5625, 293.4375, 295.3125, 297.1875, 299.0625, 300.9375, 302.8125, 304.6875, 306.5625, 308.4375, 310.3125, 312.1875, 314.0625, 315.9375, 317.8125, 319.6875, 321.5625, 323.4375, 325.3125, 327.1875, 329.0625, 330.9375, 332.8125, 334.6875, 336.5625, 338.4375, 340.3125, 342.1875, 344.0625, 345.9375, 347.8125, 349.6875, 351.5625, 353.4375, 355.3125, 357.1875, 359.0625])
- lon_bnds(lon)float64dask.array<chunksize=(192,), meta=np.ndarray>
Array Chunk Bytes 1.50 kiB 1.50 kiB Shape (192,) (192,) Count 3 Tasks 1 Chunks Type float64 numpy.ndarray - time(time)object1850-01-16 00:00:00 ... 2014-12-...
- axis :
- T
- bounds :
- time_bnds
- long_name :
- time
- standard_name :
- time
array([cftime.Datetime360Day(1850, 1, 16, 0, 0, 0, 0, has_year_zero=True), cftime.Datetime360Day(1850, 2, 16, 0, 0, 0, 0, has_year_zero=True), cftime.Datetime360Day(1850, 3, 16, 0, 0, 0, 0, has_year_zero=True), ..., cftime.Datetime360Day(2014, 10, 16, 0, 0, 0, 0, has_year_zero=True), cftime.Datetime360Day(2014, 11, 16, 0, 0, 0, 0, has_year_zero=True), cftime.Datetime360Day(2014, 12, 16, 0, 0, 0, 0, has_year_zero=True)], dtype=object)
- time_bnds(time)objectdask.array<chunksize=(1980,), meta=np.ndarray>
Array Chunk Bytes 15.47 kiB 15.47 kiB Shape (1980,) (1980,) Count 3 Tasks 1 Chunks Type object numpy.ndarray - member_id()<U8'r1i1p1f1'
array('r1i1p1f1', dtype='<U8')
- pr(time, lat, lon)float32dask.array<chunksize=(563, 144, 192), meta=np.ndarray>
- cell_measures :
- area: areacella
- cell_methods :
- area: time: mean (interval: 1 month)
- comment :
- includes both liquid and solid phases
- history :
- 2019-09-10T09:38:39Z altered by CMOR: replaced missing value flag (9.999e+20) with standard missing value (1e+20).
- long_name :
- Precipitation
- original_name :
- m01s05i216
- standard_name :
- precipitation_flux
- units :
- kg m-2 s-1
Array Chunk Bytes 208.83 MiB 59.38 MiB Shape (1980, 144, 192) (563, 144, 192) Count 13 Tasks 4 Chunks Type float32 numpy.ndarray
- Conventions :
- CF-1.7 CMIP-6.2
- activity_id :
- CMIP
- branch_method :
- standard
- branch_time_in_child :
- 0.0
- branch_time_in_parent :
- 0.0
- cmor_version :
- 3.4.0
- contact :
- Yoon-Jin Lim (yoonjin.lim@korea.kr)
- creation_date :
- 2019-09-10T09:38:39Z
- data_specs_version :
- 01.00.30
- experiment :
- all-forcing simulation of the recent past
- experiment_id :
- historical
- external_variables :
- areacella
- forcing_index :
- 1
- frequency :
- mon
- further_info_url :
- https://furtherinfo.es-doc.org/CMIP6.NIMS-KMA.KACE-1-0-G.historical.none.r1i1p1f1
- grid :
- gs1x1
- grid_label :
- gr
- history :
- 2019-09-10T09:38:39Z ; CMOR rewrote data to be consistent with CMIP6, CF-1.7 CMIP-6.2 and CF standards.
- initialization_index :
- 1
- institution :
- National Institute of Meteorological Sciences/Korea Meteorological Administration, Climate Research Division, Seoho-bukro 33, Seogwipo-si, Jejudo 63568, Republic of Korea
- institution_id :
- NIMS-KMA
- license :
- CMIP6 model data produced by NIMS-KMA is licensed under a Creative Commons Attribution ShareAlike 4.0 International License (https://creativecommons.org/licenses). Consult https://pcmdi.llnl.gov/CMIP6/TermsOfUse for terms of use governing CMIP6 output, including citation requirements and proper acknowledgment. Further information about this data, including some limitations, can be found via the further_info_url (recorded as a global attribute in this file). The data producers and data providers make no warranty, either express or implied, including, but not limited to, warranties of merchantability and fitness for a particular purpose. All liabilities arising from the supply of the information (including any liability arising in negligence) are excluded to the fullest extent permitted by law.
- mip_era :
- CMIP6
- nominal_resolution :
- 250 km
- parent_activity_id :
- CMIP
- parent_experiment_id :
- piControl
- parent_mip_era :
- CMIP6
- parent_source_id :
- KACE-1-0-G
- parent_time_units :
- days since 1850-01-01
- parent_variant_label :
- r1i1p1f1
- physics_index :
- 1
- product :
- model-output
- realization_index :
- 1
- realm :
- atmos
- references :
- Evaluation of the Korea Meteorological Administration Advanced Community Earth-system model (K-ACE): doi: 10.1007/s13143-019-00144-7. Lee et al., 2019.
- source :
- KACE1.0-G (2018): aerosol: UKCA-GLOMAP-mode atmos: MetUM-HadGEM3-GA7.1 (N96; 192 x 144 longitude/latitude; 85 levels; top level 85 km) atmosChem: none land: JULES-HadGEM3-GL7.1 landIce: none ocean: MOM4p1 (tripolar primarily 1deg; 360 x 200 longitude/latitude; 50 levels; top grid cell 0-10 m) ocnBgchem: none seaIce: CICE-HadGEM3-GSI8 (tripolar primarily 1deg; 360 x 200 longitude/latitude)
- source_id :
- KACE-1-0-G
- source_type :
- AOGCM
- status :
- 2020-01-18;created; by gcs.cmip6.ldeo@gmail.com
- sub_experiment :
- none
- sub_experiment_id :
- none
- table_id :
- Amon
- table_info :
- Creation Date:(30 April 2019) MD5:cc2ae51c23960ce127b4d68ab3d8ac87
- title :
- KACE-1-0-G output prepared for CMIP6
- tracking_id :
- hdl:21.14100/8fc44423-1f8a-4780-ac8c-4d6e7fbd8884
- variable_id :
- pr
- variant_label :
- r1i1p1f1
- netcdf_tracking_ids :
- hdl:21.14100/8fc44423-1f8a-4780-ac8c-4d6e7fbd8884
- version_id :
- v20190910
- intake_esm_varname :
- ['pr']
- intake_esm_dataset_key :
- CMIP.NIMS-KMA.KACE-1-0-G.historical.Amon.gr
ds_proj
<xarray.Dataset> Dimensions: (lat: 144, lon: 192, time: 1032) Coordinates: * lat (lat) float64 -89.38 -88.12 -86.88 -85.62 ... 86.88 88.12 89.38 lat_bnds (lat) float64 dask.array<chunksize=(144,), meta=np.ndarray> * lon (lon) float64 0.9375 2.812 4.688 6.562 ... 355.3 357.2 359.1 lon_bnds (lon) float64 dask.array<chunksize=(192,), meta=np.ndarray> * time (time) object 2015-01-16 00:00:00 ... 2100-12-16 00:00:00 time_bnds (time) object dask.array<chunksize=(1032,), meta=np.ndarray> member_id <U8 'r1i1p1f1' Data variables: pr (time, lat, lon) float32 dask.array<chunksize=(451, 144, 192), meta=np.ndarray> Attributes: (12/51) Conventions: CF-1.7 CMIP-6.2 activity_id: ScenarioMIP branch_method: standard branch_time_in_child: 0.0 branch_time_in_parent: 0.0 cmor_version: 3.4.0 ... ... variable_id: pr variant_label: r1i1p1f1 netcdf_tracking_ids: hdl:21.14100/8b57555a-95ed-47b0-8cad-049c403e745a version_id: v20190920 intake_esm_varname: ['pr'] intake_esm_dataset_key: ScenarioMIP.NIMS-KMA.KACE-1-0-G.ssp585.Amon.gr
- lat: 144
- lon: 192
- time: 1032
- lat(lat)float64-89.38 -88.12 ... 88.12 89.38
- axis :
- Y
- bounds :
- lat_bnds
- long_name :
- Latitude
- standard_name :
- latitude
- units :
- degrees_north
array([-89.375, -88.125, -86.875, -85.625, -84.375, -83.125, -81.875, -80.625, -79.375, -78.125, -76.875, -75.625, -74.375, -73.125, -71.875, -70.625, -69.375, -68.125, -66.875, -65.625, -64.375, -63.125, -61.875, -60.625, -59.375, -58.125, -56.875, -55.625, -54.375, -53.125, -51.875, -50.625, -49.375, -48.125, -46.875, -45.625, -44.375, -43.125, -41.875, -40.625, -39.375, -38.125, -36.875, -35.625, -34.375, -33.125, -31.875, -30.625, -29.375, -28.125, -26.875, -25.625, -24.375, -23.125, -21.875, -20.625, -19.375, -18.125, -16.875, -15.625, -14.375, -13.125, -11.875, -10.625, -9.375, -8.125, -6.875, -5.625, -4.375, -3.125, -1.875, -0.625, 0.625, 1.875, 3.125, 4.375, 5.625, 6.875, 8.125, 9.375, 10.625, 11.875, 13.125, 14.375, 15.625, 16.875, 18.125, 19.375, 20.625, 21.875, 23.125, 24.375, 25.625, 26.875, 28.125, 29.375, 30.625, 31.875, 33.125, 34.375, 35.625, 36.875, 38.125, 39.375, 40.625, 41.875, 43.125, 44.375, 45.625, 46.875, 48.125, 49.375, 50.625, 51.875, 53.125, 54.375, 55.625, 56.875, 58.125, 59.375, 60.625, 61.875, 63.125, 64.375, 65.625, 66.875, 68.125, 69.375, 70.625, 71.875, 73.125, 74.375, 75.625, 76.875, 78.125, 79.375, 80.625, 81.875, 83.125, 84.375, 85.625, 86.875, 88.125, 89.375])
- lat_bnds(lat)float64dask.array<chunksize=(144,), meta=np.ndarray>
Array Chunk Bytes 1.12 kiB 1.12 kiB Shape (144,) (144,) Count 3 Tasks 1 Chunks Type float64 numpy.ndarray - lon(lon)float640.9375 2.812 4.688 ... 357.2 359.1
- axis :
- X
- bounds :
- lon_bnds
- long_name :
- Longitude
- standard_name :
- longitude
- units :
- degrees_east
array([ 0.9375, 2.8125, 4.6875, 6.5625, 8.4375, 10.3125, 12.1875, 14.0625, 15.9375, 17.8125, 19.6875, 21.5625, 23.4375, 25.3125, 27.1875, 29.0625, 30.9375, 32.8125, 34.6875, 36.5625, 38.4375, 40.3125, 42.1875, 44.0625, 45.9375, 47.8125, 49.6875, 51.5625, 53.4375, 55.3125, 57.1875, 59.0625, 60.9375, 62.8125, 64.6875, 66.5625, 68.4375, 70.3125, 72.1875, 74.0625, 75.9375, 77.8125, 79.6875, 81.5625, 83.4375, 85.3125, 87.1875, 89.0625, 90.9375, 92.8125, 94.6875, 96.5625, 98.4375, 100.3125, 102.1875, 104.0625, 105.9375, 107.8125, 109.6875, 111.5625, 113.4375, 115.3125, 117.1875, 119.0625, 120.9375, 122.8125, 124.6875, 126.5625, 128.4375, 130.3125, 132.1875, 134.0625, 135.9375, 137.8125, 139.6875, 141.5625, 143.4375, 145.3125, 147.1875, 149.0625, 150.9375, 152.8125, 154.6875, 156.5625, 158.4375, 160.3125, 162.1875, 164.0625, 165.9375, 167.8125, 169.6875, 171.5625, 173.4375, 175.3125, 177.1875, 179.0625, 180.9375, 182.8125, 184.6875, 186.5625, 188.4375, 190.3125, 192.1875, 194.0625, 195.9375, 197.8125, 199.6875, 201.5625, 203.4375, 205.3125, 207.1875, 209.0625, 210.9375, 212.8125, 214.6875, 216.5625, 218.4375, 220.3125, 222.1875, 224.0625, 225.9375, 227.8125, 229.6875, 231.5625, 233.4375, 235.3125, 237.1875, 239.0625, 240.9375, 242.8125, 244.6875, 246.5625, 248.4375, 250.3125, 252.1875, 254.0625, 255.9375, 257.8125, 259.6875, 261.5625, 263.4375, 265.3125, 267.1875, 269.0625, 270.9375, 272.8125, 274.6875, 276.5625, 278.4375, 280.3125, 282.1875, 284.0625, 285.9375, 287.8125, 289.6875, 291.5625, 293.4375, 295.3125, 297.1875, 299.0625, 300.9375, 302.8125, 304.6875, 306.5625, 308.4375, 310.3125, 312.1875, 314.0625, 315.9375, 317.8125, 319.6875, 321.5625, 323.4375, 325.3125, 327.1875, 329.0625, 330.9375, 332.8125, 334.6875, 336.5625, 338.4375, 340.3125, 342.1875, 344.0625, 345.9375, 347.8125, 349.6875, 351.5625, 353.4375, 355.3125, 357.1875, 359.0625])
- lon_bnds(lon)float64dask.array<chunksize=(192,), meta=np.ndarray>
Array Chunk Bytes 1.50 kiB 1.50 kiB Shape (192,) (192,) Count 3 Tasks 1 Chunks Type float64 numpy.ndarray - time(time)object2015-01-16 00:00:00 ... 2100-12-...
- axis :
- T
- bounds :
- time_bnds
- long_name :
- time
- standard_name :
- time
array([cftime.Datetime360Day(2015, 1, 16, 0, 0, 0, 0, has_year_zero=True), cftime.Datetime360Day(2015, 2, 16, 0, 0, 0, 0, has_year_zero=True), cftime.Datetime360Day(2015, 3, 16, 0, 0, 0, 0, has_year_zero=True), ..., cftime.Datetime360Day(2100, 10, 16, 0, 0, 0, 0, has_year_zero=True), cftime.Datetime360Day(2100, 11, 16, 0, 0, 0, 0, has_year_zero=True), cftime.Datetime360Day(2100, 12, 16, 0, 0, 0, 0, has_year_zero=True)], dtype=object)
- time_bnds(time)objectdask.array<chunksize=(1032,), meta=np.ndarray>
Array Chunk Bytes 8.06 kiB 8.06 kiB Shape (1032,) (1032,) Count 3 Tasks 1 Chunks Type object numpy.ndarray - member_id()<U8'r1i1p1f1'
array('r1i1p1f1', dtype='<U8')
- pr(time, lat, lon)float32dask.array<chunksize=(451, 144, 192), meta=np.ndarray>
- cell_measures :
- area: areacella
- cell_methods :
- area: time: mean (interval: 1 month)
- comment :
- includes both liquid and solid phases
- history :
- 2019-09-20T05:36:00Z altered by CMOR: replaced missing value flag (9.999e+20) with standard missing value (1e+20).
- long_name :
- Precipitation
- original_name :
- m01s05i216
- standard_name :
- precipitation_flux
- units :
- kg m-2 s-1
Array Chunk Bytes 108.84 MiB 47.57 MiB Shape (1032, 144, 192) (451, 144, 192) Count 10 Tasks 3 Chunks Type float32 numpy.ndarray
- Conventions :
- CF-1.7 CMIP-6.2
- activity_id :
- ScenarioMIP
- branch_method :
- standard
- branch_time_in_child :
- 0.0
- branch_time_in_parent :
- 0.0
- cmor_version :
- 3.4.0
- contact :
- Yoon-Jin Lim (yoonjin.lim@korea.kr)
- creation_date :
- 2019-09-20T05:36:01Z
- data_specs_version :
- 01.00.30
- experiment :
- update of RCP8.5 based on SSP5
- experiment_id :
- ssp585
- external_variables :
- areacella
- forcing_index :
- 1
- frequency :
- mon
- further_info_url :
- https://furtherinfo.es-doc.org/CMIP6.NIMS-KMA.KACE-1-0-G.ssp585.none.r1i1p1f1
- grid :
- gs1x1
- grid_label :
- gr
- history :
- 2019-09-20T05:36:01Z ; CMOR rewrote data to be consistent with CMIP6, CF-1.7 CMIP-6.2 and CF standards.
- initialization_index :
- 1
- institution :
- National Institute of Meteorological Sciences/Korea Meteorological Administration, Climate Research Division, Seoho-bukro 33, Seogwipo-si, Jejudo 63568, Republic of Korea
- institution_id :
- NIMS-KMA
- license :
- CMIP6 model data produced by NIMS-KMA is licensed under a Creative Commons Attribution ShareAlike 4.0 International License (https://creativecommons.org/licenses). Consult https://pcmdi.llnl.gov/CMIP6/TermsOfUse for terms of use governing CMIP6 output, including citation requirements and proper acknowledgment. Further information about this data, including some limitations, can be found via the further_info_url (recorded as a global attribute in this file). The data producers and data providers make no warranty, either express or implied, including, but not limited to, warranties of merchantability and fitness for a particular purpose. All liabilities arising from the supply of the information (including any liability arising in negligence) are excluded to the fullest extent permitted by law.
- mip_era :
- CMIP6
- nominal_resolution :
- 250 km
- parent_activity_id :
- CMIP
- parent_experiment_id :
- historical
- parent_mip_era :
- CMIP6
- parent_source_id :
- KACE-1-0-G
- parent_time_units :
- days since 1850-01-01
- parent_variant_label :
- r1i1p1f1
- physics_index :
- 1
- product :
- model-output
- realization_index :
- 1
- realm :
- atmos
- references :
- Evaluation of the Korea Meteorological Administration Advanced Community Earth-system model (K-ACE): doi: 10.1007/s13143-019-00144-7. Lee et al., 2019.
- source :
- KACE1.0-G (2018): aerosol: UKCA-GLOMAP-mode atmos: MetUM-HadGEM3-GA7.1 (N96; 192 x 144 longitude/latitude; 85 levels; top level 85 km) atmosChem: none land: JULES-HadGEM3-GL7.1 landIce: none ocean: MOM4p1 (tripolar primarily 1deg; 360 x 200 longitude/latitude; 50 levels; top grid cell 0-10 m) ocnBgchem: none seaIce: CICE-HadGEM3-GSI8 (tripolar primarily 1deg; 360 x 200 longitude/latitude)
- source_id :
- KACE-1-0-G
- source_type :
- AOGCM
- status :
- 2020-01-18;created; by gcs.cmip6.ldeo@gmail.com
- sub_experiment :
- none
- sub_experiment_id :
- none
- table_id :
- Amon
- table_info :
- Creation Date:(30 April 2019) MD5:cc2ae51c23960ce127b4d68ab3d8ac87
- title :
- KACE-1-0-G output prepared for CMIP6
- tracking_id :
- hdl:21.14100/8b57555a-95ed-47b0-8cad-049c403e745a
- variable_id :
- pr
- variant_label :
- r1i1p1f1
- netcdf_tracking_ids :
- hdl:21.14100/8b57555a-95ed-47b0-8cad-049c403e745a
- version_id :
- v20190920
- intake_esm_varname :
- ['pr']
- intake_esm_dataset_key :
- ScenarioMIP.NIMS-KMA.KACE-1-0-G.ssp585.Amon.gr
How does the mean monthly January precipitation change between the historical and projection (ssp585) periods?¶
We can answer this question simply by groupbying the months and getting the average of this grouped data. Since we are interested in analyzing the January precipitation amounts, we can select the first month, which is January, using the .isel()
method.
hist_mean_jan = ds_hist.pr.groupby('time.month').mean().isel(month=0) * 86400
proj_mean_jan = ds_proj.pr.groupby('time.month').mean().isel(month=0) * 86400
So here’s the question most of you might ask:
Why did we multiply the data with 86400?
Quite simple. The unit of our precipitation data is kg m-2 s-1
, which corresponds to 86400 mm/day. Given that it will be easier for us to analyze precipitation in mm/day, we will be converting the units to mm/day.
ds_hist.pr.units
'kg m-2 s-1'
Let’s plot our findings!
(proj_mean_jan - hist_mean_jan).plot()
<matplotlib.collections.QuadMesh at 0x29c162e0af0>

The change in the precipitation amount might have looked more dramatic if we had used more specific temporal periods (e.g., (1900-1949 ; 2050-2099 averages)). Also note that our precipitation now has a unit of mm/seconds. So, you could resample daily the values to yearly in order to have a broader picture of the projected changes in precipitation.
How does the area-averaged total precipitation in Turkey change during the historical and projection (ssp585) periods?¶
Our aim is to calculate the area-averaged total precipitation for Turkey.
So what should we do first?
Firstly, we will be subsetting our data to the coordinates of Turkey. Then we are going to implement the resample
method to transform our monthly values to yearly summed values.
# Subset the data to the coordinates of Turkey
ds_hist_tr = ds_hist.pr.sel(lat=slice(36,42), lon=slice(26,45)) * 86400 * 30
ds_proj_tr = ds_proj.pr.sel(lat=slice(36,42), lon=slice(26,45)) * 86400 * 30
# Resample monthly to yearly summed values and get the areal average
ds_hist_tr_yearly_averaged = ds_hist_tr.resample(time='1Y').sum().mean(dim=['lat','lon'])
ds_proj_tr_yearly_averaged = ds_proj_tr.resample(time='1Y').sum().mean(dim=['lat','lon'])
# Historical change in precipitation
ds_hist_tr_yearly_averaged.plot()
[<matplotlib.lines.Line2D at 0x29c13c3b640>]

# Projected change in precipitation
ds_proj_tr_yearly_averaged.plot()
[<matplotlib.lines.Line2D at 0x29c07aee040>]

To what extent our analysis can be questionable?¶
Remember that so far we used 1 historical and 1 projection data. We could use a larger set of model simulations to perform ensemble analyses, employing various statistical and probabilistic approaches.
Elaborate on the topics below:
What is
CMIP6
data?What are the meanings for ssp585 and rcp85?
Where
are these CMIP6 model simulations used and presented?
See you until the next time!
Blog by:
Berkay DÖNMEZ :
Linkedin | Github | Twitter | Instagram
Kutay DÖNMEZ :
LinkedIn | Github | Twitter | Instagram