ERA5 monthly averaged reanalysis by hour of day error

I tried to download T2M data for time T00, T06, T12, T18, but the final result did not have the dimension of “time”
But the data downloaded earlier this year through the old version of CDS was correct

import cdsapi

dataset = “reanalysis-era5-single-levels-monthly-means”
request = {
“product_type”: [“monthly_averaged_reanalysis_by_hour_of_day”],
“variable”: [“2m_temperature”],
“year”: [“2023”],
“month”: [“01”],
“time”: [
“00:00”, “06:00”, “12:00”,
“18:00”
],
“data_format”: “netcdf”,
“download_format”: “unarchived”
}
client = cdsapi.Client()
client.retrieve(dataset, request).download()

1 Like

Quick hack is to substitute the output: netcdf with netcdf_legacy in the data_format field. This returns the old format style. Here are some more tips and tricks for the transition to the new API:

1 Like

Thank you very much! I can now download the data correctly. However, I still don’t understand why changing the data format affects the downloaded data. Using ‘netcdf’ only downloaded one time step, while using ‘netcdf_legacy’ correctly downloaded four time steps.

There are changes to the GRIB to netCDF conversion software which cause inconsistencies relative to the previous legacy version.

1 Like

Thanks for raising this @Huang_yb! I also find the new monthly averaged data very inconvenient with the time dimension missing, making it very difficult (if not impossible) to perform some rather basic operations (e.g. obtaining the long-term monthly average, subselecting time periods) using cdo/xarray.
The new ‘date’ coordinate is not even convertible to datetime64[ns], the screenshot below shows what it gives me after trying:

1 Like

This appears to be a different issue. Based on the website below, I am still expecting a valid_month coordinate which is a time dimension.
https://confluence.ecmwf.int/display/CKB/GRIB+to+netCDF+conversion+on+new+CDS+and+ADS+systems#GRIBtonetCDFconversiononnewCDSandADSsystems-ERA5
However, the date coordinate in the new monthly averaged dataset is not a time dimension, it only consists of strings of 19810101, 19810201, 19810301 etc.

Well, at least the ERA5-land monthly averaged reanalysis data has a time dimension. If you are not looking for data over the ocean and file size is not an issue (given its higher resolution), then it might serve as an alternative…