A curated list of open technology projects to sustain a stable climate, energy supply, biodiversity and natural resources.

qgs

Models the dynamics of a 2-layer quasi-geostrophic channel atmosphere on a beta-plane, coupled to a simple land or shallow-water ocean component.
https://github.com/climdyn/qgs

Category: Atmosphere
Sub Category: Atmospheric Composition and Dynamics

Keywords

atmospheric-models climate climate-variability meteorology numba ocean-atmosphere-model python

Last synced: about 18 hours ago
JSON representation

Repository metadata

A 2-layer quasi-geostrophic atmospheric model in Python. Can be coupled to a simple land or shallow-water ocean component.

README.md

Quasi-Geostrophic Spectral model (qgs)

PyPI version
PyPI pyversions
DOI
DOI
Documentation Status
tests
License: MIT

General Information

qgs is a Python implementation of an atmospheric model for midlatitudes. It models the dynamics of
a 2-layer quasi-geostrophic channel
atmosphere on a beta-plane, coupled to a simple land or
shallow-water ocean component.

You can try qgs online !
Simply click on one of the following links to access an introductory tutorial:
Open in colab
Binder

About

(c) 2020-2025 qgs Developers and Contributors

Part of the code originates from the Python MAOOAM implementation by Maxime Tondeur and Jonathan Demaeyer.

See LICENSE.txt for license information.

Please cite the code description article if you use (a part of) this software for a publication:

  • Demaeyer J., De Cruz, L. and Vannitsem, S. , (2020). qgs: A flexible Python framework of reduced-order multiscale climate models.
    Journal of Open Source Software, 5(56), 2597, https://doi.org/10.21105/joss.02597.

Please consult the qgs code repository for updates.

Installation

With pip

The easiest way to install and run qgs is to use pip.
Type in a terminal

pip install qgs

and you are set!

Additionally, you can clone the repository

git clone https://github.com/Climdyn/qgs.git

and perform a test by running the script

python qgs/qgs_rp.py

to see if everything runs smoothly (this should take less than a minute).

Note:
With the pip installation, in order to be able to generate the movies with the diagnostics,
you need to install separately ffmpeg.

With Anaconda

The second easiest way to install and run qgs is to use an appropriate environment created through Anaconda.

First install Anaconda and clone the repository:

git clone https://github.com/Climdyn/qgs.git

Then install and activate the Python3 Anaconda environment:

conda env create -f environment.yml
conda activate qgs

You can then perform a test by running the script

python qgs_rp.py

to see if everything runs smoothly (this should take less than a minute).

Note for Windows and MacOS users

Presently, qgs is compatible with Windows and MacOS but users wanting to use qgs inside their Python scripts must guard the main script with a

if __name__ == "__main__":

clause and add the following lines below

  from multiprocessing import freeze_support
  freeze_support()

About this usage, see for example the main scripts qgs_rp.py and qgs_maooam.py in the root folder.
Note that the Jupyter notebooks are not concerned by this recommendation and work perfectly well on both operating systems.

Why? These lines are required to make the multiprocessing library works with these operating systems. See here for more details,
and in particular this section.

Activating DifferentialEquations.jl optional support

In addition to the qgs builtin Runge-Kutta integrator, the qgs model can alternatively be integrated with a package called DifferentialEquations.jl written in Julia, and available through the
diffeqpy Python package.
The diffeqpy package first installation step is done by Anaconda in the qgs environment but then you must install Julia and follow the final manual installation instruction found in the diffeqpy README.

These can be summed up as opening a terminal and doing:

conda activate qgs
python

and then inside the Python command line interface do:

>>> import diffeqpy
>>> diffeqpy.install()

which will then finalize the installation. An example of a notebook using this package is available in the documentation and on readthedocs.

Documentation

To build the documentation, please run (with the conda environment activated):

cd documentation
make html

You may need to install make if it is not already present on your system.
Once built, the documentation is available here.

The documentation is also available online on read the docs: https://qgs.readthedocs.io/

Usage

qgs can be used by editing and running the script qgs_rp.py and qgs_maooam.py found in the main folder.

For more advanced usages, please read the User Guides.

Examples

Another nice way to run the model is through the use of Jupyter notebooks.
Simple examples can be found in the notebooks folder.
For instance, running

conda activate qgs
cd notebooks
jupyter-notebook

will lead you to your favorite browser where you can load and run the examples.

Dependencies

qgs needs mainly:

  • Numpy for numeric support
  • sparse for sparse multidimensional arrays support
  • Numba for code acceleration
  • Sympy for symbolic manipulation of inner products

Check the yaml file environment.yml for the dependencies.

Forthcoming developments

  • Scientific development (short-to-mid-term developments)
    • Non-autonomous equation (seasonality, etc...)
    • Energy diagnostics
  • Technical midterm developments
    • Vectorization of the tensor computation
  • Long-term development track
    • Active advection
    • True quasi-geostrophic ocean when using ocean model version
    • Salinity in the ocean
    • Numerical basis of function

Contributing to qgs

If you want to contribute actively to the roadmap detailed above, please contact the main authors.

In addition, if you have made changes that you think will be useful to others, please feel free to suggest these as a pull request on the qgs Github repository.

More information and guidance about how to do a pull request for qgs can be found in the documentation here.

Other atmospheric models in Python

Non-exhaustive list:

  • Q-GCM: A mid-latitude grid based ocean-atmosphere model like MAOOAM. Code in Fortran,
    interface is in Python.
  • pyqg: A pseudo-spectral Python solver for quasi-geostrophic systems.
  • Isca: Research GCM written in Fortran and largely
    configured with Python scripts, with internal coding changes required for non-standard cases.

Citation (CITATION.cff)

cff-version: "1.2.0"
message: "Please cite the code description article if you use (a part of) this software for a publication:"
authors:
  - family-names: Demaeyer
    given-names: Jonathan
    affiliation: "Royal Meteorological Institute of Belgium"
    orcid: "https://orcid.org/0000-0002-5098-404X"
  - family-names: "De Cruz"
    affiliation: "Royal Meteorological Institute of Belgium"
    given-names: Lesley
    orcid: "https://orcid.org/0000-0003-4458-8953"
license: MIT
repository-code: https://github.com/Climdyn/qgs
title: qgs
abstract: |
  A 2-layer quasi-geostrophic atmospheric model in Python. Can be coupled to a simple land or shallow-water ocean component.
keywords:
  - Numba
  - "Idealized atmospheric model"
  - "Coupled model"
  - "Mid-latitude climate variability"
preferred-citation:
  type: article
  doi: 10.21105/joss.02597
  journal: Journal of Open Source Software
  authors:
  - family-names: Demaeyer
    given-names: Jonathan
    affiliation: "Royal Meteorological Institute of Belgium"
    orcid: "https://orcid.org/0000-0002-5098-404X"
  - family-names: "De Cruz"
    given-names: Lesley
    affiliation: "Royal Meteorological Institute of Belgium"
    orcid: "https://orcid.org/0000-0003-4458-8953"
  - family-names: Vannitsem
    given-names: "Stéphane"
    affiliation: "Royal Meteorological Institute of Belgium"
    orcid: "https://orcid.org/0000-0002-1734-1042"
  date-published: 2020-12-24
  publisher: "The Open Journal"
  year: 2020
  volume: 5
  issue: 56
  number: 56
  title: "qgs: A flexible Python framework of reduced-order multiscale climate models"
doi: 10.5281/zenodo.5569583
version: "0.2.5"
date-released: 2021-10-14

Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 7 days ago

Total Commits: 120
Total Committers: 3
Avg Commits per committer: 40.0
Development Distribution Score (DDS): 0.075

Commits in past year: 14
Committers in past year: 2
Avg Commits per committer in past year: 7.0
Development Distribution Score (DDS) in past year: 0.143

Name Email Commits
Jonathan Demaeyer j****y@m****e 111
ushham o****n@m****e 5
Lesley De Cruz l****z@m****e 4

Committer domains:


Issue and Pull Request metadata

Last synced: 2 days ago

Total issues: 12
Total pull requests: 23
Average time to close issues: 7 months
Average time to close pull requests: 1 day
Total issue authors: 4
Total pull request authors: 4
Average comments per issue: 2.33
Average comments per pull request: 0.78
Merged pull request: 19
Bot issues: 0
Bot pull requests: 0

Past year issues: 2
Past year pull requests: 6
Past year average time to close issues: N/A
Past year average time to close pull requests: 6 days
Past year issue authors: 1
Past year pull request authors: 1
Past year average comments per issue: 0.0
Past year average comments per pull request: 2.0
Past year merged pull request: 4
Past year bot issues: 0
Past year bot pull requests: 0

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/climdyn/qgs

Top Issue Authors

  • jodemaey (6)
  • sadielbartholomew (3)
  • patnr (2)
  • ifengfan (1)

Top Pull Request Authors

  • jodemaey (20)
  • arfon (1)
  • ladc (1)
  • sadielbartholomew (1)

Top Issue Labels

  • enhancement (5)
  • bug (4)
  • fixed (3)
  • documentation (3)
  • support (1)

Top Pull Request Labels

  • enhancement (2)
  • bug (2)
  • critical (1)

Package metadata

proxy.golang.org: github.com/climdyn/qgs

  • Homepage:
  • Documentation: https://pkg.go.dev/github.com/climdyn/qgs#section-documentation
  • Licenses:
  • Latest release: v1.0.0 (published 30 days ago)
  • Last Synced: 2025-04-25T13:02:24.379Z (2 days ago)
  • Versions: 13
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent packages count: 6.999%
    • Average: 8.173%
    • Dependent repos count: 9.346%
proxy.golang.org: github.com/Climdyn/qgs

  • Homepage:
  • Documentation: https://pkg.go.dev/github.com/Climdyn/qgs#section-documentation
  • Licenses: mit
  • Latest release: v1.0.0 (published 30 days ago)
  • Last Synced: 2025-04-25T13:02:28.405Z (2 days ago)
  • Versions: 13
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent packages count: 6.999%
    • Average: 8.173%
    • Dependent repos count: 9.346%
pypi.org: qgs

A 2-layer quasi-geostrophic atmospheric model. Can be coupled to a simple land or shallow-water ocean component.

  • Homepage:
  • Documentation: https://qgs.readthedocs.io/
  • Licenses: The MIT License (MIT) Copyright (c) 2020-2025 qgs Developers and Contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  • Latest release: 1.0.0 (published 30 days ago)
  • Last Synced: 2025-04-25T13:02:24.376Z (2 days ago)
  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 213 Last month
  • Rankings:
    • Dependent packages count: 7.466%
    • Average: 45.584%
    • Downloads: 59.678%
    • Dependent repos count: 69.608%
  • Maintainers (1)

Dependencies

requirements.txt pypi
  • diffeqpy *
  • ipython *
  • julia *
  • jupyter *
  • matplotlib >=3.4
  • numba *
  • numpy *
  • pebble *
  • pytest *
  • python >=3.8
  • scipy *
  • sparse *
  • sphinx *
  • sphinx_rtd_theme *
  • sphinxcontrib-bibtex *
  • sympy *
.github/workflows/checks.yml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • conda-incubator/setup-miniconda v2 composite
environment.yml conda
  • ffmpeg
  • ipython
  • jupyter
  • matplotlib >=3.4
  • numba
  • numpy
  • pebble
  • pip
  • pytest
  • python >=3.8
  • scipy
  • sparse
  • sphinx
  • sphinx_rtd_theme >0.5.1
  • sympy
pyproject.toml pypi
  • ipython *
  • jupyter *
  • matplotlib >=3.4
  • numba *
  • numpy *
  • pebble *
  • scipy *
  • sparse *
  • sympy *

Score: 10.178160370394268