PBL-Emulator

Model Introduction

PBL-Emulator uses domain-aware neural networks to diagnose same-timestamp vertical profiles of planetary-boundary-layer winds, temperature, and water vapor offline from near-surface states and forcing variables.

Paper: Fast domain-aware neural network emulation of a planetary boundary layer parameterization in a numerical weather forecast model
https://doi.org/10.5194/gmd-12-4261-2019

Model Description

The method was proposed by research teams in the Environmental Science Division and Mathematics and Computer Science Division at Argonne National Laboratory. The paper uses data from 1984-2005 generated by WRF v3.3.1 with NCEP-R2 forcing and the YSU planetary boundary layer scheme. The model is intended for offline diagnosis of PBL vertical profiles at the same timestamp, not forecasting future states.

Applicable Scenarios

Scenario Description
Offline PBL profile diagnosis Diagnose same-timestamp wind, temperature, and water-vapor profiles from existing near-surface states and forcing variables.
HPC/HAC vertical-dependency studies Validate adjacent-lower-level conditioning in HPC and all-lower-level conditioning in HAC.
Engineering validation Validate data generation, training, inference, evaluation, and visualization with structured synthetic data.
ModelScope/OneCode execution Validate structured data, training, inference, PBL-profile 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/PBL-Emulator --local-dir ./PBL-Emulator
cd PBL-Emulator

Environment Dependencies

Hardware Requirements

  • A GPU or DCU is recommended.
  • A CPU can be used to validate the workflow 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
pip install numpy pyyaml matplotlib

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
pip install numpy pyyaml matplotlib

Training Data

Each sample maps 16 near-surface state and forcing inputs to five outputs at 17 vertical positions at the same timestamp, from [N,16] to [N,17,5]. The structured synthetic data include diurnal and seasonal cycles, vertical structure, and physical relationships among heat, moisture, and wind. These data are for engineering validation only and do not represent WRF data distributions, dataset scale, or the paper's performance.

python scripts/fake_data.py

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

The default configuration reduces only the training duration from the paper protocol's 1,000 epochs to six epochs; it does not reduce the input or output dimensions. Formal experiments require the 1984-2005 WRF/NCEP-R2/YSU data and the complete training duration, and training artifacts are saved to:

result/checkpoints/pbl_emulator.pt
result/training/metrics.json

Trained Weights

No official paper weights are bundled under weight/, and no directly loadable pretrained checkpoint released by the paper authors was identified. The locally generated result/checkpoints/pbl_emulator.pt is an engineering checkpoint for the current data and must not be represented as an official pretrained weight.

Inference

python scripts/inference.py

Inference loads the training checkpoint and generates same-timestamp PBL vertical-profile diagnoses for the test samples. Complete numerical results are saved to:

result/output/predictions.npz

Evaluation and Visualization

python scripts/result.py

Evaluation reports per-variable errors and correlations and plots target and predicted profiles. Results on synthetic data are for engineering validation only and do not represent the paper's performance; outputs are saved to:

result/evaluation/metrics.json
result/evaluation/profiles.png

Official OneScience Information

Citation and License

This repository is an independent engineering reproduction of the public PBL-Emulator specifications; the paper text is licensed under CC BY 4.0, while the official paper code uses BSD-3-Clause.

Use of this repository's code, official model weights, and data remains subject to the licenses and terms of their respective projects.


中文说明

模型简介

PBL-Emulator 使用领域感知神经网络,根据近地面状态及强迫变量,离线诊断同一时间戳的行星边界层风、温度和水汽垂直廓线。

论文:数值天气预报(weather forecasting)模式中行星边界层参数化(parameterization)的快速领域感知神经网络模拟
https://doi.org/10.5194/gmd-12-4261-2019

模型描述

该方法由阿贡国家实验室环境科学部与数学和计算机科学部的研究团队提出。 论文使用 WRF v3.3.1 在 NCEP-R2 强迫及 YSU 行星边界层方案下生成的 1984-2005 年数据。 模型用于离线诊断同一时间戳的 PBL 垂直廓线,无法用于预报未来状态。

适用场景

场景 说明
离线 PBL 廓线诊断 根据已有的近地面状态和强迫变量,诊断同一时间戳的风、温度和水汽廓线。
HPC/HAC 垂直依赖研究 验证 HPC 以相邻下层为条件、HAC 以所有下层为条件的处理方式。
工程验证 使用结构化合成数据验证数据生成、训练、推理(inference)、评估和可视化。
ModelScope/OneCode 运行 在 ModelScope 或 OneCode 环境中验证结构化数据、训练、推理、PBL 廓线指标及可视化。
多 GPU 训练 通过 torchrun 验证分布式训练和模型权重(检查点)(checkpoint)流程。

使用指南

1.OneCode

通过 OneCode 在线环境体验智能一键 AI4S 编程。

体验智能一键 AI4S 编程

2. 下载与安装

hf download OneScience-Group/PBL-Emulator --local-dir ./PBL-Emulator
cd PBL-Emulator

环境依赖

硬件要求

  • 建议使用 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
pip install numpy pyyaml matplotlib

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
pip install numpy pyyaml matplotlib

训练数据

每个样本将 16 个近地面状态和强迫输入映射为同一时间戳 17 个垂直位置上的五项输出,形状从 [N,16] 变为 [N,17,5]。结构化合成数据包含日变化和季节循环、垂直结构,以及热量、水分和风之间的物理关系。这些数据仅用于工程验证,无法代表 WRF 数据分布、数据集规模或论文性能。

python scripts/fake_data.py

训练

单设备训练

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

默认配置仅将训练时长从论文规程的 1,000 轮缩短至六轮,输入和输出维度保持完整。正式实验需要 1984-2005 年 WRF/NCEP-R2/YSU 数据及完整训练时长。训练产物保存到以下位置。

result/checkpoints/pbl_emulator.pt
result/training/metrics.json

训练权重

weight/ 下未附带论文官方权重,也未找到论文作者发布的可直接加载的预训练模型权重(检查点)。本地生成的 result/checkpoints/pbl_emulator.pt 是适配当前数据的工程模型权重(检查点),不得视为官方预训练权重。

推理

python scripts/inference.py

推理加载训练的模型权重(检查点),生成测试样本在同一时间戳的 PBL 垂直廓线诊断结果。完整数值结果保存到以下位置。

result/output/predictions.npz

评估与可视化

python scripts/result.py

评估报告逐变量误差和相关系数,并绘制目标及预测廓线。合成数据结果仅用于工程验证,无法代表论文性能。输出保存到以下位置。

result/evaluation/metrics.json
result/evaluation/profiles.png

OneScience 官方信息

引用与许可证

本仓库是对公开 PBL-Emulator 规范的独立工程复现。论文文本采用 CC BY 4.0 许可证,论文官方代码采用 BSD-3-Clause。

本仓库代码、官方模型权重及数据的使用仍受各自项目的许可证和条款约束。

Downloads last month
23
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support