Skip to content

Commit

Permalink
Update to rSOILWAT2 v3.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
dschlaep committed Oct 18, 2019
1 parent 66c1bbb commit eaef9d0
Show file tree
Hide file tree
Showing 7 changed files with 223 additions and 140 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: rSFSW2
Title: Simulation Framework for SOILWAT2
Version: 4.1.0
Date: 2019-10-16
Date: 2019-10-18
Authors@R: c(
person("Daniel", "Schlaepfer", email = "daniel.schlaepfer@yale.edu",
comment = c(ORCID = "0000-0001-9973-2065"), role = c("aut", "cre")),
Expand All @@ -14,7 +14,7 @@ Description: Setting up, carrying out, and analyzing ecosystem water balance
Depends:
R (>= 3.5.0)
Imports:
rSOILWAT2 (>= 3.0.0),
rSOILWAT2 (>= 3.1.3),
RSQLite (>= 2.1.1),
DBI (>= 1.0),
Rcpp (>= 0.12.12),
Expand Down
Binary file modified R/sysdata.rda
Binary file not shown.
27 changes: 21 additions & 6 deletions data-raw/1_Input/treatments/tr_cloudin/climate.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
71.0 61.0 61.0 51.0 41.0 31.0 23.0 23.0 31.0 41.0 61.0 61.0 # (site: testing), sky cover (sunrise-sunset),%,Climate Atlas of the US,http://cdo.ncdc.noaa.gov/cgi-bin/climaps/climaps.pl
1.3 2.9 3.3 3.8 3.8 3.8 3.3 3.3 2.9 1.3 1.3 1.3 # Wind speed (m/s),Climate Atlas of the US,http://cdo.ncdc.noaa.gov/cgi-bin/climaps/climaps.pl
61.0 61.0 61.0 51.0 51.0 51.0 41.0 41.0 51.0 51.0 61.0 61.0 # rel. Humidity (%),Climate Atlas of the US,http://cdo.ncdc.noaa.gov/cgi-bin/climaps/climaps.pl
1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 # transmissivity (rel), only used in petfunc, but falls out of the equations (a = trans * b, c = a / trans)
213.7 241.6 261.0 308.0 398.1 464.5 0.0 0.0 0.0 140.0 161.6 185.1 # snow density (kg/m3): Brown, R. D. and P. W. Mote. 2009. The response of Northern Hemisphere snow cover to a changing climate. Journal of Climate 22:2124-2145.
1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 # m = number of precipitation events per day
#------ Input file for mean monthly atmospheric parameters

# Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec

# Sky cover (sunrise-sunset; percent)
71.0 61.0 61.0 51.0 41.0 31.0 23.0 23.0 31.0 41.0 61.0 61.0

# Wind speed (m / s)
1.3 2.9 3.3 3.8 3.8 3.8 3.3 3.3 2.9 1.3 1.3 1.3

# Relative humidity (%)
61.0 61.0 61.0 51.0 51.0 51.0 41.0 41.0 51.0 51.0 61.0 61.0

# Atmospheric transmissivity (relative)
1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0

# Snow density (kg / m3)
213.7 241.6 261.0 308.0 398.1 464.5 0.0 0.0 0.0 140.0 161.6 185.1

# Number of precipitation events per day
1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0
116 changes: 81 additions & 35 deletions data-raw/1_Input/treatments/tr_prodin/veg.in
Original file line number Diff line number Diff line change
@@ -1,48 +1,73 @@
# Plant production data file for SOILWAT2
# Location:
#------ Input file for land cover and vegetation types:
# parameters and mean monthly biomass values

# ---- Composition of vegetation type components (0-1; must add up to 1)
# Grasses Shrubs Trees Forbs BareGround
# USER: The vegetation composition and the mean monthly biomass values should
# be adjusted for site-specific run conditions.

# USER: Most of the other values in this file are parameters that
# describe the four available vegetation types and should not be
# modified unless a vegetation type itself is altered.


#---- Composition of vegetation type components (0-1; must add up to 1)
# Grasses Shrubs Trees Forbs BareGround
0.2 0.2 0.2 0.2 0.2


# ---- Albedo
# Grasses Shrubs Trees Forbs BareGround
0.167 0.143 0.106 0.167 0.15 # albedo: (Houldcroft et al. 2009) MODIS snowfree 'grassland', 'open shrub', ‘evergreen needle forest’ with MODIS albedo aggregated over pure IGBP cells where NDVI is greater than the 98th percentile NDVI
#---- Albedo
# Default values from Houldcroft et al. 2009:
# MODIS snowfree 'grassland', 'open shrub', ‘evergreen needle forest’ with
# MODIS albedo aggregated over pure IGBP cells where NDVI is greater than
# the 98th percentile NDVI

# Grasses Shrubs Trees Forbs BareGround
0.167 0.143 0.106 0.167 0.15


# -- Canopy height (cm) parameters either constant through season or as tanfunc with respect to biomass (g/m^2)
# Grasses Shrubs Trees Forbs
#--- Canopy height (cm) parameters
# Canopy height is either constant through season or
# is a function of monthly biomass (g / m^2)

# Grasses Shrubs Trees Forbs
300.0 0.0 0.0 300.0 # xinflec
29.5 5.0 5.0 29.5 # yinflec
85. 100. 3000. 85. # range
0.002 0.003 0.00008 0.002 # slope
0.0 50. 1200. 0.0 # if > 0 then constant canopy height (cm)


# --- Vegetation interception parameters: kSmax * log10(1 + LAI_live + kdead * LAI_dead)
# Grasses Shrubs Trees Forbs
1.0 2.6 2.0 1.0 # kSmax (mm)
1.0 0.1 0.01 0.5 # kdead (0-1 fraction)
#--- Vegetation interception parameters
# Equation: kSmax * log10(1 + LAI_live + kdead * LAI_dead)

# Grasses Shrubs Trees Forbs
1.0 2.6 2.0 1.0 # kSmax (mm)
1.0 0.1 0.01 0.5 # kdead (0-1 fraction)


#--- Litter interception parameters
# Equation: kSmax * log10(1 + litter_density)

# --- Litter interception parameters: kSmax * log10(1 + litter_density)
# Grasses Shrubs Trees Forbs
0.113 0.113 0.290 0.113 # kSmax (mm)
# Grasses Shrubs Trees Forbs
0.113 0.113 0.290 0.113 # kSmax (mm)


# ---- Parameter for partitioning of bare-soil evaporation and transpiration as in Es = exp(-param*LAI)
# Grasses Shrubs Trees Forbs
1. 1. 0.41 1. # Trees: According to a regression based on a review by Daikoku, K., S. Hattori, A. Deguchi, Y. Aoki, M. Miyashita, K. Matsumoto, J. Akiyama, S. Iida, T. Toba, Y. Fujita, and T. Ohta. 2008. Influence of evaporation from the forest floor on evapotranspiration from the dry canopy. Hydrological Processes 22:4083-4096.
#---- Parameter for partitioning of bare-soil evaporation and transpiration
# Equation: Es = exp(-param*LAI)
# Default value for trees derived from a regression based on data from a
# review by Daikoku et al. (2008) Hydrological Processes 22:4083-4096.

# Grasses Shrubs Trees Forbs
1. 1. 0.41 1.

# ---- Parameter for scaling and limiting bare soil evaporation rate: if totagb (g/m2) > param then no bare-soil evaporation
# Grasses Shrubs Trees Forbs
999. 999. 2099. 999. #

# --- Parameter for scaling and limiting bare soil evaporation rate
# If totagb (g / m2) > param then no bare-soil evaporation
# Grasses Shrubs Trees Forbs
999. 999. 2099. 999.

# --- Shade effects on transpiration based on live and dead biomass
# Grasses Shrubs Trees Forbs

#--- Shade effects on transpiration based on live and dead biomass
# Grasses Shrubs Trees Forbs
0.3 0.3 0.3 0.3 # shade scale
150. 150. 150. 150. # shade maximal dead biomass
300. 300. 0. 300. # tanfunc: xinflec
Expand All @@ -51,37 +76,58 @@
0.002 0.002 0.0002 0.002 # slope


# ---- Hydraulic redistribution: Ryel, Ryel R, Caldwell, Caldwell M, Yoder, Yoder C, Or, Or D, Leffler, Leffler A. 2002. Hydraulic redistribution in a stand of Artemisia tridentata: evaluation of benefits to transpiration assessed with a simulation model. Oecologia 130: 173-184.
# Grasses Shrubs Trees Forbs
#---- Hydraulic redistribution
# Implemenation based on Ryel et al. (2002) Oecologia 130: 173-184.
# Grasses Shrubs Trees Forbs
1 1 1 1 # flag to turn on/off (1/0) hydraulic redistribution
-0.2328 -0.2328 -0.2328 -0.2328 # maxCondroot - maximum radial soil-root conductance of the entire active root system for water (cm/-bar/day) = 0.097 cm/MPa/h
10. 10. 10. 10. # swp50 - soil water potential (-bar) where conductance is reduced by 50% = -1. MPa
3.22 3.22 3.22 3.22 # shapeCond - shaping parameter for the empirical relationship from van Genuchten to model relative soil-root conductance for water


# ---- Critical soil water potential (MPa), i.e., when transpiration rates cannot sustained anymore, for instance, for many crop species -1.5 MPa is assumed and called wilting point
# Grasses Shrubs Trees Forbs
#---- Critical soil water potential (MPa)
# Soil water potential below which transpiration rates cannot be sustained,
# for instance, for many crop species -1.5 MPa is assumed (wilting point)

# Grasses Shrubs Trees Forbs
-3.5 -3.9 -2.0 -2.0


# ---- CO2 Coefficients: multiplier = Coeff1 * x^Coeff2
# Coefficients assume that monthly biomass inputs reflect values for conditions at
# 360 ppm CO2, i.e., multiplier = 1 for x = 360 ppm CO2
# Grasses Shrubs Trees Forbs
#---- Effects of atmospheric CO2 concentrations
# Equation: multiplier = Coeff1 * x^Coeff2
# Coefficients assume that monthly biomass inputs reflect values for conditions
# at 360 ppm CO2, i.e., multiplier = 1 for x = 360 ppm CO2

# Grasses Shrubs Trees Forbs
0.1319 0.1319 0.1319 0.1319 # Biomass Coeff1
0.3442 0.3442 0.3442 0.3442 # Biomass Coeff2
25.158 25.158 25.158 25.158 # WUE Coeff1
-0.548 -0.548 -0.548 -0.548 # WUE Coeff2


# Grasslands component:
# -------------- Monthly production values ------------
#------ Mean monthly biomass values
# Input biomass per unit area (g / m2) for each vegetation type represent
# values as if that vegetation type covers 100% of the simulated surface.
# That way input biomass values are independent of the input composition values.
# For example,
# - inputs for forbs: fCover = 0.4, biomass = 300 g/m2
# - inputs for grasses: fCover = 0.6, biomass = 450 g/m2
# Then, SOILWAT2 simulates a surface with vegetation of
# fCover = 1 (= 0.4 + 0.6)
# and a
# total biomass = 390 g / m2 (= 0.4 * 300 + 0.6 * 450)
# of which
# forb biomass = 120 g / m2 (0.4 * 300)
# and
# grass biomass = 270 g/m2 (= 0.6 * 450).

# Litter - dead leafy material on the ground (g/m^2 ).
# Biomass - living and dead/woody aboveground standing biomass (g/m^2).
# %Live - proportion of Biomass that is actually living (0-1.0).
# LAI_conv - monthly amount of biomass needed to produce LAI=1.0 (g/m^2).
# There should be 12 rows, one for each month, starting with January.
#

# Grasslands component:
#Litter Biomass %Live LAI_conv
75.0 150.0 0.00 300. # January
80.0 150.0 0.00 300. # February
Expand Down
140 changes: 74 additions & 66 deletions data-raw/1_Input/treatments/tr_siteparamin/siteparam.in
Original file line number Diff line number Diff line change
@@ -1,82 +1,90 @@
# ---- SWC limits ----
-1.0 # swc_min : cm/cm if 0 - <1.0, -bars if >= 1.0.; if < 0. then estimate residual water content for each layer
15.0 # swc_init: cm/cm if < 1.0, -bars if >= 1.0.
15.0 # swc_wet : cm/cm if < 1.0, -bars if >= 1.0.
#------ Input file for site location, initialization, and
# miscellaneous model parameters

# ---- Model flags and coefficients ----
0 # reset (1/0): reset/don't reset swc each new year
1 # deepdrain (1/0): allow/disallow deep drainage function.
# if deepdrain == 1, model expects extra layer in soils file.
1.0 # multiplier for PET (eg for climate change).
0.0 #proportion of ponded surface water removed as daily runoff (value ranges between 0 and 1; 0=no loss of surface water, 1=all ponded water lost via runoff)
0.0 #proportion of water that arrives at surface added as daily runon [from a hypothetical identical neighboring site] (value ranges between 0 and +inf; 0=no runon, >0: runon is occuring)
# USER: The site location and the transpiration regions should
# be adjusted for site-specific run conditions.

# ---- Snow simulation parameters (SWAT2K model): Neitsch S, Arnold J, Kiniry J, Williams J. 2005. Soil and water assessment tool (SWAT) theoretical documentation. version 2005. Blackland Research Center, Texas Agricultural Experiment Station: Temple, TX.
# these parameters are RMSE optimized values for 10 random SNOTEL sites for western US
0.61 # TminAccu2 = Avg. air temp below which ppt is snow ( C)
1.54 # TmaxCrit = Snow temperature at which snow melt starts ( C)
0.1 # lambdasnow = Relative contribution of avg. air temperature to todays snow temperture vs. yesterday's snow temperature (0-1)
0.0 # RmeltMin = Minimum snow melt rate on winter solstice (cm/day/C)
0.27 # RmeltMax = Maximum snow melt rate on summer solstice (cm/day/C)
# USER: Most of the other values in this file are parameters that
# describe various model processes and should be considered fixed.

# ---- Drainage coefficient ----
0.02 # slow-drain coefficient per layer (cm/day). See Eqn 2.9 in ELM doc.
# ELM shows this as a value for each layer, but this way it's applied to all.
# (Q=.02 in ELM doc, .06 in FORTRAN version).

# ---- Evaporation coefficients ----
#---- Soil water content initialization, minimum, and wet condition
-1.0 # swc_min : cm/cm if 0 - <1.0, -bars if >= 1.0.; if < 0. then estimate residual water content for each layer
15.0 # swc_init: cm/cm if < 1.0, -bars if >= 1.0.
15.0 # swc_wet : cm/cm if < 1.0, -bars if >= 1.0.

#---- Diffuse recharge and runoff/runon
0 # reset (1/0): do/don't reset soil water content for each year
1 # deepdrain (1/0): allow/disallow deep drainage (diffuse recharge)
1.0 # multiplier for PET (e.g., for climate change scenarios)
0.0 # proportion of ponded surface water removed as daily runoff (value ranges between 0 and 1; 0=no loss of surface water, 1=all ponded water lost via runoff)
0.0 # proportion of water that arrives at surface added as daily runon [from a hypothetical identical neighboring site] (value ranges between 0 and +inf; 0=no runon, >0: runon is occuring)

#---- Snow simulation
# based on the SWAT2K model by Neitsch et al. (2005)
# Current values are RMSE optimized based on 10 random SNOTEL sites for western US
0.61 # TminAccu2 = Avg. air temp below which ppt is snow ( C)
1.54 # TmaxCrit = Snow temperature at which snow melt starts ( C)
0.1 # lambdasnow = Relative contribution of avg. air temperature to todays snow temperture vs. yesterday's snow temperature (0-1)
0.0 # RmeltMin = Minimum snow melt rate on winter solstice (cm/day/C)
0.27 # RmeltMax = Maximum snow melt rate on summer solstice (cm/day/C)

#---- Hydraulic conductivity
0.02 # Parameter (cm / day) for unsaturated hydraulic conductivity,
# previously called slow-drain coefficient; See Eqn 2.9 in Parton 1978.

#---- Evaporation
# These control the tangent function (tanfunc) which affects the amount of soil
# water extractable by evaporation and transpiration.
# These constants aren't documented by the ELM doc.
45. # rate shift (x value of inflection point). lower value shifts curve
# leftward, meaning less water lost to evap at a given swp. effectively
# shortens/extends high rate.
.1 # rate slope: lower value (eg .01) straightens S shape meaning more gradual
# reduction effect; higher value (.5) makes abrupt transition
.25 # inflection point (y-value of inflection point)
0.5 # range: diff btw upper and lower rates at the limits
# water extractable by bare-soil evaporation and transpiration.
45. # rate shift (x value of inflection point). lower value shifts curve
# leftward, meaning less water lost to evap at a given swp. effectively
# shortens/extends high rate.
.1 # rate slope: lower value (eg .01) straightens S shape meaning more gradual
# reduction effect; higher value (.5) makes abrupt transition
.25 # inflection point (y-value of inflection point)
0.5 # range: diff btw upper and lower rates at the limits

# ---- Transpiration Coefficients ----
# comments from Evap constants apply.
45. # rate shift
.1 # rate shape
.5 # inflection point
1.1 # range
#---- Transpiration
# These control the tangent function (tanfunc) which affects the amount of soil
# water extractable by transpiration.
45. # rate shift
.1 # rate shape
.5 # inflection point
1.1 # range

# ---- Intrinsic site params:
0.681 # latitude of the site in radians
1000 # elevation of site (m a.s.l.)
0 # slope at site (degrees): no slope = 0
-1 # aspect at site (degrees): N=0, E=90, S=180, W=270, no slope:-1
#---- Site location and topography
0.681 # latitude of the site in radians
1000 # elevation of site (m a.s.l.)
0 # slope at site (degrees): no slope = 0
-1 # aspect at site (degrees): N=0, E=90, S=180, W=270, no slope:-1

# ---- Soil Temperature Constants ----
#---- Soil temperature
# from Parton 1978, ch. 2.2.2 Temperature-profile Submodel
300. # biomass limiter, 300 g/m^2 in Parton's equation for T1(avg daily temperature at the top of the soil)
15. # constant for T1 equation (used if biomass <= biomass limiter), 15 in Parton's equation
-4. # constant for T1 equation (used if biomass > biomass limiter), -4 in Parton's equation
600. # constant for T1 equation (used if biomass > biomass limiter), 600 in Parton's equation
0.00070 # constant for cs (soil-thermal conductivity) equation, 0.00070 in Parton's equation
0.00030 # constant for cs equation, 0.00030 in Parton's equation
0.18 # constant for sh (specific heat capacity) equation, 0.18 in Parton's equation
4.15 # constant soil temperature (Celsius) at the lower boundary (max depth); approximate by mean annual air temperature of site
15. # deltaX parameter for soil_temperature function, default is 15. (distance between profile points in cm) max depth (the next number) should be evenly divisible by this number
990. # max depth for the soil_temperature function equation, default is 990. this number should be evenly divisible by deltaX
1 # flag, 1 to calculate soil_temperature, 0 to not calculate soil_temperature
300. # biomass limiter, 300 g/m^2 in Parton's equation for T1(avg daily temperature at the top of the soil)
15. # constant for T1 equation (used if biomass <= biomass limiter), 15 in Parton's equation
-4. # constant for T1 equation (used if biomass > biomass limiter), -4 in Parton's equation
600. # constant for T1 equation (used if biomass > biomass limiter), 600 in Parton's equation
0.00070 # constant for cs (soil-thermal conductivity) equation, 0.00070 in Parton's equation
0.00030 # constant for cs equation, 0.00030 in Parton's equation
0.18 # constant for sh (specific heat capacity) equation, 0.18 in Parton's equation
4.15 # constant soil temperature (Celsius) at the lower boundary (max depth); approximate by mean annual air temperature of site
15. # deltaX parameter for soil_temperature function, default is 15. (distance between profile points in cm) max depth (the next number) should be evenly divisible by this number
990. # max depth for the soil_temperature function equation, default is 990. this number should be evenly divisible by deltaX
1 # flag, 1 to calculate soil_temperature, 0 to not calculate soil_temperature

# ---- CO2 Settings ----
# Use biomass multiplier
# Activate (1) / deactivate (0) biomass multiplier
1
# Use water-usage efficiency multiplier
# Activate (1) / deactivate (0) water-usage efficiency multiplier
1
# Scenario
# Name of CO2 scenario: see input file `carbon.in`
RCP85

# ---- Transpiration regions ----
#---- Transpiration regions
# ndx : 1=shallow, 2=medium, 3=deep, 4=very deep
# layer: deepest layer number of the region.
# Layers are defined in soils.in.
# ndx layer
1 3
2 5
3 8
# 4 20
# layer: deepest soil layer number of the region.
# Must agree with soil layers as defined in `soils.in`
# ndx layer
1 3
2 5
3 8
Loading

0 comments on commit eaef9d0

Please sign in to comment.