APSIMInitiative / ApsimX

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

Problems with factorials using the potato model #2997

Closed JJguri closed 5 years ago

JJguri commented 5 years ago

Hi all, I need help with the following issues:

I am trying to compare apsimx simulations using different spatial resolution of climate inputs. I have created a simulation using the factorial mode (with weather as a factor). I updated the model to run it. Although there were not errors, the tuber yields are always 0. I checked phenology and the crop jumps directly from vegetative to senesced stage. Attached are the two met files and the simulation (Paper 1)

On the other hand, I want to create an automatic rule for fertiliser (see figure). I was not able to copy or create the module from the attached simulation (factorial_example_Hamish).

Desktop.zip

hol430 commented 5 years ago

I want to create an automatic rule for fertiliser (see figure). I was not able to copy or create the module from the attached simulation (factorial_example_Hamish).

What about this isn't working? You should (in theory) be able to split the screen, open both files, then drag and drop the automatic fertiliser rule from one file to the other. That said, Apsim won't let you drag it onto any node, you have to drag it directly on to 'Field'. Failing that, you should be able to right-click the fertiliser rule, click copy, right click on the field in the other file, and press paste.

JJguri commented 5 years ago

The problem with the automatic fertiliser rule was solved, thanks.

Regarding the problem with yields=0, I am providing you one specific example that shows what exactly happens. I run the model using a single potato model that I take from the potato example (first part of the video) and the crop grows and reasonable yields are achieved. When I said single is because you do not have the option to open the tree from this model to change every variable, such as photosynthesis, structure, cultivars, etc. In the second part of the video, I am showing you another simulation (the simulation that you fixed for me with different sowing dates) where the potato model is a complete model (i.e. where you can open the tree and make changes in the variables). Surprisingly, using the complete model, apsimx provide 0 yield. This problem appeared after I updated apsimx. Before that I was using the complete potato model (with the tree option) and everything was working well.

potato.zip

hol430 commented 5 years ago

When I replace the potato model in your Paper I.apsimx with the potato model from the potato example file, I seem to get non-zero results. Have you modified the potato model at all?

JJguri commented 5 years ago

I have not modified the potato model. I just need to specified the stems number per tuber and MaxLeafArea for cultivar RussetBurbank. The problem is, If I use the single model, I do not where I can do that. Could you please send me the the file Paper I with the complete model working well? Otherwise, you can send me the original potato model (with the three options) in other apsimx file. It is not available in the potato example.

hol430 commented 5 years ago

How have you been specifying the number of stems and max leaf area? Or is that something you are planning to do, but haven't done yet?

You should still be able to access and modify these from a manager script regardless of whether the model structure is visible, although as you said, finding them can be a bit difficult.

HamishBrownPFR commented 5 years ago

Just picking up the end of this so sorry if I am missing something

stem number per tuber is specified as the budnumber arguement in the sowing rule. MaxLeafArea is not a parameter so can not be specified. The closest thing is FinalLeafNumber which can be specified from a manager as in the PotatoPlantAndHarvest script in the potato example

JJguri commented 5 years ago

It is something I am planning to do, but haven't done yet in the simulation Paper I.

I changed stems number in other simulations using PotatoPlantandHarvest. However, as I need to run the simulation in the longterm Dean and I changed the sowing module to sow on a fixed date where that option is not available (some problems appeared with the harvest in that moment). On the other hand, I want to specify cultivar parameters using the potato model without the tree option. How can I change these from the manager script?

hol430 commented 5 years ago

OK, I've replaced the faulty potato model with the up-to-date, working one. You can't see its structure, but I'm working on #2486, so maybe in a week's time you will be able to.

I've also added two new properties to your sowing rule Sowonafixeddate, which can be set from the properties tab. The number of stems per tuber is now set on sowing, but I'm not sure when you want to set the final leaf number... I've added in a new method to this manager script which does this, and which you should be able to use/modify to suit your purposes. Paper I.zip

hol430 commented 5 years ago

I've received an email notification of your comment, but for some reason it doesn't appear to be showing up here...how odd.

Thanks everithing working well now. So, after your improvements in #2486 and in order to see the model structure, should I update the soft? or something else is required?

Yeah, when #2486 is resolved, you should be able to update Apsim via the update button. Then, once you've updated, you should be able to right-click on your potato model and select "view model structure" or something along those lines.

I'll ping you when the issue gets resolved, so you get an email notification.

JJguri commented 5 years ago

Thanks!. Another comment: Changes in FinalLeafNumber in the sow on a fixed date rule does not change the model results (I think the model is not connecting this info at cultivar level). In my opinion, the best place to manage this parameter should be in the cultivar folder as a part of the model structure node.

HamishBrownPFR commented 5 years ago

Each cultivar can have a final leaf number set that is different to the default. However, final leaf number varies within cultivar based on seed age and other things that we don't understand well enough to model. So if the cultivar default final leaf number is giving you to long or short duration you can set it specific for the simulation also.

hol430 commented 5 years ago

I'm not sure what the best way to set this value is, which is why I didn't set it at any point in the manager script. If you wanted to set this value from within the manager script, you could call the ModifyFinalLeafNumber() method which I put in there.

In fact, I've just realised that method has a typo, and you need to change its only line to this: Field.Set("Potato.Structure.FinalLeafNumber.FixedValue", FinalLeafNumber);

jbrider commented 5 years ago

There was a recent change in Structure where the first letter of the IFunction variable names were changed to small letters rather than capitals. FinalLeafNumber became finalLeafNumber. Is this a style we're supposed to be following now?

hol430 commented 5 years ago

No, being a public member, finalLeafNumber should actually be FinalLeafNumber.

jbrider commented 5 years ago

I think every Link variable in Structure was changed that way.

hol430 commented 5 years ago

Yeah looks like you're right - perhaps Hamish's plan was to make them all private, but he ran out of time or forgot.

HamishBrownPFR commented 5 years ago

In most cases Links don't need to be public so I had started moving things to being private

hol430 commented 5 years ago

Closing this now, as the original issue has been resolved. @JJguri Feel free to comment, re-open, or create a new issue if you have more questions.