A package for computing surface fluxes between the atmosphere, ocean, and land using Monin-Obukhov Similarity Theory (MOST).
SurfaceFluxes.jl provides robust, efficient methods for calculating turbulent surface fluxes of momentum, heat, and moisture. It supports GPU broadcasting, automatic differentiation, and multiple universal function parameterizations (Businger, Gryanik, Grachev), making it ideal for high-performance climate modeling.
| Stable Release | |
| Unit Tests | |
| Downloads |
- Monin-Obukhov Similarity Theory: Robust iterative solver for stability-dependent surface fluxes
- Universal Function Parameterizations: Businger et al. (1971), Gryanik et al. (2020), and Grachev et al. (2007) formulations
- GPU Support: Full GPU acceleration with CUDA.jl and other GPU array types
- Land and Ocean Parameterizations: Support for parameterizations for land and ocean surfaces, including roughness lengths that depend on wind speed (ocean) and vegetation characteristics (land)
- Dynamic Skin States: Supports dynamic calculations of skin temperatures and humidities via user-supplied functions
- Finite-Difference and Finite-Volume Schemes: Supports both finite-difference (point-wise) and finite-volume (layer-averaged) formulations following Nishizawa & Kitamura (2018)
- AD Compatible: Works with automatic differentiation frameworks for integration into differentiable models
using SurfaceFluxes
import SurfaceFluxes.Parameters as SFP
import SurfaceFluxes.UniversalFunctions as UF
import ClimaParams
# Create parameters
FT = Float64
param_set = SFP.SurfaceFluxesParameters(FT, UF.BusingerParams)
# Compute surface fluxes
result = surface_fluxes(
param_set,
T_int, # Interior temperature [K]
q_tot, # Interior total specific humidity [kg/kg]
q_liq, # Interior liquid specific humidity [kg/kg]
q_ice, # Interior ice specific humidity [kg/kg]
ρ_int, # Interior density [kg/m³]
T_sfc, # Surface temperature [K]
q_sfc, # Surface specific humidity [kg/kg]
Φ_sfc, # Surface geopotential [m²/s²]
Δz, # Height above surface [m]
d, # Displacement height [m]
u_int, # Interior wind (u, v) [m/s]
u_sfc, # Surface wind (u, v) [m/s]
)
# Access results
result.shf # Sensible heat flux [W/m²]
result.lhf # Latent heat flux [W/m²]
result.evaporation # Evaporation rate [kg/(m²·s)]
result.ustar # Friction velocity [m/s]
result.ρτxz # Momentum flux, x-component [N/m²]
result.ρτyz # Momentum flux, y-component [N/m²]
result.Cd # Drag coefficient
result.Ch # Heat exchange coefficient
result.T_sfc # Surface temperature [K] (final)
result.q_vap_sfc # Surface vapor specific humidity [kg/kg] (final)
result.L_MO # Monin-Obukhov length [m]
result.converged # Solver convergence status