Skip to content

fastscape-lem/orographic-precipitation

Repository files navigation

Linear Theory of Orographic Precipitation

Build Status Coverage Status License

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.

Installation

Required dependencies:

  • Python 3.6 or later
  • numpy

Optional dependencies (required for fastscape extension):

orographic_precipitation can be installed using pip:

$ pip install orographic_precipitation

Alternatively, you can install orographic_precipitation from conda-forge:

$ conda install orographic_precipitation -c conda-forge

Usage

  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)
  ax.set_aspect(1)
  fig.colorbar(pc)

dx = 750.
dy = 750.

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

plot2d(X, Y, elevation)

image

  1. Initialize dictionary with relevant parameters, compute and plot orographic precipitation.
lapse_rate = -5.8
lapse_rate_m = -6.5
ref_density = 7.4e-3

param = {
'latitude': 40,
'precip_base': 7,                          # uniform precipitation rate
'wind_speed': 10,
'wind_dir': 270,                   # wind direction (270: west)
'conv_time': 1000,                    # conversion time
'fall_time': 1000,                    # fallout time
'nm': 0.005,                      # moist stability frequency
'hw': 5000,                       # water vapor scale height
'cw': ref_density * lapse_rate_m / lapse_rate   # uplift sensitivity
}

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

plot2d(X, Y, P)

image

Acknowledgement

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