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

Resolve patch temporarily put into place to ensure identical weather for each grid cell for the same seed #531

Open
kpalmqui opened this issue Sep 19, 2022 · 0 comments

Comments

@kpalmqui
Copy link
Member

The following commit implemented a temporary patch to ensure that weather is identical among grid cells:

47ad7e3

This patch needs to be resolved with a permanent solution once this commit is merged into the Seed_Dispersal branch.

The problem the patch addressed: gridded mode reproduces weather almost but not exactly among cells.
The problem was that gridded mode used the last values in a year of one cell as first values of the next cell. This went mostly unnoticed but when the last day contains precipitation, then this affects the weather generator's behavior for the first day of the next cell.

The patch:
(i) SOILWAT2's SW_WTH_init_run() did not zero out yesterday's weather values;
this was an issue only for STEPWAT2's gridded mode which does not deconstruct/construct each SOILWAT2 run (fixed with commit 8a0a754).
(ii) STEPWAT2's load_cell() did not call SW_CTL_init_run() (and SW_WTH_init_run()) or equivalently to prevent the carry-over of values from one cell to the next (fixed with this commit).

However and ideally, a grid cell should continue with the state that it ended at during the previous year (and not be zeroed out). This is especially not ideal for soil moisture because the patch re-sets SOILWAT2's variables at the beginning of each year (and each cell!) to zero.

Potential solutions:

  • update gridded mode to manage SOILWAT2's globals
  • SOILWAT2 becomes re-entrant (longer term goal)
@kpalmqui kpalmqui added this to the Seed Dispersal milestone Sep 19, 2022
@kpalmqui kpalmqui removed this from the Seed Dispersal milestone Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants