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
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
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)
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)
Acknowledgement
This project is supported by the Earth Surface Process Modelling group at the German Geoscience Research Institute in Potsdam, Germany.
Release files for orographic_precipitation 1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| orographic_precipitation-1.0.tar.gz | 23.2 kB | Details |
Release files / orographic_precipitation-1.0.tar.gz
| Download URL | orographic_precipitation-1.0.tar.gz |
|---|---|
| Size | 23.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d7d15b6f0d3a40f4a5945931919c09e5dc77092591178a1168459e47e3714092
|
|
BLAKE2b-256 checksum How to use checksums |
65945015054a4f424c0eb6bbfdfaea57484eb4d17d82f7af070215c8a0a84e3e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
Python-urllib/3.7
|