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

Fix mass balance error if fertiliser entered after test #64

Merged

Conversation

HamishBrownPFR
Copy link
Collaborator

Entering a soil test date that is prior to an actual fertiliser date breaks mass balance because the code was adding all fertiliser events and then doing all soil resets.
The change in this PR combines doing actual fert applications and soil test resets into the same loop so they can be done sequentially.
Important Note. This change causes problems with the testing system because now the crop n uptake is done prior to fertiliser applicaiton which is a problem only for simulations run from the testing environment but makes the test results look bad because they now contain a know error (i.e crop N uptake is insufficient in many cases). I will keep a seperate branch for running tests but the simulation core needs to be refactored so the demands of the testing applicaiton and the schedulling applicaiton can both be met

Dont read in fertiliser dates that are outside of simulation date range
…use the change that was required to fix the but with Fert applications means the crops now do their uptake prior to fertiliser application so for the test system they become N stressed in lots of cases. The test results can no longer be relied on
@HamishBrownPFR HamishBrownPFR merged commit 8f19993 into Plant-Food-Research-Open:main Jun 23, 2024
2 checks passed
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.

1 participant