Skip to content
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

Prepare for upcoming SOILWAT2 release v7.0.0 #535

Merged
merged 21 commits into from
Jun 9, 2023

Conversation

dschlaep
Copy link
Member

@dschlaep dschlaep commented Dec 6, 2022

  • SOILWAT2 will get a major new release with several improvements and new features
  • one of the goals is to limit code changes required in STEPWAT2 and to reproduce previous STEPWAT2 behavior and output (new settings will be set such that they reproduce previous behavior)

- SOILWAT2 commit "Isolate "allWeather" functionality from global variables"
- updated "weathsetup.in": removed obsolete "first year of historical weather"
- SOILWAT2 branch "feature_read_weather" isolated the handling of daily weather data and moved it from within the simulation loop to the overall setup process

- STEPWAT2 needs now to handle daily weather data itself; there are two basic options:
i) follow SOILWAT2's new approach and generate daily weather for all years of a simulation run (for each grid cell and iteration); this would require that each grid cell stores and handles a local copy of `SW_Weather`
ii) stick with the previous approach which generated daily weather for each year

- this commit follows option (ii), i.e., generate daily weather for each year
** new `_sxw_generate_weather()` handles the generation of daily weather for the current year
** `Env_Generate()` now calls `_sxw_generate_weather()` before running SOILWAT2 for the current year
** non-gridded mode needed to set RNGs for each year (so that `markov_rng` gets updated with fresh values for each year)

-> this commit satisfies expectations, i.e., (script based on #528 (comment))
    - 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
- updated "veg.in": new input to select SOILWAT2-side method for estimation vegetation parameters from climate
-> not relevant for STEPWAT2 and turned off
- SOILWAT2 is preparing for major new release with several improvements and new features
* milestone: https://github.com/DrylandEcology/SOILWAT2/milestone/13
* PR: DrylandEcology/SOILWAT2#325

- the purpose of this STEPWAT2 branch is to track progress in SOILWAT2 towards that major release and add any necessary changes to the STEPWAT2/SOILWAT2 interface
* one of the goals is to limit code changes required in STEPWAT2 and to reproduce previous STEPWAT2 behavior and output (new settings will be set such that they reproduce previous behavior), at least as much as possible (and document deviations)

* new input: user specifies whether input soil density represents matric or bulk density (new input in `siteparam.in` with backwards compatible value of 0 = matric)
dschlaep and others added 16 commits December 22, 2022 07:21
- SOILWAT2 has now multiple soil water release curves (SWRC) implemented
- updated SOILWAT2 submodule on branch release/devel_v7.0.0 to commit a6c367aef07b746a43b459067ee0ef0139f9f60b "Merge pull request #322 from DrylandEcology/feature_swrc"

-> new SOILWAT2 inputs include: swrc_name (to select a SWRC), ptf_name (to select a pedotransfer function if used), has_swrcp (logical to determine if SWRC parameters are used from new input file or calculated at run-time with selected PTF), and swrc_params (per soil layer parameters of the selected SWRC if used)
-> default values (swrc_name = Campbell1974, ptf_name = Cosby1984AndOthers, has_swrcp = FALSE) re-created previous behavior (except for a small fix for when soil moisture values occur above field capacity and below saturation levels)
- switch to SOILWAT2 branch feature_restructure

- paths renamed in submodule SOILWAT2
* *.c -> src/
* *.h -> include
* pcg/ -> external/pcg/
* googletest/ -> external/googletest/

- makefile gained ability to create required paths at obj/
-> remove obj/ and fixed nested folder structure
-> remove nested `.gitignore` for each subfolder of obj/
-> add obj to global `.gitignore`
- the previous commit (5505457) by mistake did not update a few paths
-> this is not fixed
- set SOILWAT2 back to branch `release/devel_v7.0.0` (on commit 296f123e35836d29d59dbc5ec4974f7e55f9cfa7) that now includes the completed `feature_restructure`
Updates for new SOILWAT2 project structure

- paths renamed in submodule SOILWAT2
* *.c -> src/
* *.h -> include
* pcg/ -> external/pcg/
* googletest/ -> external/googletest/

- STEPWAT2 makefile gained ability to create required paths at obj/ as needed
- The updated submodule (SOILWAT2) has the ability to read new daily weather variables in weath.YYYY. The new variables are:
	* Cloud cover, (maximum/minimum) relative humidity, (east/north components of) wind speed, shortwave radiation, actual vapor pressure, specific humidity, and dewpoint temperature
- "sxw_soilwat.c" gains the include of "SW_Sky.h" to extern the variable, "SW_Sky"
- `_sxw_generate_weather()` makes sure monthly input flags are set, so when the weather generator runs, cloud cover, humidity, and wind speed are filled with daily interpolated values from monthly input
- for details, see DrylandEcology/SOILWAT2#345
-> "weathsetup.in" gained a new input "description of downward surface shortwave radiation"

-> none of that is currently relevant or active for STEPWAT2

- this commit produces identical output to commit c974dc6 on branch feature_SOILWAT2_v700_devel
Prepare STEPWAT2 to handle SOILWAT2's additional daily inputs

- no impacts on STEPWAT2 output: STEPWAT2 does not utilize new daily inputs
@dschlaep dschlaep marked this pull request as ready for review June 5, 2023 15:23
@dschlaep dschlaep requested a review from kpalmqui June 5, 2023 15:24
@dschlaep
Copy link
Member Author

dschlaep commented Jun 5, 2023

@kpalmqui I'm just about ready to release a major update for SOILWAT2 (will become v7.0.0) -- this PR prepares STEPWAT2 for this update. I tagged you to review this PR mainly to make you aware of the upcoming changes.

Would you like me to update the current working branches "forage_output", forage_utilization_output", "sage_update_biomass", and "wildfire_cheatgrass_cycle" from "Seed_Dispersal" following this PR?

@kpalmqui
Copy link
Member

kpalmqui commented Jun 5, 2023

@dschlaep that would be great - no need to merge into forage_utilization_output though. I will review shortly.

Copy link
Member

@kpalmqui kpalmqui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dschlaep looks good thanks!

dschlaep added a commit to DrylandEcology/SOILWAT2 that referenced this pull request Jun 9, 2023
Release v7.0.0

see https://github.com/DrylandEcology/SOILWAT2/milestone/13

- Read daily weather before the simulations enhancement (#311)
- Calculate climate variables before simulation loop (#317)
- Estimate vegetation cover from climate before simulation run (#318)
- Implement multiple soil water retention curves (#315)
- Soil density: input either for < 2 mm fraction or for whole soil? enhancement (#280)
- Re-organize repository with more sub-folders question (#89)
- Daily variables for atmospheric demand (#341)
- STEPWAT2 updated to work with this release (see DrylandEcology/STEPWAT2#535)
- rSOILWAT2 updated to work with this release (see DrylandEcology/rSOILWAT2#214)
@dschlaep
Copy link
Member Author

dschlaep commented Jun 9, 2023

After more discussion, I will not merge into the other branches (as suggested here #535 (comment)) because those branches are based on master and not Seed_Dispersal.

@dschlaep dschlaep merged commit bd0aa09 into Seed_Dispersal Jun 9, 2023
2 checks passed
@dschlaep dschlaep deleted the feature_SOILWAT2_v700_devel branch June 9, 2023 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants