Skip to content

Commit

Permalink
Re-organize repository (part 2)
Browse files Browse the repository at this point in the history
- addressing #89

- update file paths (see previous commit 90b1741 "Re-organize repository (part 1)"

- note: additional commits to complete #89 will need to update makefile and scripts
  • Loading branch information
dschlaep committed Dec 21, 2022
1 parent 90b1741 commit dc521a4
Show file tree
Hide file tree
Showing 65 changed files with 606 additions and 611 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ doc/html/*
doc/log_doxygen.log
doc/Doxyfile.bak

# Binary files
# Build and binary directories and files
bin/*
build/*
SOILWAT2
tests/example/SOILWAT2
libSOILWAT2*
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,15 +239,15 @@ __Integration tests__
We use integration tests to check that the entire simulation model works
as expected when used in a real-world application setting.

The folder `testing/` contains all necessary inputs to run `SOILWAT2`
The folder `tests/example/` contains all necessary inputs to run `SOILWAT2`
for one generic location
(it is a relatively wet and cool site in the sagebrush steppe).

```{.sh}
make bin bint_run
```

The simulated output is stored at `testing/Output/`.
The simulated output is stored at `tests/example/Output/`.


Another use case is to compare output of a new (development) branch to output
Expand All @@ -263,15 +263,15 @@ The following steps provide a starting point for such comparisons:
# Simulate on refernce branch and copy output to "Output_ref"
git checkout master
make bin bint_run
cp -r testing/Output testing/Output_ref
cp -r tests/example/Output tests/example/Output_ref
# Switch to development branch <branch_xxx> and run the same simulation
git checkout <branch_xxx>
make bin bint_run
# Compare the two sets of outputs
# * Lists all output files and determine if they are exactly they same
diff testing/Output/ testing/Output_ref/ -qs
diff tests/example/Output/ tests/example/Output_ref/ -qs
```


Expand Down
10 changes: 5 additions & 5 deletions doc/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -876,8 +876,8 @@ WARN_LOGFILE =

INPUT = . \
doc/additional_pages/ \
testing/ \
testing/Input
tests/example/ \
tests/example/Input

# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
Expand Down Expand Up @@ -925,7 +925,7 @@ RECURSIVE = NO
# Note that relative paths are relative to the directory from which doxygen is
# run.

EXCLUDE = testing/README.md
EXCLUDE = tests/example/README.md

# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded
Expand Down Expand Up @@ -958,8 +958,8 @@ EXCLUDE_SYMBOLS =
# that contain example code fragments that are included (see the \include
# command).

EXAMPLE_PATH = testing \
testing/Input
EXAMPLE_PATH = tests/example \
tests/example/Input

# If the value of the EXAMPLE_PATH tag contains directories, you can use the
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
Expand Down
14 changes: 6 additions & 8 deletions doc/additional_pages/A_SOILWAT2_user_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,18 +133,16 @@ on your side.


### Example
* The source code contains a complete example simulation project in `testing/`
* Copy the executable to the testing path, modify inputs as desired,
and run a simulation, e.g.,
* The source code contains a complete example simulation project in
`tests/example/`
* Modify inputs as desired and run a simulation, e.g.,
```{.sh}
make bint bint_run
make bin_run
```
or, equivalently,
```{.sh}
make bin
cp SOILWAT2 testing/
cd testing/
./SOILWAT2
bin/SOILWAT2 -d ./tests/example -f files.in
```

* The inputs comprise the master file `files.in` and the content of the
Expand All @@ -154,7 +152,7 @@ on your side.
warnings and errors. The output files are in `.csv` format and can be
opened by a spreadsheet program (e.g., `LibreOffice` or `Excel`) or
imported into `R`
(e.g., `data <- read.csv("testing/Output/sw2_yearly.csv")`).
(e.g., `data <- read.csv("tests/example/sw2_yearly.csv")`).
Outputs are explained in detail
[here](doc/additional_pages/SOILWAT2_Inputs.md).

Expand Down
39 changes: 19 additions & 20 deletions doc/additional_pages/SOILWAT2_Inputs.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,19 @@ Note: this document is best viewed as part of the doxygen-built documentation
<br>

### Example
* The source code contains a complete example simulation project in `testing/`
* Copy the executable to the testing path, modify inputs as desired,
and run a simulation, e.g.,
* The source code contains a complete example simulation project in
`tests/example/`
* Modify inputs as desired and run a simulation, e.g.,
```{.sh}
make bint bint_run
make bin_run
```
or, equivalently,
```{.sh}
make bin
cp SOILWAT2 testing/
cd testing/
./SOILWAT2
bin/SOILWAT2 -d ./tests/example -f files.in
```


* The inputs comprise the master file `files.in` and the content of the
`Input/` folder. They are explained in detail
\ref explain_inputs "below".
Expand Down Expand Up @@ -64,78 +63,78 @@ Go back to the \ref explain_inputs "list of input files"
<hr>

\section yearsin years.in
\verbinclude testing/Input/years.in
\verbinclude tests/example/Input/years.in

Go back to the \ref explain_inputs "list of input files"
<hr>

\section siteparamin siteparam.in
\verbinclude testing/Input/siteparam.in
\verbinclude tests/example/Input/siteparam.in

Go back to the \ref explain_inputs "list of input files"
<hr>

\section soilsin soils.in
\verbinclude testing/Input/soils.in
\verbinclude tests/example/Input/soils.in

Go back to the \ref explain_inputs "list of input files"
<hr>

\section swrcpin swrc_params.in
\verbinclude testing/Input/swrc_params.in
\verbinclude tests/example/Input/swrc_params.in

Go back to the \ref explain_inputs "list of input files"
<hr>

\section weathsetupin weathsetup.in
\verbinclude testing/Input/weathsetup.in
\verbinclude tests/example/Input/weathsetup.in

Go back to the \ref explain_inputs "list of input files"
<hr>

\section mkvprobin mkv_prob.in
\verbinclude testing/Input/mkv_prob.in
\verbinclude tests/example/Input/mkv_prob.in

Go back to the \ref explain_inputs "list of input files"
<hr>

\section mkvcovarin mkv_covar.in
\verbinclude testing/Input/mkv_covar.in
\verbinclude tests/example/Input/mkv_covar.in

Go back to the \ref explain_inputs "list of input files"
<hr>

\section climatein climate.in
\verbinclude testing/Input/climate.in
\verbinclude tests/example/Input/climate.in

Go back to the \ref explain_inputs "list of input files"
<hr>

\section vegin veg.in
\verbinclude testing/Input/veg.in
\verbinclude tests/example/Input/veg.in

Go back to the \ref explain_inputs "list of input files"
<hr>

\section estabin estab.in
\verbinclude testing/Input/estab.in
\verbinclude tests/example/Input/estab.in
<hr>
Go back to the \ref explain_inputs "list of input files"

\section carbonin carbon.in
\verbinclude testing/Input/carbon.in
\verbinclude tests/example/Input/carbon.in

Go back to the \ref explain_inputs "list of input files"
<hr>

\section swcsetupin swcsetup.in
\verbinclude testing/Input/swcsetup.in
\verbinclude tests/example/Input/swcsetup.in

Go back to the \ref explain_inputs "list of input files"
<hr>

\section outsetupin outsetup.in
\verbinclude testing/Input/outsetup.in
\verbinclude tests/example/Input/outsetup.in

Go back to the \ref explain_inputs "list of input files"
<hr>
Expand Down
12 changes: 5 additions & 7 deletions doc/additional_pages/SOILWAT2_Outputs.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,16 @@ Note: this document is best viewed as part of the doxygen-built documentation
<br>

### Example
* The source code contains a complete example simulation project in `testing/`
* Copy the executable to the testing path, modify inputs as desired,
and run a simulation, e.g.,
* The source code contains a complete example simulation project in
`tests/example/`
* Modify inputs as desired and run a simulation, e.g.,
```{.sh}
make bint bint_run
make bin_run
```
or, equivalently,
```{.sh}
make bin
cp SOILWAT2 testing/
cd testing/
./SOILWAT2
bin/SOILWAT2 -d ./tests/example -f files.in
```

* The inputs comprise the master file `files.in` and the content of the
Expand Down
2 changes: 1 addition & 1 deletion include/SW_Carbon.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#ifndef CARBON
#define CARBON

#include "SW_Defines.h"
#include "include/SW_Defines.h"


#ifdef __cplusplus
Expand Down
2 changes: 1 addition & 1 deletion include/SW_Defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#define SOILW_DEF_H

#include <math.h> /* >= C99; for: atan(), isfinite() */
#include "generic.h"
#include "include/generic.h"

#ifdef __cplusplus
extern "C" {
Expand Down
2 changes: 1 addition & 1 deletion include/SW_Markov.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#ifndef SW_MARKOV_H
#define SW_MARKOV_H

#include "pcg/pcg_basic.h"
#include "external/pcg/pcg_basic.h"

#ifdef __cplusplus
extern "C" {
Expand Down
4 changes: 2 additions & 2 deletions include/SW_Model.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
#ifndef SW_MODEL_H
#define SW_MODEL_H

#include "Times.h"
#include "SW_Defines.h"
#include "include/Times.h"
#include "include/SW_Defines.h"

#ifdef __cplusplus
extern "C" {
Expand Down
8 changes: 4 additions & 4 deletions include/SW_Output.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@
#ifndef SW_OUTPUT_H
#define SW_OUTPUT_H

#include "Times.h"
#include "SW_Defines.h"
#include "SW_SoilWater.h"
#include "SW_VegProd.h"
#include "include/Times.h"
#include "include/SW_Defines.h"
#include "include/SW_SoilWater.h"
#include "include/SW_VegProd.h"

#ifdef __cplusplus
extern "C" {
Expand Down
2 changes: 1 addition & 1 deletion include/SW_Site.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
#ifndef SW_SITE_H
#define SW_SITE_H

#include "SW_Defines.h"
#include "include/SW_Defines.h"

#ifdef __cplusplus
extern "C" {
Expand Down
2 changes: 1 addition & 1 deletion include/SW_Sky.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#ifndef SW_SKY_H
#define SW_SKY_H

#include "SW_Times.h"
#include "include/SW_Times.h"

#ifdef __cplusplus
extern "C" {
Expand Down
8 changes: 4 additions & 4 deletions include/SW_SoilWater.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@
extern "C" {
#endif

#include "generic.h"
#include "SW_Defines.h"
#include "SW_Times.h"
#include "SW_Site.h"
#include "include/generic.h"
#include "include/SW_Defines.h"
#include "include/SW_Times.h"
#include "include/SW_Site.h"

typedef enum {
SW_Adjust_Avg = 1, SW_Adjust_StdErr
Expand Down
2 changes: 1 addition & 1 deletion include/SW_Times.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#ifndef SW_TIMES_H
#define SW_TIMES_H

#include "Times.h"
#include "include/Times.h"

#ifdef __cplusplus
extern "C" {
Expand Down
4 changes: 2 additions & 2 deletions include/SW_VegEstab.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#ifndef SW_VEGESTAB_H
#define SW_VEGESTAB_H

#include "SW_Defines.h"
#include "SW_Times.h"
#include "include/SW_Defines.h"
#include "include/SW_Times.h"


#ifdef __cplusplus
Expand Down
4 changes: 2 additions & 2 deletions include/SW_VegProd.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
#ifndef SW_VEGPROD_H
#define SW_VEGPROD_H

#include "SW_Defines.h" /* for tanfunc_t*/
#include "Times.h" // for MAX_MONTHS
#include "include/SW_Defines.h" /* for tanfunc_t*/
#include "include/Times.h" // for MAX_MONTHS

#ifdef __cplusplus
extern "C" {
Expand Down
Loading

0 comments on commit dc521a4

Please sign in to comment.