diff --git a/DESCRIPTION b/DESCRIPTION index dab1fd5..0f97239 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -21,11 +21,14 @@ Imports: multidplyr, parallel, map2tidy, - rgeco + rsofun, Suggests: here, cowplot, rnaturalearth, - ggplot2 + ggplot2, +Remotes: + geco-bern/map2tidy, + geco-bern/rsofun, Roxygen: list(markdown = TRUE) RoxygenNote: 7.3.1 diff --git a/NAMESPACE b/NAMESPACE new file mode 100644 index 0000000..7796b74 --- /dev/null +++ b/NAMESPACE @@ -0,0 +1,11 @@ +# Generated by roxygen2: do not edit by hand + +export(grsofun) +export(grsofun_collect) +export(grsofun_collect_byilon) +export(grsofun_run) +export(grsofun_run_bychunk) +export(grsofun_run_byilon) +export(grsofun_tidy) +export(grsofun_tidy_byvar) +export(read_forcing_byvar_byilon) diff --git a/R/grsofun.R b/R/grsofun.R index b5d8922..0e43c54 100644 --- a/R/grsofun.R +++ b/R/grsofun.R @@ -1,3 +1,4 @@ +#' @export grsofun <- function(par, settings){ # Convert forcing files to a tidy format diff --git a/R/grsofun_collect.R b/R/grsofun_collect.R index a76a94d..14ff64f 100644 --- a/R/grsofun_collect.R +++ b/R/grsofun_collect.R @@ -1,7 +1,7 @@ # Reads daily output and aggregates temporally. Returning the data is optional. # By default, the aggregated data is written to tidy files by longitudinal bands. - +#' @export grsofun_collect <- function( settings, return_data = FALSE @@ -86,6 +86,7 @@ grsofun_collect <- function( } +#' @export grsofun_collect_byilon <- function( ilon, settings, diff --git a/R/grsofun_run.R b/R/grsofun_run.R index ecc35a9..1825f10 100644 --- a/R/grsofun_run.R +++ b/R/grsofun_run.R @@ -1,3 +1,4 @@ +#' @export grsofun_run <- function(par, settings){ if (settings$nthreads == 1){ @@ -35,7 +36,6 @@ grsofun_run <- function(par, settings){ "magrittr", "readr", "grsofun", - "rgeco" )) |> multidplyr::cluster_assign( grsofun_run_byilon = grsofun_run_byilon, # make the function known for each core @@ -70,6 +70,7 @@ grsofun_run <- function(par, settings){ } +#' @export grsofun_run_bychunk <- function(chunk, nthreads, par, settings){ # XXX: make this a system call for running a script containing this code @@ -99,7 +100,6 @@ grsofun_run_bychunk <- function(chunk, nthreads, par, settings){ "magrittr", "readr", "grsofun", - "rgeco" )) |> multidplyr::cluster_assign( grsofun_run_byilon = grsofun_run_byilon, # make the function known for each core @@ -121,6 +121,7 @@ grsofun_run_bychunk <- function(chunk, nthreads, par, settings){ } +#' @export grsofun_run_byilon <- function(ilon, par, settings){ # xxx test: ilon = 388 @@ -514,6 +515,7 @@ grsofun_run_byilon <- function(ilon, par, settings){ } +#' @export read_forcing_byvar_byilon <- function(var, ilon, settings){ if (settings$source_climate == "watch-wfdei"){ diff --git a/R/grsofun_tidy.R b/R/grsofun_tidy.R index 9755946..aa852e7 100644 --- a/R/grsofun_tidy.R +++ b/R/grsofun_tidy.R @@ -1,3 +1,4 @@ +#' @export grsofun_tidy <- function(settings){ # land mask and elevation in one @@ -79,6 +80,7 @@ grsofun_tidy <- function(settings){ return(settings) } +#' @export grsofun_tidy_byvar <- function(var, settings){ # consider data product-specific directory structure and netcdf variable and