Boreal Ecosystem Productivity Simulator in Julia
Dongdong Kong
BEPS.jl is alive in Julia now. All functions have been ported to Julia, and the performance is about 2.5 times faster than C version.
- Julia: 0.286327 seconds (822.38 k allocations: 22.998 MiB, 0.85% gc time)
- C : 0.787059 seconds (629.95 k allocations: 13.915 MiB)
Caution
BEPS.clang
only works under Windows.
-
For developers
git clone https://github.com/jl-pkgs/BEPS.jl cd BEPS.jl/deps git clone https://github.com/jl-pkgs/BEPS.c
-
For users
# In Julia ] add https://github.com/jl-pkgs/BEPS.jl
using BEPS
d = deserialize("data/p1_meteo")
lai = readdlm("examples/input/p1_lai.txt")[:]
par = (lon=120.5, lat=30.5, landcover=25, clumping=0.85,
soil_type=8, Tsoil=2.2,
soilwater=0.4115, snowdepth=0.0)
@time df_jl, df_ET_jl, Tg = besp_main(d, lai, par; version="julia");
Figure1: The bias of Julia version compared with C,
bias = (Julia - C)/ C
.
The bias of SH
is the largest due to double number accuracy, about 1.48%, which is acceptable.
Figure2: The variation of soil temperature at different depths.
See examples/example_01.qmd for details.
- 通量站上测试模型表现 (top1 task)
- 热浪期间,土壤温度的表现
- 土壤类型参数
- clumping index数据处理
-
LAMBDA
function in thephotosynthesis
module, the unit oflambda_ice
is error,333 J/kg
should be333000 J/kg
. -
snowpack_stage1:
snowrate_o
未被初始化,导致snowrate_o > 0
为true
.- 雪深最大设置为
10m
,防止不合理的不断累积:*depth_snow=min(*mass_snow_g/(*density_snow), 10.0);
-
snowpack_stage3:
max(mass_water_frozen,*depth_water*density_water)
,max
should bemin
-
snowpack: 积雪夏季不融化,
z_snow
不断增加,一直到无穷snowpack_stage3_jl
融雪和结冻条件的改正:
# con_melt = Tsnow > 0 && Tsnow_last <= 0 && ms_sup > 0 # con_frozen = Tsnow <= 0 && Tsnow_last > 0 && z_water > 0 con_melt = Tsnow > 0 && ms_sup > 0 con_frozen = Tsnow <= 0 && z_water > 0
ρ_snow
: 初始值设置为250 [kg m-3]
,避免在0
处跳动。z_snow
: 积雪深度,最大限制在10m
ρ_snow
: 传入状态变量state,前后沿用
-
Hourly BEPS model. https://github.com/JChen-UToronto/BEPS_hourly_site
-
Daily BEPS model developed by Jane Liu. https://github.com/JChen-UToronto/BEPS_D