NNCAM
Model Introduction
NNCAM predicts physical tendencies and fluxes produced by cloud, convection, and radiation subgrid processes from atmospheric-column states for data-driven climate-model parameterization research.
Paper: Deep learning to represent subgrid processes in climate models
https://gmd.copernicus.org/articles/11/3999/2018/
Model Description
The method was proposed by research teams from Ludwig Maximilian University of Munich, the University of California Irvine, and Columbia University. The paper trains on approximately 140 million atmospheric-column samples from one year of SPCAM aquaplanet simulation. The model predicts 65 heating, moistening, radiative-flux, and precipitation outputs from a 94-dimensional atmospheric-column state.
Use Cases
| Use Case | Description |
|---|---|
| Subgrid-process parameterization | Predict physical tendencies and fluxes from temperature, humidity, wind, and surface forcing. |
| Atmospheric-column diagnostics | Validate heating, moistening, radiation, and precipitation relationships over 30 levels. |
| Local engineering validation | Validate training, inference, conservation diagnostics, and visualization with structured synthetic samples. |
| ModelScope/OneCode execution | Validate structured data, training, inference, parameterization metrics, and visualization in ModelScope or OneCode environments. |
| Multi-GPU training | Validate distributed training and the checkpoint workflow through torchrun. |
Usage Instructions
1.OneCode
Experience intelligent, one-click AI4S programming through the OneCode online environment:
Try intelligent, one-click AI4S programming
2. Download and Installation
hf download OneScience-Group/NNCAM --local-dir ./NNCAM
cd NNCAM
Environment Dependencies
Hardware Requirements
- A GPU or DCU is recommended.
- A CPU can be used for connectivity validation with the default small-sample configuration.
- DCU users must install DTK in advance. DTK 25.04.2 or later, or the OneScience-recommended version matching the current cluster, is recommended.
DCU Environment
# Activate DTK and Conda first
conda create -n onescience311 python=3.11 -y
conda activate onescience311
pip install onescience[earth-dcu] -i http://mirrors.onescience.ai:3141/pypi/simple/ --trusted-host mirrors.onescience.ai
GPU Environment
# Activate Conda first
conda create -n onescience311 python=3.11 -y libstdcxx-ng=12 libgcc-ng=12 gcc_linux-64=12 gxx_linux-64=12
conda activate onescience311
pip install onescience[earth-gpu] -i http://mirrors.onescience.ai:3141/pypi/simple/ --trusted-host mirrors.onescience.ai
Training Data
The paper uses SPCAM aquaplanet simulations with a 30-minute timestep and 30 vertical levels. Inputs are [B,94] temperature, humidity, wind, and surface-forcing columns, and targets are [B,65] heating, moistening, four radiative fluxes, and precipitation. This repository uses a small structured synthetic dataset for engineering validation only and does not represent the real SPCAM distribution, training scale, or paper performance.
python scripts/fake_data.py
Training
For single-GPU training, use:
python scripts/train.py
For multi-GPU training, use:
torchrun --nproc_per_node=8 --nnodes=1 --rdzv_id=1000 --rdzv_backend=c10d --max_restarts=0 --master_addr="localhost" --master_port=29500 scripts/train.py
The default reduces the paper's nine 256-node layers to four 32-node layers and shortens training without reducing the 94 inputs, 65 outputs, or 30-level vertical protocol. Formal experiments require real SPCAM data and the paper-scale model, with artifacts saved to:
result/checkpoints/nncam.pt
result/training/metrics.json
Trained Weights
The paper does not provide directly loadable official model weights, and this repository bundles no weights under weight/. The locally trained checkpoint is saved to result/checkpoints/nncam.pt and must not be represented as an official pretrained weight.
Inference
python scripts/inference.py
Inference loads the training checkpoint and generates subgrid tendencies, radiative fluxes, and precipitation from complete atmospheric-column states. Complete numerical outputs are saved to:
result/output/predictions.npz
Evaluation and Visualization
python scripts/result.py
Evaluation computes grouped RMSE and R² and generates grouped-error and precipitation-prediction comparisons. Synthetic-data results validate engineering only and do not represent paper performance; outputs are saved to:
result/evaluation/metrics.json
result/evaluation/comparison.png
Official OneScience Information
| Platform | OneScience Main Repository | Skills Repository |
|---|---|---|
| Gitee | https://gitee.com/onescience-ai/onescience | https://gitee.com/onescience-ai/oneskills |
| GitHub | https://github.com/onescience-ai/OneScience | https://github.com/onescience-ai/oneskills |
Citation and License
This repository is an independent engineering reproduction of the public NNCAM specifications.
Use of this repository's code, official model weights, and data remains subject to the licenses and terms of their respective projects.
中文说明
模型简介
NNCAM 根据大气柱状态预测云、对流和辐射等次网格过程产生的物理倾向和通量,用于数据驱动的气候模型参数化(parameterization)研究。
论文《使用深度学习表征气候模型中的次网格过程》
https://gmd.copernicus.org/articles/11/3999/2018/
模型描述
该方法由慕尼黑路德维希-马克西米利安大学、加州大学尔湾分校及哥伦比亚大学的研究团队提出。论文使用 SPCAM 水球模拟一年的约 140 million 个大气柱样本进行训练。模型根据 94 维大气柱状态预测 65 项增温、增湿、辐射通量及降水输出。
使用场景
| 使用场景 | 说明 |
|---|---|
| 次网格过程参数化 | 根据温度、湿度、风和地表强迫预测物理倾向与通量。 |
| 大气柱诊断 | 验证 30 层上的增温、增湿、辐射及降水关系。 |
| 本地工程验证 | 使用结构化合成样本验证训练、推理(inference)、守恒诊断和可视化。 |
| ModelScope/OneCode 运行 | 在 ModelScope 或 OneCode 环境中验证结构化数据、训练、推理、参数化指标和可视化。 |
| 多 GPU 训练 | 使用 torchrun 验证分布式训练和模型权重(检查点)(checkpoint)流程。 |
使用说明
1.OneCode
通过 OneCode 在线环境体验智能一键 AI4S 编程。
2. 下载与安装
hf download OneScience-Group/NNCAM --local-dir ./NNCAM
cd NNCAM
环境依赖
硬件要求
- 建议使用 GPU 或 DCU。
- 可使用 CPU 在默认小样本配置下验证连通性。
- DCU 用户必须提前安装 DTK。建议使用 DTK 25.04.2 或更高版本,或使用 OneScience 推荐的与当前集群匹配的版本。
DCU 环境
# Activate DTK and Conda first
conda create -n onescience311 python=3.11 -y
conda activate onescience311
pip install onescience[earth-dcu] -i http://mirrors.onescience.ai:3141/pypi/simple/ --trusted-host mirrors.onescience.ai
GPU 环境
# Activate Conda first
conda create -n onescience311 python=3.11 -y libstdcxx-ng=12 libgcc-ng=12 gcc_linux-64=12 gxx_linux-64=12
conda activate onescience311
pip install onescience[earth-gpu] -i http://mirrors.onescience.ai:3141/pypi/simple/ --trusted-host mirrors.onescience.ai
训练数据
论文采用时间步长为 30 分钟、包含 30 个垂直层的 SPCAM 水球模拟。输入为 [B,94] 的温度、湿度、风和地表强迫柱数据,目标为 [B,65] 的增温、增湿、四种辐射通量及降水。本仓库使用小规模结构化合成数据集,仅用于工程验证,不代表真实 SPCAM 分布、训练规模或论文性能。
python scripts/fake_data.py
训练
单 GPU 训练使用以下命令。
python scripts/train.py
多 GPU 训练使用以下命令。
torchrun --nproc_per_node=8 --nnodes=1 --rdzv_id=1000 --rdzv_backend=c10d --max_restarts=0 --master_addr="localhost" --master_port=29500 scripts/train.py
默认配置将论文中的九个 256 节点层缩减为四个 32 节点层,并缩短训练,同时保留 94 个输入、65 个输出及 30 层垂直协议。正式实验需要真实 SPCAM 数据和论文规模的模型,产物保存至以下路径。
result/checkpoints/nncam.pt
result/training/metrics.json
训练权重
论文未提供可直接加载的官方模型权重,本仓库的 weight/ 中未附带权重。本地训练所得的模型权重(检查点)保存至 result/checkpoints/nncam.pt,不得将其作为官方预训练权重。
推理
python scripts/inference.py
推理加载训练所得的模型权重(检查点),根据完整的大气柱状态生成次网格倾向、辐射通量和降水。完整数值输出保存至以下路径。
result/output/predictions.npz
评估与可视化
python scripts/result.py
评估计算分组 RMSE 和 R²,并生成分组误差及降水预测的对比图。合成数据结果仅用于工程验证,不代表论文性能。输出保存至以下路径。
result/evaluation/metrics.json
result/evaluation/comparison.png
OneScience 官方信息
| 平台 | OneScience 主仓库 | Skills 仓库 |
|---|---|---|
| Gitee | https://gitee.com/onescience-ai/onescience | https://gitee.com/onescience-ai/oneskills |
| GitHub | https://github.com/onescience-ai/OneScience | https://github.com/onescience-ai/oneskills |
引用与许可证
本仓库是对公开 NNCAM 规范的独立工程复现。
使用本仓库的代码、官方模型权重和数据仍须遵守各自项目的许可证和条款。
- Downloads last month
- 21