GithubHelp home page GithubHelp logo

natgeo-wong / speedyweather.jl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from speedyweather/speedyweather.jl

0.0 0.0 0.0 68.08 MB

The little sister of a big weather forecast model

Home Page: https://speedyweather.github.io/SpeedyWeather.jl/dev

License: MIT License

Julia 100.00%

speedyweather.jl's Introduction

SpeedyWeather.jl

CI docs docs status

SpeedyWeather.jl is 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. With minimal code redundancies it supports

  • different physical models (barotropic vorticity, shallow water, primitive equations dry and wet core)
  • physics parameterizations for precipitation, boundary layer, etc; new ones are passed as argument to the model constructor
  • 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)
  • 32-bit single and 64-bit double precision (16 bits in development)
  • multi-threading, layer-wise for dynamics, grid point-wise for physics (multi-processing in development)
  • different architectures (x86 and arm, GPUs in development)

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

For an overview of the functionality and explanation see the documentation.

Example use

SpeedyWeather.jl is currently developed. Some things work, some don't. Stay tuned or talk to us by raising an issue to express interest as a user or developer. All contributions are always welcome.

With v0.6 the interface to SpeedyWeather.jl consist of 4 steps: define the grid, create the model, initialize, run

spectral_grid = SpectralGrid(trunc=31, Grid=OctahedralGaussianGrid, nlev=8)
model = PrimitiveDryModel(;spectral_grid, orography = EarthOrography(spectral_grid))
simulation = initialize!(model)
run!(simulation,period=Day(10),output=true)

and you will see


Hurray🥳 In 5 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 dry 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

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 at T511 (~20km resolution) and 31 vertical levels. The simulation was multi-threaded in Float32 (single precision).

out11.mp4

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.

stochastic_stirring_T340_ortho.mp4

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.

random_waves_T255.mp4

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

  • 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 defines LowerTriangularMatrix 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.8) 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.

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.

speedyweather.jl's People

Contributors

milankl avatar maximilian-gelbrecht avatar navidcy avatar tomkimpson avatar dmey avatar simone-silvestri avatar pitmonticone avatar white-alistair avatar hottad avatar giordano avatar vchuravy 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.