# Differences in ERA5 Pressure Level Data Between CDS and CDS-Beta

**URL:** <https://forum.ecmwf.int/t/differences-in-era5-pressure-level-data-between-cds-and-cds-beta/5014>\
**Category:** C3S - Datasets and Usage\
**Tags:** cds, era5\
**Created:** [5 September 2024 06:31 UTC](https://forum.ecmwf.int/t/differences-in-era5-pressure-level-data-between-cds-and-cds-beta/5014 "2024-09-05T06:31:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sahil\_Dabhi](https://forum.ecmwf.int/letter_avatar_proxy/v4/letter/s/58956e/32.png) [@Sahil\_Dabhi](https://forum.ecmwf.int/u/Sahil_Dabhi)\
**Post date:** [5 September 2024 06:31 UTC](https://forum.ecmwf.int/t/differences-in-era5-pressure-level-data-between-cds-and-cds-beta/5014/1 "2024-09-05T06:31:06Z")

</div>

Hi everyone,

I’m experiencing some discrepancies while downloading the **ERA5 pressure level data** using both the new and old licenses.

Here’s the code snippet I’m using:

```auto
import cdsapi
client = cdsapi.Client(url="url", key="secret-key")

dataset = 'reanalysis-era5-pressure-levels'
request = {'product_type': 'reanalysis', 'format': 'netcdf', 'grid': ['0.25', '0.25'], 'date': ['2024-05-05'],
'time': ['00', '01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17',
'18', '19', '20', '21', '22', '23'], 'variable': ['geopotential'], 'pressure_level': ['1']}
target = 'download_new.grib'

result = client.retrieve(dataset, request, target)

```

When I use the **CDS API** (old license) in the above code, the data I receive contains:

- Variable: `z` (geopotential) **only**
- Coordinates: `longitude, latitude, time`
- Attributes: `Conventions` and `history`

However, when using the **CDS-Beta API** (new license) in the above code, the data output changes to:

- Variables: `number, expver, z` (geopotential)
- Coordinates: `pressure_level, longitude, latitude, valid_time`
- More attributes, including: `GRIB_centre, GRIB_centreDescription, GRIB_subCentre, Conventions, institution, history`

I’m trying to understand how I can get the same output from the **CDS-Beta** that I currently get from the **CDS**. Any guidance or suggestions would be greatly appreciated!

Thank you in advance!

---

<div class="post-metadata">

**Author:** ![Michiya\_Hayashi](https://forum.ecmwf.int/letter_avatar_proxy/v4/letter/m/35a633/32.png) [@Michiya\_Hayashi](https://forum.ecmwf.int/u/Michiya_Hayashi)\
**Post date:** [11 September 2024 07:37 UTC](https://forum.ecmwf.int/t/differences-in-era5-pressure-level-data-between-cds-and-cds-beta/5014/2 "2024-09-11T07:37:19Z")

</div>

Same here.

I’ve been comparing some similar files using ncinfo, and it seems that the differences might be due to the conversion method from grib to netcdf. In the older CDS, the netcdf file was created using grib\_to\_netcdf-2.25.1, while in the newer CDS-Beta, it was created using cfgrib-0.9.14.0/ecCodes-2.36.0. This difference probably has led to discrepancies in the dimension names, variable names, and attributes within the files.

I used the nco and cdo commands to modify the new netcdf file (here, monthly mean zonal wind in 2023) to make it consistent with the old file as follows:

1. $ ncrename -d pressure\_level,level -v pressure\_level,level -d date,time -v date,time u.mon.nc.2023
2. $ ncatted -a long\_name,level,o,c,“pressure\_level” -a units,level,o,c,“millibars” -a stored\_direction,level,d, u.mon.nc.2023
3. $ ncpdq -a -level u.mon.nc.2023 u.mon.nc.2023.ncpdq
4. $ cdo -setcalendar,“gregorian” -setreftime,‘1900-01-01’,‘00:00:00.0’,‘hours’ -settaxis,2023-01-01,00:00:00,1mo u.mon.nc.2023.ncpdq u.mon.nc.2023.ncpdq.setreftime
5. $ cdo -P 8 -b F32 -f nc copy u.mon.nc.2023.ncpdq.setreftime u.mon.nc.2023.unpacked

First, I changed the dimension/variable names (in hourly data, the time axis was valid\_time instead of date). Second, I modified attributes. Third, I reversed the vertical axis data. Then, I modified the time axis (in hourly data, the timestep is 1hour instead of 1mo) and unpacked the compressed netcdf file. I believe there may be many better ways than mine, but for my purpose, this method (though not perfect) worked to concatenate with my old netcdf files downloaded from CDS.

---

<div class="post-metadata">

**Author:** ![HAN\_ZHANG](https://forum.ecmwf.int/letter_avatar_proxy/v4/letter/h/8491ac/32.png) [@HAN\_ZHANG](https://forum.ecmwf.int/u/HAN_ZHANG)\
**Post date:** [16 October 2024 07:21 UTC](https://forum.ecmwf.int/t/differences-in-era5-pressure-level-data-between-cds-and-cds-beta/5014/3 "2024-10-16T07:21:14Z")

</div>

I tried it and it worked. Thank you for sharing

---

<div class="post-metadata">

**Author:** ![R\_RR](https://forum.ecmwf.int/letter_avatar_proxy/v4/letter/r/c57346/32.png) [@R\_RR](https://forum.ecmwf.int/u/R_RR)\
**Post date:** [2 January 2025 15:13 UTC](https://forum.ecmwf.int/t/differences-in-era5-pressure-level-data-between-cds-and-cds-beta/5014/4 "2025-01-02T15:13:55Z")

</div>

When I run the first step (ncrename -d pressure\_level,level -v pressure\_level,level -d date,time -v date,time), the time of output file becomes the same time, and the pressure levels becomes 0 hPa.

 ![0](https://forum.ecmwf.int/uploads/default/original/1X/fb2e51789aa0c6abed9f4a6583282fada1e1fe18.jpeg)  
 ![1](https://forum.ecmwf.int/uploads/default/original/1X/87b764d818c4b4c5ea1e0a7c8a264548265d23e6.jpeg)  
 ![2](https://forum.ecmwf.int/uploads/default/original/1X/7181275d0854c6c079002ad496a3a8d8824dfe46.jpeg)
