Skip to main content

Linear Theory of Orographic Precipitation

Project description

A Python framework that implements the Linear Theory of Orographic Precipitation following Smith & Barstad (2004).

The model includes airflow dynamics, condensed water advection, and downslope evaporation. It consists of two vertically-integrated steady-state advection equations describing: (i) the cloud water density and (ii) the hydrometeor density. Solving these equations using Fourier transform techniques, derives a single formula relating terrain and precipitation.

Please refer to the original manuscript of Smith and Barstad (2004) to understand the model physics and limitations.


Required dependencies:

  • Python 3.6 or later
  • numpy

orographic precipitation can be installed using pip:

$ pip install orographic_precipitation


  1. Import relevant functions to compute orographic precipitation, set up a topography and plot the resulting precipitation matrix.
import matplotlib.pyplot as plt
from orographic_precipitation import compute_orographic_precip

2. Create example topography, for instance, an isolated circular Gaussian hill (see original publication, Fig. 4 a-c).

def gauss_topography(dx, dy):
  """Returns synthetic topography for testing.
  Analogous to Fig 4 in Smith and Barstedt, 2004.
  h_max = 500.
  x0 = -25e3
  y0 = 0
  sigma_x = sigma_y = 15e3

  x, y = np.arange(-100e3, 200e3, dx), np.arange(-150e3, 150e3, dy)
  X, Y = np.meshgrid(x, y)

  h = (h_max *
       np.exp(-(((X - x0)**2 / (2 * sigma_x**2)) +
                ((Y - y0)**2 / (2 * sigma_y**2)))))

  return X, Y, h

def plot2d(X, Y, field):
  """Function that plots precipitation matrices"""
  fig, ax = plt.subplots(figsize=(6, 6))
  pc = ax.pcolormesh(X, Y, field)

dx = 750.
dy = 750.

X, Y, elevation = gauss_topography(dx, dy)

plot2d(X, Y, elevation)
  1. Initialize dictionary with relevant parameters, compute and plot orographic precipitation.
gamma = -5.8    #-6.49
Gamma_m = -6.5  #-5
rhosref = 7.4e-3

param = {
'latitude': 40,
'p0': 7,                          # uniform precipitation rate
'windspeed': 10,
'winddir': 270,                   # wind direction (270: west)
'tau_c': 1000,                    # conversion time
'tau_f': 1000,                    # fallout time
'nm': 0.005,                      # moist stability frequency
'hw': 5000,                       # water vapor scale height
'cw': rhosref * Gamma_m / gamma   # uplift sensitivity

P = compute_orographic_precip(elevation, dx, dy, **param)

plot2d(X, Y, P)


This project is supported by the Earth Surface Process Modelling group at the German Geoscience Research Institute in Potsdam, Germany.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for orographic_precipitation, version 0.1rc0
Filename, size File type Python version Upload date Hashes
Filename, size orographic_precipitation-0.1rc0.tar.gz (21.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page