Skip to content

biopsichas/cliwf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This script is a detailed set of instructions written in R programming language for a workflow related to using the SWAT+ (Soil and Water Assessment Tool) model for climate scenarios. Workflow is following these steps:

  1. Loading Libraries: This section loads various R libraries required for the workflow. These libraries include SWATfarmR, SWATprepR, and other data manipulation and visualization libraries like tidyverse and ggpubr.

  2. Preparing Management Files: It involves creating necessary directories and copying setup files required for the simulation. Additionally, it updates, copies a database file to the temporary directory and write out model text files.

  3. Updating landuse.lum File: This section involves backing up and updating the landuse.lum file using a custom script.

  4. Run Climate Data Preparation: Parallel processing is used to prepare climate data files required for the simulation.

  5. Prepare for SWATfarmR: Copies necessary files from the setup directory to the temporary result directory.

  6. Run Parallelized SWATfarmR Calculation: Executes the SWATfarmR calculation for preparing model management files in parallel.

  7. Adjust Output Settings: Modifies settings related to output files and print settings for the simulation.

  8. Run All Climate Scenarios in Parallel and Collect Results: Executes the simulation for all scenarios in parallel and collects the output files.

  9. Load Functions for Output Extraction and Prepare Results: Loads custom functions for extracting output indicators and prepares the results directory.

  10. Output Analysis: Calculates various indicators related to water quantity, quality, and crop yield from the simulation results.

  11. Aggregate Outputs for Plotting: Combines the calculated indicators into a dataframe for plotting.

  12. Plotting Results: Divides the indicators into thematic plots and creates visualizations using the throw_box function.

About

Climate workflow

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages