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
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