APSIMInitiative / ApsimX

ApsimX is the next generation of APSIM
http://www.apsim.info
Other
137 stars 165 forks source link

Handling and reporting Wt and N have few problems #1453

Closed rcichota closed 9 months ago

rcichota commented 7 years ago

I am adding this issue with a somewhat generic description to enable fixing a few (relatively small) issues on how the variables Wt and N and the Biomass class are handled by the organs. A few points I noticed to date: 1) There is no test for Wt being zero when computing Nconc for organs; 2) There is no test when removing biomass to prevent it to go negative. Wt and N can go below zero on RemoveBiomass if fractions given by user are not balanced (there is some test when gathering default fractions, this could be better organized to avoid duplicate and test the fractions); 3) Message given when removing biomass from GenericOrgan is wrong (fraction are doubled); 4) Reported values for Removed and Detached biomass are wrong, the first is always zero and the second is cumulative over time (seems to be due to passing variables as values instead of as reference, and not zeroing them at the beginning of the day - in GenericOrgan); 5) Missing outputs for biomass allocated (actual growth) and senesced in any given day (these complement Detached and Removed providing information about biomass changes); 6) Test for negative DM or N allocation should be better placed, supply should be tested when calculated while allocations should be in the arbitrator; 7) There is no provision in Biomass.cs for Wt and N value to be very small. This can eventually lead to absurd Nconc values (>100%) as Wt and N decrease. Which is the case when an organ dies, but the plant keeps growing (e.g. flowers after a reproductive phonological phase ends). This seem to cause no errors in the model results (so far), but reported values are wrong/misleading; 8) Initial Wt is set at sowing for root, but at emergence for other organs; 9) There is no test in Biomass.cs for Wt or N to go below zero, also the class is not aware of minimum or maximum Nconc values given for organs, so there is no way to test whether any change has violated those limits (this may not be important if all processes are done carefully, but having a test in Biomass would reduce the chances of errors, and have a test in only one place);

ric394 commented 9 months ago

This very old. Closing. If this is still an issue, please feel free to comment.