-
Notifications
You must be signed in to change notification settings - Fork 4
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 for v6.1.0 #245
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
…up capabilities currently and to prepare for potential domain integration later
…ion from SOILWAT2 to rSOILWAT2 (namely the spinup functionality)
- More details about DayMet: noleap calendar; no wind data - Code examples illustrate now lack of wind data and obtaining atmospheric CO2 values
* renamed rSW_Model to rSW_Domain * added new file M_swSpinup.R to handle new spinup variables * incorporated new spinup variable with the existing years variables in the new domain file
* Something is still causing errors in terms of when files are read or not
- update to commit 3d349b9f7bf8db981df8b13f551f17210746e5e0 on branch release/devel_v8.0.0 ** now includes merged feature_nc_output ** submodule pcg changed remote origin
- Package-level updates: * NEWS * Submodule SOILWAT2 now at commit 6467716e415b42a13170d2b14452019b46f099fe (includes a few minor bug fixes) * SOILWAT2 test example input files * rSOILWAT2 test objects * rSOILWAT2 tests for spinup functionality * Vignette with spinup demonstration * Export and document new methods to interact with spinup functionality: set_swSpinup(), get_sw_Spinup(), swSpinup_SpinupActive(), swSpinup_SpinupDuration(), swSpinup_SpinupMode(), swSpinup_SpinupScope(), swSpinup_SpinupSeed() - Class upgrade functionality * sw_upgrade() now adds (i) new slot "spinup" for objects of class "swInputData" and (ii) adds additional input files for objects of class "swFiles" - Class "swSpinup" * Added missing generic method "swSpinup_SpinupActive<-" * Added missing spinup methods: get_swSpinup(), set_swSpinup(), swSpinup_SpinupActive() * Validity tests now agree with C implementation * Renamed spinup code file from R/M_swSpinup.R to R/B_swSpinup.R -- package building/installation requires that "swSpinup" is available before "swInputData" is processed - Class "swInputData" * Added new slot "spinup" * Implemented upgrade functionality for new slot "spinup" in sw_upgrade() method of "swInputData" * Implemented "spinup"-methods for class "swInputData" Updates to interface to C code of SOILWAT2 (v8.0.0-devel) - New "spinup" functionality * `sw_start()` now calls `SW_CTL_run_spinup()` to run the spinup - New struct "SW_Domain" * SW_R_lib gains new global "SoilWatDomain" (rSOILWAT2 does not represent a domain to the R user -- it is fixed internally at size 1 reproducing previous behavior) * New call to `SW_DOM_soilProfile()` (see SOILWAT2's `main()`) by functions that set up SOILWAT2 inputs, i.e., `sw_start()` and `onGetInputDataFromFiles()` * rSW2_readAllWeatherFromDisk() gains argument "sw_template" which hold default rSOILWAT2 inputs that serve as template (now required by `setupSOILWAT2()`) * New `onSet_SW_DOM()` and `onGet_SW_DOM()` to pass values via memory between rSOILWAT2 and SOILWAT2 structures/classes ** Note that `onSet_SW_DOM()` currently hard-codes a domain size of 1 * New `rSW_CTL_setup_domain()` (equivalent to SOILWAT2's `SW_CTL_setup_domain()`): obtain inputs for "files" and "domain" (from disk or via memory); construct and set up the domain - Order of obtaining inputs ("files" and new "domain" are now called earlier by `SW_CTL_setup_domain()` and not longer later by `SW_CTL_obtain_inputs()` as previously): * `setupSOILWAT2()` now sets up the domain and thus obtains inputs (from disk or via memory): new arguments "from_files" and "InputData" -- only `onGetInputDataFromFiles()` is reading inputs from disk, all other functionality passes inputs via memory (from the R user to the SOILWAT2 C code) * Move call to `onSet_SW_F()` from `rSW_CTL_obtain_inputs()` to `rSW_CTL_setup_domain()` -- matching SOILWAT2's new `SW_CTL_setup_domain()` - (De)allocating memory (new dedicated functions for finer control): * De-allocation of SOILWAT2 memory now requires a separate call to `SW_DOM_deconstruct()` * `onSet_MKV()` gains call to new `allocateMKV()` * `onSet_SW_VES()` gains calls to `SW_VES_construct()` and new `SW_VES_alloc_outptrs()` as well as `SW_VegEstab_alloc_outptrs()` * `sw_start()` gains call to `SW_CTL_alloc_outptrs()`
- `cInF` of sw_consts() again contains the correct (newly increased number of) input file names --> this should be fixing "undefined behavior" in `SET_STRING_ELT(cnames, i, mkChar(cInF[i]));` --> this should be fixing "segfault" in `.Call(C_sw_consts)`
- tests and example code was failing when external data sources were offline or changed their delivery format - now failures are captured correctly
- compare_weather() now creates boxplots of correlation of each variables with precipitation (in addition to the already implemented mean and standard variation of each variable) - compare_weather() now creates a new figure that shows the long-term (across years) daily, weekly, and monthly means of each variable (plus a time series of annual values)
- compare_weather() accepts weather sets from different years; thus, the new added plot that compares time-series across years (commit ab6cd73) failed if years differed -> now create time-series comparisons only if comparable data are available - also fix test expectations: now five (instead of four) figures are produced
- update to commit 36cb14ec060b841f0be3679387f0168ae27d6ffd - includes "Fix sw_fail_on_error() for rSOILWAT2"
* SOILWAT2 updated to v8.0.0-devel which now includes a simulation domain; however, this has no impact on rSOILWAT2. * New spin-up functionality (@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).
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #245 +/- ##
==========================================
+ Coverage 58.93% 58.95% +0.02%
==========================================
Files 43 44 +1
Lines 8593 8863 +270
==========================================
+ Hits 5064 5225 +161
- Misses 3529 3638 +109 ☔ View full report in Codecov by Sentry. |
- update SOILWAT2 to commit 8670d8767123a129976a1861178b104e10784bbe ** feature_format: formatted code, include header directives, and adjusted macros ** feature_compile_lib: improved compilation as library
- declare C11 as system requirement because * R v4.3.0 now requires C11 or later to satisfy "R_ext/Complex.h:77:5: warning: anonymous structs are a C11 extension" * C11 is apparently required to find externed SOILWAT2 variables in flat namespace Update 'makevars' - removed "-I.." because SOILWAT2 files no longer include rSOILWAT2 header files - removed "sw_sources" because SOILWAT2 now automatically includes correct source files
- Use fmin/fmax instead of macros min/max (now MIN/MAX) when used with types float or double - Renamed swprintf to sw_printf
- SOILWAT2 has two new structs - SW_OUT_DOM & SW_OUT_RUN * SW_OUT_DOM - Holds output information that is constant between simulation runs * SW_OUT_RUN - Holds output information that will change during simulation runs - SOILWAT2 removed SW_OUTPUT_POINTERS - SOILWAT2 functions `SW_CTL_setup_model()` & `SW_OUT_construct()` gain new parameter * Parameter determines if SW_OUT_RUN should be zeroed out - Remove instances of SW_OUTPUT_POINTERS - Rename SW_ALL to SW_RUN and `SoilWatAll` to `SoilWatRun` - Update call to `SW_CTL_setup_model()` to provide the flag input - Update `inst/extdata/example1/Input/outsetup.in` to turn on the ESTABL with a sumtype of AVG
… example inputs - SOILWAT2 example inputs: ESTABL output method is now "AVG" by default (and no longer "OFF") - however, rSOILWAT2 turns off ESTABL output for its own "example1"
N1ckP3rsl3y
approved these changes
Jul 11, 2024
- update NEWS - update SOILWAT2 submodule to v8.0.0
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.
No description provided.