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数据处理
-
LAMBDAfunction in thephotosynthesismodule, the unit oflambda_iceis error,333 J/kgshould 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),maxshould 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,前后沿用
- 植被光合中的叶片温度 传入参数有误,待修正
-
surface_temperature_jl中T_weighted求解公式错误,分子第二项漏写了z_snow,推导过程见:<docs/modules/TS_Case02.md>。 -
surface_temperature_jl中case02G_soilG_soil = G_snow * (T_soil_surf - T_soil1_last) / z_soil1 # wrong G_soil = κ_soil1 * (T_soil_surf - T_soil1_last) / Δz_soil1 # correct
-
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
-
统一C与Julia接口,https://github.com/CUG-hydro/BEPS.c



