Skip to content

Commit fb2c6d3

Browse files
authored
Release v6.3.1 (#250)
* Simulation output remains the same as the previous version. * SOILWAT2 updated to v8.1.1 * Fix methods that interact with depth of sapric conditions. * Fix scaling of daily meteorological variables.
2 parents 543655d + 5c9f371 commit fb2c6d3

19 files changed

+39
-10
lines changed

DESCRIPTION

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: rSOILWAT2
2-
Version: 6.3.0
2+
Version: 6.3.1
33
Title: An Ecohydrological Ecosystem-Scale Water Balance Simulation Model
4-
Description: Access to the C-based SOILWAT2 v8.1.0 and functionality for
4+
Description: Access to the C-based SOILWAT2 v8.1.1 and functionality for
55
SQLite-database of weather data.
66
Authors@R: c(
77
person(

NAMESPACE

+1
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,7 @@ exportMethods(swSite_SoilTemperatureFlag)
388388
exportMethods(swSite_SurfaceTempMethod)
389389
exportMethods(swSite_TranspCoefficients)
390390
exportMethods(swSite_TranspirationRegions)
391+
exportMethods(swSite_depthSapric)
391392
exportMethods(swSite_hasSWRCp)
392393
exportMethods(swSoils_Layers)
393394
exportMethods(swSoils_SWRCp)

NEWS.md

+9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
# rSOILWAT2 v6.3.1
2+
* Simulation output remains the same as the previous version.
3+
* `SOILWAT2` updated to v8.1.1
4+
5+
## Bugfix
6+
* Fix methods that interact with depth of sapric conditions.
7+
* Fix scaling of daily meteorological variables.
8+
9+
110
# rSOILWAT2 v6.3.0
211
## Breaking changes
312
* `SOILWAT2` updated to v8.1.0

R/A_swGenericMethods.R

+1
Original file line numberDiff line numberDiff line change
@@ -1766,6 +1766,7 @@ setGeneric(
17661766
#' @param object An object of class \code{\linkS4class{swSite}} or
17671767
#' \code{\linkS4class{swInputData}}.
17681768
#' @seealso \code{\linkS4class{swSite}} and \code{\linkS4class{swInputData}}
1769+
#' @exportMethod swSite_depthSapric
17691770
setGeneric(
17701771
"swSite_depthSapric",
17711772
function(object) standardGeneric("swSite_depthSapric")

R/F_swSite.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ setReplaceMethod(
449449
"swSite_depthSapric",
450450
signature = "swSite",
451451
definition = function(object, value) {
452-
object@has_swrcp <- isTRUE(as.logical(value))
452+
object@depth_sapric <- as.numeric(value)
453453
validObject(object)
454454
object
455455
}

data/sw_exampleData.rda

18 Bytes
Binary file not shown.

inst/extdata/example1/Input/outsetup.in

-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ TIMESTEP dy wk mo yr # must be lowercase
7474

7575
# Simulation output directory/filenames
7676
Output/ # Path for output files: / for same directory, or e.g., Output/; PROGRAMMER NOTE: This is currently the 13th position; if this changes then update function SW_Files.c/SW_F_read()
77-
logfile.log # Output file to which warnings, errors, and other important information is written (can also be stdout); relative to output directory
7877

7978
sw2_daily.csv # Output file if daily output time period was selected; relative to output directory
8079
sw2_weekly.csv # Output file if weekly output time period was selected; relative to output directory

inst/extdata/example1/Output/.gitignore

-4
This file was deleted.

inst/extdata/example1/files.in

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Input/domain.in
1414

1515
#--- Description of a model run
1616
Input/modelrun.in # Input file for model time: start - end years
17+
logs/logfile.log # Output file to which warnings, errors, and other important information is written (can also be stdout)
1718

1819
#--- Description of simulated site
1920
Input/siteparam.in # Input file for site location, initialization, and miscellaneous model parameters

src/SW_R_lib.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -993,12 +993,13 @@ SEXP sw_consts(void) {
993993
"eNCIn", "eNCInAtt", "eNCOutVars",
994994
"eDomain",
995995
"eModel",
996+
"eLog",
996997
"eSite", "eLayers", "eSWRCp",
997998
"eWeather", "eMarkovProb", "eMarkovCov", "eSky",
998999
"eVegProd", "eVegEstab",
9991000
"eCarbon",
10001001
"eSoilwat",
1001-
"eOutput", "eLog",
1002+
"eOutput",
10021003
"eOutputDaily", "eOutputWeekly", "eOutputMonthly", "eOutputYearly",
10031004
"eOutputDaily_soil", "eOutputWeekly_soil", "eOutputMonthly_soil", "eOutputYearly_soil"
10041005
};

tests/test_data/Ex1_input.rds

1 Byte
Binary file not shown.

tests/test_data/Ex2_input.rds

4 Bytes
Binary file not shown.

tests/test_data/Ex3_input.rds

1 Byte
Binary file not shown.

tests/test_data/Ex4_input.rds

1 Byte
Binary file not shown.

tests/test_data/Ex5_input.rds

0 Bytes
Binary file not shown.

tests/test_data/Ex6_input.rds

1 Byte
Binary file not shown.
Binary file not shown.

tests/testthat/test_WeatherData.R

+21
Original file line numberDiff line numberDiff line change
@@ -433,3 +433,24 @@ test_that("Weather data fixing", {
433433
)
434434

435435
})
436+
437+
438+
test_that("Weather data scaling", {
439+
swin <- rSOILWAT2::sw_exampleData
440+
441+
ref <- sw_exec(swin)
442+
443+
scalingParams <- setdiff(
444+
colnames(swWeather_MonScalingParams(swin)),
445+
"ShortWR" # ShortWR only works if we provide daily radiation as input
446+
)
447+
448+
for (k in seq_along(scalingParams)) {
449+
x <- swin
450+
swWeather_MonScalingParams(x)[, scalingParams[[k]]] <- 2
451+
res <- sw_exec(x)
452+
453+
# Expect that the scaled simulation produces different SWC than the default
454+
expect_false(isTRUE(all.equal(res@SWCBULK@Day, ref@SWCBULK@Day)))
455+
}
456+
})

0 commit comments

Comments
 (0)