Type: Package
Title: Soil and Chemical Substance Emission and Transport Model
Version: 2.0.1
Description: An enhanced version of the semi-empirical, spatially distributed emission and transport model PhosFate implemented in 'R' and 'C++'. It is based on the D-infinity, but also supports the D8 flow method. The currently available substances are suspended solids (SS) and particulate phosphorus (PP). A major feature is the allocation of substance loads entering surface waters to their sources of origin, which is a basic requirement for the identification of critical source areas and in consequence a cost-effective implementation of mitigation measures. References: Hepp et al. (2022) <doi:10.1016/j.jenvman.2022.114514>; Hepp and Zessner (2019) <doi:10.3390/w11102161>; Kovacs (2013) http://hdl.handle.net/20.500.12708/9468.
License: AGPL (≥ 3)
URL: https://gisler.github.io/RPhosFate/
BugReports: https://github.com/gisler/RPhosFate/issues
Language: en-GB
Encoding: UTF-8
ByteCompile: true
Depends: R (≥ 3.5.0)
Imports: checkmate, graphics, methods, Rcpp, stats, terra, tools, utils, yaml
Suggests: knitr, rmarkdown, tinytest, whitebox (≥ 2.0.0)
LinkingTo: Rcpp, RcppArmadillo
RoxygenNote: 7.3.2
VignetteBuilder: knitr
Collate: 'GOFmetrics.R' 'aaa.R' 'RPhosFate.R' 'RcppExports.R' 'assertives.R' 'gettersSetters.R' 'input.R' 'interface.R' 'utils.R' 'zzz.R'
NeedsCompilation: yes
Packaged: 2025-03-22 10:15:59 UTC; ghepp
Author: Gerold Hepp [aut, cre]
Maintainer: Gerold Hepp <gisler@hepp.cc>
Repository: CRAN
Date/Publication: 2025-03-22 10:40:04 UTC

DEM related input

Description

Clips, pre-processes and calculates or determines all input data related to the digital elevation model (DEM) in the broader sense: acc_inf, cha, dem, dir_inf, rds, slp_inf, and wsh.

Requires the WhiteboxTools binary (whitebox::install_whitebox) to be installed on your computer.

Usage

DEMrelatedInput(
  cv_dir,
  cs_dem,
  cs_cha,
  sp_msk,
  sp_olp,
  sp_sds,
  cs_rds = NULL,
  ns_cha = NULL,
  ns_brn = 50,
  is_adj = 1L,
  is_ths = 1L,
  ls_mD8 = FALSE,
  ls_tmp = FALSE
)

Arguments

cv_dir

A character vector specifying the desired project root directory (first position).

cs_dem

A character string specifying a path to a potentially large raster digital elevation model.

cs_cha

A character string specifying a path to a potentially large raster providing channels.

sp_msk

A terra::SpatVector providing a somewhat oversized catchment polygon mask used to clip the potentially large input rasters for further processing.

sp_olp

A terra::SpatVector providing the desired catchment outlet point(s).

sp_sds

A terra::SpatVector providing channel source points.

cs_rds

An optional character string specifying a path to a potentially large raster providing roads.

ns_cha

An optional numeric scalar specifying the minimum D8 flow accumulation in number of upslope grid cells determining a channel.

ns_brn

A numeric scalar specifying the stream burning step size in m.

is_adj

A numeric scalar specifying how many cells adjacent to channels shall be burnt.

is_ths

An integer scalar specifying the number of threads to use for processing, where applicable.

ls_mD8

A logical scalar specifying if D8 flow directions shall be mimicked, i.e. the D-infinity flow directions are rounded to the nearest multiple of 45 degrees. Please note that this treatment is always applied to channel cells independently of this argument.

ls_tmp

A logical scalar specifying if the temporary files created during computation shall be kept.

Details

This function applies the following (pre-processing) steps to ensure hydrologic consistency of the generated input data:

When roads are provided, they are considered as flow obstacles breaking the continuity of the calculated flow accumulations.

ns_cha can be used to enhance the channel network obtained by the tracing of downslope flowpaths from the provided channel sources.

dem represents the breached DEM with reversed stream burning if applicable. The basis for the calculation of the D-infinity slopes provided by slp_inf, however, is the original DEM.

Value

A two column numeric matrix specifying one or more catchment outlet coordinates and side effects in the form of raster files.

References

Lindsay, J.B., 2016. Efficient hybrid breaching-filling sink removal methods for flow path enforcement in digital elevation models. Hydrological Processes 30, 846–857. https://doi.org/10.1002/hyp.10648

Tarboton, D.G., 1997. A new method for the determination of flow directions and upslope areas in grid digital elevation models. Water Resour. Res. 33, 309–319. https://doi.org/10.1029/96WR03137

See Also

RPhosFate, catchment

Examples

## Not run: 
# obtain temporary project root directory
cv_dir <- normalizePath(
  tempfile("cmt"),
  winslash = .Platform$file.sep,
  mustWork = FALSE
)
# obtain directory holding "large" rasters and other required data sets
cs_dir_lrg <- system.file("tinytest", "largeData", package = "RPhosFate")

nm_olc <- DEMrelatedInput(
  cv_dir = cv_dir,
  cs_dem = file.path(cs_dir_lrg, "dem_lrg.tif"),
  cs_cha = file.path(cs_dir_lrg, "cha_lrg.tif"),
  sp_msk = terra::vect(file.path(cs_dir_lrg, "msk.shp")),
  sp_olp = terra::vect(file.path(cs_dir_lrg, "olp.shp")),
  sp_sds = terra::vect(file.path(cs_dir_lrg, "sds.shp")),
  cs_rds = file.path(cs_dir_lrg, "rds_lrg.tif"),
  ls_tmp = TRUE
)
## End(Not run)


Initialise project

Description

Initialises a project from scratch or loads the state of an existing one utilising GeoTIFF (*.tif) raster files from, by convention, the following three project root subdirectories:

See subdirectory sections for further information.

catchment is an alias for RPhosFate.

Usage

RPhosFate(...)

catchment(...)

Arguments

...

Arguments used to initialise the project. See argument sections for further information.

Value

An S4 RPhosFate river catchment object.

Input subdirectory

This directory holds all possible user input raster data (flow obstacles like roads must be considered during the generation of the flow accumulation layer and must also be cut out from it in order to be properly respected):

Intermediate subdirectory

This directory holds intermediate calculations:

Result subdirectory

This directory holds the model results:

Data management and processing arguments

Model parameter arguments

Monte Carlo simulation mode

This mode can make use of repeated random samples, i.e. raster data, of distributions of about all input data. The filenames of the Monte Carlo input raster data must contain the specified iteration, for example, CFa12.tif for the twelfth iteration of the C-factors input data, and can reside in a separate directory. In case no Monte Carlo raster file is found for a certain layer in the designated directory, the respective project root subdirectory is searched for one and finally the “normal” project input raster data is utilised.

See Also

saveState, demoProject

Examples


# temporary demonstration project copy
cv_dir <- demoProject()

# initialise project from scratch
x <- RPhosFate(
  cv_dir = cv_dir,
  ns_dep_ovl = 25e-4,
  ns_dep_cha = 0.0,
  nv_tfc_inl = c(SS = 0.6, PP = 0.6),
  nv_enr_rto = c(PP = 2.0),
  nm_olc = matrix(c(4704255, 2795195), ncol = 2L),
  df_cdt = read.table(
    file.path(cv_dir, "cdt.txt"),
    header = TRUE,
    stringsAsFactors = FALSE
  )
)

# load state of existing project in Monte Carlo simulation mode
x <- RPhosFate(
  cv_dir = c(
    cv_dir,
    system.file("tinytest", "testProject", package = "RPhosFate")
  ),
  ls_ini = TRUE,
  is_MCi = 1L,
  cv_MCl = c("xxt", "xxt_cld")
)


RPhosFate class

Description

An S4 object representing a river catchment.

Slots

cv_dir

A character vector holding the project root (first position) and optionally the Monte Carlo input data directory (second position).

ls_ini

A logical scalar specifying if the state of an existing project was loaded from disk.

is_ths

An integer scalar holding the number of threads to use for processing, where applicable.

is_MCi

An integer scalar holding the current Monte Carlo iteration if applicable.

cv_MCl

A character vector holding the names of the layers, which shall be written to disk with the associated Monte Carlo iteration in their filenames upon calling the appropriate methods.

parameters

An S4 object holding the model parameters.

topo

An S4 object holding the raster layers related to topography in the broader sense.

erosion

An S4 object holding the raster layers related to erosion.

transport

An S4 object holding raster layers required for modelling transport.

substances

An S4 object holding the substance raster layer containers.

helpers

An S4 object holding helper data.

See Also

RPhosFate, catchment


One dimensional automatic model calibration

Description

Automatically calibrates the model with the help of a combination of golden section search and successive parabolic interpolation.

Usage

## S4 method for signature 'RPhosFate'
autoCalibrate(
  x,
  substance,
  col,
  interval,
  metric,
  tol = min(interval) * 0.1,
  parameter = NULL
)

Arguments

x

An S4 RPhosFate river catchment object.

substance

A character string specifying the substance to calculate.

col

A character string specifying the calibration data column with the respective substance river loads.

interval

A numeric vector specifying the end-points of the interval to be searched.

metric

A character string specifying the metric to optimise. See calibrationQuality for available metrics.

tol

A numeric scalar specifying the desired accuracy of the parameter used for optimisation (not the metric).

parameter

By default, SS are calibrated utilising the overland deposition rate and all other substances are calibrated utilising their respective enrichment ratio. This argument can be used to specify a dedicated parameter utilised for calibration via a character string: "ns_dep_ovl" for overland or "ns_dep_cha" for channel deposition rate.

Value

An S4 RPhosFate river catchment object and side effects in the form of raster files.

See Also

snapGauges, optimize

Examples


# temporary demonstration project copy
cv_dir <- demoProject()
# load temporary demonstration project
x <- RPhosFate(
  cv_dir = cv_dir,
  ls_ini = TRUE
)
# presupposed method calls
x <- firstRun(x, "SS")
x <- snapGauges(x)

x <- autoCalibrate(
  x,
  "SS",
  col = "SS_load",
  interval = c(1e-3, 2e-3),
  metric = "KGE"
)


Two dimensional automatic model calibration

Description

Automatically calibrates the model with the help of a general-purpose optimisation function. In contrast to autoCalibrate, this method always utilises the overland and channel deposition rate at the same time and never the respective enrichment ratio for calibration. Beware of local optima and parameters approximately within the convergence tolerance of interval end-points.

Usage

## S4 method for signature 'RPhosFate'
autoCalibrate2(
  x,
  substance,
  col,
  metric,
  method = "Nelder-Mead",
  lower = 0,
  upper = 0.1,
  control = list(fnscale = if (metric %in% c("NSE", "mNSE", "KGE")) -1 else 1)
)

Arguments

x

An S4 RPhosFate river catchment object.

substance

A character string specifying the substance to calculate.

col

A character string specifying the calibration data column with the respective substance river loads.

metric

A character string specifying the metric to optimise. See calibrationQuality for available metrics.

method

A character string specifying the utilised optimisation method. See optim for further information (use autoCalibrate instead of method "Brent").

lower

A numeric scalar or vector specifying the lower end-point(s) of the interval(s) to be searched.

upper

A numeric scalar or vector specifying the upper end-point(s) of the interval(s) to be searched.

control

A list of control parameters passed on to optim. See optim for further information.

Value

An S4 RPhosFate river catchment object and side effects in the form of raster files.

See Also

snapGauges

Examples


# temporary demonstration project copy
cv_dir <- demoProject()
# load temporary demonstration project
x <- RPhosFate(
  cv_dir = cv_dir,
  ls_ini = TRUE
)
# presupposed method calls
x <- firstRun(x, "SS")
x <- snapGauges(x)

x <- autoCalibrate2(
  x,
  "SS",
  col = "SS_load",
  metric = "KGE",
  method = "L-BFGS-B",
  lower = c(1e-3, 0),
  upper = c(2e-3, 2e-3),
  control = list(fnscale = -1, parscale = c(1e-3, 1e-3), factr = 1e12)
)


Calibration quality

Description

Assesses the model's calibration quality with the help of the pairwise complete modelled as well as observed loads and the following metrics:

In addition, a scatter plot with the observed river loads on the x- and the modelled river loads on the y-axis is displayed and provides a visual impression of the model performance. Other elements of this plot are an identity line (solid) and plus/minus 30% deviation lines (dashed).

Usage

## S4 method for signature 'RPhosFate'
calibrationQuality(x, substance, col)

Arguments

x

An S4 RPhosFate river catchment object.

substance

A character string specifying the substance to calculate.

col

A character string specifying the calibration data column with the respective substance river loads.

Value

A named numeric vector containing the assessed metrics along with the in-channel retention ratio (one minus sum of xxt at catchment outlet(s) divided by sum of xxt_inp).

References

Nash, J.E., Sutcliffe, J.V., 1970. River flow forecasting through conceptual models part I – a discussion of principles. Journal of Hydrology 10, 282–290. https://doi.org/10.1016/0022-1694(70)90255-6

Legates, D.R., McCabe Jr., G.J., 1999. Evaluating the use of “goodness-of-fit” measures in hydrologic and hydroclimatic model validation. Water Resources Research 35, 233–241. https://doi.org/10.1029/1998WR900018

Kling, H., Fuchs, M., Paulin, M., 2012. Runoff conditions in the upper Danube basin under an ensemble of climate change scenarios. Journal of Hydrology 424–425, 264–277. https://doi.org/10.1016/j.jhydrol.2012.01.011

Moriasi, D.N., Arnold, J.G., Van Liew, M.W., Bingner, R.L., Harmel, R.D., Veith, T.L., 2007. Model evaluation guidelines for systematic quantification of accuracy in watershed simulations. Transactions of the ASABE 50, 885–900.

See Also

snapGauges, autoCalibrate, autoCalibrate2

Examples


# temporary demonstration project copy
cv_dir <- demoProject()
# load temporary demonstration project
x <- RPhosFate(
  cv_dir = cv_dir,
  ls_ini = TRUE
)
# presupposed method calls
x <- firstRun(x, "SS")
x <- snapGauges(x)

calibrationQuality(x, "SS", "SS_load")


Demonstration project

Description

Copies a demonstration project to an existing or a temporary directory.

The demonstration project data are a derivative of the

data sets, used and licensed under (CC BY 4.0) by Gerold Hepp.

While the data represent a real catchment (HOAL), some of them are fictitious, but plausible. These are, among others, R- and C-factors, soil and related data, existence of subsurface drainage at road embankments as well as substance river loads.

Usage

demoProject(cs_dir = tempdir(TRUE))

Arguments

cs_dir

An optional character string specifying an existing directory.

Value

A character string containing the demonstration project root directory.

See Also

RPhosFate, catchment

Examples


demoProject()


Emission

Description

Calculates and writes substance emissions to disk.

Usage

## S4 method for signature 'RPhosFate'
emission(x, substance = "PP")

Arguments

x

An S4 RPhosFate river catchment object.

substance

A character string specifying the substance to calculate.

Value

An S4 RPhosFate river catchment object and side effects in the form of raster files.

See Also

firstRun, subsequentRun

Examples


# temporary demonstration project copy
cv_dir <- demoProject()
# load temporary demonstration project
x <- RPhosFate(
  cv_dir = cv_dir,
  ls_ini = TRUE
)
# presupposed method calls
x <- erosionPrerequisites(x)
x <- erosion(x)

x <- emission(x, "PP")


Erosion

Description

Calculates and writes (R)USLE erosion to disk.

Usage

## S4 method for signature 'RPhosFate'
erosion(x)

Arguments

x

An S4 RPhosFate river catchment object.

Value

An S4 RPhosFate river catchment object and side effects in the form of raster files.

References

Renard, K.G., Foster, G.R., Weesies, G.A., McCool, D.K., Yoder, D.C., 1997. Predicting soil erosion by water: a guide to conservation planning with the Revised Universal Soil Loss Equation (RUSLE), Agriculture Handbook. U.S. Government Printing Office, Washington, DC.

Wischmeier, W.H., Smith, D.D., 1978. Predicting rainfall erosion losses. A guide to conservation planning, Agriculture Handbook. U.S. Government Printing Office, Washington, DC.

See Also

firstRun, subsequentRun

Examples


# temporary demonstration project copy
cv_dir <- demoProject()
# load temporary demonstration project
x <- RPhosFate(
  cv_dir = cv_dir,
  ls_ini = TRUE
)
# presupposed method call
x <- erosionPrerequisites(x)

x <- erosion(x)


Erosion prerequisites

Description

Calculates and writes capped slopes, L- and RUSLE S-factors (equations for summer conditions and slopes \geq 15 ft) to disk.

Usage

## S4 method for signature 'RPhosFate'
erosionPrerequisites(x)

Arguments

x

An S4 RPhosFate river catchment object.

Value

An S4 RPhosFate river catchment object and side effects in the form of raster files.

References

Desmet, P.J.J., Govers, G., 1996. A GIS procedure for automatically calculating the USLE LS factor on topographically complex landscape units. Journal of Soil and Water Conservation 51, 427–433.

Renard, K.G., Foster, G.R., Weesies, G.A., McCool, D.K., Yoder, D.C., 1997. Predicting soil erosion by water: a guide to conservation planning with the Revised Universal Soil Loss Equation (RUSLE), Agriculture Handbook. U.S. Government Printing Office, Washington, DC.

See Also

firstRun, subsequentRun

Examples


# temporary demonstration project copy
cv_dir <- demoProject()
# load temporary demonstration project
x <- RPhosFate(
  cv_dir = cv_dir,
  ls_ini = TRUE
)

x <- erosionPrerequisites(x)


First run

Description

Calls erosionPrerequisites, erosion, emission, transportPrerequisites and transport in the mentioned order. While transport is called for the specified substance only, emission is called for all substances whose top soil concentrations have been provided.

Usage

## S4 method for signature 'RPhosFate'
firstRun(x, substance = "PP")

Arguments

x

An S4 RPhosFate river catchment object.

substance

A character string specifying the substance to calculate.

Value

An S4 RPhosFate river catchment object and side effects in the form of raster files.

See Also

subsequentRun

Examples


# temporary demonstration project copy
cv_dir <- demoProject()
# load temporary demonstration project
x <- RPhosFate(
  cv_dir = cv_dir,
  ls_ini = TRUE
)

x <- firstRun(x, "SS")


Get layer

Description

Obtains a project raster layer for further analysis.

Usage

## S4 method for signature 'RPhosFate'
getLayer(x, i, j = NULL)

## S4 method for signature 'RPhosFate,ANY,ANY'
x[i, j]

Arguments

x

An S4 RPhosFate river catchment object.

i

A character string specifying a layer name. Substance related layers whose names start with xx are treated differently. They have to be queried by their name (not filename), for example, "xxc" in combination with "PP" in argument j queries the particulate phosphorus concentrations in top soils. See subdirectory sections for further information.

j

A character string specifying a substance if applicable.

Value

A terra::SpatRaster object.

Input subdirectory

This directory holds all possible user input raster data (flow obstacles like roads must be considered during the generation of the flow accumulation layer and must also be cut out from it in order to be properly respected):

Intermediate subdirectory

This directory holds intermediate calculations:

Result subdirectory

This directory holds the model results:

Examples


# temporary demonstration project copy
cv_dir <- demoProject()
# load temporary demonstration project
x <- RPhosFate(
  cv_dir = cv_dir,
  ls_ini = TRUE
)
# presupposed method call
x <- firstRun(x, "SS")

getLayer(x, "dir_inf")
getLayer(x, "xxt", "SS")
getLayer(x, "xxe", "PP")


Get parameter(s)

Description

Obtains a single model parameter or all model parameters at once.

Usage

## S4 method for signature 'RPhosFate'
getParameter(x, parameter = NULL)

Arguments

x

An S4 RPhosFate river catchment object.

parameter

A character string specifying a parameter name or NULL for a list of all parameters. See model parameter arguments section for further information.

Value

Depends on the queried parameter or a list in case of all parameters. See model parameter arguments section for further information.

Model parameter arguments

See Also

setParameter

Examples


# temporary demonstration project copy
cv_dir <- demoProject()
# load temporary demonstration project
x <- RPhosFate(
  cv_dir = cv_dir,
  ls_ini = TRUE
)

getParameter(x)
getParameter(x, "ns_dep_ovl")


Convert ERDAS IMAGINE to GeoTIFF raster files

Description

Converts all ERDAS IMAGINE raster files in a directory and its subdirectories into GeoTIFF raster files.

Usage

img2tif(cs_dir, cs_crs = NULL)

Arguments

cs_dir

A character string specifying an existing directory.

cs_crs

An optional character string used to set the coordinate reference system of all output raster files. See terra::crs for further information.

Value

A character vector containing the paths to the processed ERDAS IMAGINE raster files.


Save state

Description

Saves parameters (parameters.yaml) to disk.

Usage

## S4 method for signature 'RPhosFate'
saveState(x)

Arguments

x

An S4 RPhosFate river catchment object.

Value

NULL invisibly and side effects in the form of files.

See Also

RPhosFate, catchment

Examples


# temporary demonstration project copy
cv_dir <- demoProject()
# load temporary demonstration project
x <- RPhosFate(
  cv_dir = cv_dir,
  ls_ini = TRUE
)

saveState(x)


Set parameter(s)

Description

Sets one or more model parameters or substance parameter values.

Usage

## S4 method for signature 'RPhosFate'
setParameter(x, ...)

Arguments

x

An S4 RPhosFate river catchment object.

...

Names and values of the parameters to set. See model parameter arguments section for further information.

Value

An S4 RPhosFate river catchment object.

Model parameter arguments

See Also

getParameter

Examples


# temporary demonstration project copy
cv_dir <- demoProject()
# load temporary demonstration project
x <- RPhosFate(
  cv_dir = cv_dir,
  ls_ini = TRUE
)

x <- setParameter(x, ns_dep_ovl = 15e-4)
x <- setParameter(
  x,
  nv_tfc_inl = c(SS = 0.6, PP = 0.6),
  nv_enr_rto = c(PP = 1.4)
)


Snap gauge(s)

Description

Snaps the coordinates of the provided calibration gauges to the respective midpoint of the nearest channel cell.

Usage

## S4 method for signature 'RPhosFate'
snapGauges(x)

Arguments

x

An S4 RPhosFate river catchment object.

Value

An S4 RPhosFate river catchment object.

See Also

calibrationQuality, autoCalibrate, autoCalibrate2

Examples


# temporary demonstration project copy
cv_dir <- demoProject()
# load temporary demonstration project
x <- RPhosFate(
  cv_dir = cv_dir,
  ls_ini = TRUE
)

x <- snapGauges(x)


Subsequent run

Description

Calls transport for the specified substance and optionally erosionPrerequisites, erosion, emission and transportPrerequisites beforehand.

Usage

## S4 method for signature 'RPhosFate'
subsequentRun(
  x,
  substance = "PP",
  erosionPrerequisites = FALSE,
  erosion = FALSE,
  emission = FALSE,
  transportPrerequisites = FALSE
)

Arguments

x

An S4 RPhosFate river catchment object.

substance

A character string specifying the substance to calculate.

erosionPrerequisites

A logical scalar specifying if erosionPrerequisites is called.

erosion

A logical scalar specifying if erosion is called.

emission

A logical scalar specifying if emission is called. It is never called with substance = "SS" though.

transportPrerequisites

A logical scalar specifying if transportPrerequisites is called.

Value

An S4 RPhosFate river catchment object and side effects in the form of raster files.

See Also

firstRun

Examples


# temporary demonstration project copy
cv_dir <- demoProject()
# load temporary demonstration project
x <- RPhosFate(
  cv_dir = cv_dir,
  ls_ini = TRUE
)
# presupposed method call
x <- firstRun(x, "SS")

x <- subsequentRun(x, "PP")


Transport

Description

Calculates and writes substance retentions, transports and cell loads as well as transfers to disk.

Usage

## S4 method for signature 'RPhosFate'
transport(x, substance = "PP")

Arguments

x

An S4 RPhosFate river catchment object.

substance

A character string specifying the substance to calculate.

Value

An S4 RPhosFate river catchment object and side effects in the form of raster files.

References

Engman, E.T., 1986. Roughness coefficients for routing surface runoff. Journal of Irrigation and Drainage Engineering 112, 39–53.

Molnár, P., Ramírez, J.A., 1998. Energy dissipation theories and optimal channel characteristics of river networks. Water Resources Research 34, 1809–1818. https://doi.org/10.1029/98WR00983

See Also

firstRun, subsequentRun

Examples


# temporary demonstration project copy
cv_dir <- demoProject()
# load temporary demonstration project
x <- RPhosFate(
  cv_dir = cv_dir,
  ls_ini = TRUE
)
# presupposed method calls
x <- erosionPrerequisites(x)
x <- erosion(x)
x <- emission(x, "PP")
x <- transportPrerequisites(x)

x <- transport(x, "PP")


Transport prerequisites

Description

Determines cells representing inlets as well as riparian zones before writing them to disk.

Usage

## S4 method for signature 'RPhosFate'
transportPrerequisites(x)

Arguments

x

An S4 RPhosFate river catchment object.

Value

An S4 RPhosFate river catchment object and side effects in the form of raster files.

See Also

firstRun, subsequentRun

Examples


# temporary demonstration project copy
cv_dir <- demoProject()
# load temporary demonstration project
x <- RPhosFate(
  cv_dir = cv_dir,
  ls_ini = TRUE
)

x <- transportPrerequisites(x)