Skip to content

Commit

Permalink
Merge branch 'main' of github.com:geco-bern/grsofun
Browse files Browse the repository at this point in the history
  • Loading branch information
stineb committed Jul 8, 2024
2 parents 8b6ad8e + 0bf3635 commit 59e4a2a
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 5 deletions.
7 changes: 5 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 11 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -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)
1 change: 1 addition & 0 deletions R/grsofun.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#' @export
grsofun <- function(par, settings){

# Convert forcing files to a tidy format
Expand Down
3 changes: 2 additions & 1 deletion R/grsofun_collect.R
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -86,6 +86,7 @@ grsofun_collect <- function(
}


#' @export
grsofun_collect_byilon <- function(
ilon,
settings,
Expand Down
6 changes: 4 additions & 2 deletions R/grsofun_run.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#' @export
grsofun_run <- function(par, settings){

if (settings$nthreads == 1){
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -121,6 +121,7 @@ grsofun_run_bychunk <- function(chunk, nthreads, par, settings){

}

#' @export
grsofun_run_byilon <- function(ilon, par, settings){

# xxx test: ilon = 388
Expand Down Expand Up @@ -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"){
Expand Down
2 changes: 2 additions & 0 deletions R/grsofun_tidy.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#' @export
grsofun_tidy <- function(settings){

# land mask and elevation in one
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 59e4a2a

Please sign in to comment.