GithubHelp home page GithubHelp logo

sarvex / speedyweather.jl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from speedyweather/speedyweather.jl

0.0 1.0 0.0 13.66 MB

The little sister of a big weather forecast model

License: MIT License

Julia 99.20% Jupyter Notebook 0.80%

speedyweather.jl's Introduction

SpeedyWeather.jl

CI

SpeedyWeather.jl is a global atmospheric model with simple physics which is developed as a computational playground with an everything-flexible attitude as long as it is speedy. With minimal code redundancies it supports

  • any number format and precision (32 and 64 bits, 16 bits in development)
  • different architectures (x86 and arm, GPUs in development)
  • different physical models (barotropic vorticity, shallow water, primitive equations dry core; wet core in development)
  • different spatial grids (full and octahedral grids, Gaussian and Clenshaw-Curtis, HEALPix, OctaHEALPix)
  • different horizontal resolutions (T31 to T1023 and higher, i.e. 400km to 10km using linear, quadratic or cubic truncation)
  • multi-threading, layer-wise for dynamics, grid point-wise for physics (multi-processing in development)

and Julia will compile to these choices just-in-time.

For an overview of the functionality and explanation see the (always somehow incomplete) documentation.

Gallery

Here is video of some 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

vorticity_clouds_T1023.mp4

The primitive equation core (wet or dry) is in development, this is temperature at the surface and at the tropopause at T511 (~20km resolution) and 31 vertical levels. The simulation was multi-threaded in Float32 (single precision). The orography is visible at the tropopause level because we currently use sigma coordinates

out10.mp4

Example use

SpeedyWeather.jl is currently developed. Some things work, some don't. Stay tuned. The main interface to SpeedyWeather.jl is

julia> using SpeedyWeather
julia> run_speedy(ShallowWater, n_days=30, trunc=63, Grid=OctahedralGaussianGrid, output=true)
Weather is speedy run 1: 100%|███████████████████████████████████| Time: 0:00:04 (1498.70 years/day)

Hurray! In 4 seconds we just simulated 30 days of the Earth's atmosphere at a speed of 1500 years per day. This simulation used a T63 spectral resolution on an octahedral Gaussian grid (~165km resolution) solving the shallow water equations. The arguments for run_speedy are described in src/default_parameters.jl.

To run the primitive equation dry core you can for example do

julia> run_speedy(Float32, PrimitiveDryCore, physics=true, diffusion=HyperDiffusion(power=2))
Weather is speedy: 100%|███████████████████████████████████| Time: 0:00:03 (753.71 years/day)

The arguments here use single precision (Float32), enable physics (Held-Suarez forcing and boundary layer drag) and use biharmonic diffusion (default power=4).

History

SpeedyWeather.jl is 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 the numerical schemes share similarities (but we start to diverge here too). 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

  • LowerTriangularMatrices, a module that defines LowerTriangularMatrix (among others) used for the spherical harmonic coefficients
  • RingGrids, a module that defines several iso-latitude ring-based spherical grids (like the FullGaussianGrid or the HEALPixGrid) and interpolations between them
  • 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> import SpeedyWeather: LowerTriangularMatrices, RingGrids, SpeedyTransforms

Installation

SpeedyWeather.jl is registered in Julia's registry, so open the package manager with ] and

(@v1.8) pkg> add SpeedyWeather

which will install the latest release and all dependencies automatically. The very latest version is installed with

(@v1.8) pkg> add https://github.com/SpeedyWeather/SpeedyWeather.jl#main

which pulls directly from the #main branch. Please use the current minor version of Julia, compatibilities with older versions are not guaranteed.

speedyweather.jl's People

Contributors

milankl avatar maximilian-gelbrecht avatar tomkimpson avatar dmey avatar navidcy avatar white-alistair avatar hottad avatar giordano avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.