RF-ClimParam
Model Introduction
RF-ClimParam learns unresolved convection, cloud microphysics, radiation, turbulent diffusion, and surface-flux processes from high-resolution atmospheric simulations and provides stable subgrid parameterizations for coarse climate models at multiple horizontal resolutions. Its primary uses are multi-resolution climate simulation, analysis of parameterization scale dependence, and reconstruction of precipitation climate statistics.
Paper: Stable machine-learning parameterization of subgrid processes for climate modeling at a range of resolutions
https://arxiv.org/abs/2001.03151
Model Description
The method reproduced by RF-ClimParam was proposed by Janni Yuval and Paul A. O'Gorman at the Massachusetts Institute of Technology. The paper trains random forests with coarse-grained states, instantaneous physical tendencies, turbulent diffusivity, and surface fluxes from a three-dimensional high-resolution System for Atmospheric Modeling aquaplanet simulation. The model is suitable for multi-resolution atmospheric subgrid parameterization, coarse-resolution climate simulation, and evaluation of mean and extreme precipitation statistics.
Use Cases
| Use Case | Description |
|---|---|
| Multi-resolution parameterization | Predict column tendencies and diffusion quantities separately at x4/x8/x16/x32. |
| Joint multi-output regression | Preserve cross-variable and cross-level output means in one tree leaf without splitting outputs. |
| Offline engineering evaluation | Compute per-scale, per-output R2 and RMSE over all four complete coarse-grid fields. |
| Online-coupling proxy | Evaluate zonal-mean 3 h precipitation and extremes on an additional native x32 18×48 coarse grid. |
| ModelScope/OneCode execution | Validate data generation, training, inference, evaluation, visualization, and checkpoint workflows in ModelScope or OneCode. |
| Multi-GPU training | Launch distributed data-parallel training with 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/RF-ClimParam --local-dir ./RF-ClimParam
cd RF-ClimParam
Environment Dependencies
Hardware Requirements
- A GPU or DCU is recommended; the random forest itself runs on CPU with NumPy.
- A CPU supports the complete default small-sample connectivity test.
- DCU users must install DTK first. DTK 25.04.2 or later, or the OneScience-recommended version matching the 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
python scripts/fake_data.py
This repository uses a small number of structured synthetic atmospheric-column samples to validate the engineering workflow and retains complete 144×360, 72×180, 36×90, and 18×45 coarse-grid snapshots for x4, x8, x16, and x32. The data preserve all 48 levels and the real 145→144 and 62→17 random-forest interfaces while reducing only the number of snapshots, sampled training columns, and trees. Synthetic temperature, moisture, condensate, wind, and flux fields contain spatial and vertical relationships and validate multi-resolution parameterization, training, inference, and evaluation only; they do not represent the official SAM distribution or paper performance.
Training
For single-device 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
Training samples a small number of atmospheric columns from the complete spatial field at each resolution and fits the two joint multi-output random forests separately. It produces model parameters and training-sample statistics for all four resolutions, saved to:
result/checkpoints/rf_climparam.pt
result/training/metrics.json
Trained Weights
This repository does not include weights under weight/. The original paper provides random-forest estimators at different resolutions; refer to the authors' OSF archive for the released weights and model artifacts: https://doi.org/10.17605/OSF.IO/36YPT.
Inference
python scripts/inference.py
Inference results include reference targets and subgrid-process predictions at the x4, x8, x16, and x32 resolutions. They also contain complete spatial fields, diagnosed precipitation, grid-location information for each scale, and native x32-grid results. All numerical results are saved to result/output/predictions.npz.
Evaluation and Visualization
python scripts/result.py
Evaluation results include subgrid-process prediction performance at all four resolutions and an online proxy for coarse-grid precipitation. The visualization compares results across resolutions and shows the zonal distributions of target and predicted precipitation. Structured results and the auxiliary figure are saved to result/evaluation/metrics.json and result/evaluation/comparison.png. Synthetic-data results validate the engineering workflow only and do not represent the paper's formal SAM online performance.
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 RF-ClimParam specifications.
Use of this repository's code, official model weights, and data remains subject to the licenses and terms of their respective projects.
中文说明
模型简介
RF-ClimParam 从高分辨率大气模拟中学习未解析的对流、云微物理、辐射、湍流扩散和地表通量过程,并为不同水平分辨率的粗网格气候模式提供稳定的次网格参数化(parameterization)。主要用途包括多分辨率气候模拟、参数化的尺度依赖分析和降水气候统计量重建。
论文:面向多种分辨率气候模拟的稳定次网格过程机器学习参数化
https://arxiv.org/abs/2001.03151
模型描述
RF-ClimParam 复现的方法由麻省理工学院的 Janni Yuval 和 Paul A. O'Gorman 提出。论文使用 System for Atmospheric Modeling 的三维高分辨率水球模拟所提供的粗粒化状态、瞬时物理倾向、湍流扩散率和地表通量训练随机森林。该模型适用于多分辨率大气次网格参数化、粗分辨率气候模拟,以及平均和极端降水统计量评估。
使用场景
| 使用场景 | 说明 |
|---|---|
| 多分辨率参数化 | 分别在 x4/x8/x16/x32 上预测柱状倾向及扩散量。 |
| 联合多输出回归 | 在同一树叶节点上保留跨变量及跨层输出的均值,无需拆分输出。 |
| 离线工程评估 | 在四种完整的粗网格场上逐尺度、逐输出计算 R2 和 RMSE。 |
| 在线耦合代理 | 在额外的原生 x32 18×48 粗网格上评估纬向平均 3 h 降水及极值。 |
| ModelScope/OneCode 运行 | 在 ModelScope 或 OneCode 中验证数据生成、训练、推理(inference)、评估、可视化和模型权重(检查点)(checkpoint)流程。 |
| 多 GPU 训练 | 通过 torchrun 启动分布式数据并行训练。 |
使用指南
1.OneCode
通过 OneCode 在线环境体验智能一键 AI4S 编程。
2. 下载与安装
hf download OneScience-Group/RF-ClimParam --local-dir ./RF-ClimParam
cd RF-ClimParam
环境依赖
硬件要求
- 建议使用 GPU 或 DCU。随机森林本身使用 NumPy 在 CPU 上运行。
- 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
训练数据
python scripts/fake_data.py
本仓库使用少量结构化合成大气柱样本验证工程流程,针对 x4、x8、x16、x32 保留完整的 144×360、72×180、36×90 和 18×45 粗网格快照。数据保留全部 48 层及真实的 145→144 和 62→17 随机森林接口,仅减少快照数、采样的训练柱数和树数。合成温度、水分、凝结物、风及通量场具有空间和垂直相关性,仅用于验证多分辨率参数化、训练、推理和评估,无法代表官方 SAM 分布或论文性能。
训练
单设备训练
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
训练在每个分辨率的完整空间场中采样少量大气柱,分别拟合两组联合多输出随机森林。训练生成四种分辨率的模型参数和训练样本统计量,并保存到以下位置。
result/checkpoints/rf_climparam.pt
result/training/metrics.json
训练权重
本仓库未在 weight/ 下附带权重。原始论文提供不同分辨率的随机森林估计器,已发布的权重及模型产物可参阅作者的 OSF 存档 https://doi.org/10.17605/OSF.IO/36YPT.
推理
python scripts/inference.py
推理结果包含 x4、x8、x16 和 x32 分辨率下的参考目标及次网格过程预测,也包含完整空间场、诊断降水、各尺度网格位置信息及原生 x32 网格结果。全部数值结果保存到 result/output/predictions.npz。
评估与可视化
python scripts/result.py
评估结果包括全部四种分辨率下的次网格过程预测性能,以及用于粗网格降水的在线代理。可视化比较不同分辨率下的结果,并展示目标降水及预测降水的纬向分布。结构化结果及辅助图保存到 result/evaluation/metrics.json 和 result/evaluation/comparison.png。合成数据结果仅用于验证工程流程,无法代表论文中的 SAM 正式在线性能。
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 |
引用与许可证
本仓库是对公开 RF-ClimParam 规范的独立工程复现。
本仓库代码、官方模型权重及数据的使用仍受各自项目的许可证和条款约束。
- Downloads last month
- 23