Skip to content

Commit

Permalink
added package specification
Browse files Browse the repository at this point in the history
  • Loading branch information
stineb committed Jul 8, 2024
1 parent 9b07f58 commit 8b6ad8e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 6 additions & 4 deletions R/grsofun_run.R
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,11 @@ grsofun_run_byilon <- function(ilon, par, settings){
dplyr::mutate(
Tair = Tair - 273.15, # K -> deg C
ppfd = SWdown * kfFEC * 1.0e-6, # W m-2 -> mol m-2 s-1
vapr = calc_vp(
vapr = rgeco::calc_vp(
qair = Qair,
patm = PSurf
),
vpd = calc_vpd(
vpd = rgeco::calc_vpd(
eact = vapr,
tc = Tair,
patm = PSurf
Expand Down Expand Up @@ -269,15 +269,17 @@ grsofun_run_byilon <- function(ilon, par, settings){
year_start <- min(lubridate::year(dates))
year_end <- max(lubridate::year(dates))

ddf <- dplyr::tibble(
# create a data frame that spans all dates between start and end of simulation
# consider only complete years
ddf <- dplyr::tibble(
date = seq(
from = lubridate::ymd(paste0(year_start, "-01-01")),
to = lubridate::ymd(paste0(year_end, "-12-31")),
by = "days"
))

# function to linearly interpolate (leaves trailing NAs)
interpolate2daily_fpar <- function(df, ddf){
# linearly interpolate (leaves trailing NAs)
ddf <- ddf |>
dplyr::left_join(
df,
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ library(cowplot)

### Specify settings

Note: currently, {grsofun} is set up run in demo mode with a prescribed constant CO2 and globally uniform constant cloud cover. This is to be accounted for by reading from data.

``` r
settings <- list(
fileprefix = "test", # simulation name defined by the user
Expand Down

0 comments on commit 8b6ad8e

Please sign in to comment.