APSIMInitiative / APSIM710

APSIM
https://www.apsim.info
30 stars 47 forks source link

APSIM Maize produces negative biomass values #2181

Open LenLon opened 1 year ago

LenLon commented 1 year ago

I am simulating climate change impacts on maize yields on a grid level, and one grid cell produces negative biomass values, with maize never leaving the emergence stage. This starts in the first year of the sim and goes on until 30 years later, when the simulation reaches its end date. Maize is never harvested or dies. This behaviour can be seen across multiple climate models (with their own .met files), but not all of them.

I have absolutely no clue what could be causing this. This is the only out of 205 grid cells that exhibits this behaviour.

I have attached the simulation file, my .out and .sum files containing the negative values and the weather file used to produce these. The soil profile has been fetched from ISRIC using the apsimx R package.

APSIM.zip

peter-devoil commented 1 year ago

Thanks for the repeatable example!

Extremely low N and cold temperatures are a good place to start looking. Some bugs were uncovered in nextgen recently that I don't think have been fixed in classic yet - @jbrider might have info.

I've noticed before that the isric soils are quite different to what we're used to in apsim; and that the thin surface layer (50mm) is going to do some odd things to our evaporation routine that assumes evap only occurs from the surface layer. You should check your water balance (partitioning between runoff/drainage/evap/transpiration over each season) to verify it isnt silly.

In your case, that crop is being sown in a heat wave (40 oC), and won't get a lot of water (the soil can only hold 4.5mm of water - ie 1 day's evaporation rate). So I think the correct thing for the crop to do is die. It's a bug for it to go zombie though..

In other exercises, I've used a piece of logic to kill the crop if it gets older than 180 days - this would allow the simulation to continue.

LenLon commented 1 year ago

Thank you so much for the valuable and interesting points. I am not too deep into APSIM's "under-the-hood" workings, so your input is very much appreciated. It was a pain to operationalise it in a grid-wise setting already...

The layer structure is sadly mandated by ISRIC and I'm not sure if there is an easy way to e.g. combine the first two layers into one across 205 soil profiles. I already splined together NO3 and NH4 values from literature, as the ISRIC-built soil profiles only contain some default values which don't vary with location (and total N, which can't be converted to mineral N).

How would I go about scripting the mentioned plant-killing logic into my simulations? I have also observed a lot of runs where the plants enter the grain-filling phase, but never build yield until the phenology routine caps out the grain-filling DDs and just calls the plant "mature" and harvests (or would that be intended behaviour anyway).

peter-devoil commented 1 year ago

I think the isric problem will persist for some time. Just be aware of it, and check that your water balance is believeable.

You need some logic in the "harvesting rule for Intercropping" component:

if (maize.daysaftersowing > 180) then
   maize_to_harvest = 1
endif
jbrider commented 1 year ago

I thought I had updated Maize as well, but it must have slipped through. I will fix it up when I get a chance.

ugrewer commented 1 year ago

Dear LenLon, great that you are working on gridded APSIM simulations! From own experience, I know how labour-intensive this can be...

When looking at your .apsim-file, the soil-profile is characterized by low ph-values:

4.5 4.6 4.7 4.7 4.8 4.8

APSIM is inhibiting nitrification starting from a ph of 4.5 and strongly penalizing it while below 5 (see graph on: https://www.apsim.info/documentation/model-documentation/soil-modules-documentation/soiln/). In combination with not applying any fertilizer (as in your .apsim-file), your plant is likely not provided with any nitrogen, respectively causing plant death. (You may want to include N-stress in your APSIM output to verify this impact pathway &/or check if the same simulation also fails when providing ample N).

I experienced the above issue as cause of crop failure for gridded simulation in Ghana. You mention, that you are likewise using other crop-models that do not fail when fed with the same data. Out of curiosity, would you be happy to mention the spatial scale and crop models you are using? Having experimented with DSSAT for gridded simulation in Ghana a couple of years back, I do not remember having experienced the same crop failure (might be false memory though), but never went back to actually verify if the models react different to low PH levels for nitrification.

LenLon commented 1 year ago

Thanks to all for the input and info :)

@ugrewer: The other crop models are all APSIM, I was referring to the grid cells :-) I am modelling maize yields in Cameroon, using a 0.5° resolution grid, resulting in 205 grid cells with 205 soil profiles and 205 weather files (actually 2050, because I am using 10 GCMs for impact forecasting).

I have managed to fix my problem with the negative yields as well: It was caused by reverse indexing of the weather files, so weather from grid cell 1 was used for grid cell 205, 2 for 204 etc. which resulted in weather from the semi-arid North of the country to be used with soils from the humid tropical South. No idea how that resulted in negative biomass values, but fixing the weather file indices also fixed that, go figure.