Configuration
Program organisation
The main module of VAMPS is the vamps program itself. It uses a series of
equations to describe the flow of water through a forested ecosystem.
Preparing input for VAMPS takes quite a while and is by no means a trivial
task.
Post-processing tools included with VAMPS:
vsel — the recommended tool for general post-processing. It can produce data that can be fed directly to plotting programmes such as
gnuplot.util.pyinshare/— Python equivalent providingvsel(),vprof(), andf_save().
VAMPS can crash in certain situations:
A genuine bug.
The situation to be modelled is beyond the capabilities of VAMPS.
The timestep estimate done by VAMPS is not right. A lot of precipitation on a very clayey soil is a recipe for disaster.
Troubleshooting options are described in Troubleshooting.
Layers in the soil section
The layers variable in the [soil] section determines the number of
layers used in the calculations (nodes, strictly speaking). The number of
physical layers (with different \(K_{sat}\), for example) is determined
by the number of [layer_n] sections. Any computational layer that is not
assigned a specific layer section automatically inherits the settings from the
overlying layer.
The [layer_0] section is the only one that is mandatory.
Time series and time-steps
Time series are values of variables over time used as input. All time series
must be listed in the [ts] section.
The precipitation time series is special because it also determines the time-steps at which output is calculated. The x-column should be in days or fractions of a day (e.g. 1.5 means halfway through day 1). Time-steps may vary within one run. Example precipitation file:
# This is a comment
# Precipitation from the no-name site
# time in days amounts in cm/day (intensity!)
0.5 0.6
1.0 0.9
2.0 0.7
2.1 0.9
2.2 0.7
2.3 0.5
3.0 0.8
3.5 0.0
Points to remember:
Units are cm/day (intensities). Convert precipitation data if necessary.
The time in the x-column is the end of an interval. Output at time 3.0 covers the period from time 2.3 to 3.0 (duration 0.7 days). The first record has no known preceding interval; VAMPS defaults to one day. You can change this with the
firststepvariable in the[time]section.The x-column in all files except the precipitation file is ignored (it must be present but VAMPS does not check the time values).
Input file format
The VAMPS input file format is similar to Windows .ini files. All names
and sections are case-insensitive. String variable values preserve case, so
filenames are case-sensitive if the operating system is.
The file is divided into sections, each containing variables with a related
purpose. Each variable name is followed by = and then the value. Example:
[vamps]
verbose = TRUE
# This is a comment
[environment]
caseid = Interception test file. Bisley catchment.\
Summer of 1995
The \ character may be used to break long strings over more than one line
(it is converted to a space). The # sign at the start of a line denotes a
comment. Only the first = sign is significant. Spaces within variable
names are preserved verbatim, making the following legal:
[vamps]
output mode = This is ('=') a nonsense example.
VAMPS uses six variable types:
floats — floating point numbers
arrays — a row of floating point numbers separated by whitespace
strings — a series of characters
integers — whole signed numbers
characters — a single printable character
boolean — either 0/1, FALSE/TRUE, or NO/YES
Available sections and variables
[vamps]
verboseIf set to FALSE VAMPS will be silent; if set to TRUE VAMPS will display progress information.
headerIf set to FALSE no header is added to the output; if set to TRUE a header is added. Default is FALSE.
loggingFALSE = no logging; TRUE = logging is on.
logfilenameName of the file to which logging is written.
iniinmemTRUE = the input file is read into memory (some speed-up); FALSE = the input file is not read into memory.
progstrString used to display progress information. Use 0, 1 or 2 for built-in strings: 0 = calculation time and estimated time remaining; 1 = percentage finished bar; 2 = ‘calculating’. You can define your own string.
graphcommandFull path to
gnuplotwith optional command-line options.commentcharsCharacter(s) that denote the start of a comment. Defaults to
#%. The first character should not be changed without good reason.xtrapyPath to a Python script to load at startup. The path is resolved relative to the
.inpfile. The script may defineat_start(),each_step(), and/orat_end()functions. See Python Scripting for details.
[time]
stepsInteger value specifying the number of steps in the current simulation. This value must be smaller than or equal to the number of entries in the precipitation file.
startposPosition (line) in the precipitation input file used as start. Counting starts at zero.
starttimeDay at which the simulation should start. If not specified the simulation starts at the first step in the precipitation input file. If both
starttimeandstartposare specified,starttimeis used.firststepDuration to assume for the first time-step when no prior step is known. Default is 1.0 day.
[run]
outputfileFilename to save output to. Can be overridden with the
-ocommand-line option.runidNot currently used.
[determine]
canopyDetermine canopy water balance (see
[canopy]).evaporationDetermine actual evaporation (see
[evaporation]).pevaporationDetermine potential evaporation (see
[pevaporation]).soilmoistureDetermine soil moisture profile (see
[soil]).fitUse nonlinear regression to fit to measured data (see
[fit]).
[pevaporation]
method0 — potential evaporation via Penman \(E_0\) (needs:
refrad,netrad,rhumid,windspeed,temp,inrad)1 — potential evaporation via Penman \(E_0\) using sun-ratio (needs:
sunratio,rhumid,windspeed,temp,inrad)2, 3 — not yet implemented
4 — potential evaporation using Makkink (needs:
rhumid,windspeed,temp,inrad)
[evaporation]
method0 — evaporation equal to potential evaporation
1 — multiply potential evaporation by a crop factor (needs
cropfac)2 — calculate actual evaporation using the Penman–Monteith formula
cropfacFloating point crop factor by which potential evaporation is multiplied to yield actual evaporation (only needed for method = 1).
[interception]
method0 — Gash analytical model
1 — Rutter numerical model
2 — LAI fraction
3 — Calder regression
gammaMaximum interception loss per day \(\gamma\) in the Calder equation [mm].
deltaFitting parameter \(\delta\) in the Calder equation.
E_avg/RAverage evaporation / average rainfall during a storm (Gash model). If not set, Penman–Monteith with \(R_a = 0\) is used.
p_trFraction of water diverted to the trunk (Gash, Rutter).
p_fFree throughfall coefficient (Gash, Rutter).
SCanopy storage in cm (Gash, Rutter).
gashm0 or 1. If set to 1, an adapted Gash model is used that works for time-steps smaller than 1 day. Default = 0.
laifracCanopy interception coefficient (LAI fraction method).
laiLeaf area index. Needed for the laifrac method. If not present it is searched in the
[canopy]section.
[canopy]
layersNumber of canopy layers. At present only one layer is allowed.
Rnet_absorbFraction of total radiation absorbed by the canopy (\(0 \le \text{Rnet\_absorb} \le 1\)). The remaining amount is used for soil evaporation.
transpirationWhich transpiration equation to use. * 2 — Penman–Monteith * 3 — read from
ptrin the[ts]sectionzHeight of the canopy [m].
z_0Aerodynamic roughness length [m].
dZero plane displacement length [m].
rsCanopy resistance [s/m]. If not specified the user-defined regression function
estrs()is used.drytimeIf set, this value [days] determines how long it takes for the canopy to dry.
wetevapIf set, this value [cm/day] determines the wet-canopy evaporation rate instead of Penman–Monteith with \(R_s = 0\).
[roots]
depthDepth of the root zone [cm]. To vary rooting depth in time use the
drootzvariable in the[ts]section.swsink0 — sink term according to Feddes (needs:
hlim1,hlim2u,hlim2l,hlim3h,hlim3l,hlim4)1 — sink term according to Hoogland (needs:
hlim1,hlim2u,hlim2l,hlim3,hlim4)
swhypr0 — linear relation between the points
hlim3andhlim41 — hyperbolic relation between the points
hlim3andhlim4
swupfu0 — water uptake function according to Feddes
1 — water uptake function according to Hoogland
2 — water uptake function according to Prasad (1988)
cofszaIntercept a in Feddes et al. 1988 (only needed if
swupfu= 1).cofszbSlope b in Feddes et al. 1988 (only needed if
swupfu= 1).hlim1Pressure head [cm] below which roots start to extract water from the upper soil layer (starting point).
hlim2uPressure head [cm] below which roots start to extract water optimally from the upper soil layer.
hlim2lAs above, but for all lower soil layers.
hlim3hPressure head [cm] below which roots cannot extract water optimally for a high potential transpiration rate (0.5 cm/d) — limiting point.
hlim3lAs above, but for low potential transpiration rate (0.1 cm/d).
hlim3Pressure head [cm] below which roots cannot extract water any more (limiting point; Hoogland method).
hlim4Pressure head [cm] below which no water uptake by roots is possible (wilting point).
[ts]
Lists the forcing time series. Each variable name maps to a file path. The
precipitation variable (pre) is mandatory.
File format: two whitespace-separated columns (time, value). VAMPS assumes
column 0 = time and column 1 = value. You can override this by appending
,xcol,ycol to the filename (a comma is therefore not allowed in filenames).
Standard variables:
prePrecipitation [cm/day]. Also determines the simulation time-steps.
rlhRelative humidity [%].
temDry-bulb temperature [°C].
winWind speed [m/s].
nraNet radiation [W/m²].
iraIncoming (global) radiation [W/m²].
ptrPotential transpiration [cm/day] (if pre-computed).
spePotential soil evaporation [cm/day] (if pre-computed).
inrInterception [cm/day] (if pre-computed).
heaHead at the bottom node [cm] (bottom condition 4).
rdpRooting depth [cm]. You must specify at least three points; other points are interpolated using a spline.
gwtGroundwater table [cm] (bottom condition 0).
laiLeaf area index.
scaCanopy storage [cm].
[soil]
outskipSkip this many timesteps in soil output. Used to reduce output file size.
initprof0 — water content profile (needs
theta_initialarray)1 — pressure head profile (needs
h_initialarray)2 — calculate pressure head profile (needs
gw_initial)
gw_initialInitial groundwater level [cm below field level]. Needed if
initprof= 2.swreduReduction of soil evaporation: * 0 — no reduction * 1 — Black (1969) model * 2 — Boesten (1986) model * 3 — adapted Boesten (1986) model (takes into account actual surface moisture)
cofredFactor alfa in Black or beta in Boesten. Not needed for
swredu= 0.bottomBottom boundary condition (see The Soil for descriptions): 0 = groundwater table, 1 = fixed flux, 2 = seepage/infiltration, 3 = flux as function of head, 4 = fixed head, 5 = zero flux, 6 = free drainage.
smoothSize of the running average used for smoothing the
ksat,theta_saturation, andresidual_waterprofiles. Set to zero for no smoothing (default).layersNumber of computational soil layers. The number of physical layers is determined by the number of
[layer_n]sections.pondmxMaximum amount of ponding [cm] at the top of the profile. Defaults to 0.0.
gwlevelWater level at the bottom of the profile [cm]. Needed if
bottom= 4.dtmaxMaximum timestep [days] in the soil module. Lower this if you experience large mass-balance errors.
dtminMinimum timestep [days] in the soil module. Setting
dtminanddtmaxto equal values forces VAMPS to use a fixed timestep.speedInteger from 1 (slow/accurate) to 6 (fastest/least accurate) controlling the trade-off between calculation accuracy and speed. Combines the settings of
dtmin,thetol,solvemet,mktable,maxitr, andswnums. Individually specified variables override the speed preset. Default is 3.maxitrMaximum number of iterations in the soil module. Iterations are only performed if
swnums!= 1.thetolTheta tolerance. VAMPS checks if the solution is good enough and iterates if needed. Usually between 1.0E-2 and 1.0E-5. The default value usually works fine.
solvemetHow VAMPS solves the equation matrix: * 0 — default tridiagonal (Thomas algorithm) * 1 — always use band-diagonal * 2 — very general solution (regains full machine precision; slow)
swnumsIf set to 1 the soil module will not check for convergence; it assumes the initial maximum
dtis a good guess. Much faster but can give poor results.mktableIf set to TRUE VAMPS creates lookup tables for the \(\theta\)–\(K\) relation and uses them during iteration. Default is FALSE. Can speed up calculations by up to 50 % at a slight loss of precision. The default table size is 300 points; change with
tablesize.tablesizeSize of the lookup tables. Default 300. Increasing improves accuracy at some memory and performance cost. Table sizes up to 1200 still provide speed improvements over not using tables.
dumptablesIf TRUE the lookup tables are dumped to the initial section of the output file (useful for plotting pF curves).
estdmcIf TRUE and
mktableis also TRUE, the dmc table is built usingts_slopesand the pF curve instead of theh2dmcfunction.verboseVerbose level in the soil module (0 = silent, 1 = show estimated run time).
smddepthIf set, the SMD (soil moisture deficit) is calculated to this depth. Otherwise the rooting depth is used.
fieldcapHead [cm] at which the soil is at field capacity. Needed for SMD calculation. Default = −100.0.
mbckIf set to 1, VAMPS uses a simple mass balance check for convergence instead of
thetol. Usually faster for the same accuracy.mbalerrRequired mass balance accuracy per timestep when
mbck= 1. A value between 1.0E-2 and 1.0E-5 is usually best. Default = 0.5E-3.
[drainage]
This section is experimental.
method0 — no lateral drainage (default)
1 — TOPOG type drainage (only at saturation)
2 — allow unsaturated lateral flow as well
If
method> 0 thenslopemust also be set.slopeSlope used in the calculation of lateral drainage.
excludeArray of layer indices in which lateral drainage is not allowed. Example:
exclude = 12 1 23 45. Combined with a no-flow bottom boundary this can simulate a lysimeter.
[soilsectionname]
This section can have any name and contains the soil-type-specific
parameters. The soilsection variable in each [layer_n] section
references this section by name.
methodMethod for the \(K\) vs \(\theta\) relation:
Value
Description
0
Clapp/Hornberger
1
Van Genuchten (default)
2
Not yet implemented
3
Van Genuchten parameters determined from \(\theta\) vs pF pairs
4
Read TOPOG_soil lookup tables
5
User-defined Python functions (requires Python support; see Python Scripting)
6
Brooks and Corey (1964)
For method 3: given values of
alphaandnare used as initial guesses. Required variables:theta(array) andpf(array). The exponentlis fixed at 0.5.For method 4: VAMPS reads and uses soil tables generated by the TOPOG_soil programme.
For method 5: define
getspars,h2t,t2k,t2h,h2dmc,h2k,h2u, andh2dkdpPython functions. See Python Scripting andshare/soilf.py/share/soilf_bc.pyfor reference implementations. It is strongly recommended to also setmktable = 1in[soil]for acceptable performance.For method 6: required parameters are
lambda,hb,thetas,theta_residual,ksat.descriptionOptional description of the soil layer.
ksatSaturated hydraulic conductivity of the layer.
kh/kvRatio of \(K_{sat}\) horizontal to \(K_{sat}\) vertical. Only used with lateral drainage. Default = 1.
thetasWater content at saturation (porosity).
psisatHead at saturation (air entry value) — needed for Clapp/Hornberger (method = 0).
bFactor b in Clapp/Hornberger (method = 0).
theta_residualResidual soil moisture content.
alpha\(\alpha\) parameter in Van Genuchten [1/cm].
l\(l\) parameter in Van Genuchten (use 0.5 if not measured).
n\(n\) parameter in Van Genuchten.
lambdaPore-size distribution index \(\lambda\) for Brooks and Corey (method = 6). Starting approximation from Van Genuchten: \(\lambda \approx n - 1\).
hbAir-entry (bubbling) pressure head \(h_b\) for Brooks and Corey (method = 6), in cm. Must be negative (e.g.
hb = -16.4). Starting approximation from Van Genuchten: \(h_b \approx -1/\alpha\).tablefileFile from which the soil table is read. Use with method = 4.
tablefiletypeFormat of the table file:
1 — TOPOG format (VAMPS uses columns 1, 3, 4, and 5)
2 — whitespace-separated columns (psi theta k); differential moisture capacity is estimated
3 — whitespace-separated columns (psi theta k diff_moist)
All table files should be made with descending theta values.
[layer_n]
Only [layer_0] is mandatory. Additional sections are needed only if
you have more than one physical soil layer.
thicknessThickness of the layer [cm].
soilsectionName of the section that contains the soil-type parameters for this layer.
[fit]
Used with the --fit option or when fit = 1 in [determine].
fittoName of a time series (must be in the
[ts]section) with actual measurements to fit against.n(where n = 0 … MAXPAR)Add a parameter to the fitting list. Available parameters: 1 = n (VG), 2 = alpha, 3 = ksat, 4 = b, 5 = psisat, 6 = l, 7 = residual_water, 8 = thetas.
layerPhysical layer to use in fitting.