Hello all,

When I attempt to download ERA5 forecast data from the complete ERA5 archive (e.g. https://apps.ecmwf.int/data-catalogues/era5/?stream=oper&levtype=sfc&expver=1&month=dec&year=1979&type=fc&class=ea) in netCDF format via a python script, the request fails because there are 2 initializations (6Z and 18Z) with 19 forecast steps (0-18), meaning there are 38 valid times in a 24 hour period. Does anyone have thoughts on how to get around this while keeping netCDF format and downloading all of the data?

Thanks

2 Comments

  1. Hi Frederick,

    That's an excellent question!

    This issue is due to you requesting forecast data in netCDF i.e. it is due to the grib to netCDF conversion software used.

    The data for each forecast field are stored in individual grib records, which are independent of each other.

    NetCDF files (generally) have coordinate axes which the fields are mapped onto.

    In your request, you asked for forecast steps from 0-18hrs from 06Z and 18Z.

    So, for a given day

    06Z+ fc step of 13hrs = 19:00

    and

    18Z + fc step of 1 hr = 19:00.

    i.e. you have 2 fields with the same 'validity time' of 19:00.

    When you do the grib to netcdf conversion, it tries to map  1 data field onto 1 time coordinate, so it gives an error when it finds 2 for 19:00, 20:00,...etc.

    (this is a 'feature' of the data model used in this particular conversion script)

    Some straightforward ways to get around this are :

    1) Just use the grib version of the data (netCDF conversion is not ok)

    2) Just request forecast steps for 0-12 each day for 06Z and 18Z  (netCDF conversion is ok)

    3) Get forecast steps for 0-18 each day for 06Z in one request (netCDF conversion is ok) and

    forecast steps for 0-18 each day for 18Z in a separate request (netCDF conversion is ok).


    Hope that helps!

    Thanks,
    Kevin

    C3S User Support at ECMWF

  2. I had a similar issue with seasonal forecasts data and the real solution was to work only with GRIB files. The cfgrib library provides a perfect interface for xarray, so if you are using Python the transition from NetCDF to GRIB is seamless.