-
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
Resurrect "vegetation establishment" #337
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
Member
dschlaep
commented
Jan 9, 2023
- close Resurrect functionality to calculate and output vegetation establishment #336
- addressing #336 - note: "vegetation establishment" functionality must be activated and output turned on (see #336 for more details) - "ERROR: Input/estab.in : Layers requested (estab_lyrs) > (# transpiration layers=0)." was produced because code previously tested `estab_lyrs` before `SW_Site.n_transp_lyrs[]` was initialized -> this commit * creates new `SW_VES_init_run()` to initialize vegetation establishment parameters of each species by `_spp_init()` and checked by `_sanity_check()` -- which now are called after `SW_SIT_init_run()` that initializes soil parameters (to fix above error message); previously, they were erroneously called by `SW_VegEstab_construct()`, i.e., before soil parameters were initialized * struct `SW_VEGESTAB_INFO` gains new element `vegType` to encode to which vegetation type a species belongs; this is required to correctly check validity of `estab_lyrs` (previous code was from a time before `SOILWAT2` handled multiple vegetation types simultaneously) * accordingly, species input files with establishment parameters gain one new input line to provide associated vegetation type, and `_read_spp()` is updated to read in value of `vegType` * `_sanity_check()` now checks that `vegType` is implemented; now correctly checks `estab_lyrs` against `SW_Site.n_transp_lyrs[]` of the associated vegetation type; and error messages now include species name * `SW_VegEstab_construct()` now allocates memory for `SW_VegEstab.p_oagg[eSW_Year]->days` (which is de-allocated by `SW_VES_deconstruct()` which previously errored because it was previously erroneously never allocated)
Codecov Report
@@ Coverage Diff @@
## master #337 +/- ##
==========================================
+ Coverage 52.68% 56.16% +3.47%
==========================================
Files 20 20
Lines 3625 3657 +32
==========================================
+ Hits 1910 2054 +144
+ Misses 1715 1603 -112
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
…_Estab - we expect consistent output files, i.e., no special treatment of output period for vegetation establishment results (remove restriction to yearly output if `timeStep` is not set) - `SW_OUT_read_onekey()` loses argument `period`
…ablishment parameters - existing `SW_VES_read()` reads through "estab.in" and does not read input files with species establishment parameters if the use flag is turned off - new `SW_VES_read2()` accepts two arguments that allow overriding the use flag read in from "estab.in" (e.g., to programmatically turn on/off the establishment functionality)
- previously, vegetation type inputs that were not implemented caused the fail due to `key2veg[v->vegType]`, i.e., out of bounds error -> if `vegType` is misspecified, then error message cannot translate with `key2veg` to string, i.e., create error message with just `vegType` value -> `vegType` is base0, thus any value >= NVEGTYPES is not implemented
- Organize input files for species establishment in subfolder "estab" - add `_ProjDir` to file path of each species establishment file, e.g., utilized by STEPWAT2 to locate the files relative to the SOILWAT2 directory
…point - `min_swc_estab` is calculated across the top soil layers (n = `estab_lyrs`) but previously the checks compared it against the wilting point of the most shallow soil layer only -> `min_swc_estab` is now checked against the average across `estab_lyrs` the same way as it is calculated and then utilized for establishment calculations
N1ckP3rsl3y
approved these changes
Jan 12, 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.