samudra

Global Ocean Emulator

https://github.com/suryadheeshjith/samudra

Science Score: 49.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 2 DOI reference(s) in README
  • Academic publication links
    Links to: wiley.com
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (16.3%) to scientific vocabulary
Last synced: 7 months ago · JSON representation

Repository

Global Ocean Emulator

Basic Info
  • Host: GitHub
  • Owner: suryadheeshjith
  • License: apache-2.0
  • Language: Jupyter Notebook
  • Default Branch: main
  • Homepage:
  • Size: 37.6 MB
Statistics
  • Stars: 33
  • Watchers: 1
  • Forks: 4
  • Open Issues: 0
  • Releases: 1
Created over 1 year ago · Last pushed 10 months ago
Metadata Files
Readme License

README.md

Samudra: A Global Ocean Emulator

This repository contains the implementation of Samudra, a global ocean emulator described in "Samudra: An AI Global Ocean Emulator for Climate". Samudra efficiently emulates the ocean component of a state-of-the-art climate model, accurately reproducing key ocean variables including sea surface height, horizontal velocities, temperature, and salinity, across their full depth.

Overview

Samudra reproduces the 3D ocean temperature structure and variability of the OM4 climate model with high fidelity, while also demonstrating stable long-term performance under realistic, time-varying forcing conditions. It achieves a significant speedup as well—rolling out a 100-year simulation is approximately 150 times faster than the original model.

Installation

  1. Clone the repository: bash git clone https://github.com/suryadheeshjith/Samudra.git cd Samudra

  2. Set up the environment using either method:

Using conda: bash conda env create -f environment.yml conda activate samudra

Using uv: bash uv sync source .venv/bin/activate

Usage

To train or rollout Samudra, download the OM4 data and statistics referenced in the OM4 Data section. You can also substitute your own data, provided it aligns with the same format. Note that mean and standard deviation files are precomputed for training and model rollouts; if you opt to use your own data, you will need to compute these statistics yourself.

Should you wish to evaluate Samudra directly, you may use the pre-trained model weights discussed in the Trained Model Weights section.

Training

A default training configuration is provided in the file configs/trainsamudraom4.yaml. Update all fields marked with # FILL IN to reference your local data paths and files for OM4 data and statistics.

Note: Ensure your environment is activated before training. ```bash

Train a new model

torchrun src/train.py --config path/to/train_config.yaml ```

Rollout

A default rollout configuration is provided in configs/rolloutsamudraom4.yaml. Update all fields marked with # FILL IN to reference your local data paths and files for OM4 data and statistics.

Note: Ensure your environment is activated before training. ```bash

Produce a rollout from a trained model (and optionally save the result)

python src/rollout.py --config path/to/rolloutconfig.yaml --ckptpath path/to/checkpoint.pt --save_zarr ```

Note: For both training and rollout, you may change the experiment name in the config files or use --sub_name argument in the command line to specify a different name for the output directory.

OM4 Data

The OM4 data and corresponding statistics are publicly available as Zarr files via our hosted pod.

```python import xarray as xr

Download statistics

means = xr.opendataset("https://nyu1.osn.mghpcc.org/m2lines-pubs/Samudra/OM4means", engine='zarr', chunks={}) means.to_zarr("local/path/to/data-dir/means.zarr")

stds = xr.opendataset("https://nyu1.osn.mghpcc.org/m2lines-pubs/Samudra/OM4stds", engine='zarr', chunks={}) stds.to_zarr("local/path/to/data-dir/stds.zarr") ```

Downloading the entire dataset (~70 GB) can be time-consuming, depending on your network speed. If you only need to evaluate Samudra on the test set, a reduced dataset (~12 GB) is sufficient.

```python import xarray as xr

Download the entire data

data = xr.open_dataset("https://nyu1.osn.mghpcc.org/m2lines-pubs/Samudra/OM4", engine='zarr', chunks={})

For training ~ 70GB

data.to_zarr("local/path/to/data-dir/data.zarr")

(OR) For evaluation ~ 12GB

data.sel(time=slice("2014-10-10", "2022-12-24")).to_zarr("local/path/to/data-dir/data.zarr") ```

Trained Model Weights

Pre-trained weights for Samudra are available on Hugging Face. You can download them as follows: ```bash

Download the weights for thermo model

wget https://huggingface.co/M2LInES/Samudra/resolve/main/samudrathermoseed1.pt

(OR) Download the weights for thermo-dynamic model

wget https://huggingface.co/M2LInES/Samudra/resolve/main/samudrathermodynamic_seed1.pt ```

There are 5 seeds saved for each model.

Paper Plots

The notebooks in the notebooks folder reproduce most of the plots from the paper.

Further methodological details and model architecture specifications can be found in the paper.

Citation

If you find this code useful in your research, please cite: @article{dheeshjith2025samudra, title={Samudra: An ai global ocean emulator for climate}, author={Dheeshjith, Surya and Subel, Adam and Adcroft, Alistair and Busecke, Julius and Fernandez-Granda, Carlos and Gupta, Shubham and Zanna, Laure}, journal={Geophysical Research Letters}, volume={52}, number={10}, pages={e2024GL114318}, year={2025}, publisher={Wiley Online Library} }

Owner

  • Name: Surya Dheeshjith
  • Login: suryadheeshjith
  • Kind: user
  • Location: Bangalore, India

GitHub Events

Total
  • Release event: 1
  • Watch event: 4
  • Delete event: 6
  • Issue comment event: 1
  • Push event: 33
  • Pull request event: 10
  • Fork event: 3
  • Create event: 8
Last Year
  • Release event: 1
  • Watch event: 4
  • Delete event: 6
  • Issue comment event: 1
  • Push event: 33
  • Pull request event: 10
  • Fork event: 3
  • Create event: 8

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 25
  • Total Committers: 1
  • Avg Commits per committer: 25.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 25
  • Committers: 1
  • Avg Commits per committer: 25.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Surya s****h@g****m 25

Issues and Pull Requests

Last synced: 7 months ago

All Time
  • Total issues: 1
  • Total pull requests: 6
  • Average time to close issues: 29 days
  • Average time to close pull requests: 5 days
  • Total issue authors: 1
  • Total pull request authors: 2
  • Average comments per issue: 2.0
  • Average comments per pull request: 0.17
  • Merged pull requests: 4
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 6
  • Average time to close issues: 29 days
  • Average time to close pull requests: 5 days
  • Issue authors: 1
  • Pull request authors: 2
  • Average comments per issue: 2.0
  • Average comments per pull request: 0.17
  • Merged pull requests: 4
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
  • suryadheeshjith (8)
  • alxmrs (1)
Top Labels
Issue Labels
Pull Request Labels

Dependencies

.github/workflows/pre-commit.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
pyproject.toml pypi
  • aiohttp ==3.9.3
  • cartopy ==0.23
  • cftime >=1.5.2
  • cmocean ==4.0.3
  • dacite ==1.9.1
  • dask ==2024.2.1
  • einops ==0.8
  • huggingface-hub ==0.23.4
  • ipykernel ==6.29.3
  • ipywidgets ==8.1.2
  • matplotlib ==3.8.3
  • nc-time-axis ==1.4.1
  • numpy ==1.24.4
  • pandas ==2.2.1
  • requests ==2.32.3
  • scikit-learn ==1.4.1.post1
  • torch ==2.2.1
  • xarray ==2023.7
  • xarrayutils ==2.0.1
  • zarr ==2.16.1
environment.yml pypi
  • aiohttp ==3.9.3
  • cartopy ==0.23.0
  • cftime >=1.5.2
  • cmocean ==4.0.3
  • dacite ==1.9.1
  • dask ==2024.2.1
  • einops ==0.8.0
  • huggingface-hub ==0.23.4
  • ipykernel ==6.29.3
  • ipywidgets ==8.1.2
  • matplotlib ==3.8.3
  • nc-time-axis ==1.4.1
  • numpy ==1.24.4
  • pandas ==2.2.1
  • requests ==2.32.3
  • scikit-learn ==1.4.1.post1
  • torch ==2.2.1
  • xarray ==2023.7.0
  • xarrayutils ==2.0.1
  • zarr ==2.16.1