ERA-Interim production stopped on 31st August 2019
For ERA-Interim (1st January 1979 to 31st August 2019) access through the ECMWF Web API stopped on 01 June 2023
Its successor ERA5 is available from the Climate Data Store (CDS) (What are the changes from ERA-Interim to ERA5?) and users are strongly advised to migrate to ERA5 (How to download ERA5).
For those users who still need access to ERA-Interim after 01 June 2023 (subject to further notice), they can do so via the Climate Data Store (CDS) API.
Introduction
Some users are interested on geopotential (z) of the different model levels (ml). ECMWF provides two tools for this, a MetView macro and a Python script, which are the recommended methods, but only work on Linux, and output geopotential as an area, not for a specific location.
One of our customers, Mark Jackson from Cambridge Environmental Research Consultants (CERC), wanted to calculate geopotential and height above the surface for model levels, and this for one particular point location.
So Mark wrote his own script and kindly provided it to us. The script calculates the geopotential in m^2/s^2 on each model level for a single point location. It then also calculates the height in meters by dividing the geopotential by the gravity of Earth (9.80665 m/s^2).
This is a two step process: first you have to obtain the required input data, then you perform the actual geopotential and height calculation.
Notes:
- All data is in NetCDF format
- The computation script requires Python; the input data script requires Python and the ECMWF WebAPI to access ECMWF public datasets
The script only works correctly for ECMWF ERA-Interim data, do not use it with other datasets
Input data has to be gridded, not spectral
- In the computation script, paths and other arguments are hard-coded, so you will need to adapt the script to your system
Step1: Get data
The first script downloads ERA-Interim data from ECMWF through the ECMWF Web API:
- Temperature (t) and specific humidity (q), both on each model level, as file 'tq_ml.nc'.
- The log of surface pressure (lnsp) and geopotential (z), both on model level 1, as file 'zlnsp_ml.nc'.
The Python script:
Copy the script and save it to your computer.
You can change date, type, step, time, grid and area in the script, but make sure you use the same values in both 'execute' blocks so that the two output files are synchronized. Later the calculation of geopotential will iterate through the date/time/step parameters, calculating values for multiple times.
Run the script.
Outputs: A file 'tq_ml.nc' and a file 'zlnsp_ml.nc', both in the current working directory.
Step2: Compute geopotential on model levels
This script was kindly provided by Mark Jackson from Cambridge Environmental Research Consultants Ltd. The script is provided 'as is' and is not supported by ECMWF/Copernicus or by CERC.
The Python script:
Copy the script and save it to your computer.
You have to adapt:
- line 58: specify your file containing t and q ('tq_ml.nc')
- line 59: specify your file containing z and lnsp ('tzlnsp.nc')
- line 60/61: specify lat/long of your point of interest. These must be multiples of the grid resolution of your input files.
- line 62: specify an output directory.
Run the script.
Outputs: CSV files (one per timestamp) with geopotential and height (relative to terrain) on each model level.
This document has been produced in the context of the Copernicus Climate Change Service (C3S).
The activities leading to these results have been contracted by the European Centre for Medium-Range Weather Forecasts, operator of C3S on behalf of the European Union (Delegation agreement signed on 11/11/2014). All information in this document is provided "as is" and no guarantee or warranty is given that the information is fit for any particular purpose.
The users thereof use the information at their sole risk and liability. For the avoidance of all doubt, the European Commission and the European Centre for Medium-Range Weather Forecasts have no liability in respect of this document, which is merely representing the author's view.
2 Comments
Unknown User (uskh)
To adapt the script 'EI_geopotential_on_ml_compute.py' for use with ERA5:
Unknown User (uskh)
Peter Ukkonen from FMI kindly provided an alternative script for the calculation of geopotential on model levels (step2 above) for ERA5.
Differences to the Python script above:
Download Peter's script here: calc_geopotential_ERA5.jl