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
using SpeedyWeather
spectral_grid = SpectralGrid()
radiation = Radiation(spectral_grid; shortwave = TwoBandShortwave(spectral_grid), longwave = OneBandLongwave(spectral_grid))
model = PrimitiveWetModel(spectral_grid; radiation)
model.radiationRadiation{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 aRadiation; 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"):
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
using SpeedyWeather
subtypes(SpeedyWeather.AbstractLongwave)5-element Vector{Any}:
JeevanjeeRadiation
OneBandLongwave
SpeedyWeather.AbstractLongwaveRadiativeTransfer
SpeedyWeather.AbstractLongwaveTransmissivity
UniformCoolingSee Parameterizations for the general parameterization interface these implement.
Uniform cooling
Following , the uniform cooling of the atmosphere is defined as
with
Jeevanjee radiation
(Eq. 2) define a longwave radiative flux $F$ for atmospheric cooling as (following , Eq. 1)The flux
The flux
The term in parentheses is the absorbed flux in layer
OneBandLongwave
Solves the standard two-stream approximation to calculate longwave radiative fluxes up
using optical depth
such that the upward flux
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 TwoBandShortwave). Following the stratospheric correction in Fortran SPEEDY, the stratosphere stratosphere_pressure, default 140 hPa) additionally emits
with 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)
spectral_grid = SpectralGrid()
longwave = OneBandLongwave(spectral_grid)
model = PrimitiveWetModel(spectral_grid; radiation = Radiation(spectral_grid; longwave))
model.radiation.longwaveOneBandLongwave{ByrneOGormanLongwaveTransmiss...} <: SpeedyWeather.AbstractLongwave
├ transmissivity::ByrneOGormanLongwaveTransmissivity{Float32}
└ radiative_transfer::OneBandLongwaveRadiativeTransfer{Float32}The transmissivity is defined as in using the following parameters
FriersonLongwaveTransmissivity(spectral_grid)FriersonLongwaveTransmissivity{Float32} <: SpeedyWeather.AbstractLongwaveTransmissivity
├ τ₀_equator::Float32 = 8.4
├ τ₀_pole::Float32 = 2.1
└ fₗ::Float32 = 0.25to compute
with surface values of optical depth at the equator
For details see . The default constants differ from Frierson's (TwoBandShortwave radiation.
Use the Frierson transmissivity, which prescribes the optical depth independent of humidity and CO₂, with
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
with dry absorption SpeedyWeather.DEFAULT_CO2), water vapor absorption 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
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.0With Byrne and O'Gorman's values TwoBandShortwave radiation. The defaults
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
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
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_timeadvances the daily cycle,orbit_timeadvances 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:
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 time2 hours, 24 minuteswhile the orbit time keeps up with the model time almost exactly, because this planet's year is only 6 hours shorter than Earth's:
canonicalize(clock.orbit_time - clock.start)1 day, 59 seconds, 184 millisecondsThe 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:
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
planet = Earth(spectral_grid, daily_cycle=false)
model = PrimitiveWetModel(spectral_grid; planet)
typeof(model.solar_zenith).name.name:SolarZenithSeasonWith 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
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
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:
using SpeedyWeather
subtypes(SpeedyWeather.AbstractShortwave)6-element Vector{Any}:
OneBandShortwave
SpeedyWeather.AbstractShortwaveClouds
SpeedyWeather.AbstractShortwaveRadiativeTransfer
SpeedyWeather.AbstractShortwaveTransmissivity
TransparentShortwave
TwoBandShortwaveTwoBandShortwave: 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 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
with axial_tilt length_of_year, equinox, axial_tilt, seasonal_cycle). For Earth,
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.shortwaveTwoBandShortwave{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
where
Stratocumulus clouds: Stratocumulus cloud cover over oceans is parameterized based on boundary layer static stability
with
Over land, the stratocumulus cover stratocumulus_cover_min_land):
where
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
In the cloud-top layer, cloud reflection is included:
Ozone absorption in the upper (
where
At the surface, stratocumulus reflection and surface albedo are applied:
The upward flux at the surface is
and is propagated upward as
Cloud reflection 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):
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]")
osr = simulation.variables.parameterizations.outgoing_shortwave
heatmap(osr,title="Outgoing shortwave radiation [W/m^2]")
For dry models (no water vapor or clouds):
Use OneBandGreyShortwave instead, which automatically uses NoClouds and TransparentShortwaveTransmissivity:
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]")
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 precipitationNoClouds(spectral_grid): No clouds (used inOneBandGreyShortwave)
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 cloudsTransparentShortwaveTransmissivity(spectral_grid): Transparent atmosphere (used inOneBandGreyShortwave)
BackgroundShortwaveTransmissivity
For each layer
with
(zenith-path correction;is the zenith angle) from the half-levels in the grid geometrythe column surface pressure dry-air absorptivity ( absorptivity_dry_air)aerosol absorptivity ( absorptivity_aerosol), scaled bywhen aerosols = truewater-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 OneBandShortwaveRadiativeTransfer.
TransparentShortwaveTransmissivity details
Sets
Stratocumulus clouds
The DiagnosticClouds scheme includes a use_stratocumulus flag (default: true) that enables the diagnostic stratocumulus cloud parameterization over oceans:
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]")
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.
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.0f0A CO2 concentration that increases exponentially over time:
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.020833334Step-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.