import cdsapi
c = cdsapi.Client()
c.retrieve('reanalysis-era5-complete-preliminary-back-extension', { # Please note the name of the dataset
# Keywords 'expver' and 'class' can be dropped. They are obsolete
# since their values are imposed by 'reanalysis-era5-complete-preliminary-back-extension'
'date': '1970-01-01', # Valid range: 1950-01-01 to 1978-12-31.
'levelist': '1/2/3/4/5', # Model levels from 1 to 5
'levtype': 'ml',
'param': '130.128', # Full information at https://apps.ecmwf.int/codes/grib/param-db/
'stream': 'oper', # Hourly data.
'type': 'an',
'grid': '1.0/1.0', # Latitude/longitude grid resolution.
'time':'00/to/23', # You can drop :00:00 and use MARS short-hand notation, instead of '00/06/12/18', full information at https://confluence.ecmwf.int/pages/viewpage.action?pageId=118817378
'format':'netcdf', # Output needs to be regular lat-lon, so only works in combination with 'grid'!
}, 'era5.preliminary-back-extension-temperature-monthly-mean.nc') |