Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Some users are interested on geopotential (z) of the different model levels (ml).  ECMWF provide a script for this calculation, which is the recommended method, but that script requires the ECMWF GRIB API. The script below is intended as a workaround for users who can not work with the ECMWF GRIB API.

The script uses as inputs Below you will find a Python script to compute this, using as inputs NetCDF files containing geopotential and the pressure (z and lnsp) on the surface, and creating creates as output a NetCDF file containing the geopotential in m^2/s^2 for each level. Note that you can get You can then also calculate the height in meters if you divide by dividing the geopotential by the gravity of Earth (9.80665 m/s^2).

Notes:

  • All data is in NetCDF formatThis script is intended only as a workaround for users who can not work with the ECMWF GRIB API. If you can use the GRIB API, use the script available here.
  • The 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.

Get input data

For this use case, you need both temperature (t) and Specific humidity (q) for each model level. You also need both surface geopotential (z) and logarithm of surface pressure (lnsp) for model level = 1. In the two scripts below you can change date, time, type, step and gridType, but make sure you use the same values in both scripts, i.e. the files are synchronized. Later the calculation of geopotential will iterate through the date/time/step parameters, allowing you to get the values for multiple times.

...