Home

Awesome

rSOILWAT2: An Ecohydrological Ecosystem-Scale Water Balance Simulation Model

<!-- badges: start -->

R build status github release DOI license codecov status

<!-- badges: end --> <br>

Table of contents

  1. How to get started
    1. Installation
    2. Documentation
  2. Overview of rSW2
  3. How to contribute
    1. Code guidelines
    2. Code documentation
    3. Code linting
    4. Code tests
    5. Code versioning
  4. Additional notes
<br>

<a name="get_started"></a>

How to get started

<a name="install"></a>

Installation

Install rSOILWAT2

Please not that rSOILWAT2 compiles C source code of SOILWAT2 -- see section on binary version below for alternatives. Your computer must be set up adequately (see below for requirements).

Binary package

If you require a binary version of the 'rSOILWAT2' package (e.g., to distribute to someone without development tools) for a platform to which you do not have access, then you may consider using one of the cloud services (no endorsements), e.g.,

Minimal requirements

Example instructions for a minimal latex installation

<br>

<a name="get_documentation"></a>

Documentation

rSOILWAT2 offers documentation and code examples of exported functions help(package = "rSOILWAT2"), in particular ?sw_exec, and several vignettes vignette(package = "rSOILWAT2"), in particular vignette("rSOILWAT2_demo", package = "rSOILWAT2").

<br>

<a name="rSW2"></a>

Overview of rSW2

The DrylandEcology team hosts a group of related repositories and R packages.

They are organized around two simulation models, i.e., SOILWAT2, an dryland ecosystem water balance simulation model, and STEPWAT2, an individual-based model for dryland plant communities. They are both written in compiled languages.

We developed a family of R packages to support SOILWAT2 and STEPWAT2 simulation experiments:

<br>

<a name="contribute"></a>

How to contribute

You can help us in different ways:

  1. Reporting issues
  2. Contributing code and sending a pull request

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

<br>

<a name="follow_guidelines"></a>

Follow our guidelines as detailed here

<br>

Tests, documentation, and code

We develop code on development branches and, after they are reviewed and pass our checks, merge them into the main branch for release:

<a name="code_documentation"></a>

Code documentation

<br>

<a name="code_linting"></a>

Code linting

<br>

<a name="code_tests"></a>

Code tests and package checks

Debugging compiled code

How to update the submodule 'SOILWAT2' to the latest commit

git submodule update --remote #--remote: uses the latest commit; without --remote: uses the previously defined commit
git commit -am "Pulled down latest commit 'COMMIT-FLAG' for submodule SOILWAT2"
git push

Change the branch of submodule SOILWAT2

open .gitmodules # and change branch = <branch> to the desired <branch>

git submodule init
git submodule update --remote #--remote: uses the latest commit; without --remote: uses the previously defined commit
git commit -am "Changed to branch 'branch' commit 'COMMIT-FLAG' for submodule SOILWAT2"
git push

Run the script ./data-raw/prepare_testInput_objects.R from within rSOILWAT2/ if the SOILWAT2 updated included changes to the input files.

<br>

<a name="code_versioning"></a>

Version numbers

We base our versions on the guidelines of semantic versioning with version numbers of MAJOR.MINOR.PATCH.

We create a new release for each update to the main branch; a new release is identified by the package version (DESCRIPTION) and by a github release that also creates a git tag of the same name. The main branch is updated via pull requests from development branches after they are reviewed and pass required checks.

If the version numbers changes, then the following files must be updated

<br>

<a name="more_notes"></a>

Notes

Citation

Please cite the package if you publish results based on simulations carried out with our package, see citation("rSOILWAT2"), and we would like to hear about your publication.

Some other references

References for the original version of Soilwat

Considerations and Caveats

We haven't really published the code yet nor prepared it for sharing (though through our use of github made it openly accessible), it is actively and gradually being developed by the Lauenroth lab and affiliates, and there is no manual either - we cannot give you individual support in setting up and running the model except if we agreed on a collaboration or similar agreement.

Not every part of the code has been extensively tested or is in a stable state. Similarly, not every combination of model inputs and options has been evaluated in depth and there is not guarantee for anything to work. The code comes with no warranty and no guarantees, expressed or implied, as to suitability, completeness, accuracy, and whatever other claim you would like to make.

There is no graphical user interface, help pages and available documentation may be out of date, and you will need to write your own tools to analyze outputs.

Funding

Work on this package has been supported by various funds managed by Dr. John Bradford (USGS), Dr. Bill Lauenroth (Yale University), Dr. Kyle Palmquist (Marshall University), and Dr. Daniel Schlaepfer.

<br>

License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3 of the License.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

<br>