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.
https://github.com/suryadheeshjith/samudra
Category: Hydrosphere
Sub Category: Ocean Models
Last synced: about 22 hours ago
JSON representation
Repository metadata
Global Ocean Emulator
- Host: GitHub
- URL: https://github.com/suryadheeshjith/samudra
- Owner: suryadheeshjith
- License: apache-2.0
- Created: 2024-12-01T20:46:11.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-22T04:02:06.000Z (7 months ago)
- Last Synced: 2025-12-22T08:16:52.864Z (20 days ago)
- Language: Jupyter Notebook
- Homepage:
- Size: 37.6 MB
- Stars: 36
- Watchers: 1
- Forks: 8
- Open Issues: 0
- Releases: 1
-
Metadata Files:
- Readme: README.md
- License: 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
- Clone the repository:
git clone https://github.com/suryadheeshjith/Samudra.git
cd Samudra
- Set up the environment using either method:
Using conda:
conda env create -f environment.yml
conda activate samudra
Using uv:
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/train_samudra_om4.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.
# Train a new model
torchrun src/train.py --config path/to/train_config.yaml
Rollout
A default rollout configuration is provided in configs/rollout_samudra_om4.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.
# Produce a rollout from a trained model (and optionally save the result)
python src/rollout.py --config path/to/rollout_config.yaml --ckpt_path 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_nameargument 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.
import xarray as xr
# Download statistics
means = xr.open_dataset("https://nyu1.osn.mghpcc.org/m2lines-pubs/Samudra/OM4_means", engine='zarr', chunks={})
means.to_zarr("local/path/to/data-dir/means.zarr")
stds = xr.open_dataset("https://nyu1.osn.mghpcc.org/m2lines-pubs/Samudra/OM4_stds", 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.
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:
# Download the weights for thermo model
wget https://huggingface.co/M2LInES/Samudra/resolve/main/samudra_thermo_seed1.pt
# (OR) Download the weights for thermo-dynamic model
wget https://huggingface.co/M2LInES/Samudra/resolve/main/samudra_thermo_dynamic_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 metadata
- Name: Surya Dheeshjith
- Login: suryadheeshjith
- Email:
- Kind: user
- Description:
- Website: http://suryadheeshjith.github.io/
- Location: Bangalore, India
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/41594351?u=65807bc70b6c7720d9adaa7bb9cf533760b5f5a4&v=4
- Repositories: 5
- Last ynced at: 2023-03-08T22:52:52.136Z
- Profile URL: https://github.com/suryadheeshjith
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: 4
- 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: 4
- Create event: 8
Committers metadata
Last synced: 5 days ago
Total Commits: 25
Total Committers: 1
Avg Commits per committer: 25.0
Development Distribution Score (DDS): 0.0
Commits in past year: 9
Committers in past year: 1
Avg Commits per committer in past year: 9.0
Development Distribution Score (DDS) in past year: 0.0
| Name | Commits | |
|---|---|---|
| Surya | s****h@g****m | 25 |
Issue and Pull Request metadata
Last synced: 4 months ago
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 request: 4
Bot issues: 0
Bot pull requests: 0
Past year issues: 1
Past year pull requests: 6
Past year average time to close issues: 29 days
Past year average time to close pull requests: 5 days
Past year issue authors: 1
Past year pull request authors: 2
Past year average comments per issue: 2.0
Past year average comments per pull request: 0.17
Past year merged pull request: 4
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
Top Pull Request Authors
- suryadheeshjith (8)
Top Issue Labels
Top Pull Request Labels
Dependencies
- actions/checkout v2 composite
- actions/setup-python v2 composite
- 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
- 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
Score: 3.58351893845611