8000 GitHub - m2lines/ANN-momentum-mesoscale: Source code and figure plotting for paper "Generalizable neural-network parameterization of mesoscale eddies in idealized and global ocean models"
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Source code and figure plotting for paper "Generalizable neural-network parameterization of mesoscale eddies in idealized and global ocean models"

License

Notifications You must be signed in to change notification settings

m2lines/ANN-momentum-mesoscale

Repository files navigation

ANN parameterization of mesoscale momentum fluxes in ocean model MOM6

This repository contains training algorithm and MOM6 ocean model with implemented parameterization. Additionally, we include figure plotting notebooks for the paper "Generalizable neural-network parameterization of mesoscale eddies in idealized and global ocean models" by Pavel Perezhogin, Laure Zanna and Alistair Adcroft, to be submitted soon.

Example of online simulation with the proposed ANN parameterization in the idealized configuration NeverWorld2 of the MOM6 ocean model (full movie, code):

Example GIF

Online simulation in global ocean model OM4 (full movie, code):

Example GIF

Paper figures

In folder notebooks we show Jupyter notebooks for each Figure plotted in the paper.

Data

Training data, offline and online skill can be found on Zenodo.

Installation

git clone --recursive git@github.com:m2lines/ANN-momentum-mesoscale.git

MOM6 online experiments

Training ANN on global ocean data CM2.6

The ANN parameterization with local dimensional scaling is executed in Python code in training-on-CM2.6/helpers/state_functions.py.

  • Download training dataset from Zenodo.
wget https://zenodo.org/records/15328410/files/factor-15.zip
wget https://zenodo.org/records/15328410/files/factor-12.zip
wget https://zenodo.org/records/15328410/files/factor-9.zip
wget https://zenodo.org/records/15328410/files/factor-4.zip
  • Unpack dataset:
unzip factor-15.zip
unzip factor-12.zip
unzip factor-9.zip
unzip factor-4.zip

Training algorithm and evaluation

Training loop is executed on CPUs via the following script and takes ~9 hours on 4CPU cores and 64GB memory:

cd src/training-on-CM2.6/scripts/
python train_script.py

This script contains the default hyperparameters used in the paper. The skill on the testing dataset will be available in {path_save}/skill-test/factor-{factor}.nc and log of training/validation losses in {path_save}/model/logger.nc.

How training data was generated

In case you want to recreate training data yourself instead of downloading it from Zenodo, here are the instructions.

Downloading raw CM2.6 data

cd src/training-on-CM2.6/scripts/
python download_raw_data.py

Filtering and coarsegraining

cd src/training-on-CM2.6/scripts/
python generate_3d_datasets.py --factor=4
  • Provide the path to newly generated coarse datasets in cm26.py

Filtering and offline analysis in idealized configuration NW2

Filtered dataset with diagnosed subfilter fluxes in idealized configuration NW2 is constructed using scripts filter-NW2-data.py and filter-interfaces-GM-filter.py. Second script is optional and used only to more accurately estimate APE in outcropping regions. Offline prediction of subfilter fluxes and evaluation of offline skill is present in notebook offline-analysis-NW2.ipynb.

About

Source code and figure plotting for paper "Generalizable neural-network parameterization of mesoscale eddies in idealized and global ocean models"

Resources

License

Stars

Watchers

Forks

Packages

No packages published
0