GPU-capable surface fluxes between atmosphere, ocean, and land via Monin-Obukhov Similarity Theory
21
stars
352
commits
Julia
primary language
Sep 1, 2026
updated
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.
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.g_h # Heat conductance Ch * U_eff [m/s]
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
The full documentation, including the mathematical formulation of MOST, the universal function parameterizations, and the API reference, is available at the stable docs.
Contributors should follow the shared CliMA engineering standards in
docs/dev-guides/, which cover architecture, performance, code quality,
documentation, and workflows. These are vendored from
CliMA/DeveloperGuides and synced automatically
each month. The repo's AGENTS.md is a starting point for AI agents with
repo-specific guidance.
Julia
100.0%
GPU-capable surface fluxes between atmosphere, ocean, and land via Monin-Obukhov Similarity Theory
21
stars
352
commits
Julia
primary language
Sep 1, 2026
updated
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.
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.g_h # Heat conductance Ch * U_eff [m/s]
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
The full documentation, including the mathematical formulation of MOST, the universal function parameterizations, and the API reference, is available at the stable docs.
Contributors should follow the shared CliMA engineering standards in
docs/dev-guides/, which cover architecture, performance, code quality,
documentation, and workflows. These are vendored from
CliMA/DeveloperGuides and synced automatically
each month. The repo's AGENTS.md is a starting point for AI agents with
repo-specific guidance.
Julia
100.0%