-
Notifications
You must be signed in to change notification settings - Fork 2
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
Soilwat co2 effects #22
Conversation
TODO: * Remove the additional start() parameters once that data is transferred to inputData * Test with rSFSW2 and rSOILWAT2 once changes have been done there (has succesfully worked with local old repos) * Confirm placement of global variable initializations
Includes: * Adding a structure SW_Carbon to avoid clogging up the global space * Moved R CO2 settings to S4 class * onGet/onSet functions to interact with S4 class and its respective object * Removal of additional parameters to SEXP start() SOILWAT2 remains fully functional by itself, and seems fully functional with rSOILWAT2's CO2 branch
…e_CO2_multipliers()"
This changes results massively. Linear equations were previously used for WUE and Biomass multipliers, which have been switched to power equations in this commit. Additionally, the correct source is being used for the PPMs now.
* @biomass --> @CO2EFFECTS * Added yearly output * Added a total biomass column * Added a WUE multiplier column * Removed additional column * This slot, and this slot only, now reflects the proper future simulation years
Previously, when future scenarios were run, the original years would be used as output. For instance, a scenario in 2020-2050 would have outputs from 1980-2010. I've utilized the delta year that I pass in for carbon effects and added it to the model year ONLY IN THE OUTPUT FUNCTIONALITY. The rest of the model still needs the 'incorrect' years.
I created this pull request so that I can comment. |
Commenting on last available commit 050dfbb:
|
Commenting on last available commit 050dfbb:
Literature: 2.Lee, T.D., Barrott, S.H. & Reich, P.B. (2011). Photosynthetic responses of 13 grassland species across 11 years of free-air CO2 enrichment is modest, consistent and independent of N supply. Global Change Biology, 17, 2893–2904 3.Poorter, H. (1993). Interspecific variation in the growth response of plants to an elevated ambient CO2 concentration. Vegetatio, 104–105, 77–97 4.Poorter, H. & Navas, M.-L. (2003). Plant growth and competition at elevated CO2: on winners, losers and functional groups. New Phytologist, 157, 175–198 5.Temme, A.A., Cornwell, W.K., Cornelissen, J.H.C. & Aerts, R. (2013). Meta-analysis reveals profound responses of plant traits to glacial CO2 levels. Ecol Evol, 3, 4525–4535 |
Caitlin's email response:
|
Hi Daniel, I appreciate the feedback. I want to be clear that this branch is still a work in progress, is not ready to be merged, and still needs things done before a full code review.
I agree, it should be designed this way to support more scenarios, though this specific support is not within our original scope, which is supporting RCP85. While I should have designed this better off the bat, if we have time constraints it will have to be delayed into a future enhancement.
For context:
I'm not against this idea, I'm just providing context for why it is this way. Again, if we have time constraints this will have to become a future enhancement, as it is outside of the original scope.
I am not completely understanding your explanation. Why do we want the input biomass to be the simulated biomass of year a0? If you are suggesting that this be the base point, where biomass multipliers before it are <1 and after it are >1, that would change the equation, wouldn't it? Sorry, I'm just a bit confused.
I agree. The current approach just has a very small performance effect and is tightly coupled, correct? In which case this should be a lower priority enhancement. |
Disregard the description in the last commit, I forgot that SOILWAT2 holds the instance of the rSOILWAT2 output class
# Conflicts: # makefile --> merged # makefile_n --> removed
Tabs to spaces, reducing reliance on hard-coded values, constructor, comments, change the stomatal term to water-usage efficiency, be more consistent on variable names
@dschlaep Could you do another iteration for this review? I have some recent changes, but nothing that significant |
Sure, I will. Give me a few days.
Thanks!
… On Sep 4, 2017, at 22:53, Zachary Kramer ***@***.***> wrote:
@dschlaep <https://github.com/dschlaep> Could you do another iteration for this review? I have some recent changes, but nothing that significant
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#22 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AEAp2-xqOOkarlSdaBuDAsEDEKjjP6Dqks5sfLeMgaJpZM4OJtXC>.
|
Good job! I opened four new issues (of which I consider only 2 high priority). Please consider them. Please revert the testing folder to our old default values (plus enable both the CO2-effects). |
Thanks for the review! I'm off work this week and next week because I'm moving to Germany, so I won't fix these issues until after then. I'll revert the testing folder as well. |
in appveyor-ci and not travis-ci because the order of unit test execution differs. |
- the order in which tests are executed is not fixed - each TEST() must carefully reset global states -- this is a pain because our old SOILWAT2 c code is rich in functions that manipulate global states
That did the trick! Unit tests have to carefully reset global states! |
- `REvprintf()` returns void unlike `vfprintf()`; thus we cannot check for EOF
- function `LogError` should only be called with argument `logfp` and no longer with `stderr` or `stdout` directly (see commit 4e0cc0e)
- close DrylandEcology/rSOILWAT2#78 - close DrylandEcology/rSOILWAT2#73 - file 'testing/Input/outsetup_v31.in' * fully explain what output columns are * rename output file to 'vegetation' from 'co2_effects' - function '_collect_values()' did not call `SW_OUT_sum_today(eVPD)` - return value of function 'get_co2effects' was 'void' instead of 'static void' as every other 'get_*' function - function 'SW_OUT_flush' did not call `SW_OUT_sum_today(eVPD)` - function 'sumof_vpd' only ever added biomass values into output slots from 'Today' which is 1 -- the correct index is 'SW_Model.doy' - function 'average_for' precluded 'ObjType's other than 'eSWC' and 'eWTH' to perform averaging
- turn on all cover types
- replace 'nullptr' with 'NULL'
- addressing issue DrylandEcology/rSOILWAT2#81 - define 'OBJECTS' and 'SOURCES' for rSOILWAT2 compilation
f790f94
to
5387c0d
Compare
Coefficients assume that monthly biomass inputs reflect values for conditions at 360 ppm CO2, i.e., Coeff1 * x^Coeff2 = 1 for x = 360 CO2 ppm
- addressing DrylandEcology/rSOILWAT2#81 and DrylandEcology/rSOILWAT2#66 - Makevars, SW_R_init.c, SW_R_lib.c, and SW_R_lib.h are not used by SOILWAT2 -- they are rSOILWAT2 files - remove rSOILWAT2 shared object target from makefile --> this commit requires that the removed files are added to rSOILWAT2/src/ and that the source code of SOILWAT2 is now a submodule in rSOILWAT2/src/SOILWAT2/ -- instead of rSOILWAT2/src/
…sage Also, i was a high number because the simstart year was 1979 and only data for 1980-2010 was provided, so the loop iterated i many times.
If the 'values' object doesn't contain the value of 'year', then the loop was not behaving properly and didn't stop until 'i' was extremely large. Fix: add condition that i remains less than maximum number of years. This and commit 48f3588 close DrylandEcology/rSOILWAT2#80
# Conflicts: # SW_Output.c # SW_Site.c # generic.c # makefile # testing/Input/siteparam.in # testing/Input/veg.in # testing/Input/years.in # testing/files_v31.in
# Conflicts: # SW_Output.c
siteparam.in still uses RCP85 by default
No description provided.