"test/git@developer.sourcefind.cn:OpenDAS/torchaudio.git" did not exist on "e6886a4d86de47c95cf0e2512a86c74f1147aadd"
README.md 3.7 KB
Newer Older
mashun1's avatar
veros  
mashun1 committed
1
2
# veros

mashun1's avatar
mashun1 committed
3
4
一个从 Fortran 语言转换为 Python 语言的通用循环海洋模型。

mashun1's avatar
veros  
mashun1 committed
5
6
7
8
9
10
## 论文

**Veros v0.1 – a fast and versatile ocean simulator in pure Python**

* https://gmd.copernicus.org/articles/11/3299/2018/

mashun1's avatar
mashun1 committed
11
12
13
14
15
16
17
18
## 模型结构

数值解是使用 Arakawa C 网格上的有限差分计算的,该网格在每个维度上都是交错的。示踪剂(如温度和盐度)的计算位置与纬向通量、经向通量和垂直通量(如速度 u、v 和 w)不同.

![alt text](readme_imgs/model.png)

## 算法原理

mashun1's avatar
mashun1 committed
19
主要通过求解诊断关系来获得压力,并使用多种湍流混合和涡旋混合闭合来模拟海洋环流中的非静水效应。
mashun1's avatar
mashun1 committed
20

mashun1's avatar
mashun1 committed
21
22
![alt text](readme_imgs/alg.png)

mashun1's avatar
veros  
mashun1 committed
23
24
25
26
27
28
29
30
## 环境配置

### Docker(方法一)
    
    docker pull image.sourcefind.cn:5000/dcu/admin/base/jax:0.4.23-ubuntu20.04-dtk24.04.1-py3.10

    docker run --shm-size 10g --network=host --name=veros --privileged --device=/dev/kfd --device=/dev/dri --group-add video --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -v 项目地址(绝对路径):/home/ -v /opt/hyhal:/opt/hyhal:ro -it <your IMAGE ID> bash

mashun1's avatar
mashun1 committed
31
    pip install -r requirements_extra.txt
mashun1's avatar
veros  
mashun1 committed
32
33
34
35
36
37
38
39
40
41

    python setup.py develop


### Dockerfile(方法二)

    docker build -t <IMAGE_NAME>:<TAG> .

    docker run --shm-size 10g --network=host --name=idmvton --privileged --device=/dev/kfd --device=/dev/dri --group-add video --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -v 项目地址(绝对路径):/home/ -v /opt/hyhal:/opt/hyhal:ro -it <your IMAGE ID> bash

mashun1's avatar
mashun1 committed
42
43
    pip install -r requirements_extra.txt

mashun1's avatar
veros  
mashun1 committed
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
    python setup.py develop


### Anaconda (方法三)

1、关于本项目DCU显卡所需的特殊深度学习库可从光合开发者社区下载安装:
https://developer.hpccube.com/tool/

    DTK驱动:dtk24.04
    python:python3.10
    jax: 0.4.23

Tips:以上dtk驱动、python、torch等DCU相关工具版本需要严格一一对应

2、其它非特殊库参照requirements.txt安装

mashun1's avatar
mashun1 committed
60
    pip install -r requirements_extra.txt
mashun1's avatar
veros  
mashun1 committed
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
94
95
96
97
98

    python setup.py develop

## 数据集



## 推理

### 快速应用

    # 以下是两个基本使用方法,可以查看`veros/setups`中的文件并对命令行进行相应的修改
    veros copy-setup acc 
    veros run acc/acc.py -b jax --device gpu --float-type float32

    veros copy-setup global_4deg
    veros run global_4deg/global_4deg.py -b jax --device gpu --float-type float32

注意:更多使用方法参考`https://veros.readthedocs.io/en/latest/introduction/introduction.html`

### benchmark

    cd benchmarks

    python acc_benchmark.py --timesteps 100 --size 30 42 15 -b jax --device gpu --float-type float32

    python isoneutral_benchmark.py --timesteps 100 --size 30 42 15 -b jax --device gpu --float-type float32

    python pressure_solver_benchmark.py --timesteps 100 --size 30 42 15 -b jax --device gpu --float-type float32

    python streamfunction_solver_benchmark.py --timesteps 100 --size 30 42 15 -b jax --device gpu --float-type float32

    python tdma_benchmark.py --timesteps 100 --size 30 42 15 -b jax --device gpu --float-type float32

### 数据分析

    analyze.ipynb

mashun1's avatar
mashun1 committed
99
注意:需运行`pip install jupyter`安装依赖并执行`jupyter notebook --no-browser --ip=0.0.0.0 --allow-root`启动服务以运行该程序。
mashun1's avatar
veros  
mashun1 committed
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127


## result

||psi|salt|temp|vsf_depth|
|:---:|:---:|:---:|:---:|:---:|
|K100_AI|![alt text](readme_imgs/image.png)|![alt text](readme_imgs/image-3.png)|![alt text](readme_imgs/image-5.png)|![alt text](readme_imgs/image-7.png)|


### 精度



## 应用场景

`海洋模拟`

### 热点应用行业

`气象,能源,海洋`

## 源码仓库及问题反馈

* https://developer.hpccube.com/codes/modelzoo/veros_jax

## 参考资料

* https://github.com/team-ocean/veros