improver.orographic_enhancement module

This module contains a plugin to calculate the enhancement of precipitation over orography.

class OrographicEnhancement[source]

Bases: BasePlugin

Class to calculate orographic enhancement from horizontal wind components, temperature and relative humidity.

References

Alpert, P. and Shafir, H., 1989: Meso-Gamma-Scale Distribution of

Orographic Precipitation: Numerical Study and Comparison with Precipitation Derived from Radar Measurements. Journal of Applied Meteorology, 28, 1105-1117.

Roe, G., 2005: Orographic Precipitation. Annual Review of Earth

and Planetary Sciences, 33, 645-671.

__init__()[source]

Initialise the plugin with thresholds from STEPS code. Usage as follows:

Criteria for site orographic enhancement calculation:
  • 3x3 mean topography height >= self.orog_thresh_m (20 m)

  • Relative humidity (fraction) >= self.rh_thresh_ratio (0.8)

  • v dot grad z (wind x topography gradient) >= self.vgradz_thresh_ms (0.0005 m/s)

Parameters for calculating upstream contribution:
  • Maximum range of an upstream cell to contribute to the total enhancement (self.upstream_range_of_influence_km). This is 15 km in STEPS.

  • Cloud lifetime (self.cloud_lifetime_s) defines the standard deviation of the distance weighting function for upstream enhancement contributions. This is 102 seconds in STEPS.

  • Scaling factor by which to multiply the weighted sum of upstream contributions (self.efficiency_factor). This is 0.23265 in STEPS.

Create placeholder class members for regridded variable cubes (orography, temperature, humidity, pressure and wind components), saturation vapour pressure, V.gradZ (uplift) array and grid spacing.

_abc_impl = <_abc_data object>
_add_upstream_component(point_orogenh)[source]

Add upstream component to site orographic enhancement

Parameters:

point_orogenh (ndarray) – Site orographic enhancement in mm h-1

Return type:

ndarray

Returns:

Total orographic enhancement in mm h-1

_compute_weighted_values(point_orogenh, x_source, y_source, distance, wind_speed)[source]

Extract orographic enhancement values from source points and weight according to source-destination distance.

Parameters:
  • point_orogenh (ndarray) – 2D array of point orographic enhancement values

  • x_source (ndarray) – 3D array of x-coordinates of source points from which to read upstream contribution

  • y_source (ndarray) – 3D array of y-coordinates of source points from which to read upstream contribution

  • distance (ndarray) – 3D array of grid point source-to-destination distances

  • wind_speed (ndarray) – 2D array of wind speeds

Return type:

Tuple[ndarray, ndarray]

Returns:

  • 2D array containing a weighted sum of orographic enhancement components from upstream source points

  • 2D array containing weights for normalisation

_create_output_cube(orogenh_data, reference_cube)[source]

Creates a cube containing orographic enhancement values in SI units.

Parameters:
  • orogenh_data (ndarray) – Orographic enhancement value in mm h-1

  • reference_cube (Cube) – Cube with the correct time and forecast period coordinates on the UK standard grid

Return type:

Cube

Returns:

Orographic enhancement cube (m s-1)

_generate_mask()[source]

Generates a boolean mask of areas NOT to calculate orographic enhancement. Criteria for calculating orographic enhancement are that all of the following are true:

  • 3x3 mean topography height >= threshold (20 m)

  • Relative humidity (fraction) >= threshold (0.8)

  • v dot grad z (wind x topography gradient) >= threshold (0.0005)

The mask is therefore “True” if any of these conditions are false.

Return type:

ndarray

Returns:

Boolean mask - where True, set orographic enhancement to a default zero value

_get_point_distances(wind_speed, max_sin_cos)[source]

Generate 3d array of distances to upstream components

Parameters:
  • wind_speed (ndarray) – 2D array of wind speeds

  • max_sin_cos (ndarray) – 2D array containing the larger of sin(wind_direction) or cos(wind_direction) with respect to grid north

Return type:

ndarray

Returns:

3D array of source-to-destination distances in grid points, with np.nan filled in for out of range values

static _locate_source_points(wind_speed, distance, sin_wind_dir, cos_wind_dir)[source]

Generate 3D arrays of source points from which to add upstream orographic enhancement contribution. Assumes spatial coordinate ordering [y, x].

Parameters:
  • wind_speed (ndarray) – 2D array of wind speed magnitudes

  • distance (ndarray) – 3D array of grid point source-to-destination distances

  • sin_wind_dir (ndarray) – 2D array of sin wind direction wrt grid north

  • cos_wind_dir (ndarray) – 2D array of cos wind direction wrt grid north

Return type:

Tuple[ndarray, ndarray]

Returns:

  • 3D array of source point x-coordinates

  • 3D array of source point y-coordinates

_orography_gradients()[source]

Calculates the dimensionless gradient of self.topography along both spatial axes, smoothed along the perpendicular axis. If spatial coordinates are not in the same units as topography height (m), converts coordinate units in place.

Return type:

Tuple[Cube, Cube]

Returns:

  • 2D cube of dimensionless topography gradients in the positive x direction

  • 2D cube of dimensionless topography gradients in the positive y direction

_point_orogenh()[source]

Calculate the grid-point precipitation enhancement contribution due to orographic uplift using:

orogenh = ((humidity * svp * vgradz) /

(R_WATER_VAPOUR * temperature)) * 60 * 60

Return type:

ndarray

Returns:

Orographic enhancement values in mm/h

_regrid_and_populate(temperature, humidity, pressure, uwind, vwind, topography)[source]

Regrids input variables onto the high resolution orography field, then populates the class instance with regridded variables before converting to SI units. Also calculates V.gradZ as a class member.

Parameters:
  • temperature (Cube) – Temperature at top of boundary layer

  • humidity (Cube) – Relative humidity at top of boundary layer

  • pressure (Cube) – Pressure at top of boundary layer

  • uwind (Cube) – Positive eastward wind vector component at top of boundary layer

  • vwind (Cube) – Positive northward wind vector component at top of boundary layer

  • topography (Cube) – Height of topography above sea level on 1 km UKPP domain grid

Return type:

None

_regrid_variable(var_cube, unit)[source]

Sorts spatial coordinates in ascending order, regrids the input variable onto the topography grid and converts to the required units. This function does not modify the input variable cube.

Parameters:
  • var_cube (Cube) – Cube containing input variable data

  • unit (str) – Required unit for this variable

Return type:

Cube

Returns:

Cube containing regridded variable data

process(temperature, humidity, pressure, uwind, vwind, topography)[source]

Calculate precipitation enhancement over orography on high resolution grid. Input diagnostics are all expected to be on the same grid, and are regridded to match the orography.

Parameters:
  • temperature (Cube) – Temperature at top of boundary layer

  • humidity (Cube) – Relative humidity at top of boundary layer

  • pressure (Cube) – Pressure at top of boundary layer

  • uwind (Cube) – Positive eastward wind vector component at top of boundary layer

  • vwind (Cube) – Positive northward wind vector component at top of boundary layer

  • topography (Cube) – Height of topography above sea level on high resolution (1 km) UKPP domain grid

Return type:

Cube

Returns:

Precipitation enhancement due to orography in m/s.