SpeedyWeather.jl
A global spectral atmospheric model with simple physics which is developed as a research playground with an everything-flexible attitude as long as it is speedy.
https://github.com/speedyweather/speedyweather.jl
Category: Atmosphere
Sub Category: Atmospheric Composition and Dynamics
Keywords from Contributors
ode numerics parallelism transforms climate differential-equations ocean genetic-algorithm sciml control
Last synced: about 2 hours ago
JSON representation
Repository metadata
Play atmospheric modelling like it's LEGO.
- Host: GitHub
- URL: https://github.com/speedyweather/speedyweather.jl
- Owner: SpeedyWeather
- License: mit
- Created: 2020-04-27T13:36:33.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2025-04-21T13:25:03.000Z (6 days ago)
- Last Synced: 2025-04-21T13:44:15.197Z (6 days ago)
- Language: Julia
- Homepage: https://speedyweather.github.io/SpeedyWeather.jl/dev
- Size: 358 MB
- Stars: 472
- Watchers: 9
- Forks: 35
- Open Issues: 46
- Releases: 18
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
- Citation: CITATION.cff
README.md
SpeedyWeather.jl
SpeedyWeather.jl is a global atmospheric model with simple physics developed as a research playground
with an everything-flexible attitude as long as it is speedy. It is easy to use and easy to extend, making
atmospheric modelling an interactive experience -- in the terminal, in a notebook or conventionally through scripts.
With minimal code redundancies it supports
Dynamics and physics
- Different physical equations (barotropic vorticity, shallow water, primitive equations, with and without humidity)
- Particle advection in 2D for all equations
- Tracer advection in 2D/3D that can be added, deleted, (de)activated anytime
- Physics parameterizations for convection, precipitation, boundary layer, etc.
Numerics and computing
- Different spatial grids (full and octahedral grids, Gaussian and Clenshaw-Curtis, HEALPix, OctaHEALPix)
- Different resolutions (T31 to T1023 and higher, i.e. 400km to 10km using linear, quadratic or cubic truncation)
- Different arithmetics: Float32 (default), Float64, and (experimental) BFloat16, stochastic rounding
- a very fast and flexible spherical harmonics transform library SpeedyTransforms
User interface
- Data visualisation: 2D, 3D, interactive (you can zoom and rotate!) powered by Makie
- Extensibility: New model components (incl. parameterizations) can be externally defined
- Modularity: Models are constructed from its components, non-defaults are passed on as argument
- Interactivity: SpeedyWeather.jl runs in a notebook or in the REPL as well as from scripts
- Callbacks can be used to inject any piece of code after every time step, e.g. custom output, event handling, changing the model while it's running
and Julia will compile to these choices just-in-time.
For an overview of the functionality and explanation see the
documentation.
You are always encouraged to raise an issue
(even it is not actually an issue but an idea, a suggestion or really anything)
describing what you'd like to use SpeedyWeather for. We're keen to help!
Vision and roadmap
Why another model? You may ask. We believe that most currently available are stiff, difficult to use
and extend, and therefore slow down research whereas a modern code in a modern language wouldn't have to.
We decided to use Julia because it combines the best of Fortran and Python: Within a single language
we can interactively run SpeedyWeather but also extend it, inspect its components, evaluate
individual terms of the equations, and analyse and visualise output on the fly.
We do not aim to make SpeedyWeather an atmospheric model similar to the production-ready models used
in weather forecasting, at least not at the cost of our current level of interactivity and ease of
use or extensibility. If someone wants to implement a cloud parameterization that is very complicated
and expensive to run then they are more than encouraged to do so, but it will probably live in
its own repository and we are happy to provide a general interface to do so. But SpeedyWeather's
defaults should be balanced: Physically accurate yet general; as independently as possible from other
components and parameter choices; not too complicated to implement and understand; and computationally cheap.
Finding a good balance is difficult but we try our best.
This means in practice, that while SpeedyWeather is currently developed, many more physical processes
and other features will be implemented. On our TODO is
- A (somewhat) realistic radiation scheme with a daily cycle, depending on clouds and humidity
- Longwave radiation that depends on (global) CO2 concentrations to represent climate change
- Slab ocean and a (seasonal cycle) sea ice interacting with radiation
- Exoplanet support
- 3D particle advection
- single GPU support to accelerate medium to high resolution simulations
- differentiability with Enzyme
Contributing
Open-source lives from large teams of (even occasional) contributors. If you are interested to
fix something, implement something, or just use it and provide feedback you are always welcome.
We are more than happy to guide you, especially when you don't know where to start.
We can point you to the respective code, highlight how everything is connected and tell you
about dos and don'ts. Just express your interest to contribute and we'll be happy to have you.
Example use
For a more comprehensive tutorial with several examples, see
Examples in the documentation.
The basic interface to SpeedyWeather.jl consist of 4 steps: define the grid,
construct the model, initialize, run
spectral_grid = SpectralGrid(trunc=31, nlayers=8) # define resolution
model = PrimitiveWetModel(spectral_grid) # construct model
simulation = initialize!(model) # initialize all model components
run!(simulation, period=Day(10), output=true) # aaaand action!
and you will see
Hurray🥳 In a few seconds seconds we just simulated 10 days of the Earth's atmosphere at a speed of 440 years per day.
This simulation used a T31 spectral resolution on an
octahedral Gaussian grid
(~400km resolution) solving the primitive equations on 8 vertical levels.
The UnicodePlot will give
you a snapshot of surface vorticity at the last time step. The plotted resolution is not representative,
but allows a quick check of what has been simulated.
The NetCDF output is independent of the unicode plot.
More examples in the How to run SpeedyWeather
section of the documentation.
Gallery
Specific humidity in the primitive equation model simulated at T340 spectral resolution (about 40km)
with 16 vertical levels (shown here is level 15, just above the surface) on the octahedral Gaussian grid
computed in single precision multi-threaded on 16 CPUs. With convection, large-scale condensation, surface fluxes
and some simplified radiation (the daily cycle is visible)
Relative vorticity in the shallow water model, simulated at T1023 spectral resolution (about 10km) on an
octahedral Clenshaw-Curtis grid
with more than 4 million grid points
Surface temperature in the primitive equation model without surface fluxes or radiation
at T511 (~20km resolution) and 31 vertical levels. The simulation was multi-threaded in Float32 (single precision).
SpeedyWeather.jl can also solve the 2D barotropic vorticity equations on the sphere.
Here, we use Float32 (single precision) at a resolution of T340 (40km) on
an octahedral Gaussian grid.
Forcing is a stochastic stirring on northern hemisphere mid-latitudes following Barnes and Hartmann, 2011.
Map projection is orthographic centred on the north pole.
Here, SpeedyWeather.jl simulates atmospheric gravity waves, initialised randomly interacting with orography
over a period of 2 days. Each frame is one time step, solved with a centred semi-implicit scheme that
resolves gravity waves with a timestep of CFL=1.2-1.4 despite a single-stage RAW-filtered leapfrog integration.
Advection of 5000 particles with wind in the lower-most layer of the primitive equation model at
T85 (150km) resolution and 8 vertical layers.
Data visualisation
Difficult to plot spherical data? SpeedyWeather also includes extensions for Makie and GeoMakie
making it supereasy to create plots and interactively investigate a variables from a simulation.
Two examples (screen recording those makes it a bit laggy, it's pretty smooth otherwise): Humidity plotted
on a 50km HEALPix grid
https://github.com/user-attachments/assets/b02b31eb-e139-4193-89d1-7e277a2af5cc
or the visualising cell centres and faces of the OctaminimalGaussianGrid
https://github.com/user-attachments/assets/6dfa212a-c5dc-4c54-b274-7755d5baf15c
History
SpeedyWeather.jl started off as a reinvention of the atmospheric general circulation model
SPEEDY in Julia. While conceptually a similar model,
it is entirely restructured, features have been added, changed and removed, such that only some of the numerical
schemes share similarities. Fortran SPEEDY's dynamical core has an obscure history:
Large parts were written by Isaac Held at GFDL in/before the 90ies with an unknown amount of
contributions/modifications from Steve Jewson (Oxford) in the 90ies.
The physical parametrizations were then added by Franco Molteni, Fred Kucharski, and Martin P. King
afterwards while the model was still written in Fortran77.
Around 2018-19, SPEEDY was then translated to Fortran90 by Sam Hatfield in speedy.f90.
SpeedyWeather.jl is then adopted from first translations to Julia by Sam Hatfield.
Submodules
SpeedyWeather.jl defines several submodules that are technically stand-alone (with dependencies) but aren't separated
out to their own packages for now
- RingGrids,
a module that defines several iso-latitude ring-based spherical grids (like the FullGaussianGrid or the HEALPixGrid)
and interpolations between them - LowerTriangularMatrices,
a module that definesLowerTriangularMatrix
used for the spherical harmonic coefficients - SpeedyTransforms, a module that defines
the spherical harmonic transform between spectral space (for which LowerTriangularMatrices is used) and grid-point space
(as defined by RingGrids).
These modules can also be used independently of SpeedyWeather like so
julia> using SpeedyWeather: LowerTriangularMatrices, RingGrids, SpeedyTransforms
check out their documentation: RingGrids,
LowerTriangularMatrices,
SpeedyTransforms.
Installation
SpeedyWeather.jl is registered in Julia's registry, so open the package manager with ]
and
(@v1.11) pkg> add SpeedyWeather
which will install the latest release
and all dependencies automatically. For more information see the
Installation in the documentation.
Please use the current minor version of Julia,
compatibilities with older versions are not guaranteed.
Benchmarks
The primitive equations at 400km resolution with 8 vertical layers can be simulated by
SpeedyWeather.jl at 1800 simulated years per day (SYPD) on a single core of newer CPUs with arm architecture
(M-series MacBooks for example). At that speed, simulating one year takes about 50 seconds
without output. The complex fused-multiply adds of the spectral transform compile efficiently to
the large vector extensions of the newer arm chips in single precision.
Another considerable speed-up comes from the reduced grids minimizing the number of columns for
which expensive parameterizations like convection have to be computed. The parameterizations
take up 40-60% of the total simulation time, depending on the grid. Particularly the
OctaminimalGaussianGrid
, OctaHEALPixGrid
and the HEALPixGrid
are increasingly faster,
at a small accuracy sacrifice of the then inexact spectral transforms.
On older CPUs, like the Intel CPU MacBooks, the 1800 SYPD drop to about 500-600 SYPD,
which is still 2x faster than Fortran SPEEDY which is reported to reach 240 SYPD.
For an overview of typical simulation speeds a user can expect under different model setups see
Benchmarks.
Citing
If you use SpeedyWeather.jl in research, teaching, or other activities, we would be grateful
if you could mention SpeedyWeather.jl and cite our paper in JOSS:
Klöwer et al., (2024). SpeedyWeather.jl: Reinventing atmospheric general circulation models towards interactivity and extensibility. Journal of Open Source Software, 9(98), 6323, doi:10.21105/joss.06323.
The bibtex entry for the paper is:
@article{SpeedyWeatherJOSS,
doi = {10.21105/joss.06323},
url = {https://doi.org/10.21105/joss.06323},
year = {2024},
publisher = {The Open Journal},
volume = {9},
number = {98},
pages = {6323},
author = {Milan Klöwer and Maximilian Gelbrecht and Daisuke Hotta and Justin Willmert and Simone Silvestri and Gregory L. Wagner and Alistair White and Sam Hatfield and Tom Kimpson and Navid C. Constantinou and Chris Hill},
title = {{SpeedyWeather.jl: Reinventing atmospheric general circulation models towards interactivity and extensibility}},
journal = {Journal of Open Source Software}
}
Copyright and license
Copyright (c) 2020 Milan Klöwer for SpeedyWeather.jl
Copyright (c) 2021 The SpeedyWeather.jl Contributors for SpeedyWeather.jl
Copyright (c) 2022 Fred Kucharski and Franco Molteni for SPEEDY parametrization schemes
Software licensed under the MIT License.
Citation (CITATION.cff)
cff-version: 1.2.0 preferred-citation: type: article authors: - family-names: "Klöwer" given-names: "Milan" orcid: "https://orcid.org/0000-0002-3920-4356" - family-names: "Gelbrecht" given-names: "Maximilian" orcid: "https://orcid.org/0000-0002-0729-6671" - family-names: "Hotta" given-names: "Daisuke" orcid: "https://orcid.org/0000-0003-2287-0608" - family-names: "Willmert" given-names: "Justin" orcid: "https://orcid.org/0000-0002-6452-4693" - family-names: "Silvestri" given-names: "Simone" orcid: "https://orcid.org/0000-0002-7156-946X" - family-names: "Wagner" given-names: "Gregory L" orcid: "https://orcid.org/0000-0003-3377-6852" - family-names: "White" given-names: "Alistair" orcid: "https://orcid.org/0000-0001-7235-6450" - family-names: "Hatfield" given-names: "Sam" orcid: "https://orcid.org/0000-0002-6542-6032" - family-names: "Kimpson" given-names: "Tom" orcid: "https://orcid.org/0000-0002-8149-4094" - family-names: "Constantinou" given-names: "Navid C" orcid: "https://orcid.org/0000-0001-5317-2445" - family-names: "Hill" given-names: "Chris" title: "SpeedyWeather.jl: Reinventing atmospheric general circulation models towards interactivity and extensibility" journal: "Journal of Open Source Software" doi: "10.21105/joss.06323" volume: 9 issue: 98 start: 6323 year: 2024
Owner metadata
- Name: SpeedyWeather
- Login: SpeedyWeather
- Email:
- Kind: organization
- Description:
- Website:
- Location:
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/117775587?v=4
- Repositories: 1
- Last ynced at: 2023-03-21T21:29:11.593Z
- Profile URL: https://github.com/SpeedyWeather
GitHub Events
Total
- Fork event: 7
- Create event: 90
- Commit comment event: 15
- Release event: 3
- Issues event: 52
- Watch event: 39
- Delete event: 62
- Member event: 2
- Issue comment event: 467
- Push event: 1258
- Pull request event: 176
- Pull request review event: 133
- Pull request review comment event: 144
Last Year
- Fork event: 7
- Create event: 90
- Commit comment event: 15
- Release event: 3
- Issues event: 52
- Watch event: 39
- Delete event: 62
- Member event: 2
- Issue comment event: 467
- Push event: 1258
- Pull request event: 176
- Pull request review event: 133
- Pull request review comment event: 144
Committers metadata
Last synced: 6 days ago
Total Commits: 2,080
Total Committers: 24
Avg Commits per committer: 86.667
Development Distribution Score (DDS): 0.181
Commits in past year: 354
Committers in past year: 13
Avg Commits per committer in past year: 27.231
Development Distribution Score (DDS) in past year: 0.339
Name | Commits | |
---|---|---|
Milan | m****r@g****e | 1703 |
Max | m****t@p****e | 178 |
Navid C. Constantinou | n****y | 67 |
Tom Kimpson | t****n@g****m | 34 |
CompatHelper Julia | c****y@j****g | 18 |
Simone Silvestri | 3****i | 17 |
dmey | d****y | 17 |
Pietro Monticone | 3****e | 15 |
dependabot[bot] | 4****] | 7 |
Alistair White | 5****r | 6 |
github-actions[bot] | 4****] | 2 |
miniufo | m****o@1****m | 2 |
Daisuke Hotta | d****a@e****t | 2 |
Daisuke Hotta | d****a@o****l | 2 |
Anshul Singhvi | a****i@g****m | 1 |
Mosè Giordano | m****e@g****g | 1 |
Nathanael Wong | 3****g | 1 |
Shpherd-china-can | 1****1 | 1 |
T. Ehlert | 1****k | 1 |
Tim Reichelt | t****m | 1 |
Valentin Churavy | v****y@g****m | 1 |
minqi6 | 1****6 | 1 |
Milan K | m****r@p****k | 1 |
rocroc2017 | c****e@l****n | 1 |
Committer domains:
- live.cn: 1
- physics.ox.ac.uk: 1
- gnu.org: 1
- ecmwf.int: 1
- 163.com: 1
- julialang.org: 1
- posteo.de: 1
- gmx.de: 1
Issue and Pull Request metadata
Last synced: 1 day ago
Total issues: 131
Total pull requests: 334
Average time to close issues: 4 months
Average time to close pull requests: 13 days
Total issue authors: 33
Total pull request authors: 21
Average comments per issue: 6.43
Average comments per pull request: 2.63
Merged pull request: 285
Bot issues: 0
Bot pull requests: 25
Past year issues: 52
Past year pull requests: 168
Past year average time to close issues: about 2 months
Past year average time to close pull requests: 9 days
Past year issue authors: 15
Past year pull request authors: 14
Past year average comments per issue: 4.96
Past year average comments per pull request: 2.61
Past year merged pull request: 133
Past year bot issues: 0
Past year bot pull requests: 22
Top Issue Authors
- milankl (57)
- maximilian-gelbrecht (10)
- miniufo (9)
- navidcy (9)
- madnanabid (5)
- mini-DONG (3)
- natgeo-wong (3)
- slayoo (3)
- rocroc2017 (3)
- glwagner (2)
- Richard2323111 (2)
- azmmel (2)
- treigerm (2)
- p-hss (2)
- FredericWantiez (1)
Top Pull Request Authors
- milankl (214)
- maximilian-gelbrecht (42)
- navidcy (27)
- github-actions[bot] (16)
- dependabot[bot] (9)
- tomkimpson (4)
- simone-silvestri (3)
- minqi6 (3)
- sunmoumou1 (2)
- pitmonticone (2)
- miniufo (2)
- dmey (1)
- rocroc2017 (1)
- jackleland (1)
- asinghvi17 (1)
Top Issue Labels
- bug :lady_beetle: (15)
- dynamics :wavy_dash: (14)
- documentation :books: (12)
- user interface :musical_keyboard: (11)
- forcing :weight_lifting: (10)
- parameterizations :cloud_with_rain: (8)
- testing :test_tube: (7)
- testing (7)
- initial conditions :traffic_light: (6)
- humidity :droplet: (6)
- documentation (6)
- question :question: :grey_question: (6)
- dynamics (6)
- output :outbox_tray: (5)
- particles :balloon: (5)
- forcing (5)
- parameterizations (5)
- joss review :book: (4)
- grid :globe_with_meridians: (4)
- radiation :sun_with_face: (4)
- bug (4)
- structure :house: (4)
- differentiability 🤖 (4)
- transform (4)
- surface :mountain: (3)
- performance :rocket: (3)
- user interface (3)
- transform :arrow_left: :arrow_right: (3)
- low precision (3)
- enhancement :mag: (3)
Top Pull Request Labels
- documentation :books: (45)
- user interface :musical_keyboard: (23)
- surface :mountain: (21)
- bug :lady_beetle: (18)
- documentation (18)
- testing :test_tube: (18)
- array types :globe_with_meridians: (17)
- parameterizations :cloud_with_rain: (17)
- dependency :guide_dog: (16)
- gpu :framed_picture: (13)
- differentiability 🤖 (13)
- dynamics (13)
- dynamics :wavy_dash: (13)
- structure :house: (13)
- compatibility :dancers: (12)
- output :outbox_tray: (12)
- time integration :clock10: (12)
- user interface (11)
- parameterizations (11)
- vertical (11)
- humidity :droplet: (11)
- grid :globe_with_meridians: (10)
- forcing (10)
- performance :rocket: (10)
- package :package: (10)
- transform :arrow_left: :arrow_right: (9)
- bug (8)
- humidity (8)
- new defaults (7)
- testing (7)
Package metadata
- Total packages: 1
-
Total downloads:
- julia: 36 total
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 18
juliahub.com: SpeedyWeather
Play atmospheric modelling like it's LEGO.
- Homepage: https://speedyweather.github.io/SpeedyWeather.jl/dev
- Documentation: https://docs.juliahub.com/General/SpeedyWeather/stable/
- Licenses: MIT
- Latest release: 0.14.0 (published 4 months ago)
- Last Synced: 2025-04-26T13:03:13.303Z (1 day ago)
- Versions: 18
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 36 Total
-
Rankings:
- Stargazers count: 4.953%
- Dependent repos count: 9.94%
- Forks count: 13.666%
- Average: 16.868%
- Dependent packages count: 38.915%
Dependencies
- actions/cache v1 composite
- actions/checkout v2 composite
- julia-actions/julia-buildpkg v1 composite
- julia-actions/julia-runtest v1 composite
- julia-actions/setup-julia v1 composite
- actions/checkout v2 composite
- julia-actions/setup-julia latest composite
- JuliaRegistries/TagBot v1 composite
- julia-actions/setup-julia v1 composite
- actions/checkout v2 composite
- actions/cache v3 composite
- actions/checkout v3 composite
- julia-actions/julia-buildpkg latest composite
- julia-actions/julia-runtest v1 composite
- julia-actions/setup-julia v1 composite
Score: 13.011548011063539