Skip to content

Commit

Permalink
updated ensemble download for GEE
Browse files Browse the repository at this point in the history
  • Loading branch information
stineb committed Mar 16, 2020
1 parent e1cf22d commit 2bc34fd
Show file tree
Hide file tree
Showing 27 changed files with 156 additions and 11,932 deletions.
49 changes: 8 additions & 41 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,45 +1,12 @@
Package: rsofun
Title: A package for handling the SOFUN model framework for simulating processes
in terrestrial ecosystems
Version: 0.0.0.9000
Authors@R: c(person("Benjamin", "Stocker", email = "[email protected]", role = c("aut", "cre")),
person("Joan", "Maspons", email = "[email protected]", role = c("aut")))
Description: This package provides functions for all the routine steps in
running the SOFUN model, including setup of the model environment, preparation
of input files, calibrating model parameters, running the model, reading outputs
into R, and evaluating outputs (benchmarking).
Title: Implements the SOFUN modelling framework for simulating terrestrial processes, including model
calibration and benchmarking.
Version: 0.3.0
Authors@R: c(person("Benjamin", "Stocker", email = "[email protected]", role = c("aut", "cre")))
Description: Implements the SOFUN modelling framework for simulating terrestrial processes, including model
calibration and benchmarking.
License: GPL-3
SystemRequirements: This package uses bash scripts to run NCO (http://
nco.sourceforge.net/) and CDO (https://code.mpimet.mpg.de/) commands.
LazyData: true
Imports:
dplyr,
ggplot2,
lubridate,
Metrics,
mgcv,
ncdf4,
optimr,
purrr,
readr,
rlang,
stringr,
tidyr,
LSD,
GenSA,
Suggests:
BayesianTools,
caret,
gplots,
hydroGOF,
maps,
maptools,
neuralnet,
nnet,
raster,
sp,
testthat,
knitr,
rmarkdown
RoxygenNote: 7.0.2
Depends: dplyr, purrr, lubridate, tidyr, raster, lubridate, stringi, sp, gensa, stringr, rland, readr
RoxygenNote: 7.1.0
VignetteBuilder: knitr
16 changes: 10 additions & 6 deletions R/collect_drivers_sofun.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,29 @@
#' Collect all drivers for site-level simulations into a nested data frame with one row for each site
#'
#' @param settings A named list containing the simulation settings (see vignette_rsofun.pdf for more information and examples).
#' @param forcing A data frame containing the model forcing for each model time step.
#' @param meteo A data nested data frame with rows for each site and meteo forcing data time series nested inside a column named \code{"data"}
#' @param fapar A data nested data frame with rows for each site and fAPAR forcing data time series nested inside a column named \code{"data"}
#' @param df_soiltexture
#'
#' @return
#' @export
#'
#' @examples mod <- collect_drivers_sofun( settings = settings, forcing, df_soiltexture )
#'
collect_drivers_sofun <- function( settings, forcing, df_soiltexture ){
collect_drivers_sofun <- function( settings, meteo, fapar, df_soiltexture ){

## create mega-df containing all forcing data and parameters that vary by site (not model parameters!)
names_metainfo <- names(settings)[-which(names(settings) %in% c("sitename", "params_siml"))]
df_mega <- settings %>%
tidyr::nest(siteinfo = names_metainfo) %>%
left_join(
forcing %>%
group_by(sitename) %>%
tidyr::nest() %>%
rename(forcing = data),
meteo %>%
rename(meteo = data),
by = "sitename"
) %>%
left_join(
fapar %>%
rename(fapar = data),
by = "sitename"
) %>%
mutate(df_soiltexture = purrr::map(as.list(seq(nrow(.))), ~return(df_soiltexture)))
Expand Down
31 changes: 0 additions & 31 deletions R/download_file_cx1.R

This file was deleted.

89 changes: 0 additions & 89 deletions R/download_from_remote.R

This file was deleted.

73 changes: 0 additions & 73 deletions R/load_depencendies_rsofun.R

This file was deleted.

3 changes: 2 additions & 1 deletion R/prepare_setup_sofun.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ prepare_setup_sofun <- function( siteinfo, params_siml ){
dplyr::mutate(tmp = 1) %>%
dplyr::right_join(mutate(siteinfo, tmp = 1), by = "tmp") %>%
dplyr::select(names(siteinfo), names(params_siml)) %>%
dplyr::rename(nyeartrend = years_data, firstyeartrend = year_start) %>%
dplyr::mutate(nyeartrend = year_end - year_start + 1) %>%
dplyr::rename(firstyeartrend = year_start) %>%
tidyr::nest(params_siml = c(names(params_siml), "firstyeartrend", "nyeartrend"))

return(siteinfo)
Expand Down
5 changes: 0 additions & 5 deletions R/run_sofun_f_bysite.R
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,6 @@ run_sofun_f_bysite <- function( sitename, params_siml, siteinfo, forcing, df_soi
calc_aet_fapar_vpd = as.logical(params_siml$calc_aet_fapar_vpd),
in_ppfd = as.logical(params_siml$in_ppfd),
in_netrad = as.logical(params_siml$in_netrad),
const_clim_year = as.integer(params_siml$const_clim_year),
const_lu_year = as.integer(params_siml$const_lu_year),
const_co2_year = as.integer(params_siml$const_co2_year),
const_ndep_year = as.integer(params_siml$const_ndep_year),
const_nfert_year = as.integer(params_siml$const_nfert_year),
outdt = as.integer(params_siml$outdt),
ltre = as.logical(params_siml$ltre),
ltne = as.logical(params_siml$ltne),
Expand Down
Binary file modified inst/.DS_Store
Binary file not shown.
18 changes: 0 additions & 18 deletions inst/bash/extract_pointdata_byfil.sh

This file was deleted.

Loading

0 comments on commit 2bc34fd

Please sign in to comment.