-
Notifications
You must be signed in to change notification settings - Fork 5
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
Updates for SOILWAT2 v7.1.0 #555
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
STEPWAT2 should meet reproducibility expectations as formulated with PR #528 (#528) that was merged into the main branch on Sep 18, 2022 with commit (7dce3c7) "Exactly reproduce random number sequences" This new bash script automatically runs gridded and nongridded example runs with STEPWAT2 using different seeds and uses 'diff' and 'Rscript' to check the following: * if seed != 0 (output is reproduced among runs) ** weather is exactly identical among runs and cells ** weather is different among years, iterations and seeds * if seed == 0 (output cannot be reproduced among runs) ** weather is different among cells, years, iterations and runs Note that 'master' and 'Seed_Dispersal' branches use different naming schemes of output files -> these need to be manually adjusted with variables `tag_gridded_biomass_cellk` (line 30) and `fname_gridded_biomass_meancell` (line 35) -- they are currently set to the 'Seed_Dispersal' scheme
- This commit puts together all changes made on the original development branch (#544) but without the changes to whitespace - Update submodule to the latest SOILWAT2 version - To prepare for parallelization, SOILWAT2 has been given the capability to be thread-safe and reentrant and has gained four new main structs * SW_ALL - All information relevant to the simulation, e.g., simulation output, program/user settings, etc. * LOG_INFO - Information pertaining to logging in the case of a warning, note, error, etc. output * PATH_INFO - Details about the program/project directory (input files, output files, and prefixes) * SW_OUTPUT_POINTERS - Storage to hold specific subroutines for output * STEPWAT2 gains these types as global - Most functions within SOILWAT2 have had their interfaces updated to have access to local instances of the four new structs and subtypes (SW_WEATHER, SW_MODEL, etc.) - Functions that call `LogError()` are updated to send in global LOG_INFO - Updated `ForEach*TranspLayer()` macro calls with `ForEachTranspLayer()` due to `ForEach*TranspLayer()` being replaced with `ForEachTranspLayer()` on SOILWAT2 - Updated other SOILWAT2 function calls to have the information it requires - Functions that read in files gain local buffers to write into instead of writing into a global buffer from SOILWAT2 - Removed "extern" comments for types/variables that are no longer globals - Removed unnecessary inclusion of SOILWAT2 files - sxw_sql.c/sxw.c gain SW_Times.h for constants representing the number of every month - Because STEPWAT2 does not use SOILWAT2 globals, we have to * Copy STEPWAT2 globals, SuperGlobals and Globals into SOILWAT2 instances of it after every model year run * Copy STEPWAT2 global, SuperGlobals into SOILWAT2 instance before reading in input from disk * Copy SOILWAT2's instance of SXW into STEPWAT2's global after every model year run - SOILWAT2 removed the "OUTSEP" line of "outsetup.in", so within STEPWAT inputs, the line has been removed - Updated test to create a local instance of LOG_INFO
- `SXW_Init()` now calls `SXW_Reset()` instead of directly `SXW_Reinit()` because gridded mode needs to deallocate memory that was previously dynamically allocated by SOILWAT2 for global variables `SoilWatAll`, etc. - gridded mode uses the same global variables for all grid cells and they are initialized by `_init_stepwat_inputs()` > loop over gridcells: `_init_SXW_inputs()` > `SXW_Init()`; thus, we were previously leaking memory that was allocated via call to `SXW_Init()` and not freed for the next grid cell. - this will no longer be needed once grid cells use their own local SOILWAT2 variables - sharing these global variables among iterations was already working correctly because it already called `SXW_Reset()`
…cy_threadsafety_compact - Updates SOILWAT2 to latest development version - v7.1.0 (includes preparations for threadsafety and reentrancy) - Added globals of the four new main (SOILWAT2) types - SW_ALL, SW_OUTPUT_POINTERS, PATH_INFO, and LOG_INFO
kpalmqui
approved these changes
Aug 23, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See DrylandEcology/SOILWAT2#351
tools/check_STEPWAT2.sh