APSIMInitiative / ApsimX

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

Some changes/cleanup in root water uptake to implement root angle #5052

Closed BrianCollinss closed 4 years ago

BrianCollinss commented 4 years ago
BrianCollinss commented 4 years ago

@jbrider , sorrt for bothering you again.

I think if we change Line 676 in Root.cs to something like:

if (RootFrontCalcSwitch?.Value() >= 1 && CROP IS MAIZE OR SORGHUM)

Then we can use RootAngle and other options for other crops as well. This part of the code is the only part that doesn't let wheat use RootFrontCalcSwitch==1.

jbrider commented 4 years ago

What is it in that code that cause Wheat to fail? I would prefer that RootAngle was implemented properly rather than implementing a hack on a hack.

BrianCollinss commented 4 years ago

I think the only diffreence between new C4 model and wheat model is under the line I mentioned. Those new models need to calculate Diffusion and MassFlow and wheat does not. Other things related to Root Angle are the same. I am still looking into the code.

jbrider commented 4 years ago

I'm assuming that your proposed changes will not be relevant to every model - but you made changes that affected every model except Sorghum/C4Maize. The proper way to do it is to extract the RootAngle functionality into functions that can be added/removed from the model. That is the goal for the sorghum relevant code in the long run.

BrianCollinss commented 4 years ago

You're absolutely right. My ultimate goal is to make root angle and root depth (i.e. velocity) mutually dependent. That is, a bigger/wider system (large angle) is shallower than a smaller/taller system (small anlge). Any suggestion is more than welcome.