Section 16 Update of the SWATfarmR input input files

run_this_chapter <- FALSE

RECALC_FARMR <- FALSE

16.1 Setup

We need the following packages:

# parallel
library(doParallel)
library(foreach)

# spatial
library(sf)

# SWAT
library(SWATprepR)
# We need FarmR 3.2 from optain cloud:
# WPs & Tasks > WP4 > Task 4.4 > Tools to Share > workflow_scripts > SWATfarmR_3.2.0.zip
library(SWATfarmR)

# Data
library(dplyr)
library(readr)
library(stringr)
library(lubridate)
library(data.table)

# famrR input
source('model_data/code/functions_write_SWATfarmR_input.R') 
library(data.table)
library(dplyr)
library(lubridate)
library(stringr)
library(tidyr) 
library(purrr) 
library(reshape2)
library(readr)
library(sf)

16.2 Documenting changes in the txt inputs files of calibrated model setup

The following changes were done directly in the SWAT+ txt input files to improve the simulation of sediment yields from the land objects during the hard calibration:

  • Plant soil cover was added to the urban land uses (urml_lum and utrn_lum) in the landuse.lum >> pointing to a plant community in plant.ini (initial cover with rngb)

  • managements were added to the plant cover of urml_lum and utrn_lum (this must be added to generic farmR input inputs.)

  • cn2 pointer were added to urml_lum and utrn_lum (‘farm’ and ‘urban’)

  • cons practices were added to urml_lum and utrn_lum.

  • cons_practice.lum usle_p values were reduced as proposed by Micha in CS1 to reduce sediment yields to values which are in line with previous publications.

  • Plant parametrizations for ‘frst’ and ‘rngb’ were replaced by parametrizations of ‘frst_test’ and ‘rngb_test’ which have lower t_base to better work in colder climates.

Some of the listed changes do not affect the SWATfarmR project and others must be included in them or otherwise they would be simply overwritten when a SWATfarmR project writes schedules in the SWAT project folder.

Therefore the SWATfarmR input input files which are required to set up SWATfarmR projects must be revised and new SWATfarmR projects must be generated to ensure that all manual changes of the calibrated model setup are also included in the SWATfarmR projects:

  • Update the file ‘model_data/farmR_generic_CS10.csv’ (remark here the updates described above were done in the file ‘model_data/farmR_generic_CS10_ext.csv’ already). The only difference is that the plant ‘cngr’ is used there and the calibrated model setup used ‘rngb’. To be in line with the calibrated model setup the in file ‘model_data/farmR_generic_CS10_ext.csv’ only the crop will be changed from ‘cngr’ to ‘rngb’.

16.2.1 Preparation of SWATfarmR management input files

To update all SWATfarmR projects the management input files must be generated for the following cases:

  • statusquo / observed time period (‘obs’)

  • notill / observed time period (‘obs’)

  • statusquo / climate scenario time periods historical (‘hist’), near future (‘near’), and far future (‘far’).

  • notill / climate scenario time periods historical (‘hist’), near future (‘near’), and far future (‘far’).

Related Issues Confirm 4x Equal Farmers - #116