Skip to content

Radiation ​

Radiation as one model component ​

Shortwave and longwave radiation are bundled into a single model component model.radiation. The default is Radiation, which holds a shortwave and a longwave scheme and calls them in that order for every grid column

julia
using SpeedyWeather
spectral_grid = SpectralGrid()
radiation = Radiation(spectral_grid; shortwave = TwoBandShortwave(spectral_grid), longwave = OneBandLongwave(spectral_grid))
model = PrimitiveWetModel(spectral_grid; radiation)
model.radiation
Radiation{TwoBandShortwave{DiagnosticCl...} <: SpeedyWeather.AbstractRadiation
├ shortwave::TwoBandShortwave{DiagnosticClouds{Float32, Base.RefValue{Int64}}...
└ longwave::OneBandLongwave{ByrneOGormanLongwaveTransmissivity{Float32}, OneB...

Either stream can be nothing to switch it off, e.g. Radiation(spectral_grid; shortwave = nothing). The individual schemes are accessed as model.radiation.shortwave and model.radiation.longwave. A radiation scheme that computes both streams at once (for example a correlated-k scheme that shares its gas optics between shortwave and longwave) subtypes SpeedyWeather.AbstractRadiation directly, implements parameterization!(ij, vars, scheme, model) for both streams, declares its variables via variables(::MyRadiation) (the standard radiation diagnostics such as outgoing_longwave and surface_shortwave_down are those of variables(::AbstractShortwave) and variables(::AbstractLongwave)), and is passed as radiation = MyRadiation(spectral_grid).

Radiation schemes from NumericalRadiation.jl ​

SpeedyWeather itself includes simple radiation schemes, described in the rest of this page: a uniform cooling, the Jeevanjee temperature-flux longwave, and one-band longwave and shortwave schemes with diagnostic clouds. More comprehensive schemes are provided by NumericalRadiation.jl through a package extension that is active as soon as both packages are loaded:

  • ClearSkyEcCKDRadiation: clear-sky correlated-k gas optics (ecCKD, the gas-optics models of ECMWF's ecRad) with 32 or 64 longwave and 32, 64 or 96 shortwave g points, interpolated from tabulated coefficients for every column. Longwave and shortwave are solved from one gas-optics evaluation, with Rayleigh scattering in the shortwave. CO₂ follows the model's greenhouse gases; ozone comes from an analytic default profile until SpeedyWeather has an ozone field, other gases are prescribed with the scheme (mole_fractions).

  • AnalyticBandLongwave: NumericalRadiation's analytic 41-band clear-sky longwave scheme of for water vapour and CO₂, usable as it is as the longwave part of a Radiation; see its documentation for the scheme's parameters.

Both are NumericalRadiation's own scheme types, used like any other SpeedyWeather scheme; the extension adds constructors from a SpectralGrid. Add NumericalRadiation (version 0.2 or later) with Pkg.add("NumericalRadiation"):

julia
using SpeedyWeather, NumericalRadiation

spectral_grid = SpectralGrid(truncation = 31, nlayers = 8)

# ecCKD for both streams: the reference 32x32 model, or e.g. ClearSkyEcCKDRadiation(spectral_grid, "64x96")
radiation = ClearSkyEcCKDRadiation(spectral_grid)
model = PrimitiveWetModel(spectral_grid; radiation)
simulation = initialize!(model)
run!(simulation, period = Day(10))
simulation.variables.parameterizations.outgoing_longwave

# or the analytic-band longwave next to the default one-band shortwave; keywords are the scheme's
# parameters, e.g. the surface emissivities (SpeedyWeather has no field for them)
longwave = AnalyticBandLongwave(spectral_grid; ocean_emissivity = 0.98, land_emissivity = 0.97)
model = PrimitiveWetModel(spectral_grid; radiation = Radiation(spectral_grid; longwave))

Both schemes take CO₂ from the model's co2 component when present (see Greenhouse gases). Without it, AnalyticBandLongwave uses the default 360 ppm and ClearSkyEcCKDRadiation its own mole_fractions.CO₂ (280 ppm by default).

The first ClearSkyEcCKDRadiation downloads the ecCKD coefficient tables (a lazy artifact of NumericalRadiation). Its work arrays, optical depths per g point, interface fluxes and the surface emission, are parameterization variables in the ecckd namespace, simulation.variables.parameterizations.ecckd. The scheme is clear-sky, about 3x the cost of the one-band pair at T31 with 8 layers, and further gases of an ecCKD model are passed as mole_fractions = (; CH₄ = 1.8e-6); see NumericalRadiation's documentation for the scheme.

Work in progress

NumericalRadiation is still in an early stage and not yet fully validated.

Longwave radiation implementations ​

Currently implemented is

julia
using SpeedyWeather
subtypes(SpeedyWeather.AbstractLongwave)
5-element Vector{Any}:
 JeevanjeeRadiation
 OneBandLongwave
 SpeedyWeather.AbstractLongwaveRadiativeTransfer
 SpeedyWeather.AbstractLongwaveTransmissivity
 UniformCooling

See Parameterizations for the general parameterization interface these implement.

Uniform cooling ​

Following , the uniform cooling of the atmosphere is defined as

with   resulting in a cooling of -1.5K/day for most of the atmosphere, except below temperatures of   in the stratosphere where a relaxation towards   with a time scale of   is present.

Jeevanjee radiation ​

(Eq. 2) define a longwave radiative flux $F$ for atmospheric cooling as (following , Eq. 1)

The flux (in ) is a vertical upward flux between two layers (vertically adjacent) of temperature difference . The change of this flux across layers depends on the temperature and is a relaxation term towards a prescribed stratospheric temperature   with a radiative forcing constant  . Two layers of identical temperatures   would have no net flux between them, but a layer below at higher temperature would flux into colder layers above as long as its temperature  . This flux is applied above the lowermost layer and above, leaving the surface fluxes unchanged. The uppermost layer is tied to through a relaxation at time scale  

The flux is converted to temperature tendencies at layer via

The term in parentheses is the absorbed flux in layer of the upward flux from below at interface   ( increases downwards, see Vertical coordinates and resolution and Sigma coordinates).    is the pressure thickness of layer , gravity and heat capacity .

OneBandLongwave ​

Solves the standard two-stream approximation to calculate longwave radiative fluxes up and down following .

using optical depth as vertical coordinate. Longwave emittance is following Stefan-Boltzmann with emittance of 1. Boundary conditions are   at the surface, i.e. the surface emitting with its surface temperature (sea surface temperature, skin or soil temperature); and   at the top (no longwave radiation from space). Instead of optical depth we solve these equations using the transmissivity   .

such that the upward flux of layer is reduced by transmissivity of that layer but increased by longwave emittance going up. Similarly on the downwards pass

Note that the sign change in the differential formulation with optical depth only occurs because the optical depth as vertical coordinate strictly increases towards the surface.

To be used like (currently the default anyway, with the Byrne and O'Gorman transmissivity below)

Stratospheric emission. A grey scheme with an optical depth that increases like has an almost transparent stratosphere, which can hardly emit and therefore cannot balance stratospheric ozone heating (see TwoBandShortwave). Following the stratospheric correction in Fortran SPEEDY, the stratosphere   (stratosphere_pressure, default 140 hPa) additionally emits directly to space

with the pressure overlap of layer with the stratosphere and = stratospheric_emissivity (0.05 for OneBandLongwave, 0 for OneBandGreyLongwave). This emission cools the stratospheric layers and is added to the outgoing longwave radiation. It represents emission in the centre of the CO₂ band, which a single grey band lacks.

To be used like (currently the default anyway)

julia
spectral_grid = SpectralGrid()
longwave = OneBandLongwave(spectral_grid)
model = PrimitiveWetModel(spectral_grid; radiation = Radiation(spectral_grid; longwave))
model.radiation.longwave
OneBandLongwave{ByrneOGormanLongwaveTransmiss...} <: SpeedyWeather.AbstractLongwave
├ transmissivity::ByrneOGormanLongwaveTransmissivity{Float32}
└ radiative_transfer::OneBandLongwaveRadiativeTransfer{Float32}

The transmissivity is defined as in using the following parameters

julia
FriersonLongwaveTransmissivity(spectral_grid)
FriersonLongwaveTransmissivity{Float32} <: SpeedyWeather.AbstractLongwaveTransmissivity
├ τ₀_equator::Float32 = 8.4
├ τ₀_pole::Float32 = 2.1
└ fₗ::Float32 = 0.25

to compute

with surface values of optical depth at the equator and at the poles and a transition in between with latitude . Then the optical depth changes in the vertical as

For details see . The default constants differ from Frierson's ( ,  ,  ): is 1.4x larger and   to avoid a too cold planet with the TwoBandShortwave radiation.

Use the Frierson transmissivity, which prescribes the optical depth independent of humidity and CO₂, with

julia
longwave = OneBandLongwave(spectral_grid, transmissivity = FriersonLongwaveTransmissivity(spectral_grid))
OneBandLongwave{FriersonLongwaveTransmissivit...} <: SpeedyWeather.AbstractLongwave
├ transmissivity::FriersonLongwaveTransmissivity{Float32}
└ radiative_transfer::OneBandLongwaveRadiativeTransfer{Float32}

Humidity- and CO₂-dependent transmissivity ​

The default ByrneOGormanLongwaveTransmissivity follows (as also used in Isca). The optical depth of layer is

with dry absorption , CO₂ sensitivity relative to the reference concentration   ppm (the default CO₂, SpeedyWeather.DEFAULT_CO2), water vapor absorption , specific humidity , the pressure thickness of layer and reference pressure (from model.atmosphere). CO₂ is taken from model.greenhouse_gases.co2 (see Greenhouse gases) so that the optical depth responds to both the model's humidity (a water vapor feedback) and CO₂. The parameters are

julia
ByrneOGormanLongwaveTransmissivity(spectral_grid)
ByrneOGormanLongwaveTransmissivity{Float32} <: SpeedyWeather.AbstractLongwaveTransmissivity
├ dry_absorption::Float32 = 1.45
├ water_vapor_absorption::Float32 = 750.0
├ co2_sensitivity::Float32 = 0.2023
└ reference_co2::Float32 = 360.0

With Byrne and O'Gorman's values   and   the water vapor feedback runs away together with the TwoBandShortwave radiation. The defaults   and   are tuned for stable long integrations and a global energy budget close to observations (Wild et al., 2013) at T32L8: a global mean sea surface temperature of about 291.5 K, 397 W/m² of surface longwave emission and 314 W/m² of downward longwave radiation at the surface. Because the longwave radiation does not include clouds, the latter matches the observed clear-sky rather than the all-sky value (342 W/m²).

Solar zenith angle, length of day and year ​

The incoming solar radiation depends on the cosine of the solar zenith angle, which in turn depends on where the planet is in its daily rotation and in its orbit around the sun. Both are controlled through the planet

julia
using Dates
spectral_grid = SpectralGrid(truncation=32, nlayers=8)
planet = Earth(spectral_grid, length_of_day=Hour(24), length_of_year=Day(365)+Hour(6))
Earth{Float32, Second, DateTime, Bo...} <: SpeedyWeather.AbstractPlanet
├ radius::Float32 = 6.371e6
├ rotation::Float32 = 7.29e-5
├ gravity::Float32 = 9.81
├ daily_cycle::Bool = true
├ length_of_day::Second = 86400 seconds
├ seasonal_cycle::Bool = true
├ length_of_year::Second = 31557600 seconds
├ equinox::DateTime = 2000-03-20T00:00:00
├ axial_tilt::Float32 = 23.4
├ solar_constant::Float32 = 1365.0
└ orbit::KeplerOrbit{Float32} = KeplerOrbit{Float32} <: Abstra...

length_of_day is the time the planet takes for one rotation about its own axis (controlling the daily cycle) and length_of_year the time for one orbit around the sun (controlling the seasonal cycle). Both are Dates periods, so Hour(24), Day(1) or Second(86400) are equivalent, and both are completely independent of the model's time step and of the simulation time you pass to run!. A planet with a 10-day-long day and an Earth-length year is just

julia
planet = Earth(spectral_grid, length_of_day=Day(10), length_of_year=Day(365))
Earth{Float32, Second, DateTime, Bo...} <: SpeedyWeather.AbstractPlanet
├ radius::Float32 = 6.371e6
├ rotation::Float32 = 7.29e-5
├ gravity::Float32 = 9.81
├ daily_cycle::Bool = true
├ length_of_day::Second = 864000 seconds
├ seasonal_cycle::Bool = true
├ length_of_year::Second = 31536000 seconds
├ equinox::DateTime = 2000-03-20T00:00:00
├ axial_tilt::Float32 = 23.4
├ solar_constant::Float32 = 1365.0
└ orbit::KeplerOrbit{Float32} = KeplerOrbit{Float32} <: Abstra...

Orbit and rotation time ​

Internally, SpeedyWeather does not stretch the calendar to achieve this. Dates is inherently tied to the Earth calendar: a "month" or a "leap year" only means something for Earth, and a 10-day-long day would make DateTime meaningless. Instead, the clock carries two additional times alongside the model time

  • rotation_time advances the daily cycle,

  • orbit_time advances the seasonal cycle.

Both start synchronized with the model time and then run faster, slower or even backwards relative to it, at a rate set by the ratio of Earth's day/year to the planet's. So a day that is 10x longer than Earth's makes rotation_time tick at 1/10 of the model time:

julia
planet = Earth(spectral_grid, length_of_day=Day(10), length_of_year=Day(365))
model = PrimitiveWetModel(spectral_grid; planet)
simulation = initialize!(model, time=DateTime(2000, 1, 1))
run!(simulation, period=Day(1))

clock = simulation.variables.prognostic.clock
canonicalize(clock.rotation_time - clock.start)   # 2.4h of rotation in 1 day of model time
2 hours, 24 minutes

while the orbit time keeps up with the model time almost exactly, because this planet's year is only 6 hours shorter than Earth's:

julia
canonicalize(clock.orbit_time - clock.start)
1 day, 59 seconds, 184 milliseconds

The solar zenith angle is then computed from rotation_time and orbit_time, never from the model time directly. The year and hour angles that enter it always run continuously from 0 to 2π with no jump at midnight or at the New Year – including across leap years, where the length of the year is taken to be the actual length of that year (365 or 366 days).

A negative length_of_day makes the planet rotate backwards, so the sun rises in the west. A very long one approximates a tidally locked planet:

julia
planet = Earth(spectral_grid, length_of_day=Second(typemax(Int)))
Earth{Float32, Second, DateTime, Bo...} <: SpeedyWeather.AbstractPlanet
├ radius::Float32 = 6.371e6
├ rotation::Float32 = 7.29e-5
├ gravity::Float32 = 9.81
├ daily_cycle::Bool = true
├ length_of_day::Second = 9223372036854775807 seconds
├ seasonal_cycle::Bool = true
├ length_of_year::Second = 31557600 seconds
├ equinox::DateTime = 2000-03-20T00:00:00
├ axial_tilt::Float32 = 23.4
├ solar_constant::Float32 = 1365.0
└ orbit::KeplerOrbit{Float32} = KeplerOrbit{Float32} <: Abstra...

Zero is not allowed for either (that would be an infinitely fast rotation or orbit) and throws an error – switch the respective cycle off instead, see below.

Switching the cycles off ​

daily_cycle and seasonal_cycle control whether these cycles are resolved at all

julia
planet = Earth(spectral_grid, daily_cycle=false)
model = PrimitiveWetModel(spectral_grid; planet)
typeof(model.solar_zenith).name.name
:SolarZenithSeason

With daily_cycle=false a SolarZenithSeason is used, which applies the daily average insolation and so ignores rotation_time entirely – useful to avoid resolving a daily cycle you do not care about. With seasonal_cycle=false the season is instead held fixed at the initial time of the simulation. Note that these are independent of length_of_day and length_of_year: the lengths say how fast the cycles run, these switches say whether they run.

Other orbital parameters ​

Two further planet parameters feed into the zenith angle: axial_tilt [˚], the tilt of the rotation axis with respect to the orbit, which sets the amplitude of the seasonal cycle, and equinox, the time of the spring equinox, which sets its phase (only the month and day matter, not the year). solar_constant [W/m²] scales the total incoming radiation.

Eccentric orbits ​

By default the orbit is elliptical, planet.orbit = KeplerOrbit(), with present-day Earth's eccentricity and longitude of perihelion. A circular orbit, CircularOrbit(), keeps the Sun–planet distance constant and takes the solar declination from the zenith's solar_declination, as before this option existed. An elliptical orbit is set with a KeplerOrbit

julia
orbit = KeplerOrbit(spectral_grid, eccentricity=0.0167, longitude_of_perihelion=282.9)
planet = Earth(spectral_grid; orbit)
Earth{Float32, Second, DateTime, Bo...} <: SpeedyWeather.AbstractPlanet
├ radius::Float32 = 6.371e6
├ rotation::Float32 = 7.29e-5
├ gravity::Float32 = 9.81
├ daily_cycle::Bool = true
├ length_of_day::Second = 86400 seconds
├ seasonal_cycle::Bool = true
├ length_of_year::Second = 31557600 seconds
├ equinox::DateTime = 2000-03-20T00:00:00
├ axial_tilt::Float32 = 23.4
├ solar_constant::Float32 = 1365.0
└ orbit::KeplerOrbit{Float32} = KeplerOrbit{Float32} <: Abstra...

eccentricity is the orbit's eccentricity e (0 ≤ e < 1) and longitude_of_perihelion [˚] the true solar longitude at perihelion, measured from the vernal equinox, which sets where perihelion falls in the year (precession). KeplerOrbit can represent any elliptical orbit, but its defaults are present-day Earth (as above), with perihelion in early January. Note that KeplerOrbit() is almost identical to CircularOrbit() in the solar declination but not in insolation, see below. Following the PMIP protocol, the vernal equinox stays fixed at planet.equinox, so precession moves perihelion through the calendar.

Once per time step, before the zenith angle, the solar zenith computes the orbit position from orbit_time: Kepler's equation for the eccentric anomaly E, the true anomaly and solar longitude λ, the solar declination sin(δ) = sin(tilt)·sin(λ) and the distance factor (a/r)² = 1/(1 - e cos E)². The orbit defines the variables it needs: a KeplerOrbit stores the distance factor as the scalar solar_distance_factor in vars.parameterizations, a CircularOrbit stores nothing. The shortwave schemes multiply solar_constant by solar_distance_factor(vars), which is 1 when no such variable exists, so the incoming radiation varies by a factor ((1+e)/(1-e))² between aphelion and perihelion, about 7% (±46 W/m²) for Earth. Averaged over an orbit, the factor is 1/√(1 - e²), so an eccentric orbit also receives slightly more energy in the annual mean.

A KeplerOrbit computes the solar declination itself, so the solar zenith's solar_declination is not used (a warning is shown at initialization if it isn't the default SinSolarDeclination). The equation of time (SolarTimeCorrection) is still that of present-day Earth, not derived from the orbit, so for strongly eccentric orbits the daily cycle (sunrise and sunset times) is slightly off.

The Last Interglacial orbit about 127,000 years ago (PMIP4's lig127k), with a larger eccentricity and perihelion just after the northern summer solstice, is

julia
orbit = KeplerOrbit(spectral_grid, eccentricity=0.0394, longitude_of_perihelion=95.4)
planet = Earth(spectral_grid; axial_tilt=24.04, orbit)
Earth{Float32, Second, DateTime, Bo...} <: SpeedyWeather.AbstractPlanet
├ radius::Float32 = 6.371e6
├ rotation::Float32 = 7.29e-5
├ gravity::Float32 = 9.81
├ daily_cycle::Bool = true
├ length_of_day::Second = 86400 seconds
├ seasonal_cycle::Bool = true
├ length_of_year::Second = 31557600 seconds
├ equinox::DateTime = 2000-03-20T00:00:00
├ axial_tilt::Float32 = 24.04
├ solar_constant::Float32 = 1365.0
└ orbit::KeplerOrbit{Float32} = KeplerOrbit{Float32} <: Abstra...

Calendar effect

With a fixed vernal equinox, eccentric orbits change the length of the seasons (Kepler's second law), so calendar-month means sample slightly different parts of the orbit than for a circular orbit. This "calendar effect" is not corrected for.

Shortwave radiation ​

The surface albedo used by the shortwave radiation schemes is a separate model component, model.albedo, see Albedo. Currently implemented shortwave schemes:

julia
using SpeedyWeather
subtypes(SpeedyWeather.AbstractShortwave)
6-element Vector{Any}:
 OneBandShortwave
 SpeedyWeather.AbstractShortwaveClouds
 SpeedyWeather.AbstractShortwaveRadiativeTransfer
 SpeedyWeather.AbstractShortwaveTransmissivity
 TransparentShortwave
 TwoBandShortwave

TwoBandShortwave: Two-band shortwave radiation with diagnostic clouds and ozone ​

TwoBandShortwave is the default shortwave radiation in PrimitiveWetModel and follows Fortran SPEEDY () as in speedy.f90. It uses the same diagnostic clouds as OneBandShortwave (see below), but splits the incoming solar radiation into two bands

  • a visible band (95%, 1 - near_infrared_fraction) that is absorbed by ozone in the stratosphere, by dry air, aerosols, water vapor and clouds, reflected by clouds at the top of the cloud-top layer, by stratocumulus clouds at the top of the boundary layer and by the surface albedo,

  • a near-infrared band (5%, near_infrared_fraction) that is only absorbed by water vapor (strongly, absorptivity_water_vapor_near_infrared). It bypasses the cloud reflection and is fully absorbed at the surface, i.e. not reflected by the surface albedo.

The transmissivities of both bands are computed by TwoBandShortwaveTransmissivity with the same zenith angle correction factor as BackgroundShortwaveTransmissivity below, but with separate absorptivities for the visible and the near-infrared band. Clouds absorb from the cloud top down to the cloud base, so never in the boundary layer.

Ozone: The ozone absorption is a separate component, SeasonalOzone (default) or NoOzone. SeasonalOzone absorbs a fraction of the top-of-atmosphere shortwave flux in the upper (  hPa) and lower (   hPa) stratosphere

with  , latitude and the second Legendre polynomial   . The seasonal cycle uses the solar declination of the solar zenith angle normalized by the planet's axial_tilt , so it is synchronized with the planet's orbit (length_of_year, equinox, axial_tilt, seasonal_cycle). For Earth,   with the angle of the year from the northern winter solstice as in SPEEDY. There is more ozone absorption towards the poles and in the northern hemisphere during its winter. The absorption is distributed across model layers by their overlap with these pressure intervals, so that stratospheric heating rates don't increase over high orography where the upper σ-layers are thinner.

julia
spectral_grid = SpectralGrid(truncation=31, nlayers=8)
shortwave = TwoBandShortwave(spectral_grid, ozone=NoOzone(spectral_grid))
model = PrimitiveWetModel(spectral_grid; radiation=Radiation(spectral_grid; shortwave))
model.radiation.shortwave
TwoBandShortwave{DiagnosticClouds{Float32, Bas...} <: SpeedyWeather.AbstractShortwave
├ clouds::DiagnosticClouds{Float32, Base.RefValue{Int64}}
├ transmissivity::TwoBandShortwaveTransmissivity{Float32}
├ ozone::NoOzone
└ radiative_transfer::TwoBandShortwaveRadiativeTransfer{Float32}

OneBandShortwave: Single-band shortwave radiation with diagnostic clouds ​

The OneBandShortwave scheme provides a single-band (broadband) shortwave radiation parameterization, including diagnostic cloud effects following (). For dry models without water vapor, use OneBandGreyShortwave instead, which automatically disables cloud effects and uses transparent transmissivity  .

Key differences:

  • OneBandShortwave: Includes diagnostic clouds, water vapor absorption, and atmospheric transmissivity effects (for wet models)

  • OneBandGreyShortwave: No clouds, transparent atmosphere (for dry models)

Cloud diagnosis: Cloud properties are diagnosed from the relative humidity and total precipitation in the atmospheric column. Clouds only form in the free troposphere: layers between the tropopause (  σ_tropopause, default 0.14) and the top of the boundary layer (  σ_boundary_layer, default 0.9). These σ-boundaries are the half levels of Fortran SPEEDY's 8 layers, where the top two layers are the stratosphere and the lowest is the boundary layer, and they generalize this to any number of layers. Clouds never reach the surface layer. The cloud base is the lowest layer above the boundary layer. Among all free-tropospheric layers with   (this threshold does not apply to the cloud base layer, as in SPEEDY) the one with the largest relative humidity is found. The cloud top is the higher (smaller ) of this layer and the top of convection or large-scale condensation, restricted to the free troposphere. The cloud cover (CLC) is then given by

where and are parameters, and are large-scale and convective precipitation (rain and snow), and is a threshold. Precipitation is in mm/day.

Stratocumulus clouds: Stratocumulus cloud cover over oceans is parameterized based on boundary layer static stability    , the vertical gradient of dry static energy    between the cloud base layer and the surface layer (the lowest two layers with 8 layers) normalized by their geopotential difference (0 for a dry adiabatic, 1 for an isothermal lower atmosphere):

with

Over land, the stratocumulus cover is further modified to be proportional to the surface relative humidity with a minimum cover (stratocumulus_cover_min_land):

where is the surface (lowest model layer) relative humidity.

Radiative transfer: The incoming solar flux at the top of the atmosphere is computed from astronomical formulae. Shortwave radiation is propagated downward through each layer using a transmissivity , which depends on zenith angle, layer depth, humidity, and cloud properties:

In the cloud-top layer, cloud reflection is included:

Ozone absorption in the upper ( ) and lower ( ) stratosphere is applied inside the layer loop, depositing the absorbed energy as a temperature tendency in those layers:

where is a prescribed fraction of the TOA solar flux .

At the surface, stratocumulus reflection and surface albedo are applied:

The upward flux at the surface is

and is propagated upward as

Cloud reflection is re-added to the upward beam at the cloud-top layer. The final upward flux leaving the atmosphere is stored as outgoing_shortwave (OSR) and represents the total TOA-outgoing SW: cloud reflection + stratocumulus reflection + surface albedo reflection, all after partial attenuation by water vapor on the return path.

Key features:

  • Single-band (broadband) shortwave radiative transfer

  • Cloud reflection and absorption parameterized using diagnosed cloud cover

  • Surface albedo can vary between land and ocean

  • Top-of-atmosphere insolation set by the solar constant and zenith angle

  • Designed for use in idealized and moist atmospheric simulations

Usage ​

To use the OneBandShortwave scheme, construct your model as follows and run as usual.

For wet models (with water vapor and clouds):

julia
using SpeedyWeather, CairoMakie
spectral_grid = SpectralGrid(truncation=32, nlayers=8)
model = PrimitiveWetModel(spectral_grid; radiation=Radiation(spectral_grid; shortwave=OneBandShortwave(spectral_grid)))
simulation = initialize!(model)
run!(simulation, period=Week(1))

# get surface shortwave radiation down
ssrd = simulation.variables.parameterizations.surface_shortwave_down
heatmap(ssrd,title="Surface shortwave radiation down [W/m^2]")

Surface shortwave radiation down

julia
osr = simulation.variables.parameterizations.outgoing_shortwave
heatmap(osr,title="Outgoing shortwave radiation [W/m^2]")

Outgoing shortwave radiation

For dry models (no water vapor or clouds):

Use OneBandGreyShortwave instead, which automatically uses NoClouds and TransparentShortwaveTransmissivity:

julia
using SpeedyWeather, CairoMakie
spectral_grid = SpectralGrid(truncation=32, nlayers=8)
model = PrimitiveDryModel(spectral_grid; radiation=Radiation(spectral_grid; shortwave=OneBandGreyShortwave(spectral_grid), longwave=OneBandGreyLongwave(spectral_grid)))
simulation = initialize!(model)
run!(simulation, period=Week(1))

# The shortwave fluxes can be visualised
ssrd = simulation.variables.parameterizations.surface_shortwave_down
heatmap(ssrd, title="Surface shortwave radiation (dry model) [W/m^2]")

Surface shortwave radiation (dry model)

Parameterization options ​

The OneBandShortwave scheme includes several configurable components:

Cloud schemes ​

The cloud scheme can be specified when constructing the radiation scheme:

  • DiagnosticClouds(spectral_grid) (default): Diagnoses clouds from humidity and precipitation

  • NoClouds(spectral_grid): No clouds (used in OneBandGreyShortwave)

Transmissivity schemes ​

The atmospheric transmissivity can be calculated using:

  • BackgroundShortwaveTransmissivity(spectral_grid) (default): Fortran SPEEDY-based transmissivity with zenith correction and absorption by aerosols, water vapor, and clouds

  • TransparentShortwaveTransmissivity(spectral_grid): Transparent atmosphere (used in OneBandGreyShortwave)

BackgroundShortwaveTransmissivity ​

For each layer , the transmissivity is

with

  •     (zenith-path correction; is the zenith angle)

  •    from the half-levels in the grid geometry

  • the column surface pressure

  • dry-air absorptivity (absorptivity_dry_air)

  • aerosol absorptivity (absorptivity_aerosol), scaled by when aerosols = true

  • water-vapor absorptivity (absorptivity_water_vapor) times specific humidity

  •   cloud absorptivity added below the diagnosed cloud top, scaled by cloud cover

All absorptivity coefficients are per Pa. The resulting values are computed once per column and reused for both the downward and upward sweeps in OneBandShortwaveRadiativeTransfer.

TransparentShortwaveTransmissivity details ​

Sets   for all layers and bands, effectively skipping atmospheric attenuation while still computing surface and cloud reflections in the radiative transfer step.

Stratocumulus clouds ​

The DiagnosticClouds scheme includes a use_stratocumulus flag (default: true) that enables the diagnostic stratocumulus cloud parameterization over oceans:

julia
using SpeedyWeather, CairoMakie

spectral_grid = SpectralGrid()
sw_no_sc = OneBandShortwave(spectral_grid, clouds = DiagnosticClouds(spectral_grid; use_stratocumulus=false))

model = PrimitiveWetModel(spectral_grid; radiation=Radiation(spectral_grid; shortwave=sw_no_sc))
sim = initialize!(model)
run!(sim, period=Day(5))
ssrd = sim.variables.parameterizations.surface_shortwave_down
heatmap(ssrd, title="No stratocumulus clouds [W/m^2]")

No stratocumulus clouds

Greenhouse gases ​

Greenhouse gas concentrations can be prescribed as time-varying scalar quantities and are tracked as prognostic variables. For example, an ExponentialCO2 concentration is fitted to the Keeling curve. To customise or add greenhouse gases, pass a NamedTuple of gas objects to greenhouse_gases. The key of the named tuple will be used for the variable name, so co2 = ..., carbon_dioxide = ... can co-exist.

julia
spectral_grid = SpectralGrid(truncation=32, nlayers=8)

# constant CO2 at 420 ppm
model = PrimitiveWetModel(spectral_grid; greenhouse_gases = (; co2 = CO2(spectral_grid, 420)))
simulation = initialize!(model)
simulation.variables.prognostic.greenhouse_gases.co2[]
420.0f0

A CO2 concentration that increases exponentially over time:

julia
co2 = ExponentialCO2(spectral_grid)
ExponentialCO2{Float32, DateTime} <: SpeedyWeather.AbstractCO2
├ base_concentration::Float32 = 280.0
├ start::DateTime = 1850-01-01T00:00:00
├ a::Float32 = 3.85
└ b::Float32 = 0.020833334

Step-change scenarios are also available: TwoTimesCO2 and FourTimesCO2 double or quadruple the default CO2 of 360 ppm at a given date (default: year 2000). Any callable f(t::DateTime) -> concentration_in_ppm can be wrapped in CO2(f) for a fully custom trajectory.

By default, the primitive equation models have a constant co2 = CO2(spectral_grid) at 360 ppm, about the concentration in the year 2000, the default start date of the model clock. This is also the reference_co2 of ByrneOGormanLongwaveTransmissivity, so its dry optical depth is dry_absorption by default. Use greenhouse_gases = (;) or nothing to remove it.

Only some radiation schemes are CO2-aware

The default ByrneOGormanLongwaveTransmissivity uses greenhouse_gases.co2: its dry optical depth grows logarithmically with CO2. FriersonLongwaveTransmissivity and the shortwave schemes do not use it, so with them, changing CO2 has no effect on the radiative fluxes.