jchen-utoronto / beps_hourly_site Goto Github PK
View Code? Open in Web Editor NEWBioshpere-atmosphere Exchange Process Simulator, hourly version for site.
License: GNU General Public License v3.0
Bioshpere-atmosphere Exchange Process Simulator, hourly version for site.
License: GNU General Public License v3.0
您好,模型的input数据 我看均是按照365天计算的,不知代码是否考虑了366天年份的情况
https://github.com/JChen-UToronto/BEPS_hourly_site/blob/master/soil_thermal_regime.c#L22-L31
L22 should be for (i = 1; i < p->n_layer; i++)
hi,
i am a dummy of program,but i want to use your project to complete my study,so,if i use visual studio,how can i run this project.
many thx
BEPS script might have the problem of memory leak.
I am trying to interface BEPS with Rcpp. Most work has been done. But results returned by BEPS
are different in different tries.
Any suggestion how to solve this problem?
https://github.com/rpkgs/rBEPS/blob/dev/Rcpp_debug.R
#! /usr/bin/Rscript
devtools::load_all()
# beps(system.file("examples/input", package = "rBEPS"))
library(data.table)
library(dplyr)
d_metro <- fread("inst/examples/input/p1_meteo.txt")
colnames(d_metro) <- c("day", "hour", "rad", "tem", "hum", "pre", "wind")
LAI <- read.table("inst/examples/input/p1_lai.txt") %>%
unlist() %>%
as.numeric()
opts <- c(
long = 120.5, lat = 30.5,
clumping = 0.85,
LC = 25,
soil_type = 8,
soiltemp = 2.2,
soilwater = 0.4115,
snowdepth = 0,
j_start = 1,
j_end = 1
)
func <- function() {
beps_main(indir, d_metro, LAI, opts) %>% mat2df() %>%
dplyr::select(-starts_with("npp"), -ends_with("resp"), -NEP) %>%
.[, -(1:4)]
}
indir <- "inst/examples/input"
res1 = func(); print(res1)
res2 = func(); print(res2)
diff = tibble::as_tibble(res1 - res2)
print(diff)
Results difference of 1st time and 2nd time
# A tibble: 24 × 6
GPP Net_Rad SH LH Trans Evap
<dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 -5.75e-10 -6.31e-8 1.36 -30.1 -8.15e-10 -4.41e- 2
2 -7.23e-11 1.24e-9 0.841 0.340 -1.12e-10 4.96e- 4
3 4.58e-10 2.77e-8 -0.00158 0.128 7.65e-10 1.87e- 4
4 1.18e- 9 8.06e-8 -0.00120 0.128 2.12e- 9 1.87e- 4
5 7.10e- 8 -1.93e-3 -0.00386 0.115 5.56e- 8 1.68e- 4
6 -1.23e- 7 4.40e-3 0.00352 0.0917 -1.19e- 7 1.34e- 4
7 -7.90e- 8 3.82e-3 0.00478 0.0679 -7.21e- 8 9.88e- 5
8 4.58e- 9 2.09e-7 0.00588 0.0508 6.82e- 9 7.43e- 5
9 -3.10e- 9 -1.41e-7 -0.0995 0.00759 -5.23e- 9 1.11e- 5
10 -1.10e-10 8.78e-4 -0.00736 0.0000175 2.55e- 8 1.78e-320
Julia is much easier to use, and more friendly to users.
It is amazing to find that BEPS in julia is about 2x faster than C.
The test case is at: https://github.com/CUG-hydro/BEPS.jl/blob/master/example_01.qmd.
Call for contributors for BEPS.jl.
In Line 422-424 https://github.com/JChen-UToronto/BEPS_hourly_site/blob/master/inter_prg.c#L422,
Ci_u_sunlit_old=Ci_o_sunlit_new;
Cs_u_sunlit_old=Cs_u_sunlit_new;
Gs_u_sunlit_old=Gs_o_sunlit_new; // m/s
might should be
Ci_u_sunlit_old=Ci_u_sunlit_new;
Cs_u_sunlit_old=Cs_u_sunlit_new;
Gs_u_sunlit_old=Gs_u_sunlit_new; // m/s
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.