Skip to content

Commit

Permalink
Updates for new SOILWAT2 project structure
Browse files Browse the repository at this point in the history
- switch to SOILWAT2 branch feature_restructure

- paths renamed in submodule SOILWAT2
* *.c -> src/
* *.h -> include
* pcg/ -> external/pcg/
* googletest/ -> external/googletest/

- makefile gained ability to create required paths at obj/
-> remove obj/ and fixed nested folder structure
-> remove nested `.gitignore` for each subfolder of obj/
-> add obj to global `.gitignore`
  • Loading branch information
dschlaep committed Dec 22, 2022
1 parent eb67f2c commit 5505457
Show file tree
Hide file tree
Showing 33 changed files with 175 additions and 172 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*.exe
*.o
*.so
obj

# Packages #
############
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[submodule "sw_src"]
path = sw_src
url = https://github.com/DrylandEcology/SOILWAT2.git
branch = release/devel_v7.0.0
branch = feature_restructure
ignore = dirty
4 changes: 2 additions & 2 deletions ST_colonization.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
*/

#include "ST_colonization.h"
#include "sw_src/myMemory.h"
#include "sw_src/filefuncs.h"
#include "sw_src/include/myMemory.h"
#include "sw_src/include/filefuncs.h"
#include "ST_functions.h"
#include "ST_globals.h"

Expand Down
2 changes: 1 addition & 1 deletion ST_defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#ifndef STEPPE_DEF_H
#define STEPPE_DEF_H

#include "sw_src/generic.h"
#include "sw_src/include/generic.h"

/* see #include "ST_structs.h" below */

Expand Down
24 changes: 12 additions & 12 deletions ST_grid.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@
#include <string.h>
#include <ctype.h>
#include <dirent.h>
#include "sw_src/generic.h"
#include "sw_src/filefuncs.h"
#include "sw_src/myMemory.h"
#include "sw_src/rands.h"
#include "sw_src/SW_SoilWater.h" // externs SW_Soilwat
#include "sw_src/SW_Weather.h" // externs SW_Weather
#include "sw_src/SW_Markov.h"// externs `markov_rng`
#include "sw_src/include/generic.h"
#include "sw_src/include/filefuncs.h"
#include "sw_src/include/myMemory.h"
#include "sw_src/include/rands.h"
#include "sw_src/include/SW_SoilWater.h" // externs SW_Soilwat
#include "sw_src/include/SW_Weather.h" // externs SW_Weather
#include "sw_src/include/SW_Markov.h"// externs `markov_rng`
#include "ST_grid.h"
#include "ST_steppe.h"
#include "ST_globals.h" // externs `UseProgressBar`
Expand All @@ -51,12 +51,12 @@
#include "ST_colonization.h"
#include "ST_seedDispersal.h" // externs `UseSeedDispersal`
#include "ST_mortality.h" // externs `mortality_rng`, `*_SomeKillage`, `UseCheatgrassWildfire`
#include "sw_src/SW_Output.h"
#include "sw_src/SW_Output_outtext.h"
#include "sw_src/SW_Output_outarray.h"
#include "sw_src/include/SW_Output.h"
#include "sw_src/include/SW_Output_outtext.h"
#include "sw_src/include/SW_Output_outarray.h"

#include "sw_src/SW_Flow.h" // for `SW_FLW_init_run()`
#include "sw_src/SW_Flow_lib.h" // for `SW_ST_init_run()`
#include "sw_src/include/SW_Flow.h" // for `SW_FLW_init_run()`
#include "sw_src/include/SW_Flow_lib.h" // for `SW_ST_init_run()`



Expand Down
18 changes: 9 additions & 9 deletions ST_grid.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@
/******** These modules are necessary to compile ST_grid.c ********/
#include "ST_stats.h"
#include "ST_defines.h"
#include "sw_src/pcg/pcg_basic.h"
#include "sw_src/external/pcg/pcg_basic.h"
#include "sxw_vars.h"
#include "sw_src/SW_Site.h"
#include "sw_src/SW_SoilWater.h"
#include "sw_src/SW_VegProd.h"
#include "sw_src/SW_Model.h"
#include "sw_src/SW_Weather.h"
#include "sw_src/include/SW_Site.h"
#include "sw_src/include/SW_SoilWater.h"
#include "sw_src/include/SW_VegProd.h"
#include "sw_src/include/SW_Model.h"
#include "sw_src/include/SW_Weather.h"
#include "ST_seedDispersal.h"

/*********************** Grid Structures ****************************/

/**
/**
* \brief Soil layer information for a single [cell](\ref CellType)
*
*
* This struct requires dynamic memory allocation, so be carefull when
* instanciating it.
*
*
* \ingroup GRID
*/
typedef struct Soil_st
Expand Down
4 changes: 2 additions & 2 deletions ST_indivs.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
#include <stdlib.h>
#include "ST_steppe.h"
#include "ST_globals.h"
#include "sw_src/filefuncs.h"
#include "sw_src/myMemory.h"
#include "sw_src/include/filefuncs.h"
#include "sw_src/include/myMemory.h"


/******** Modular External Function Declarations ***********/
Expand Down
22 changes: 11 additions & 11 deletions ST_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,21 @@
#include <string.h>
#include <stdlib.h>
#include "ST_steppe.h"
#include "sw_src/generic.h" // externs `*logfp`, `errstr`, `EchoInits`, `QuietMode`, `logged`
#include "sw_src/filefuncs.h" // externs `inbuf`
#include "sw_src/myMemory.h"
#include "sw_src/SW_VegProd.h"
#include "sw_src/SW_Control.h"
#include "sw_src/pcg/pcg_basic.h"
#include "sw_src/SW_Markov.h"// externs `markov_rng`
#include "sw_src/include/generic.h" // externs `*logfp`, `errstr`, `EchoInits`, `QuietMode`, `logged`
#include "sw_src/include/filefuncs.h" // externs `inbuf`
#include "sw_src/include/myMemory.h"
#include "sw_src/include/SW_VegProd.h"
#include "sw_src/include/SW_Control.h"
#include "sw_src/external/pcg/pcg_basic.h"
#include "sw_src/include/SW_Markov.h"// externs `markov_rng`

#include "sxw_funcs.h"
#include "sxw.h"
// externs `prepare_IterationSummary`, `storeAllIterations`
#include "sw_src/SW_Output.h"
#include "sw_src/SW_Output_outtext.h" // externs `print_IterationSummary`
#include "sw_src/SW_Output_outarray.h"
#include "sw_src/rands.h"
#include "sw_src/include/SW_Output.h"
#include "sw_src/include/SW_Output_outtext.h" // externs `print_IterationSummary`
#include "sw_src/include/SW_Output_outarray.h"
#include "sw_src/include/rands.h"
#include "ST_functions.h" // externs `environs_rng`, `resgroups_rng`, `species_rng`
#include "ST_spinup.h"
#include "ST_stats.h"
Expand Down
8 changes: 4 additions & 4 deletions ST_mortality.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
#include <string.h>

#include "ST_mortality.h"
#include "sw_src/filefuncs.h"
#include "sw_src/rands.h"
#include "sw_src/myMemory.h"
#include "sw_src/include/filefuncs.h"
#include "sw_src/include/rands.h"
#include "sw_src/include/myMemory.h"
#include "ST_steppe.h"
#include "ST_globals.h"
#include "sw_src/pcg/pcg_basic.h"
#include "sw_src/external/pcg/pcg_basic.h"
#include "sxw_vars.h"


Expand Down
12 changes: 6 additions & 6 deletions ST_mortality.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@
#ifndef MORTALITY_H
#define MORTALITY_H

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

/* --------------------------- Exported Structs ---------------------------- */

/**
* \brief Information used when simulating the cheatgrass-wildfire loop.
*
*
* The biggest determinant in cheatgrass driven wildfire is precipitation,
* specifically precipitation in Spring and Winter. This struct stores the
* specifically precipitation in Spring and Winter. This struct stores the
* values from previous Spring and Winter precipitation as well as the running
* averages of both.
*
*
* Note that "year" in this context refers to the water year, which runs from
* October to September.
*
*
* \sa _updateCheatgrassPrecip, where this struct is updated each year.
* \author Chandler Haukap
* \date 13 January 2020
Expand Down
6 changes: 3 additions & 3 deletions ST_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
#include <string.h>
#include "ST_steppe.h"
#include "ST_globals.h"
#include "sw_src/filefuncs.h"
#include "sw_src/myMemory.h"
#include "sw_src/include/filefuncs.h"
#include "sw_src/include/myMemory.h"


/******** Modular External Function Declarations ***********/
/* -- truly global functions are declared in functions.h --*/
/***********************************************************/
#include "sw_src/SW_Model.h" // externs `SW_Model`
#include "sw_src/include/SW_Model.h" // externs `SW_Model`


/*------------------------------------------------------*/
Expand Down
6 changes: 3 additions & 3 deletions ST_params.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
#include <ctype.h>
#include <errno.h>
#include "ST_steppe.h"
#include "sw_src/filefuncs.h"
#include "sw_src/myMemory.h"
#include "sw_src/rands.h"
#include "sw_src/include/filefuncs.h"
#include "sw_src/include/myMemory.h"
#include "sw_src/include/rands.h"
#include "sxw_funcs.h"
#include "ST_globals.h"
#include "sxw_vars.h"
Expand Down
6 changes: 3 additions & 3 deletions ST_resgroups.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
#include <string.h>
#include "ST_steppe.h"
#include "ST_globals.h"
#include "sw_src/myMemory.h"
#include "sw_src/rands.h"
#include "sw_src/filefuncs.h"
#include "sw_src/include/myMemory.h"
#include "sw_src/include/rands.h"
#include "sw_src/include/filefuncs.h"
#include "sxw_funcs.h"


Expand Down
6 changes: 3 additions & 3 deletions ST_seedDispersal.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
#include "ST_defines.h"
#include "ST_grid.h"
#include "ST_seedDispersal.h"
#include "sw_src/rands.h"
#include "sw_src/myMemory.h"
#include "sw_src/rands.h"
#include "sw_src/include/rands.h"
#include "sw_src/include/myMemory.h"
#include "sw_src/include/rands.h"

float _distance(int x1, int y1, int x2, int y2, float cellWidth);
Bool _shouldProduceSeeds(SppIndex sp);
Expand Down
6 changes: 3 additions & 3 deletions ST_species.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
#include <string.h>
#include "ST_steppe.h"
#include "ST_globals.h"
#include "sw_src/filefuncs.h"
#include "sw_src/myMemory.h"
#include "sw_src/rands.h"
#include "sw_src/include/filefuncs.h"
#include "sw_src/include/myMemory.h"
#include "sw_src/include/rands.h"
#include "ST_spinup.h"
#include "ST_seedDispersal.h" // externs `UseSeedDispersal`

Expand Down
22 changes: 11 additions & 11 deletions ST_spinup.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@
#include "ST_stats.h"
#include "ST_globals.h" // externs UseProgressBar
#include "ST_mortality.h"
#include "sw_src/rands.h"
#include "sw_src/SW_SoilWater.h" // externs SW_Soilwat
#include "sw_src/SW_Weather.h" // externs SW_Weather
#include "sw_src/SW_Site.h" // externs SW_Site
#include "sw_src/SW_VegProd.h" // externs SW_VegProd
#include "sw_src/SW_Markov.h"// externs `markov_rng`
#include "sw_src/include/rands.h"
#include "sw_src/include/SW_SoilWater.h" // externs SW_Soilwat
#include "sw_src/include/SW_Weather.h" // externs SW_Weather
#include "sw_src/include/SW_Site.h" // externs SW_Site
#include "sw_src/include/SW_VegProd.h" // externs SW_VegProd
#include "sw_src/include/SW_Markov.h"// externs `markov_rng`
#include "sxw_funcs.h"
#include "sw_src/myMemory.h"
#include "sw_src/filefuncs.h"
#include "sw_src/include/myMemory.h"
#include "sw_src/include/filefuncs.h"
#include "ST_progressBar.h"
#include "ST_grid.h" // externs grid_rng
// externs `prepare_IterationSummary`, `storeAllIterations`
#include "sw_src/SW_Output.h"
#include "sw_src/SW_Output_outtext.h" // externs `print_IterationSummary`
#include "sw_src/SW_Output_outarray.h"
#include "sw_src/include/SW_Output.h"
#include "sw_src/include/SW_Output_outtext.h" // externs `print_IterationSummary`
#include "sw_src/include/SW_Output_outarray.h"
#include "ST_functions.h" // externs `environs_rng`, `resgroups_rng`, `species_rng`


Expand Down
4 changes: 2 additions & 2 deletions ST_stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@

#include <string.h>
#include "ST_steppe.h"
#include "sw_src/filefuncs.h"
#include "sw_src/myMemory.h"
#include "sw_src/include/filefuncs.h"
#include "sw_src/include/myMemory.h"
#include "ST_stats.h" // Contains most of the function declarations.
#include "ST_seedDispersal.h" // externs `UseSeedDispersal`
#include "ST_globals.h"
Expand Down
2 changes: 1 addition & 1 deletion ST_structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#ifndef STEPPE_STRUCT_DEF
#define STEPPE_STRUCT_DEF

#include "sw_src/generic.h"
#include "sw_src/include/generic.h"
#include "ST_mortality.h"

/**
Expand Down
Loading

0 comments on commit 5505457

Please sign in to comment.