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

Do N balance on a daily loop #46

Open
HamishBrownPFR opened this issue May 30, 2024 · 1 comment
Open

Do N balance on a daily loop #46

HamishBrownPFR opened this issue May 30, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@HamishBrownPFR
Copy link
Collaborator

The model is currently structured to calculate each of the components for the duration of the simulation and then stick them together to do the N balance. This worked well when the model was quite simple. However, we have had to add more complexity into the loss model and feedbacks to reduce uptake if soil N is limited which has resulted in a code structure that is quite hard to read.
It would be better to turn this into a true daily time-step model so it is easier to follow for others needing to ready of debug the code in the future.

@HamishBrownPFR HamishBrownPFR added the bug Something isn't working label Jun 23, 2024
@HamishBrownPFR
Copy link
Collaborator Author

HamishBrownPFR commented Jun 23, 2024

Fixing this bug is crucial now.

An issue emerged with mass balance breaking if an actual fertiliser event was entered after a test value had been entered. This was fixed by PR #64 but this test has broken some bits of the testing system. Specifically, crop N uptake when fert is not scheduled is calculated before actual fertiliser events are applied and not update after actual fertiliser is applied so the results look bad. A convoluted series of roll back/update calculations was attempted but it became to complex. Better to refactor the core model so it can deal effectively with the demands that have emerged for it (i.e to do a full N balance including losses in both retrospective {testing} and forecast {schedulling} situations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant