============================================================================================================
START readme
============================================================================================================

============================================================================================================
## General
============================================================================================================

Author(s): 
Name: Meindert Commelin
Affiliation: Soil Physics and Land Management Group, Wageningen University, Wageningen, Netherlands
ORCID: 0000-0001-7460-1915

Name: Jan Wesseling
Affiliation: Soil Physics and Land Management Group, Wageningen University, Wageningen, Netherlands
ORCID: 0000-0003-1499-1047

Name: Victor Jetten
Affiliation: Faculty of Geo-Information Science and Earth Observation (ITC), University of Twente, Enschede, The Netherlands
ORCID: 0000-0002-3523-4830

Name: Jantiene Baartman
Affiliation: Soil Physics and Land Management Group, Wageningen University, Wageningen, Netherlands
ORCID: 0000-0001-6051-8619

Contact: meindert.commelin@wur.nl

============================================================================================================
## Title
============================================================================================================

"Code and software underlying the publication: Simulating event based pesticide transport with runoff and erosion; OpenLISEM-pesticide v.1" 
DOI: 10.4121/1838022f-05ee-4243-b599-097a777cde1c


============================================================================================================
## Methods
============================================================================================================

# Introduction

This repository contains the code and secondary data used to initialize and calibrate OpenLISEM-pesticide v1.
The related article presents a novel pesticide transport model extension for the OpenLISEM runoff and erosion model. 
The model was designed to simulate dissolved and particulate phase transport of pesticides during rainfall-runoff 
events from agricultural fields. We conceptualized pesticide transport during runoff with a mixing-layer, 
including soil-water partitioning of the pesticides in the soil, mass transfer from the mixing layer to the 
runoff water and runoff or infiltration transport. Entrainment and deposition of soil particles drive the transport 
of sorbed pesticides. The model was tested on two rainfall-runoff events with observed data in a small agricultural 
catchment in South-Limburg, the Netherlands. The model could, after calibration, simulate the transported loads and 
concentrations of metobromuron and glyphosate adequately. A sensitivity analysis showed that pesticide transport was 
mainly influenced by the initial field concentrations and the soil-water partitioning. To obtain accurate 
simulations of pesticide contents, correct simulation of runoff and erosion is a prerequisite.

============================================================================================================
## FolderStructure
============================================================================================================

openlisem_pesticide_model_development/
├───docs
├───ext_data
├───images
├───results
├───sources
│   ├───pcr_scripts
│   └───tcs_files
└───spatial_data_SL
    ├───qgis_models
    ├───rasters2019
    └───rasters2020

============================================================================================================
## FolderContents
============================================================================================================

- openlisem_pesticide_model_development/
contains the main R script and R-project file to execute all analysis for this study, the QGIS project file 
for the spatial analysis and the README for GitHUB.

--- docs/
contains pdf files of the full manuscript and supplementary materials

--- ext_data/
contains data from secondary sources: metereological data from KNMI and pesticide chemical characteristics from 
the public pesticide database.

--- images/
contains the figures from the manuscript

--- results/
contains the results for steps in this study that take long computation, e.g. the full output of the 
sensitivity analysis. If the full r code is executed these results will be reproduced and overwritten.

--- sources/
contains intermediate data files to speed up the analysis and R script files with functions which are
called from the main code.

	----- pcr_scripts/
	contains all scripts in the PCRaster language which create and modify raster maps.
	
	----- tcs_files/
	this directory contains the main input files with choices and data to setup the OpenLISEM input database
	also includes the settings for calibrations

--- spatial_data_SL/
contains basic raster and vector spatial data on the case study dataset. The preparation of these maps is
partly done with the available QGIS models. The dataset is spatially shifted to improve anonimization.

	----- qgis_models/
	contains 4 QGIS models that do part of the preprocessing of the spatial data, all output of this models
	is already present in the 'spatial_data_SL/' directory
	
	----- rasters2019/
	contains preprocessed .tif raster files with season specific variables
	
	----- rasters2020/
	contains preprocessed .tif raster files with season specific variables

============================================================================================================
## Software
============================================================================================================

SoftwareRequired: 

To run the code and analysis for this research the following software and data is required:
 - R, download from: https://cran.r-project.org/
 - RStudio, download from: https://www.rstudio.com/
 - The OpenLISEM-pesticide model
 - The TCRP model
 - the primary dataset

An executable for OpenLISEM-pesticide is included in the repository  
The code on github: https://github.com/vjetten/openlisem/tree/lisem_pest  

The observational dataset:  
Runoff, erosion and pesticide transport in a small catchment in Limburg - The Netherlands  
DOI: 10.4121/19690684  
URL: https://data.4tu.nl/articles/dataset/Runoff_erosion_and_pesticide_transport_in_a_small_catchment_in_Limburg_-_The_Netherlands/19690684  

The TCRP v1.1 model is used as additional software:
Title: Tillage-controlled Runoff Pattern model (TCRP) v1.1; a GIS model to adjust runoff patterns for tillage induced roughness in agricultural catchments  
DOI: 10.4121/22153622  
URL:  
Original TCRP version: https://ees.kuleuven.be/eng/geography/modelling/tcrp/  

OtherSoftwareRequirements: 

The observational dataset should be downloaded, and added in a subfolder 'data/'.
Then open the R project file: 'model_development.Rproj'. The R script with the full workflow for this study is: 'paper_all_steps.R'
In this document further guidance on setup and choices is given.
Required packages can be installed with: 'install.packages("package name")'.

The calculations for the original manuscript where done using the following software and package versions in R.
R version 4.2.3 (2023-03-15)

Versions of loaded packages in R:
hydroGOF(v.0.4-0), extrafont(v.0.19), gridExtra(v.2.3), cowplot(v.1.1.1), zoo(v.1.8-11), pander(v.0.6.5), 
forcats(v.1.0.0), stringr(v.1.5.0), dplyr(v.1.1.0), purrr(v.1.0.1), readr(v.2.1.4), tidyr(v.1.3.0), 
tibble(v.3.2.0), ggplot2(v.3.4.1), tidyverse(v.2.0.0), raster(v.3.6-20), sp(v.1.6-0), sf(v.1.0-11), 
hms(v.1.1.3) and lubridate(v.1.9.2)

============================================================================================================
## FileFormats
============================================================================================================

GeoTIFF (.tif), geopackage (.gpkg), ASCII (.R, .txt, .mod, .csv), QGIS-project (.qgz), R-project (.Rproj), 
PDF (.pdf), .png

============================================================================================================
END readme
============================================================================================================
