| Table of Contents |
|---|
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 location. The existing methods did not suit him: Both methods only work on Linux, and they output geopotential for an area of interest rather than a single 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).
...
- 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 hardcoded, 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:
...
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.
...
- 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: A file 'tq_ml.nc' and a file 'zlnsp_ml.nc', both in the current working directory.
Outputs: CSV files (one per timestamp) with geopotential and height (relative to terrain) on each model level.
...