Derived Variables
Met.3D can compute a range of derived atmospheric quantities on-the-fly from gridded input data.
Defining input variable mapping
When loading a dataset, you need to map the variable names in your data files to the CF standard names that Met.3D uses internally. In the “Add dataset” dialog, click the “Variable mapping” button to open a table editor where you can define these mappings interactively.
Alternatively, specify the mapping as a /-separated string of CF standard name:input variable name pairs.
For example, for ECMWF GRIB data:
eastward_wind:u/northward_wind:v/air_temperature:t/specific_humidity:q/surface_geopotential:z/surface_air_pressure:sp/surface_temperature:2t/lwe_thickness_of_precipitation_amount:tp/geopotential:z
For NetCDF files, use the NetCDF variable names directly.
For instance, if the u-wind variable is called u_wind, the entry would be eastward_wind:u_wind.
Available derived variables
As of Met.3D v2.0, the following derived variables are implemented. All variable names follow the CF standard names convention. Unless noted, variables support all grid and vertical level types.
Wind
wind_speedHorizontal wind speed.
Requires: eastward_wind, northward_wind.
Input level types: all.
Output: same level type as input.
magnitude_of_air_velocity3-D wind speed magnitude.
Requires: eastward_wind, northward_wind, upward_air_velocity.
Input level types: all.
Output: same level type as input.
Temperature and thermodynamics
air_potential_temperaturePotential temperature.
Requires: air_temperature.
Input level types: all.
Output: same level type as input.
equivalent_potential_temperatureEquivalent potential temperature; Bolton (MWR, 1980), Eq. 43.
Requires: air_temperature, specific_humidity.
Input level types: all.
Output: same level type as input.
ertel_potential_vorticityErtel potential vorticity; LAGRANTO formulation. A more generic implementation for other level types is available via
potential_vorticity_baroclinic_metpy(see below).Requires: eastward_wind, northward_wind, air_temperature, surface_air_pressure.
Input level types: HYBRID_SIGMA_PRESSURE_3D only.
Output: HYBRID_SIGMA_PRESSURE_3D.
potential_vorticity_baroclinic_metpyBaroclinic potential vorticity (MetPy). More generic than
ertel_potential_vorticity; works on all level types. Computed via the Python/MetPy interface.Requires: air_potential_temperature, air_pressure, eastward_wind, northward_wind.
Input level types: all.
Output: same level type as input.
static_stability_metpyStatic stability (MetPy). Computed via the Python/MetPy interface.
Requires: air_pressure, air_temperature.
Input level types: all.
Output: same level type as input.
Geopotential and pressure
surface_geopotentialSurface geopotential derived from geometric height; MetPy / Wallace & Hobbs (2006).
Requires: height_above_mean_sea_level (surface field, in metres).
Input level types: SINGLE_LEVEL.
Output: SINGLE_LEVEL.
geopotential_heightGeopotential height.
Requires: air_temperature, specific_humidity, surface_geopotential, surface_air_pressure, surface_temperature.
Input level types: all (3D inputs at any level type; surface inputs at SINGLE_LEVEL).
Output: same level type as the 3D inputs.
geopotential_height_from_geopotentialGeopotential height from geopotential field (divides by 9.81 m² s⁻²).
Requires: geopotential.
Input level types: all.
Output: same level type as input.
air_pressure3-D air pressure field reconstructed from grid level specification; no input data needed.
Requires: nothing.
Input level types: PRESSURE_LEVELS_3D, AUXILIARY_PRESSURE_3D, HYBRID_SIGMA_PRESSURE_3D.
Output: same level type as input.
omega_hydrostatic_approximationVertical velocity in pressure coordinates (ω, Pa s⁻¹); MetPy / Wallace & Hobbs (2006).
Requires: upward_air_velocity, air_temperature.
Input level types: all.
Output: same level type as input.
Moisture and precipitation
relative_humidityRelative humidity; saturation vapour pressure after Huang (JAMC, 2018).
Requires: air_temperature, specific_humidity.
Input level types: all.
Output: same level type as input.
dew_point_temperatureDew-point temperature.
Requires: specific_humidity.
Input level types: all.
Output: same level type as input.
lwe_thickness_of_precipitation_amount_NhN-hourly total precipitation (N = 1, 3, 6, 12, 24), computed as the difference of accumulated totals over N hours.
Requires: lwe_thickness_of_precipitation_amount at the current and N-hours-prior time steps.
Input level types: all (in practice SINGLE_LEVEL for precipitation data).
Output: same level type as input.
precipitation_amount_NhSame as above but without the
lwe_thickness_of_prefix (N = 1, 3, 6, 12, 24), for data files that omit it.Requires: precipitation_amount at the current and N-hours-prior time steps.
Input level types: all (in practice SINGLE_LEVEL).
Output: same level type as input.
magnitude_of_vertically_integrated_horizontal_transport_of_moisture__from_LEVELTYPEVertically integrated horizontal moisture flux magnitude. Registered separately for each 3D level type;
LEVELTYPEin the name is replaced accordingly.Requires: surface_air_pressure, eastward_wind, northward_wind, specific_humidity.
Input level types: HYBRID_SIGMA_PRESSURE_3D, PRESSURE_LEVELS_3D, AUXILIARY_PRESSURE_3D (one registration per type).
Output: SINGLE_LEVEL (vertically integrated → 2D field).
magnitude_of_horizontal_transport_of_moistureColumn-wise (not vertically integrated) horizontal moisture flux magnitude.
Requires: eastward_wind, northward_wind, specific_humidity.
Input level types: all.
Output: same level type as input.
lwe_thickness_of_atmosphere_water_vapor_contentVertically integrated water vapour (IWV, kg m⁻²).
Requires: specific_humidity (any level type).
Input level types: all.
Output: SINGLE_LEVEL.
wet_bulb_temperature_metpyWet-bulb temperature (MetPy, Normand method — can be slow on large grids). Computed via the Python/MetPy interface.
Requires: air_pressure, air_temperature, dew_point_temperature.
Input level types: all.
Output: same level type as input.
wet_bulb_potential_temperature_metpyWet-bulb potential temperature (MetPy). Computed via the Python/MetPy interface.
Requires: air_pressure, air_temperature, dew_point_temperature.
Input level types: all.
Output: same level type as input.
hourly_mean_of_surface_downward_latent_heat_fluxHourly mean surface downward latent heat flux (ERA5-specific; derived from accumulated flux).
Requires: integral_wrt_time_of_surface_downward_latent_heat_flux.
Input level types: all (in practice SINGLE_LEVEL for ERA5 surface flux data).
Output: same level type as input.
Boundary layer
bulk_richardson_numberBulk Richardson number.
Requires: geopotential_height, eastward_wind, northward_wind, air_temperature, specific_humidity, air_pressure.
Input level types: all.
Output: same level type as input.
blh_from_richardson_numberBoundary layer height derived from the bulk Richardson number (metres).
Requires: bulk_richardson_number, geopotential_height (any level type).
Input level types: all.
Output: SINGLE_LEVEL.
Wind speed derivatives
Used by the Jetcore detection actor.
All derivatives below require at least eastward_wind and northward_wind. Derivatives in z additionally require geopotential_height. All support all input level types and output the same level type as input.
dVs_dn— ∂Vs/∂n: first derivative perpendicular to wind direction.dVs_dz— ∂Vs/∂z: first derivative, vertical (upward).dVs_dp— ∂Vs/∂p: first derivative along pressure.d2Vs_dn2— ∂²Vs/∂n²: second derivative perpendicular to wind.d2Vs_dz2— ∂²Vs/∂z²: second derivative, vertical.d2Vs_dp2— ∂²Vs/∂p²: second derivative along pressure.d2Vs_dndz— ∂²Vs/∂n∂z: mixed derivative (perpendicular × vertical).d2Vs_dndp— ∂²Vs/∂n∂p: mixed derivative (perpendicular × pressure).
Height-to-pressure conversion
For each surface 2-D field with height values in metres available in the loaded dataset, Met.3D automatically registers two derived variables:
air_pressure_at_<fieldname>_from_standard_atmosphere— converts the height field to pressure using the ICAO standard atmosphere.air_pressure_at_<fieldname>_from_geopotential_height— uses geopotential height for a more accurate conversion.
For example, if a field BLH (boundary layer height in metres) is loaded,
Met.3D automatically provides air_pressure_at_BLH_from_standard_atmosphere.
Python/MetPy interface
Several derived variables (marked “Computed via the Python/MetPy interface” in the
list above) are computed through Met.3D’s embedded Python interface using
MetPy via an in-memory NetCDF buffer. Input data
for the computation is passed as an xarray.Dataset to the corresponding Python function.
See Python Interface for the full Python interface documentation.
If you have already implemented a computation in Python, or want to use additional MetPy functions, adding new Python-derived variables is straightforward. See Adding a new derived variable in the developer manual.
Source code
Derived variable computation is in src/data/derivedvars/:
The base class is MDerivedDataFieldProcessor (deriveddatafieldprocessor.h).
Standard variables are implemented in derivedmetvars_standard.cpp.
All processors are registered in MDerivedMetVarsDataSource (derivedmetvarsdatasource.cpp).
For developer guidance on adding new derived variables, see
Adding a new derived variable in the developer manual.