Deriving pre-defined atmospheric quantities

Computation of several derived atmospheric quantities (e.g., potential temperature, equivalent potential temperature) is implemented in Met.3D. Prerequisite is that corresponding input variables are specified by the user for the dataset for which derived quantities shall be computed. Below we provide a (possibly incomplete) list of available derived variables and potential restrictions to grid types on which the variables can be computed. If you are interested in the specific definitions, please refer to the corresponding source code referenced below.

Defining input variables for computations

The input variables to compute derived quantities need to be specified when the dataset is loaded. The following example shows the "Add datset" dialog in Met.3D v1.7. The input variables need to be specified by a "/"-separated string using the mapping "CF standard name:NetCDF or GRIB input variable name".

For example, assume that you are loading ECMWF ensemble forecast data from GRIB files. The variables will be named "u", "v", etc. in the GRIB files. For ECMWF-GRIB files only, Met.3D appends "(ens)", "(an)", "(fc)" to indicate whether the data refers to ensemble forecasts, analyses or HRES forecasts. Hence, your mapping string could look like:

eastward_wind:u (ens)/northward_wind:v (ens)/air_temperature:t (ens)/specific_humidity:q (ens)/surface_geopotential:z (ens)/surface_air_pressure:sp (ens)/surface_temperature:2t (ens)/lwe_thickness_of_precipitation_amount:tp (ens)/geopotential:z (ens)/atmosphere_relative_vorticity:vo (ens)

If your input data is read from NetCDF files, you would use the NetCDF variable names directly. E.g., if you u-wind variable is called "u_wind" in the input file, the corresponding part in the mapping would be "eastward_wind:u_wind".

Available derived quantities

As of Met.3D v1.7, the following derived variables are implemented (all input variable names follow the CF standard names):

Supported grid types

The variables in the following list support all grid and vertical level types unless otherwise noted.

  • Horizontal wind speed ("wind_speed")
    • Requires eastward_wind, northward_wind
  • 3D wind velocity ("magnitude_of_air_velocity")
    • Requires eastward_wind, northward_wind, upward_air_velocity
  • Potential temperature ("air_potential_temperature")
    • Requires air_temperature
  • Equivalent potential temperature ("equivalent_potential_temperature")
    • Requires air_temperature, specific_humidity
    • Computed using equation (43) of Bolton (MWR, 1980), "The Computation of Equivalent Potential Temperature".
  • Relative humidity ("relative_humidity")
    • Requires air_temperature, specific_humidity
    • Computed using saturation vapour pressure by Huang (JAMC, 2018), "A Simple Accurate Formula for Calculating Saturation VaporPressure of Water and Ice", DOI: 10.1175/JAMC-D-17-0334.1
  • Potential vorticity ("ertel_potential_vorticity")
    • Requires eastward_wind, northward_wind, air_temperature, surface_air_pressure

    • NOTE: Only available for regular lon-lat grids defined on hybrid sigma-pressure levels (e.g. ECMWF, ERA-5)
    • Computed using the ETH Lagranto formulation
  • Geopotential height ("geopotential_height")
    • Requires air_temperature, specific_humidity, surface_geopotential, surface_air_pressure, surface_temperature
  • Geopotential height ("geopotential_height_from_geopotential")
    • Requires geopotential
    • Simply divides input by 9.81m^2/s^2
  • Dew point temperature ("dew_point_temperature")
    • Requires specific_humidity
  • Hourly total precipitation ("lwe_thickness_of_precipitation_amount_Nh")
    • Requires lwe_thickness_of_precipitation_amount
    • Computes N-hourly precipitation from accumulated total precipitation (i.e., difference in the accumulated amount over N hours)
  • Vertically integrated horizontal moisture flux ("magnitude_of_vertically_integrated_horizontal_transport_of_moisture")
    • Requires surface_air_pressure, eastward_wind, northward_wind, specific_humidity
  • Air pressure ("air_pressure")
    • Requires air_temperature
    • Reconstructs 3D pressure field from grid level specification

Computation of derived variables is implemented in the "derivedvars" source code subdirectory:

Variable computation is implemented for each derived variable in a class derived from MDerivedDataFieldProcessor. The actual implementations are distributed over multiple files. A basic set of common quantities is implemented in

For each quantity, the implementation lists which input variables are required for computation. For example, the computation of horizontal wind speed requires the eastward and northward wind components as inputs.

MHorizontalWindSpeedProcessor::MHorizontalWindSpeedProcessor()
    : MDerivedDataFieldProcessor(
          "wind_speed",
          QStringList() << "eastward_wind" << "northward_wind")
{}

All derived variables available are listed in the constructor of MDerivedMetVarsDataSource:

Generic derivation of quantities (to come)

We are working on a Python interface to allow the computation of arbitrary quantities on-the-fly in Python scripts executed by Met.3D. Help with the implementation is appreciated!


  • No labels