{"id":13948699,"url":"https://github.com/Climdyn/qgs","last_synced_at":"2025-07-20T10:32:30.591Z","repository":{"id":45979076,"uuid":"246609584","full_name":"Climdyn/qgs","owner":"Climdyn","description":"A 2-layer quasi-geostrophic atmospheric model in Python. Can be coupled to a simple land or shallow-water ocean component.","archived":false,"fork":false,"pushed_at":"2025-06-11T16:56:23.000Z","size":36112,"stargazers_count":39,"open_issues_count":2,"forks_count":10,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-03T22:35:30.247Z","etag":null,"topics":["atmospheric-models","climate","climate-variability","meteorology","numba","ocean-atmosphere-model","python"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Climdyn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-03-11T15:32:55.000Z","updated_at":"2025-04-25T17:50:14.000Z","dependencies_parsed_at":"2023-09-21T19:33:28.901Z","dependency_job_id":"4aee6ed5-cb20-4faa-8693-750e8d6a8a66","html_url":"https://github.com/Climdyn/qgs","commit_stats":{"total_commits":106,"total_committers":3,"mean_commits":"35.333333333333336","dds":0.06603773584905659,"last_synced_commit":"a9171a2549fdc67262a2c3f436f0700798d8cea8"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/Climdyn/qgs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Climdyn%2Fqgs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Climdyn%2Fqgs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Climdyn%2Fqgs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Climdyn%2Fqgs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Climdyn","download_url":"https://codeload.github.com/Climdyn/qgs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Climdyn%2Fqgs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264505259,"owners_count":23618909,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["atmospheric-models","climate","climate-variability","meteorology","numba","ocean-atmosphere-model","python"],"created_at":"2024-08-08T05:01:28.190Z","updated_at":"2025-07-20T10:32:30.556Z","avatar_url":"https://github.com/Climdyn.png","language":"Jupyter Notebook","funding_links":[],"categories":["Atmosphere"],"sub_categories":["Atmospheric Composition and Dynamics"],"readme":"\nQuasi-Geostrophic Spectral model (qgs)\n======================================\n\n\n[![PyPI version](https://badge.fury.io/py/qgs.svg)](https://badge.fury.io/py/qgs)\n[![PyPI pyversions](https://img.shields.io/pypi/pyversions/qgs.svg)](https://pypi.org/project/qgs/)\n[![DOI](https://zenodo.org/badge/246609584.svg)](https://zenodo.org/badge/latestdoi/246609584)\n[![DOI](https://joss.theoj.org/papers/10.21105/joss.02597/status.svg)](https://doi.org/10.21105/joss.02597)\n[![Documentation Status](https://readthedocs.org/projects/qgs/badge/?version=latest)](https://qgs.readthedocs.io/en/latest/?badge=latest)\n[![tests](https://github.com/Climdyn/qgs/actions/workflows/checks.yml/badge.svg?branch=master)](https://github.com/Climdyn/qgs/actions/workflows/checks.yml)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nGeneral Information\n-------------------\n\nqgs is a Python implementation of an atmospheric model for midlatitudes.  It models the dynamics of\na 2-layer [quasi-geostrophic](https://en.wikipedia.org/wiki/Quasi-geostrophic_equations) channel\natmosphere on a [beta-plane](https://en.wikipedia.org/wiki/Beta_plane), coupled to a simple land or\n[shallow-water](https://en.wikipedia.org/wiki/Shallow_water_equations) ocean component. \n\n![](https://github.com/Climdyn/qgs/blob/master/misc/figs/readme.gif?raw=true)\n\n\u003e **You can try qgs online !**  \n\u003e Simply click on one of the following links to access an introductory tutorial:\n\u003e [![Open in colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Climdyn/qgs/blob/master/notebooks/introduction_qgs.ipynb)\n\u003e [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/Climdyn/qgs/master?filepath=notebooks/introduction_qgs.ipynb)\n\u003e [\u003cimg src=\"https://deepnote.com/buttons/launch-in-deepnote-small.svg\"\u003e](https://deepnote.com/launch?name=MyProject\u0026url=https://github.com/Climdyn/qgs/tree/master/notebooks/introduction_qgs.ipynb)\n\n\nAbout\n-----\n\n(c) 2020-2025 qgs Developers and Contributors\n\nPart of the code originates from the Python [MAOOAM](https://github.com/Climdyn/MAOOAM) implementation by Maxime Tondeur and Jonathan Demaeyer.\n\nSee [LICENSE.txt](https://raw.githubusercontent.com/Climdyn/qgs/master/LICENSE.txt) for license information.\n\n**Please cite the code description article if you use (a part of) this software for a publication:**\n\n* Demaeyer J., De Cruz, L. and Vannitsem, S. , (2020). qgs: A flexible Python framework of reduced-order multiscale climate models. \n  *Journal of Open Source Software*, **5**(56), 2597,   [https://doi.org/10.21105/joss.02597](https://doi.org/10.21105/joss.02597).\n\nPlease consult the qgs [code repository](http://www.github.com/Climdyn/qgs) for updates.\n\n\nInstallation\n------------\n\n#### With pip\n\nThe easiest way to install and run qgs is to use [pip](https://pypi.org/).\nType in a terminal\n\n    pip install qgs\n\nand you are set!\n\nAdditionally, you can clone the repository\n\n    git clone https://github.com/Climdyn/qgs.git\n\nand perform a test by running the script\n\n    python qgs/qgs_rp.py\n\nto see if everything runs smoothly (this should take less than a minute).\n\n\u003e **Note:** \n\u003e With the pip installation, in order to be able to generate the movies with the diagnostics, \n\u003e you need to install separately [ffmpeg](https://ffmpeg.org/).\n\n#### With Anaconda\n\nThe second easiest way to install and run qgs is to use an appropriate environment created through [Anaconda](https://www.anaconda.com/).\n\nFirst install Anaconda and clone the repository:\n\n    git clone https://github.com/Climdyn/qgs.git\n\nThen install and activate the Python3 Anaconda environment:\n\n    conda env create -f environment.yml\n    conda activate qgs\n\nYou can then perform a test by running the script\n\n    python qgs_rp.py\n    \nto see if everything runs smoothly (this should take less than a minute).\n\n#### Note for Windows and MacOS users\n\nPresently, qgs is compatible with Windows and MacOS but users wanting to use qgs inside their Python scripts must guard the main script with a\n\n```\nif __name__ == \"__main__\":\n```\n\nclause and add the following lines below\n\n```\n  from multiprocessing import freeze_support\n  freeze_support()\n```\n\nAbout this usage, see for example the main scripts `qgs_rp.py` and `qgs_maooam.py` in the root folder.\nNote that the Jupyter notebooks are not concerned by this recommendation and work perfectly well on both operating systems.\n\n\u003e **Why?** These lines are required to make the multiprocessing library works with these operating systems. See [here](https://docs.python.org/3.8/library/multiprocessing.html) for more details, \n\u003e and in particular [this section](https://docs.python.org/3.8/library/multiprocessing.html#the-spawn-and-forkserver-start-methods).\n\n\n#### Activating DifferentialEquations.jl optional support\n\nIn addition to the qgs builtin Runge-Kutta integrator, the qgs model can alternatively be integrated with a package called [DifferentialEquations.jl](https://github.com/SciML/DifferentialEquations.jl) written in [Julia](https://julialang.org/), and available through the\n[diffeqpy](https://github.com/SciML/diffeqpy) Python package.\nThe diffeqpy package first installation step is done by Anaconda in the qgs environment but then you must [install Julia](https://julialang.org/downloads/) and follow the final manual installation instruction found in the [diffeqpy README](https://github.com/SciML/diffeqpy).\n\nThese can be summed up as opening a terminal and doing:\n```\nconda activate qgs\npython\n```\nand then inside the Python command line interface do:\n\n```\n\u003e\u003e\u003e import diffeqpy\n\u003e\u003e\u003e diffeqpy.install()\n```\nwhich will then finalize the installation. An example of a notebook using this package is available in the documentation and on [readthedocs](https://qgs.readthedocs.io/en/latest/files/examples/diffeq.html).\n\nDocumentation\n-------------\n\nTo build the documentation, please run (with the conda environment activated):\n\n    cd documentation\n    make html\n\nYou may need to install [make](https://www.gnu.org/software/make/) if it is not already present on your system.\nOnce built, the documentation is available [here](./documentation/build/html/index.html).\n\nThe documentation is also available online on read the docs: [https://qgs.readthedocs.io/](https://qgs.readthedocs.io/)\n\nUsage\n-----\n\nqgs can be used by editing and running the script `qgs_rp.py` and `qgs_maooam.py` found in the main folder.\n\nFor more advanced usages, please read the [User Guides](https://qgs.readthedocs.io/en/latest/files/user_guide.html).\n\nExamples\n--------\n\nAnother nice way to run the model is through the use of Jupyter notebooks. \nSimple examples can be found in the [notebooks folder](./notebooks).\nFor instance, running \n\n    conda activate qgs\n    cd notebooks\n    jupyter-notebook\n    \nwill lead you to your favorite browser where you can load and run the examples.\n\nDependencies\n------------\n\nqgs needs mainly:\n\n   * [Numpy](https://numpy.org/) for numeric support\n   * [sparse](https://sparse.pydata.org/) for sparse multidimensional arrays support\n   * [Numba](https://numba.pydata.org/) for code acceleration\n   * [Sympy](https://www.sympy.org/) for symbolic manipulation of inner products\n   \nCheck the yaml file [environment.yml](https://raw.githubusercontent.com/Climdyn/qgs/master/environment.yml) for the dependencies.\n\nForthcoming developments\n------------------------\n\n* Scientific development (short-to-mid-term developments)\n    + Non-autonomous equation (seasonality, etc...)\n    + Energy diagnostics\n* Technical midterm developments\n    + Vectorization of the tensor computation\n* Long-term development track\n    + Active advection\n    + True quasi-geostrophic ocean when using ocean model version\n    + Salinity in the ocean \n    + Numerical basis of function\n  \nContributing to qgs\n-------------------\n\nIf you want to contribute actively to the roadmap detailed above, please contact the main authors.\n\nIn 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](https://github.com/Climdyn/qgs).\n\nMore information and guidance about how to do a pull request for qgs can be found in the documentation [here](https://qgs.readthedocs.io/en/latest/files/general_information.html#contributing-to-qgs).\n\nOther atmospheric models in Python\n----------------------------------\n\nNon-exhaustive list:\n\n* [Q-GCM](http://q-gcm.org/): A mid-latitude grid based ocean-atmosphere model like MAOOAM. Code in Fortran,\n                                interface is in Python.\n* [pyqg](https://github.com/pyqg/pyqg): A pseudo-spectral Python solver for quasi-geostrophic systems.\n* [Isca](https://execlim.github.io/IscaWebsite/index.html): Research GCM written in Fortran and largely\n            configured with Python scripts, with internal coding changes required for non-standard cases.\n            \n            \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FClimdyn%2Fqgs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FClimdyn%2Fqgs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FClimdyn%2Fqgs/lists"}