File size: 3,777 Bytes
6dce2fb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
---
license: apache-2.0
language:
- en
tags:
- OneScience
- Earth Science
- Land Surface
- CLM5
- Model Emulation
- Parameter Estimation
frameworks: PyTorch
---

<p align="center"><strong><span style="font-size: 30px;">CLM5-Emulator</span></strong></p>

# Model Introduction

CLM5-Emulator uses machine learning to emulate global biophysical responses of Community Land Model version 5. Six parameters drive predictions of GPP and LHF EOF components and bounded parameter estimation.

Paper: A machine learning approach to emulation and biophysical parameter estimation with the Community Land Model, version 5  
https://doi.org/10.5194/ascmo-6-223-2020

# Model Description

The model was proposed by researchers at NCAR and CERFACS. It was trained with GSWP3-driven CLM5 parameter perturbation ensembles and FLUXNET-MTE observational targets. Two independent feed-forward networks emulate GPP and LHF spatial components for surrogate modeling and biophysical parameter estimation.

# Use Cases

| Use Case | Description |
| :---: | :--- |
| CLM5 emulation | Predict GPP and LHF components from six parameters. |
| Parameter estimation | Search the bounded normalized parameter space. |
| Spatial reconstruction | Reconstruct global responses from EOF components. |
| ModelScope/OneCode execution | Validate structured data, training, inference, metrics, and visualization. |
| Multi-GPU training | Start multi-process training through `torchrun`. |

# Usage Instructions

```bash
hf download OneScience-Group/CLM5-Emulator --local-dir ./CLM5-Emulator
cd CLM5-Emulator
```

### 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 should install DTK 25.04.2 or a compatible OneScience-recommended version first.

**DCU Environment**

```bash
# 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**

```bash
# 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
```

```bash
python scripts/fake_data.py
python scripts/train.py
torchrun --nproc_per_node=2 --nnodes=1 --master_addr="localhost" --master_port=29500 scripts/train.py
python scripts/inference.py
python scripts/result.py
```

Synthetic data retain `[B,6]` inputs, independent GPP/LHF targets, three EOF modes, and the logical 4-by-5-degree grid. Both target networks participate in backpropagation, and single-process and two-process DDP training have been verified. Inference restores the checkpoint, produces components with shape `[8,2,3]` and fields with shape `[8,2,46,72]`, and verifies finite outputs. Training results are saved to `result/checkpoints/clm5_emulator.pt`; inference and evaluation results are saved under `result/output/` and `result/evaluation/`.

# 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 CLM5-Emulator specifications.

The original paper is licensed under CC BY 4.0; the paper, CLM5, GSWP3, and FLUXNET-MTE data remain subject to their respective licenses and terms.