Coder Social home page Coder Social logo

jchen-utoronto / beps_hourly_site Goto Github PK

View Code? Open in Web Editor NEW
34.0 34.0 19.0 1.18 MB

Bioshpere-atmosphere Exchange Process Simulator, hourly version for site.

License: GNU General Public License v3.0

C 23.13% Makefile 2.55% CMake 0.05% HTML 69.98% CSS 3.10% JavaScript 1.19%

beps_hourly_site's Issues

bugs in `snowpack`

mass_snow_o_last is completely overwrited before pass value to others

mass_snow_o_last=*mass_snow_o;
mass_snow_u_last=*mass_snow_u;
mass_snow_g_last=*mass_snow_g;

I think those 3 lines should be removed

It will lead to the initial value Wcs_o[0]=var_o[16] never used.

Wcs_o[0]=var_o[16] ; /* the mass of intercepted liquid water and snow, overstory */

snowpack_stage1(temp_air, precip, Wcs_o[kkk-1],Wcs_u[kkk-1],Wg_snow[kkk-1],
&Wcs_o[kkk],&Wcs_u[kkk],&Wg_snow[kkk], lai_o,lai_u,clumping,
&Ac_snow_o[kkk], &Ac_snow_u[kkk], &Xcs_o[kkk], &Xcs_u[kkk], &Xg_snow[kkk] ,
&rho_snow[kkk], &Zsp, &alpha_v_sw[kkk], &alpha_n_sw[kkk]);

how can i use this

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

memory leak

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.