Skip to content

Commit

Permalink
Release v6.1.0 (#245)
Browse files Browse the repository at this point in the history
* This version produces the same output as the previous version.

* `SOILWAT2` updated to v8.0.0 which now includes a simulation domain; however, this has no impact on `rSOILWAT2`.

## New features
* SOILWAT2 gained spin-up functionality (@niteflyunicorns, @dschlaep). A user-requested sequence of (random) years is simulated (without output) before the actual simulation run to provide better starting values (e.g., soil moisture, soil temperature).
  • Loading branch information
dschlaep authored Jul 15, 2024
2 parents 233217a + 14b88c4 commit f008e89
Show file tree
Hide file tree
Showing 102 changed files with 2,993 additions and 1,026 deletions.
11 changes: 3 additions & 8 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,29 @@
^backup$
^data-raw$
\.git*
^\.travis\.yml$
^appveyor\.yml$
^\.appveyor\.yml$
^\.appveyor_clear_cache\.txt$
^codecov\.yml$
^\.lintr$
^\.github$
^.*\.Rproj$
^\.Rproj\.user$
^cran-comments\.md$
^NEWS\.md$
^tests/
tests/rSOILWAT_IntegrationTestOutput
src/SOILWAT2/\.git
src/SOILWAT2/\.github
src/SOILWAT2/doc
src/SOILWAT2/build
src/SOILWAT2/external/googletest
src/SOILWAT2/tests
src/SOILWAT2/\.travis\.yml
src/SOILWAT2/appveyor\.yml
src/SOILWAT2/codecov\.yml
src/SOILWAT2/Doxyfile
src/SOILWAT2/README\.md
src/SOILWAT2/NEWS\.md
src/SOILWAT2/tools
src/SOILWAT2/\.LSAN_suppr\.txt
src/SOILWAT2/src/SW_Main\.c
src/SOILWAT2/src/SW_Output_mock\.c
src/SOILWAT2/.clang-format
src/SOILWAT2/external/.clang-format
src/*\.o
src/*\.so
src/*\.dll
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule "src/SOILWAT2"]
path = src/SOILWAT2
url = https://github.com/DrylandEcology/SOILWAT2
branch = master
branch = master
8 changes: 4 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: rSOILWAT2
Version: 6.0.4
Version: 6.1.0
Title: An Ecohydrological Ecosystem-Scale Water Balance Simulation Model
Description: Access to the C-based SOILWAT2 v7.2.0 and functionality for
Description: Access to the C-based SOILWAT2 v8.0.0 and functionality for
SQLite-database of weather data.
Authors@R: c(
person(
Expand Down Expand Up @@ -41,13 +41,13 @@ Remotes:
github::DrylandEcology/rSW2data,
github::DrylandEcology/rSW2exter
NeedsCompilation: yes
SystemRequirements: GNU make
SystemRequirements: USE_C11, GNU make
License: GPL-3
URL: https://github.com/DrylandEcology/rSOILWAT2
BugReports: https://github.com/DrylandEcology/rSOILWAT2/issues
Encoding: UTF-8
Config/testthat/edition: 3
RoxygenNote: 7.2.3
RoxygenNote: 7.3.2
LazyData: true
Language: en-US
VignetteBuilder: knitr
15 changes: 15 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ export(set_swProd)
export(set_swSWC)
export(set_swSite)
export(set_swSoils)
export(set_swSpinup)
export(set_swWeather)
export(set_swWeatherData)
export(set_swYears)
Expand All @@ -133,6 +134,7 @@ export(swSWC)
export(swSWC_hist)
export(swSite)
export(swSoils)
export(swSpinup)
export(swWeather)
export(swWeatherData)
export(swYears)
Expand Down Expand Up @@ -177,6 +179,7 @@ exportClasses(swSWC)
exportClasses(swSWC_hist)
exportClasses(swSite)
exportClasses(swSoils)
exportClasses(swSpinup)
exportClasses(swWeather)
exportClasses(swWeatherData)
exportClasses(swYears)
Expand All @@ -194,6 +197,7 @@ exportMethods("set_swProd<-")
exportMethods("set_swSWC<-")
exportMethods("set_swSite<-")
exportMethods("set_swSoils<-")
exportMethods("set_swSpinup<-")
exportMethods("set_swWeather<-")
exportMethods("set_swWeatherData<-")
exportMethods("set_swYears<-")
Expand Down Expand Up @@ -272,6 +276,11 @@ exportMethods("swSite_TranspirationRegions<-")
exportMethods("swSite_hasSWRCp<-")
exportMethods("swSoils_Layers<-")
exportMethods("swSoils_SWRCp<-")
exportMethods("swSpinup_SpinupActive<-")
exportMethods("swSpinup_SpinupDuration<-")
exportMethods("swSpinup_SpinupMode<-")
exportMethods("swSpinup_SpinupScope<-")
exportMethods("swSpinup_SpinupSeed<-")
exportMethods("swWeather_DaysRunningAverage<-")
exportMethods("swWeather_FirstYearHistorical<-")
exportMethods("swWeather_MonScalingParams<-")
Expand All @@ -297,6 +306,7 @@ exportMethods(get_swProd)
exportMethods(get_swSWC)
exportMethods(get_swSite)
exportMethods(get_swSoils)
exportMethods(get_swSpinup)
exportMethods(get_swWeather)
exportMethods(get_swWeatherData)
exportMethods(get_swYears)
Expand Down Expand Up @@ -374,6 +384,11 @@ exportMethods(swSite_TranspirationRegions)
exportMethods(swSite_hasSWRCp)
exportMethods(swSoils_Layers)
exportMethods(swSoils_SWRCp)
exportMethods(swSpinup_SpinupActive)
exportMethods(swSpinup_SpinupDuration)
exportMethods(swSpinup_SpinupMode)
exportMethods(swSpinup_SpinupScope)
exportMethods(swSpinup_SpinupSeed)
exportMethods(swWeather_DaysRunningAverage)
exportMethods(swWeather_FirstYearHistorical)
exportMethods(swWeather_MonScalingParams)
Expand Down
12 changes: 12 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# rSOILWAT2 v6.1.0-9000
* This version produces the same output as the previous version.
* `SOILWAT2` updated to v8.0.0 which now includes a simulation domain;
however, this has no impact on `rSOILWAT2`.

## New features
* SOILWAT2 gained spin-up functionality (@niteflyunicorns, @dschlaep).
A user-requested sequence of (random) years is simulated (without output)
before the actual simulation run to provide better starting values
(e.g., soil moisture, soil temperature).


# rSOILWAT2 v6.0.4
* This version produces the same output as the previous version.

Expand Down
136 changes: 134 additions & 2 deletions R/A_swGenericMethods.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ setMethod(
tmp <- try(inherits(object, "numeric_version"), silent = TRUE)
if (inherits(tmp, "try-error") || !isTRUE(tmp)) {
tmp <- try(object@version, silent = TRUE)
if (inherits(tmp, "try-error")) {
if (length(tmp) == 0L || inherits(tmp, "try-error")) {
NA_character_
} else {
as.character(as.numeric_version(tmp))
Expand Down Expand Up @@ -105,7 +105,7 @@ check_version <- function(
) {
has <- get_version(object)

if (is.na(has) || is.na(expected_version)) {
if (length(has) == 0L || is.na(has) || is.na(expected_version)) {
FALSE

} else {
Expand Down Expand Up @@ -208,6 +208,10 @@ format_timestamp <- function(object) {
#'
#' @section Details:
#' List of changes:
#' * Changes with `v6.1.0`:
#' * class [`swInputData-class`]:
#' new slot `"spinup"` of new class [`swSpinup-class`]
#' * class [`swFiles-class`]: new total of 27 input files
#' * Changes with `v6.0.0`:
#' * class [`swSite-class`]:
#' new slots `"swrc_flags"`, `"has_swrcp"`, and
Expand Down Expand Up @@ -747,6 +751,134 @@ setGeneric(
)
########################

#########DOMAIN#########
#' \code{get_swSpinup}
#' @param object An object of class \code{\linkS4class{swSpinup}} or
#' \code{\linkS4class{swInputData}}.
#' @seealso \code{\linkS4class{swSpinup}} and \code{\linkS4class{swInputData}}
setGeneric(
"get_swSpinup",
function(object) standardGeneric("get_swSpinup")
)

#' \code{swSpinup_SpinupMode}
#' @param object An object of class \code{\linkS4class{swSpinup}} or
#' \code{\linkS4class{swInputData}}.
#' @seealso \code{\linkS4class{swSpinup}} and \code{\linkS4class{swInputData}}
setGeneric(
"swSpinup_SpinupActive",
function(object) standardGeneric("swSpinup_SpinupActive")
)

#' \code{swSpinup_SpinupMode}
#' @param object An object of class \code{\linkS4class{swSpinup}} or
#' \code{\linkS4class{swInputData}}.
#' @seealso \code{\linkS4class{swSpinup}} and \code{\linkS4class{swInputData}}
setGeneric(
"swSpinup_SpinupMode",
function(object) standardGeneric("swSpinup_SpinupMode")
)

#' \code{swSpinup_SpinupScope}
#' @param object An object of class \code{\linkS4class{swSpinup}} or
#' \code{\linkS4class{swInputData}}.
#' @seealso \code{\linkS4class{swSpinup}} and \code{\linkS4class{swInputData}}
setGeneric(
"swSpinup_SpinupScope",
function(object) standardGeneric("swSpinup_SpinupScope")
)

#' \code{swSpinup_SpinupDuration}
#' @param object An object of class \code{\linkS4class{swSpinup}} or
#' \code{\linkS4class{swInputData}}.
#' @seealso \code{\linkS4class{swSpinup}} and \code{\linkS4class{swInputData}}
setGeneric(
"swSpinup_SpinupDuration",
function(object) standardGeneric("swSpinup_SpinupDuration")
)

#' \code{swSpinup_SpinupSeed}
#' @param object An object of class \code{\linkS4class{swSpinup}} or
#' \code{\linkS4class{swInputData}}.
#' @seealso \code{\linkS4class{swSpinup}} and \code{\linkS4class{swInputData}}
setGeneric(
"swSpinup_SpinupSeed",
function(object) standardGeneric("swSpinup_SpinupSeed")
)

# Need to define and export this generic method -- otherwise,
# \code{\link{set_swSpinup<-}} doesn't work.
#' \code{set_swSpinup}
#'
#' @param object An object of class \code{\linkS4class{swSpinup}} or
#' \code{\linkS4class{swInputData}}.
#' @param value A value to assign to a specific slot of the \code{object}.
#'
#' @export
setGeneric(
"set_swSpinup",
function(object, value) standardGeneric("set_swSpinup")
)

#' \code{set_swSpinup<-}
#' @inheritParams set_swSpinup
#' @seealso \code{\linkS4class{swSpinup}} and \code{\linkS4class{swInputData}}
setGeneric(
"set_swSpinup<-",
function(object, value) standardGeneric("set_swSpinup<-")
)

#' \code{swSpinup_SpinupActive<-}
#' @param object An object of class \code{\linkS4class{swSpinup}} or
#' \code{\linkS4class{swInputData}}.
#' @param value A value to assign to a specific slot of the \code{object}.
#' @seealso \code{\linkS4class{swSpinup}} and \code{\linkS4class{swInputData}}
setGeneric(
"swSpinup_SpinupActive<-",
function(object, value) standardGeneric("swSpinup_SpinupActive<-")
)

#' \code{swSpinup_SpinupMode<-}
#' @param object An object of class \code{\linkS4class{swSpinup}} or
#' \code{\linkS4class{swInputData}}.
#' @param value A value to assign to a specific slot of the \code{object}.
#' @seealso \code{\linkS4class{swSpinup}} and \code{\linkS4class{swInputData}}
setGeneric(
"swSpinup_SpinupMode<-",
function(object, value) standardGeneric("swSpinup_SpinupMode<-")
)

#' \code{swSpinup_SpinupScope<-}
#' @param object An object of class \code{\linkS4class{swSpinup}} or
#' \code{\linkS4class{swInputData}}.
#' @param value A value to assign to a specific slot of the \code{object}.
#' @seealso \code{\linkS4class{swSpinup}} and \code{\linkS4class{swInputData}}
setGeneric(
"swSpinup_SpinupScope<-",
function(object, value) standardGeneric("swSpinup_SpinupScope<-")
)

#' \code{swSpinup_SpinupDuration<-}
#' @param object An object of class \code{\linkS4class{swSpinup}} or
#' \code{\linkS4class{swInputData}}.
#' @param value A value to assign to a specific slot of the \code{object}.
#' @seealso \code{\linkS4class{swSpinup}} and \code{\linkS4class{swInputData}}
setGeneric(
"swSpinup_SpinupDuration<-",
function(object, value) standardGeneric("swSpinup_SpinupDuration<-")
)

#' \code{swSpinup_SpinupSeed<-}
#' @param object An object of class \code{\linkS4class{swSpinup}} or
#' \code{\linkS4class{swInputData}}.
#' @param value A value to assign to a specific slot of the \code{object}.
#' @seealso \code{\linkS4class{swSpinup}} and \code{\linkS4class{swInputData}}
setGeneric(
"swSpinup_SpinupSeed<-",
function(object, value) standardGeneric("swSpinup_SpinupSeed<-")
)
########################

########WEATHER#########
#' \code{get_swWeather}
#' @param object An object of class \code{\linkS4class{swWeather}} or
Expand Down
Loading

0 comments on commit f008e89

Please sign in to comment.