CliMA/Insolation.jl

Fast, accurate solar geometry and top-of-atmosphere insolation for climate science and Earth system models.

23

stars

198

commits

Julia

primary language

Aug 4, 2026

updated

clima.github.io/Insolation.jl/
atmospheric-science
climate-modeling
climate-science
earth-system-model
insolation
julia
paleoclimate
solar-geometry
solar-radiation

README

Insolation.jl Logo

Insolation.jl

Documentationstable dev
Versionversion
Licenselicense
Testsgha ci buildkite
Code Coveragecodecov
DownloadsDownloads

Insolation.jl is a Julia package for calculating solar radiation and solar geometry. It provides efficient and accurate computations of solar zenith angle, azimuth angle, and incoming solar radiation (insolation) for climate science and Earth system modeling applications.

Features

  • Solar Geometry Calculations: Compute solar zenith angle, azimuth angle, and declination for any location and time
  • Insolation Computations: Calculate instantaneous and daily-averaged incoming solar radiation at the top of atmosphere
  • Orbital Parameters: Support for time-varying orbital parameters using the Laskar et al. (2004) solution for paleoclimate applications
  • Planetary Flexibility: Works for Earth by default, but applicable to any planetary body with configurable orbital and physical parameters
  • Type-Generic: Supports different number types (Float32, Float64) for performance optimization
  • Climate Model Integration: Built for use with ClimaAtmos.jl, RRTMGP.jl, and other CliMA packages

Installation

Insolation.jl is a registered Julia package. To install it, open the Julia REPL and run:

using Pkg
Pkg.add("Insolation")

Quick Start

using Insolation
using Dates
using ClimaParams

# Calculate insolation for a specific location and time
FT = Float64
lat = FT(40.0)    # degrees North
lon = FT(-105.0)  # degrees East
date = DateTime(2024, 6, 21, 12, 0, 0)  # Summer solstice, noon

# Create Earth parameters with default values
params = InsolationParameters(FT)

# Calculate instantaneous insolation with solar geometry
(; F, S, μ, ζ) = insolation(date, lat, lon, params)
# F: TOA insolation [W m⁻²]
# S: Solar flux [W m⁻²]  
# μ: Cosine of solar zenith angle
# ζ: Solar azimuth angle [radians]

# Calculate daily-averaged insolation
(; F, S, μ) = daily_insolation(date, lat, params)
F_daily, S_daily, μ_daily = F, S, μ

For more detailed examples and API documentation, see the documentation.

Contributors

claresinger

40 commits

bors[bot]

30 commits

ph-kev

20 commits

CliMA/Insolation.jl

Fast, accurate solar geometry and top-of-atmosphere insolation for climate science and Earth system models.

23

stars

198

commits

Julia

primary language

Aug 4, 2026

updated

clima.github.io/Insolation.jl/
atmospheric-science
climate-modeling
climate-science
earth-system-model
insolation
julia
paleoclimate
solar-geometry
solar-radiation

README

Insolation.jl Logo

Insolation.jl

Documentationstable dev
Versionversion
Licenselicense
Testsgha ci buildkite
Code Coveragecodecov
DownloadsDownloads

Insolation.jl is a Julia package for calculating solar radiation and solar geometry. It provides efficient and accurate computations of solar zenith angle, azimuth angle, and incoming solar radiation (insolation) for climate science and Earth system modeling applications.

Features

  • Solar Geometry Calculations: Compute solar zenith angle, azimuth angle, and declination for any location and time
  • Insolation Computations: Calculate instantaneous and daily-averaged incoming solar radiation at the top of atmosphere
  • Orbital Parameters: Support for time-varying orbital parameters using the Laskar et al. (2004) solution for paleoclimate applications
  • Planetary Flexibility: Works for Earth by default, but applicable to any planetary body with configurable orbital and physical parameters
  • Type-Generic: Supports different number types (Float32, Float64) for performance optimization
  • Climate Model Integration: Built for use with ClimaAtmos.jl, RRTMGP.jl, and other CliMA packages

Installation

Insolation.jl is a registered Julia package. To install it, open the Julia REPL and run:

using Pkg
Pkg.add("Insolation")

Quick Start

using Insolation
using Dates
using ClimaParams

# Calculate insolation for a specific location and time
FT = Float64
lat = FT(40.0)    # degrees North
lon = FT(-105.0)  # degrees East
date = DateTime(2024, 6, 21, 12, 0, 0)  # Summer solstice, noon

# Create Earth parameters with default values
params = InsolationParameters(FT)

# Calculate instantaneous insolation with solar geometry
(; F, S, μ, ζ) = insolation(date, lat, lon, params)
# F: TOA insolation [W m⁻²]
# S: Solar flux [W m⁻²]  
# μ: Cosine of solar zenith angle
# ζ: Solar azimuth angle [radians]

# Calculate daily-averaged insolation
(; F, S, μ) = daily_insolation(date, lat, params)
F_daily, S_daily, μ_daily = F, S, μ

For more detailed examples and API documentation, see the documentation.

Contributors

claresinger

40 commits

bors[bot]

30 commits

ph-kev

20 commits

Languages

Julia

100.0%