-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make code run with "vegetation establishment" activated
- 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)
- Loading branch information
Showing
5 changed files
with
132 additions
and
53 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
bogr # 4-char name of species | ||
bogr # 4-char name of species | ||
3 # Vegetation type of species (0, trees; 1, shrubs; 2, forbs; 3 grasses) | ||
# soil layer parameters | ||
2 # number of layers affecting establishment | ||
10. # SWP (bars) requirement for germination (top layer) | ||
15. # SWP (bars) requirement for establishment (average of top layers) | ||
# timing parameters in days | ||
60 # first possible day of germination | ||
180 # last possible day of germination | ||
180 # last possible day of germination | ||
2 # min number of consecutive "wet" days for germination to occur | ||
40 # max number of consecutive "dry" days after germination allowing estab | ||
40 # max number of consecutive "dry" days after germination allowing estab | ||
5 # min number of consecutive "wet" days after germination before establishment | ||
15 # min number of days between germination and establishment | ||
75 # max number of days between germination and establishment | ||
15 # min number of days between germination and establishment | ||
75 # max number of days between germination and establishment | ||
# temperature parameters in C | ||
5. # min temp threshold for germination | ||
20. # max temp threshold for germination | ||
0. # min temp threshold for establishment | ||
20. # max temp threshold for establishment | ||
5. # min temp threshold for germination | ||
20. # max temp threshold for germination | ||
0. # min temp threshold for establishment | ||
20. # max temp threshold for establishment |
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