Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development towards v8.0.0 #378

Merged
merged 397 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
397 commits
Select commit Hold shift + click to select a range
473ff66
Remove/modify unnecessary arguments for `fill_netCDF_with_invariants()`
N1ckP3rsl3y Dec 17, 2023
961ebe5
New function `write_uint_att()`
N1ckP3rsl3y Dec 18, 2023
9d566f9
Fill domain variables with values (domain netCDF)
N1ckP3rsl3y Dec 18, 2023
1aebbd6
Correct misspelling of "dimension"
N1ckP3rsl3y Dec 18, 2023
3cb941c
Calculate nc-attribute coordinate_system from other inputs
dschlaep Dec 18, 2023
4b7a6f6
Fail if user inputs primary CRS type but not corresponding attributes
dschlaep Dec 18, 2023
25ff435
Address 'char *' vs. 'const char *'
dschlaep Dec 18, 2023
1b8b60c
Use backwards compatible input values for spatial bbox
dschlaep Dec 18, 2023
810fedc
Fill domain file variable `*_bnds` with values
N1ckP3rsl3y Dec 20, 2023
ff65c83
Correct lat/lon & y/x unit attribute within domain netCDF
N1ckP3rsl3y Dec 20, 2023
3bccf24
Correct netCDF function doc argument directions (in/out)
N1ckP3rsl3y Dec 20, 2023
25573d3
Implement SW_NETCDF memory management
N1ckP3rsl3y Dec 20, 2023
fc47872
Added spinup variables to SW_MODEL struct for ease of access
niteflyunicorns Dec 20, 2023
7a1a2de
modified the model setup to store the new spinup data
niteflyunicorns Dec 20, 2023
5de7b0e
added spinup functionality and added flags for disabling outputs
niteflyunicorns Dec 20, 2023
b562538
added initializer for the rng seed
niteflyunicorns Dec 20, 2023
5f0850e
Fill function stub `SW_NC_check()`
N1ckP3rsl3y Dec 22, 2023
a93b56b
Update SW_DOMAIN memory management
N1ckP3rsl3y Dec 22, 2023
6bb7d9f
Correct `SW_NC_check()` + remove `SW_NC_read_domain()`
N1ckP3rsl3y Dec 23, 2023
d13f177
changed max key length for reading domain file and enabled both spinu…
niteflyunicorns Dec 24, 2023
ba602a9
Horz. coord. writing depends on CRS bounding box
N1ckP3rsl3y Dec 25, 2023
50b9c07
Fill `SW_NC_read_inputs()`
N1ckP3rsl3y Dec 26, 2023
08a9ad4
Silence mp-gcc12 complier in `SW_NC_init_ptrs()`
N1ckP3rsl3y Dec 26, 2023
c328106
Add compression to netCDF variables
N1ckP3rsl3y Dec 26, 2023
9ddb2d2
changed memory handling in spinup function
niteflyunicorns Dec 28, 2023
40257f6
changed loop scope to align with running 'first N years' of simulation
niteflyunicorns Dec 28, 2023
41628ba
Rename `ncInfo` to `SW_netCDF`
N1ckP3rsl3y Dec 29, 2023
19724a8
Misc. SW_netCDF.c changes including whitespace + documenation
N1ckP3rsl3y Dec 29, 2023
39bca68
Create new SW_netCDF.c function stubs for the branch
N1ckP3rsl3y Dec 29, 2023
4de69cd
New input file - `progress.nc`
N1ckP3rsl3y Dec 29, 2023
2d1c6e4
Close files upon error in SW_netCDF.c
N1ckP3rsl3y Jan 2, 2024
581cca6
Fix segmentation fault + dealloc rest of SW_NETCDF
N1ckP3rsl3y Jan 2, 2024
9858bf0
Remove one site/grid cell exception in `SW_CTL_run_sw()`
N1ckP3rsl3y Jan 2, 2024
cdc30b8
Additional known leak suppressions for macOS arm64
dschlaep Jan 3, 2024
703bffb
Check required input from key-value input files
dschlaep Jan 3, 2024
1b1765d
Wrapping up feature_nc_domain
dschlaep Jan 3, 2024
49c87c6
Clarify documentation of `LogError()` and usage of `LogInfo` function…
dschlaep Jan 3, 2024
69cd470
Merge branch 'release/devel_v8.0.0' into feature_nc_domain
dschlaep Jan 3, 2024
5805ebb
Fixed early return checks in a few places and removed an unnecessary …
niteflyunicorns Jan 3, 2024
6cf551e
Fixed function prototype in header file
niteflyunicorns Jan 3, 2024
b224cc8
Updated an out-of-scope variable
niteflyunicorns Jan 3, 2024
de17065
Merge branch 'release/devel_v8.0.0' into feature-spinup
niteflyunicorns Jan 3, 2024
bf32168
Guarantee domain netCDF files will be closed
N1ckP3rsl3y Jan 3, 2024
44edc31
`SW_NC_check()` fails upon no geographic CRS
N1ckP3rsl3y Jan 3, 2024
b1d842e
Only get lat/lon values from geographic CRS
N1ckP3rsl3y Jan 3, 2024
528c17b
`SW_NC_read_inputs()` - only get horz. coord. values values from geog…
N1ckP3rsl3y Jan 3, 2024
b20a66c
Rename `DOMAIN_NC` define to `vNCdom`
N1ckP3rsl3y Jan 3, 2024
fa6d965
Update NEWS, README, and user guide
dschlaep Jan 4, 2024
0decf3b
Read suid-specific netCDF inputs into `local_sw` (and not `sw_template`)
dschlaep Jan 4, 2024
2578db8
SW_DOM_read(): check that min <= max of bounding box axes
dschlaep Jan 4, 2024
1207ffa
domain_template.nc now fills both horizontal coordinates increasingly
dschlaep Jan 4, 2024
e9ca483
netCDF domain template: clarify between XY-axes and horizontal coordi…
dschlaep Jan 4, 2024
4e370cd
GHA: new step to compile SOILWAT2 with netCDF support
dschlaep Jan 4, 2024
8e3adf3
Merge pull request #383 from DrylandEcology/feature_nc_domain
dschlaep Jan 4, 2024
c6c2195
Merge branch 'release/devel_v8.0.0' into feature_nc_progress
N1ckP3rsl3y Jan 5, 2024
575008b
Correct function headers in `SW_Domain.c`/`SW_netCDF.c`
N1ckP3rsl3y Jan 5, 2024
d021c0b
SW_NETCDF stores variable IDs + update `SW_NC_open_files()`
N1ckP3rsl3y Jan 5, 2024
bcf2d8b
Fill `SW_NC_create_template()`
N1ckP3rsl3y Jan 5, 2024
819a368
Fill `SW_NC_CreateProgress()`
N1ckP3rsl3y Jan 5, 2024
0450407
Fill `SW_NC_set_progress`/`SW_NC_check_progress()`
N1ckP3rsl3y Jan 5, 2024
dab1827
Update `get_dim_identifier()` arguments to use `const char*`
N1ckP3rsl3y Jan 5, 2024
501e72b
Fix SW_NC_read(): new switch case was missing a break
dschlaep Jan 7, 2024
5be7b20
Fix SW_CTL_RunSimSet(): numDomainErrors was no longer incremented if …
dschlaep Jan 7, 2024
217226f
progress: identify failed simulation runs
dschlaep Jan 7, 2024
2e90c24
progress.nc gains attributes "flag_values" and "flag_meanings"
dschlaep Jan 7, 2024
fe4b1d6
Fix missing ";" in non-SWNETCDF code
dschlaep Jan 7, 2024
0cbaa04
Fix Bool vs bool conversion for C++ gtests
dschlaep Jan 7, 2024
0ca81ba
Fix buffer overflow in SW_NC_read_inputs()
dschlaep Jan 7, 2024
b10a6dd
Update NEWS to describe "progress" tracking
dschlaep Jan 7, 2024
42cc205
Allow for progress variable to be within domain netCDF
N1ckP3rsl3y Jan 8, 2024
4b4e01d
Add back progress netCDF checking
N1ckP3rsl3y Jan 8, 2024
3d28889
Clarify comments and documentation for domain/progress variables/files
dschlaep Jan 9, 2024
ae9dd59
fill_prog_netCDF_vals(): free allocated memory
dschlaep Jan 9, 2024
7fd06e9
Allow user-specified hostname and username to replace automatic values
dschlaep Jan 8, 2024
1573959
New timeStringISO8601()
dschlaep Jan 9, 2024
147b191
Address warnings/errors in tests compilation with `-DSWNETCDF`
N1ckP3rsl3y Jan 9, 2024
11c03fb
Deep copy netCDF information in tests
N1ckP3rsl3y Jan 9, 2024
6bbdaf2
Simple progress messages on the console
dschlaep Jan 9, 2024
d75e5d1
Fix SW_WT_ReportTime()
dschlaep Jan 9, 2024
84dbffc
Fix progress message of creating a progress tracker
dschlaep Jan 10, 2024
07ba534
Merge pull request #388 from DrylandEcology/feature_nc_progress
dschlaep Jan 10, 2024
a53f066
Prepare function (stubs) for the branch
N1ckP3rsl3y Jan 10, 2024
70531b5
`SW_FILE_STATUS` gains output netCDF file information
N1ckP3rsl3y Jan 10, 2024
d4222e5
New user input `strideOutYears`
N1ckP3rsl3y Jan 10, 2024
56b83c8
Rename `attributes_nc.in` to `desc_nc.in`
N1ckP3rsl3y Jan 10, 2024
ac41e45
Make use of p_OUT to store values with flag -DSWNETCDF
N1ckP3rsl3y Jan 11, 2024
2e56db1
Added water balance test for spinup
niteflyunicorns Jan 16, 2024
0cb4c36
File cleanup and variable modification
niteflyunicorns Jan 16, 2024
ed31bf5
Added new test file for testing spinup functionality and updated test…
niteflyunicorns Jan 16, 2024
5f31d5f
spinup: identify start year
dschlaep Jan 17, 2024
a4301a5
No resetting of spinup information in SW_Domain
dschlaep Jan 17, 2024
86f5c66
Update NEWS for new spinup functionality
dschlaep Jan 17, 2024
27dc469
Speed up spinup tests
dschlaep Jan 17, 2024
b8e650e
Spinup test: use initial soil temperature values
dschlaep Jan 18, 2024
f2e154c
Clarify that no spinup if duration is 0
dschlaep Jan 18, 2024
13e3ba9
Evaluate spinup
dschlaep Jan 18, 2024
c72938a
Merge branch 'release/devel_v8.0.0' into feature-spinup
dschlaep Jan 18, 2024
9173c90
Simplify SW_MODEL by using SW_SPINUP
dschlaep Jan 23, 2024
633e109
Add missed `desc.in`
N1ckP3rsl3y Jan 30, 2024
dc3d4a2
New input file - `SW2_netCDF_output_variables.csv`
N1ckP3rsl3y Jan 30, 2024
9e78ad6
Read new `desc_nc.in` input - `baseCalendarYear`
N1ckP3rsl3y Jan 30, 2024
b37e70c
Update `SW_netCDF` + `SW_CTL_run_sw()` function headers
N1ckP3rsl3y Jan 30, 2024
241b434
Update output key `ESTABL` number of vars for netCDFs
N1ckP3rsl3y Jan 30, 2024
98639f9
Move `depths` calculation to SW_SITE
N1ckP3rsl3y Jan 30, 2024
7d3717b
Fill `SW_NC_create_output_files()`
N1ckP3rsl3y Jan 30, 2024
0f35e9b
Fill `SW_NC_write_output()`
N1ckP3rsl3y Jan 30, 2024
ba636f0
Copy output information for each simulation
N1ckP3rsl3y Jan 30, 2024
cd40db1
Update function calls where arguments were updated
N1ckP3rsl3y Jan 30, 2024
040eb8c
Gather number of maximum soil layers
N1ckP3rsl3y Jan 30, 2024
9f83897
Add small missed changes
N1ckP3rsl3y Jan 30, 2024
fb2a3ea
Simplify `SW_NC_read_out_vars()`
N1ckP3rsl3y Feb 5, 2024
f0a9ca7
Simplify `SW_GENOUT_copy()`
N1ckP3rsl3y Feb 5, 2024
f128579
Simplify/correct time/layer calculations
N1ckP3rsl3y Feb 5, 2024
a8e3dbf
Simplify `SW_NC_write_output()`
N1ckP3rsl3y Feb 5, 2024
84e57a7
Update soil depth in tests
dschlaep Feb 5, 2024
98b0328
Merge pull request #385 from DrylandEcology/feature-spinup
niteflyunicorns Feb 6, 2024
1473b55
Resolve memory leaks in netCDF outputs
dschlaep Feb 6, 2024
0a94161
Simplify SW_NC_create_template()
dschlaep Feb 6, 2024
c5d9b80
Get correct ESTAB variable names for netCDF output
dschlaep Feb 6, 2024
6aea434
Merge branch 'release/devel_v8.0.0' into feature_nc_output
dschlaep Feb 6, 2024
660e556
New `doOutput` attribute in SW_MODEL
dschlaep Feb 7, 2024
d93ad1e
Compile tests with output code
dschlaep Feb 7, 2024
32ae7d5
Merge pull request #391 from DrylandEcology/feature_includeOutputInTests
dschlaep Feb 8, 2024
e773988
Merge branch 'release/devel_v8.0.0' into feature_nc_output
dschlaep Feb 8, 2024
cbac9be
Resolve compilation of tests if SWNETCDF defined
dschlaep Feb 8, 2024
2fa2903
Fix documentation for `SW_OUT_create_files()`
dschlaep Feb 9, 2024
a2acc0e
SW_NC_write_output(): loop over files within OutKeys
dschlaep Feb 9, 2024
9101fc6
Fix create_time_vars(): daily and weekly time values
dschlaep Feb 9, 2024
4e72f02
Fix SW_OUT_deepCopy(): avoid double-freeing of pointer
dschlaep Feb 9, 2024
7cc4df0
Partially fix calc_pOUTIndex(): avoid buffer overflow due to bad inde…
dschlaep Feb 9, 2024
864606a
Fix SW_DOM_read(): remove redundant switch case
dschlaep Feb 12, 2024
565355f
create_output_dimVar(): time variable gains "bounds" attribute
dschlaep Feb 14, 2024
16996ec
SW_NC_read_out_vars(): turn off outkey group if no variable requested
dschlaep Feb 14, 2024
2eeca32
New file: SW2_netCDF_output_variables
dschlaep Feb 14, 2024
e055f78
Improved formatting of "cell_method" netCDF attribute
dschlaep Feb 14, 2024
40f788a
Simplify time step descriptors
dschlaep Feb 14, 2024
20be646
SW_NC_create_output_files(): use "output_prefix" directory
dschlaep Feb 14, 2024
3b09df0
SW_NC_check(): now opens netCDF temporarily if not already open
dschlaep Feb 14, 2024
e649130
SW_NC_create_output_files(): now checks already existing output netCDFs
dschlaep Feb 14, 2024
5cdbd90
SW_NC_read_out_vars(): avoid double allocation of dimension value for…
dschlaep Feb 14, 2024
4c4e3bf
netCDF: only output individually requested outkey x outperiod combina…
dschlaep Feb 14, 2024
6d7ebff
Fix "SW2_netCDF_output_variables": vwcBulk <> vwcMatric
dschlaep Feb 15, 2024
2aa3dbc
Fix getNLayers(): key eSW_EvapSoil returns n_evap_lyrs
dschlaep Feb 16, 2024
ba0b46d
Output netCDF: variables are now organized by space -> time -> vertic…
dschlaep Feb 16, 2024
98556ae
Modified the spinup domain input check to accommodate for negative in…
niteflyunicorns Feb 18, 2024
9a1f441
Modified spinup functionality to handle negative domain input
niteflyunicorns Feb 18, 2024
7e829bc
SW_NC_read_out_vars(): longer attributes and check for string length
dschlaep Feb 21, 2024
de57fcd
SW_DOM_construct(): silence unused variables if not SOILWAT
dschlaep Feb 23, 2024
871e222
More specific information for output sizes: #variables, #soil layers,…
dschlaep Feb 22, 2024
3475126
SW_GENOUT_deepCopy(): check if source `colnames_OUT[]` is NULL
dschlaep Feb 22, 2024
9347af7
SW_NC_read_out_vars(): check if any ESTABL taxa
dschlaep Feb 22, 2024
37a4416
fill_dimVar(): use existing `key2veg[]`
dschlaep Feb 23, 2024
68727ba
Output netCDF: handle mixed-dimension outkeys
dschlaep Feb 23, 2024
9e44f70
Fix compilation for test and non-SWNETCDF mode
dschlaep Feb 23, 2024
da27da2
SW_DOMAIN gains domain-wide soil profile information
dschlaep Feb 28, 2024
4c7a2d4
Miscellaneous fixes needed for rSOILWAT2: added new case for closing …
niteflyunicorns Mar 14, 2024
8388298
Miscellaneous fixes needed for rSOILWAT2: added new case for closing …
niteflyunicorns Mar 14, 2024
a421118
Miscellaneous fixes needed for rSOILWAT2: changed pointer style for r…
niteflyunicorns Mar 14, 2024
34066e2
Miscellaneous fixes needed for rSOILWAT2: changed version printing fu…
niteflyunicorns Mar 14, 2024
055bb84
Miscellaneous fixes needed for rSOILWAT2: fixed a typo and an unused …
niteflyunicorns Mar 14, 2024
6f112fd
Unit conversion for netCDF output with udunits2
dschlaep Apr 16, 2024
3ab2f8b
GHA: add a compilation with netCDF and udunits2 libraries
dschlaep Apr 16, 2024
9789d7d
Merge branch 'release/devel_v8.0.0' into feature_nc_output
dschlaep Apr 16, 2024
303e771
Merge branch 'feature_nc_output' into feature_nc_units
dschlaep Apr 16, 2024
4c1beb7
Merge pull request #393 from DrylandEcology/feature_nc_units
dschlaep Apr 16, 2024
e4ec06e
Update NEWS
dschlaep Apr 17, 2024
b13f30f
Fix dimExists()
dschlaep Apr 17, 2024
9b7d9bc
Infer global netCDF attribute "featureType" based on frequency attribute
dschlaep Apr 17, 2024
f6dbdb0
Domain type is now a function argument instead of being read from net…
dschlaep Apr 17, 2024
8e09d58
Expand documentation
dschlaep Apr 18, 2024
eb6fdec
Input file "SW2_netCDF_output_variables.tsv" gains "SW2 txt output" c…
dschlaep Apr 18, 2024
c90512c
Fix SW_NC_create_units_converters()
dschlaep Apr 18, 2024
e87af56
Fix SW_NC_read_inputs(): use correct units
dschlaep Apr 19, 2024
11e35c7
New scripts to compare output among text-, nc-, and R-based runs
dschlaep Apr 26, 2024
5094acc
Use a DrylandEcology fork of pcg
dschlaep Apr 29, 2024
978146d
Merge pull request #394 from DrylandEcology/feature_forked_pcg
dschlaep Apr 29, 2024
0a7b869
Merge branch 'release/devel_v8.0.0' into feature_nc_output
dschlaep Apr 29, 2024
422a96b
Update NEWS
dschlaep Apr 30, 2024
3d349b9
Merge pull request #390 from DrylandEcology/feature_nc_output
dschlaep Apr 30, 2024
536c91a
Fixes for implementing domain/spinup in rSOILWAT2
dschlaep May 7, 2024
6467716
Merge pull request #401 from DrylandEcology/feature_v800_for_rSOILWAT2
dschlaep May 7, 2024
36cb14e
Fix sw_fail_on_error() for rSOILWAT2
dschlaep May 17, 2024
d336a42
STEPWAT2 headers are no longer required
dschlaep May 20, 2024
e15f7eb
Fix SW_OUT_create_files()
dschlaep May 20, 2024
8678a89
Basic mocked R functions to compile as RSOILWAT library
dschlaep May 20, 2024
8b38193
GHA: now also compile as library
dschlaep May 20, 2024
10322ac
Simplify compilation as library
dschlaep May 22, 2024
646a4c2
Overhauled scripts for comprehensive checks
dschlaep May 22, 2024
8db0e4c
Overhauled scripts that run extra checks and figures
dschlaep May 22, 2024
c5f29c2
Updated Readme & Contributing
dschlaep May 22, 2024
9ee8094
Merge pull request #402 from DrylandEcology/feature_compile_lib
dschlaep May 22, 2024
3689d4a
Set up code style
dschlaep May 29, 2024
0987e33
Format entire code base
dschlaep May 23, 2024
6853e36
Reorganize header include directives
dschlaep May 30, 2024
e2b74ed
Renamed swprintf to sw_printf to avoid name conflict with <wchar.h>
dschlaep May 30, 2024
bbd0bb5
Rename macro length to sw_length to avoid conflicts with <gmock.h>
dschlaep May 30, 2024
ed78d9f
Removed unused macro "abs" to avoid conflict with <stdlib.h>
dschlaep May 30, 2024
eb9a082
Fix formatting of script tools/check_functionality.sh
dschlaep May 30, 2024
1b9b606
Update ".git-blame-ignore-revs"
dschlaep May 30, 2024
06369f8
Identify non-C standard library headers in filefuncs.c
dschlaep May 31, 2024
779a45f
Rename min/max to MIN/MAX to avoid conflict with C++ <algorithm>
dschlaep May 31, 2024
fa9cb58
Updated NEWS
dschlaep May 31, 2024
8670d87
Merge pull request #404 from DrylandEcology/feature_format
dschlaep May 31, 2024
7ce19c4
Hard-code SOILWAT2 variable units
N1ckP3rsl3y Jun 16, 2024
43c220e
Correct code format to match clang's format
N1ckP3rsl3y Jun 17, 2024
08ae94a
Correct warn message for incorrect SW2 units
N1ckP3rsl3y Jun 18, 2024
e9b03c3
Merge pull request #410 from DrylandEcology/feature_issue408
N1ckP3rsl3y Jun 18, 2024
8db40de
Fix units in check tool scripts
dschlaep Jun 18, 2024
7c5ecbd
Include establishment in output for the example simulation run
dschlaep Jun 18, 2024
b163c6f
Merge pull request #413 from DrylandEcology/feature_testESTABL
dschlaep Jun 19, 2024
9bd6f28
Fix the check of internal units
dschlaep Jun 21, 2024
ea543dc
Fix memory leak in nc-based test program
dschlaep Jun 21, 2024
ab45d22
Option for automatic naming of domain template netCDF file
dschlaep Jun 21, 2024
41a9b0a
Merge pull request #414 from DrylandEcology/bugfix_testMemoryLeak
dschlaep Jun 22, 2024
1808a81
Fix SW_OUTTEXT preprocessor check in `SW_OUT_write_today()`
N1ckP3rsl3y Jun 26, 2024
09eaafa
Rename SW_ALL to SW_RUN
N1ckP3rsl3y Jun 27, 2024
88c6d6a
Split output data structs into SW_OUT_DOM/RUN
N1ckP3rsl3y Jul 2, 2024
5fe65df
Match code to new structs
N1ckP3rsl3y Jul 3, 2024
e554cf1
Fix `write_headers_to_csv()` error
N1ckP3rsl3y Jul 3, 2024
c311fab
Update code to match clang format
N1ckP3rsl3y Jul 3, 2024
018c00e
Correct STEPWAT2/rSOILWAT2 code
N1ckP3rsl3y Jul 3, 2024
2221988
Split `get_none()` into `get_none_text()` & `get_none_outarray()`
N1ckP3rsl3y Jul 3, 2024
a348dda
Finish renaming of SW_ALL to SW_RUN
N1ckP3rsl3y Jul 5, 2024
e60d67e
Rename `SW_OUT_deepCopy()` to `SW_FILESTATUS_deepCopy()`
N1ckP3rsl3y Jul 5, 2024
bc5ffac
Simplify interfaces of `SW_OUT_set_SXWrequests` & `_set_SXWrequests_h…
N1ckP3rsl3y Jul 5, 2024
5cfebb3
New function `SW_OUTDOM_construct()`
N1ckP3rsl3y Jul 5, 2024
43703e7
Change preprocessor conditions for `print_IterationSummary` and `sw_o…
N1ckP3rsl3y Jul 5, 2024
ffa0e45
Properly use `OutRun` not `sw->OutRun` in output functions
N1ckP3rsl3y Jul 5, 2024
20738d5
"Doxygen Awesome" theme for documentation
dschlaep Jul 5, 2024
90f30c0
Merge pull request #416 from DrylandEcology/feature_beautifyDoxygen
dschlaep Jul 6, 2024
eb7cb0f
Merge branch 'release/devel_v8.0.0' into feature_SeparateRunDomOutput
dschlaep Jul 6, 2024
2c8b1e3
Clang format output `SW_Output_get_functions.c`
N1ckP3rsl3y Jul 6, 2024
9c34045
Zero out SW_OUT_DOM in `SW_OUTDOM_construct()`
N1ckP3rsl3y Jul 6, 2024
9f50109
Update output description in SW_Output.c
N1ckP3rsl3y Jul 6, 2024
f96fb86
Return if `SW_FILESTATUS_deepCopy()` fails
N1ckP3rsl3y Jul 8, 2024
b9065e8
New functions - `SW_OUTDOM_init_ptrs` & `SW_OUTDOM_deepCopy`
N1ckP3rsl3y Jul 8, 2024
0b334f1
Swap dest and source for `memcpy()` in `SW_OUTDOM_deepCopy()`
N1ckP3rsl3y Jul 8, 2024
4dfbbab
Merge pull request #415 from DrylandEcology/feature_SeparateRunDomOutput
N1ckP3rsl3y Jul 8, 2024
0f99a0f
Remove `defined(STEPWAT)` when setting print_SW_Output in `SW_OUTDOM_…
N1ckP3rsl3y Jul 9, 2024
aaa66f2
Eliminate truncate warning produced on Linux (netCDFs)
N1ckP3rsl3y Jul 9, 2024
a8fadff
`SW_OUT_construct()` gains parameter to zero-out SW_OUT_RUN
N1ckP3rsl3y Jul 10, 2024
46a4244
Fix makefile for user provided flags for netcdf-c, udunits2, and expat
dschlaep Jul 9, 2024
0e9b6c6
sw_print_version() now prints capabilities
dschlaep Jul 9, 2024
57379ab
Improve tools/check_outputModes.sh
dschlaep Jul 10, 2024
7ff6e45
Simplify call to `pfunc_text` with STEPWAT2 in `SW_OUT_write_today()`
N1ckP3rsl3y Jul 10, 2024
6a4684b
Update incomplete function parameter descriptions
N1ckP3rsl3y Jul 10, 2024
2242e24
Merge branch 'release/devel_v8.0.0' into fix_compileNC
dschlaep Jul 10, 2024
5e48d76
Merge pull request #417 from DrylandEcology/fix_compileNC
dschlaep Jul 10, 2024
fbe210d
Finalize NEWS for v8.0.0
dschlaep Jul 10, 2024
3dc16b2
Remove unused variable `outputVarsFileName` (SW_NETCDF)
N1ckP3rsl3y Jul 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .LSAN_suppr.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,12 @@

# These are known leaks that await fixing

# on Apple arm64: https://github.com/google/sanitizers/issues/1501
# on Apple arm64: suppress system libraries
# * https://github.com/google/sanitizers/issues/1501
# * https://github.com/llvm/llvm-project/issues/59758
# * https://discourse.llvm.org/t/does-leaksanitizer-not-work-on-macos-13-apple-silicon
leak:realizeClassWithoutSwift
leak:_fetchInitializingClassList
leak:libobjc.A.dylib
leak:libsystem_c.dylib
leak:libsystem_info.dylib
16 changes: 16 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
BasedOnStyle: LLVM
AlignAfterOpenBracket: BlockIndent # llvm: Align; >= v14
AlignEscapedNewlines: Left # llvm: right
BinPackArguments: false # llvm: true
BinPackParameters: false # llvm: true
BreakBeforeTernaryOperators: false # llvm: true
IndentWidth: 4 # llvm: 2
InsertBraces: true # llvm: false; >= v15
InsertNewlineAtEOF: true # llvm: false; >= v16
MaxEmptyLinesToKeep: 2 # llvm: 1
PenaltyReturnTypeOnItsOwnLine: 1000 # llvm: 60
SeparateDefinitionBlocks: Always # llvm: leave; >= v14
SortIncludes: CaseInsensitive # llvm: CaseSensitive
SpaceAfterCStyleCast: true # llvm: false
...
27 changes: 27 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# List of specific commits to ignore by git

# Useful for running automatic formatters without losing author information on relevant revisions

# based on information from https://michaelheap.com/git-ignore-rev/

# Run `git blame --ignore-revs-file .git-blame-ignore-revs`

# Or set up global git config:
# # Set a global ignoreRevsFile
# git config --global blame.ignoreRevsFile .git-blame-ignore-revs
#
# # Mark any lines that have had a commit skipped using --ignore-rev with a `?`
# git config --global blame.markIgnoredLines true
#
# # Mark any lines that were added in a skipped commit and can not be attributed with a `*`
# git config --global blame.markUnblamableLines true


# Initial push of existing code base
af175f2ba4af18a3957e585a497e4913e2ec8847

# Format entire code base
0987e33874b8bba546d0cc71f7e096bb9f843869

# Reorganize header include directives
6853e36433d67be0b9c3a8b46bf46e634352a1b1
27 changes: 27 additions & 0 deletions .github/workflows/clang-format-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: clang-format check

# based on https://github.com/marketplace/actions/clang-format-check

on:
push:
branches: [master, main, release/**]
pull_request:
branches: [master, main, release/**]

jobs:
formatting-check:
name: Formatting Check
runs-on: ubuntu-latest
strategy:
matrix:
path:
- 'include'
- 'src'
- 'tests/gtests'
steps:
- uses: actions/checkout@v4
- name: Run clang-format style check
uses: jidicula/[email protected]
with:
clang-format-version: '18'
check-path: ${{ matrix.path }}
29 changes: 29 additions & 0 deletions .github/workflows/main_nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,35 @@ jobs:
if: ${{ runner.os != 'macOS' }}
run: make clean test_sanitizer

- name: Compile as library for STEPWAT2
run: CPPFLAGS='-DSTEPWAT' make clean lib

- name: Compile as library for rSOILWAT2
# Rmock/ provides bare-bones headers of R C-API functions required by SOILWAT2
run: CPPFLAGS='-DRSOILWAT' CFLAGS='-Iexternal/Rmock' make clean libr


build_ncSW2:
runs-on: ubuntu-latest

steps:
- name: Checkout repository and submodules
uses: actions/checkout@v3
with:
submodules: recursive

- name: Install netCDF-C and udunits2
run: |
sudo apt-get update
sudo apt-get install libnetcdf-dev libudunits2-dev

- name: Build binary with netCDF support
run: CPPFLAGS=-DSWNETCDF make clean all

- name: Build binary with netCDF and udunits2 support
run: CPPFLAGS='-DSWNETCDF -DSWUDUNITS' make clean all



check_code_coverage:
runs-on: ubuntu-latest
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/main_win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,9 @@ jobs:

- name: Unit tests (shuffle and repeat 3x)
run: make clean test_rep3rnd

- name: Compile as library for STEPWAT2
run: CPPFLAGS='-DSTEPWAT' sw_sources='SW_Output_outarray.c SW_Output_outtext.c' make clean lib

- name: Compile as library for rSOILWAT2
run: CPPFLAGS='-DRSOILWAT' CFLAGS='-Iexternal/Rmock' sw_sources='SW_Output_outarray.c' make clean libr
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
# Figures created by scripts in tools/
/tools/Fig*
/tools/*.pdf
/tools/figures/
/tools/figures*

# Google unit test output
gtest-*.o
Expand Down
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
branch = main
[submodule "pcg"]
path = external/pcg
url = https://github.com/imneme/pcg-c-basic
branch = master
url = https://github.com/DrylandEcology/pcg-c-basic
branch = feature_sw2
132 changes: 132 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,137 @@
# NEWS

# SOILWAT2 v8.0.0-devel
* Simulation output remains the same as the previous version.
However, output of establishment/recruitment for two species is now
generated by default by the example simulation run.

* SOILWAT2 can now be compiled in one of two modes
(#361, #362, #363; @N1ckP3rsl3y, @dschlaep):
* `"netCDF"`-based input (currently limited to the `"domain"`) and outputs;
this mode is compiled if the new preprocessor definition `"SWNETCDF"`
and the `"netCDF"` library are available,
e.g., `CPPFLAGS=-DSWNETCDF make all`
* text-based input and output (as previously)

* SOILWAT2 now represents a simulation `"domain"`, i.e.,
a set of (independent) simulation units/runs (#360; @N1ckP3rsl3y, @dschlaep).
A `"domain"` is defined by either a set of `"sites"` or by a `"xy"`-grid.
The simulation set consists of simulation units within a `"domain"` that
have not yet been simulated.
Simulation units are identified via `"suid"` (simulation unit identifier).
* Input text files are read once and now populate a `"template"`
that is used for each simulation unit.
* New `SW_CTL_RunSimSet()` loops over the simulation set or
runs one user specified simulation unit.
It writes warning and error messages from all simulation units to the
`logfile` but does not exit if a simulation unit fails
(`main()` will exit with an error if it fails or
if every simulation unit produced an error).
* New `SW_CTL_run_sw()` takes a deep copy of the `"template"` as basis
for each simulation unit.
* For `"netCDF"`-based SOILWAT2, information about the `"domain"`
(i.e., simulation units and their geographic locations) is obtained from
`"domain.nc"` (#361; @N1ckP3rsl3y, @dschlaep).
* For `"netCDF"`-based SOILWAT2, simulation progress (success/failure) is
tracked by `"progress.nc"` (#387; @N1ckP3rsl3y, @dschlaep);
progress tracking makes re-starts after partial completion of the
simulation set by an earlier execution possible.

* SOILWAT2 can now be compiled with `"udunits2"` to convert output to user
requested units (#392; @dschlaep, @N1ckP3rsl3y).
* Unit conversion is available only in `"netCDF"`-mode and if compiled
with the new preprocessor definition `"SWUDUNITS"`
and if the `"udunits2"` library is available,
e.g., `CPPFLAGS='-DSWNETCDF -DSWUDUNITS' make all`.
* Users request output units via field `"netCDF units"` of the
input file `"SW2_netCDF_output_variables.tsv"`.

* Tests now utilize the same template/deep-copy approach (@dschlaep),
i.e., input files from `test/example/` populate a `"template"` and
test fixture deep copy the `"template"` (avoiding repeated reading from disk).

* SOILWAT2 gained basic time tracking and reporting (#380; @dschlaep).
Temporal resolution may only be full seconds (for C99) but
could be sub-seconds (for C11 or later).
The runs over the simulation set end gracefully
if a user specified wall time limit is (nearly) reached
(nearly is defined by `SW_WRAPUPTIME`).
A report is written to `stdout` or (silently) to the `logfile` if user
requested quiet mode; the report includes
* Overall wall time and proportion of wall time for the simulation set
* Time of simulation units and reports average, standard deviation
minimum and maximum time.

* SOILWAT2 gained spin-up functionality (#379; @niteflyunicorns, @dschlaep).
A user-requested sequence of (random) years is simulated (without output)
before the actual simulation run to provide better starting values
(e.g., soil moisture, soil temperature).
User inputs are obtained from `"domain.in"`.

* The random number generator `"pcg"` is now a submodule of a forked copy
of the previous repository `imneme/pcg-c-basic` (#353; @dschlaep).
This allowed us to fix a function declaration without a prototype.

* Specified a consistent code style and formatted code,
header include directives, and doxygen documentation (#316; @dschlaep).

## Changes to inputs
* New input file `"domain.in"` with input variables that specify
type and spatial dimensions of the simulation `"domain"`
(with a backwards compatible default of one site),
start and end year (the latter previously in `"years.in"`), and
spin-up information (mode, duration, scope).
This input file uses a key-value pair approach, i.e., inputs must use
the correct key while they don't have to be on a specific line
(as they have to be in other input files).
* Input file `"years.in"` was removed (content moved to `"domain.in"`).
* New input file `"modelrun.in"` with inputs for geographic coordinates and
topography (previously in `"siteparam.in"`).
* Input file `"siteparam.in"` lost inputs for geographic coordinates and
topography (content moved to `"modelrun.in"`).
* Input file `"files.in"` gained two entries for `"netCDF"`-based SOILWAT2.
* New command line option `"-s X"` where `X` is a simulation unit identifier;
if the option `"-s X"` is absent or `X` is `0`, then all simulation units
in the simulation `"domain"` are run;
otherwise, only the simulation unit `X` is run.
* New command line option `"-t X"` where `X` is the wall time limit in seconds.
The code gracefully ends early if the wall time reaches a limit of
`X - SW_WRAPUPTIME` seconds; if the option `"-t X"` is absent,
then there is (practically) no wall time limit.
* New command line option `"-r"` to rename netCDF domain template file
to file name provided in `"Input_nc/files_nc.in"`.

## Changes to outputs
* Output of establishment/recruitment for two species is now
generated by default by the example simulation run (#411; @dschlaep).

## Changes to inputs and outputs for `"netCDF"`-based SOILWAT2
* `"netCDF"`-based SOILWAT2 is compiled if the new preprocessor definition
`"SWNETCDF"` is made available, e.g., `CPPFLAGS=-DSWNETCDF make all`
* User-specified paths to `"netCDF"` header and library can be provided as well,
e.g., `CPPFLAGS=-DSWNETCDF NC_CFLAGS="-I/path/to/include" NC_LIBS="-L/path/to/lib" make all`
* New input directory `"Input_nc/"` that describes `"netCDF"`-based inputs
(paths provided by new entries in `"files.in"`).
* New text input file `"files_nc.in"` that lists for each input purpose
(currently, `"domain"` and `"progress"` are implemented)
the path to the `"netCDF"` input file and associated variable name.
* New text input file `"attribues_nc.in"` to provide global attributes and a
geographic (and optionally a projected) `"CRS"` (coordinate reference system)
that describe the `"domain.nc"`.
* A user provided `"domain.nc"` that describes the simulation `"domain"`.
Specifications must be consistent with `"domain.in"`.
If absent, a template is automatically generated based on `"domain.in"`.
* A user provided `"progress.nc"` that describes the simulation `"progress"`.
Specifications must be consistent with `"domain.nc"`.
If absent, it is automatically generated based on `"domain.nc"`.
* New tab-separated value `"tsv"` input file `"SW2_netCDF_output_variables.tsv"`
that lists, activates, and describes each output variable in `"netCDF"` mode.
* All outputs are written to `"netCDF"` files based on user requests from
`"SW2_netCDF_output_variables.tsv"` (#363; @dschlaep, @N1ckP3rsl3y).
`"netCDF"` output files combine output variables by output group `"outkey"`
and output period (daily, weekly, monthly, yearly).


# SOILWAT2 v7.2.0
* Simulation output remains the same as the previous version.

Expand Down
Loading
Loading