Learn R Programming

medfate (version 4.7.0)

aspwbInput: Simulation in agricultural areas

Description

Function aspwb_day performs water balance for a single day in an agriculture location. Function aspwb performs water balance for multiple days in an agriculture location.

Usage

aspwbInput(crop_factor, control, soil)

aspwb_day( x, date, meteovec, latitude, elevation, slope = NA_real_, aspect = NA_real_, runon = 0, lateralFlows = NULL, waterTableDepth = NA_real_, modifyInput = TRUE )

aspwb( x, meteo, latitude, elevation, slope = NA_real_, aspect = NA_real_, waterTableDepth = NA_real_ )

Arguments

crop_factor

Agriculture crop factor.

control

A list with default control parameters (see defaultControl).

soil

An object of class data.frame or soil.

x

An object of class aspwbInput.

date

Date as string "yyyy-mm-dd".

meteovec

A named numerical vector with weather data. See variable names in parameter meteo of spwb.

latitude

Latitude (in degrees).

elevation, slope, aspect

Elevation above sea level (in m), slope (in degrees) and aspect (in degrees from North).

runon

Surface water amount running on the target area from upslope (in mm).

lateralFlows

Lateral source/sink terms for each soil layer (interflow/to from adjacent locations) as mm/day.

waterTableDepth

Water table depth (in mm). When not missing, capillarity rise will be allowed if lower than total soil depth.

modifyInput

Boolean flag to indicate that the input x object is allowed to be modified during the simulation.

meteo

A data frame with daily meteorological data series (see spwb).

Author

Miquel De Cáceres Ainsa, CREAF

See Also

spwbInput, spwb

Examples

Run this code

control <- defaultControl()
examplesoil <- defaultSoilParams(4)

x <- aspwbInput(0.75, control, examplesoil)

# Day to be simulated
d <- 100
meteovec <- unlist(examplemeteo[d,-1])
date <- as.character(examplemeteo$dates[d])

#Call simulation function for a single days
sd <- aspwb_day(x, date, meteovec,  
               latitude = 41.82592, elevation = 100) 

#Call simulation function for multiple days
S <- aspwb(x, examplemeteo, latitude = 41.82592, elevation = 100)

Run the code above in your browser using DataLab