Code Monkey home page Code Monkey logo

pyqg_generative's Introduction

JAMES publication

This repository was used to obtain all results of the paper Pavel Perezhogin, Laure Zanna, Carlos Fernandez-Granda "Generative data-driven approaches for stochastic subgrid parameterizations in an idealized ocean model" published in JAMES.

The main idea of the paper is to build stochastic subgrid parameterizations of mesoscale eddies using generative approach of Machine Learning (ML). Subgrid parameterization accounts for the missing physics induced by the eddies which are not resolved on the grid. Efficient parameterization should allow to simulate turbulent flows on a coarse computational grid. Turbulent flow represented on a coarse grid misses the information about the state of the subgrid eddies. It results in an uncertainty in the missing forcing induced by these eddies. Here we aim to produce samples from the distribution of all possible subgrid forcings consistent with resolved flow:

$$S \sim \rho(S|\overline{q})$$

An example of many possible realizations of the subgrid forcing at fixed resolved flow is shown below:

An animation is produced using GAN model notebooks/Animation.ipynb.

Online simulations with generative models (GAN, VAE) reveal better numerical stability properties compared to the baseline GZ (Guillaumin Zanna 2021):

An animation is produced using notebooks/Animate-solution.ipynb.

Paper Figures

See notebooks/JAMES_figures.ipynb.

Try it in Google Colab

In a case dataset in cloud is not working, download it from Zenodo!

Generation of JAMES data (Hard and depends on HPC)

cd scripts and Check that slurm is consistent with your HPC:

python -c "from slurm_helpers import *; create_slurm('','test.py')"
cat launcher.sh

Run each script and pay attention to BASIC_FOLDER, SCRIPT_PATH and so on:

  • python run_reference.py
  • Coarsegrain highres simulations with def coarsegrain_reference_dataset
  • python run_forcing_datasets.py
  • python train_parameterizations.py
  • python run_parameterized.py
  • python compute_online_metrics.py

Installation of pyqg_generative

Requirements

pip install numpy matplotlib xarray aiohttp requests zarr pyfftw gcm_filters pyqg cmocean gplearn

Install in editable mode

git clone https://github.com/m2lines/pyqg_generative.git
pip install --editable .

pyqg_generative's People

Contributors

pperezhogin avatar laurezanna 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.