Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development for v6.1.0 #245

Merged
merged 36 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
632354e
Prepare development for v6.1.0
dschlaep Jan 23, 2024
6720d04
Update to roxygen2 v7.3.0
dschlaep Jan 23, 2024
b0edff1
version functionality now handles missing version information
dschlaep Feb 15, 2024
d92eaea
Updated submodules branch name
niteflyunicorns Mar 2, 2024
3e14f4d
Incorporated the remainder of the domain functionality to enable spin…
niteflyunicorns Mar 2, 2024
7b07eeb
Added new spinup S4 class
niteflyunicorns Mar 2, 2024
a066780
Renamed rSW_Model.c to rSW_Domain.c and added partial domain integrat…
niteflyunicorns Mar 2, 2024
295c7e3
Renamed rSW_Model.h to rSW_Domain.h and added appropriate function pr…
niteflyunicorns Mar 4, 2024
6f06de1
Update to roxygen2 v7.3.1
dschlaep Apr 25, 2024
a44279b
Improved documentation of sw_meteo_obtain_DayMet()
dschlaep Apr 25, 2024
4ab52bd
Updated SOILWAT2 submodule with latest updates to integrate into rSOI…
niteflyunicorns Apr 30, 2024
28a9814
Updated rSOILWAT2 with spinup capabilities:
niteflyunicorns Apr 30, 2024
301fe35
Updating main functionality to handle new domain inputs (spinup):
niteflyunicorns Apr 30, 2024
97a5e2a
Updating new location for PathInfo struct across multiple files
niteflyunicorns Apr 30, 2024
665a21a
updated control functions to work with new spinup functionality.
niteflyunicorns Apr 30, 2024
acdc583
updating R files with appropriate generics and references to new spin…
niteflyunicorns Apr 30, 2024
95d86ef
residual updates from newly updated SOILWAT2 submodule
niteflyunicorns Apr 30, 2024
c3a14f7
Update submodule SOILWAT2 to latest devel commit
dschlaep May 3, 2024
a5da5cf
Merge branch 'release/devel_v6.1.0' into tmp
dschlaep May 3, 2024
0d20c59
Finalize implementation of spinup in rSOILWAT2
dschlaep May 7, 2024
9b79208
Fix previous commit
dschlaep May 17, 2024
ca2234c
Weather data extraction more robust
dschlaep May 17, 2024
ab6cd73
compare_weather(): now with correlation and mean time series
dschlaep May 17, 2024
737e342
Merge branch 'release/devel_v6.1.0' into feature_spinup
dschlaep May 17, 2024
02eb8a7
Fix compare_weather()
dschlaep May 17, 2024
315081f
Fix documentation of calc_SiteClimate() for R v4.4
dschlaep May 20, 2024
4762a7c
Merge branch 'release/devel_v6.1.0' into feature_spinup
dschlaep May 20, 2024
aa1c450
Update submodule SOILWAT2 to latest devel commit
dschlaep May 20, 2024
d1a5e6b
Feature spinup (#246)
dschlaep May 20, 2024
c7c73b7
Update submodule SOILWAT2 to latest devel commit
dschlaep May 31, 2024
dde63f7
Compile with C11 and improved SOILWAT2 library
dschlaep May 20, 2024
26c5b37
Update renamed SOILWAT2 macros
dschlaep May 31, 2024
f295f47
Update submodule
N1ckP3rsl3y Jul 10, 2024
7b4578b
Adjust code to SOILWAT2's output information separation
N1ckP3rsl3y Jul 10, 2024
e477397
Updates to script data-raw/prepare_testInput_objects.R for changes in…
dschlaep Jul 10, 2024
14b88c4
Finalize v6.1.0
dschlaep Jul 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
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 @@
) {
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 @@
#'
#' @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 @@
)
########################

#########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")

Check warning on line 820 in R/A_swGenericMethods.R

View check run for this annotation

Codecov / codecov/patch

R/A_swGenericMethods.R#L820

Added line #L820 was not covered by tests
)

#' \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
Loading