Closed dschlaep closed 2 years ago
@kpalmqui: I set this up so that you can check out the STEPWAT2-side of the changes. I suggest that we first finish the corresponding changes in SOILWAT2 (https://github.com/DrylandEcology/SOILWAT2/pull/289 for which I tagged you as reviewer as well) before we merge this one into the main branch. Thanks!
Updated approach for global variables
close #512
previously, defined/implemented global variables in one source file & used extern declaration by each other source files that referenced a global variable --> problem: repeated declarations
previously, some header files defined/implemented global variables including ST_grid.h, ST_initialization.h, and ST_seedDispersal.h --> error due to
-fno-common
compilation as described in #512new approach (https://stackoverflow.com/questions/1433204/how-do-i-use-extern-to-share-variables-between-source-files?rq=1):
define/implement global variables in one source file
extern declare these variables in the header file belonging to that source file
include the header file by each other source files that referenced a global variable
--> reflecting corresponding SOILWAT2 changes, see DrylandEcology/SOILWAT2#289
--> no changes to example output