APSIMInitiative / ApsimX

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

Why can’t I normally open “Show model structure” under the sugarcane module? #8397

Closed Clzuy closed 10 months ago

Clzuy commented 11 months ago

What is your question?

error I haven’t clicked on “Show model structure” yet, but it is already in the open mode by default, but there is no corresponding module below.

hol353 commented 11 months ago

The sugarcane model doesn't have a structure to show because it isn't written the same way as the other plant models. It is a direct port of the sugarcane model from the older APSIM 7.10.

par456 commented 11 months ago

Considering we've had this question a few times now, it might be worth having some sort of feedback when expanding sugercane that explains this.

Clzuy commented 11 months ago

The sugarcane model doesn't have a structure to show because it isn't written the same way as the other plant models. It is a direct port of the sugarcane model from the older APSIM 7.10. So if I want to change the sugarcane crop parameters, can I only use APSIM classic, or are there other ways to achieve this in APSIM NEXT GENERATION?

hol353 commented 10 months ago

You can do this from an operations model like this:

2023-01-01 [sugarcane].PARAMNAME = xxx

Where PARAMNAME is the name of the variable and the date should be the date (yyyy-mm-dd) of the start of your simulation. After you press the '.' character it should bring up an intellisense menu that lists the available variables you can access. I suspect though that most variables are NOT accessible because the sugarcane model was ported a while ago and hasn't had a lot of use in Next Gen. The model needs a bit of refactoring to make it more usable.

Q: What crop parameters do you want to change?

Clzuy commented 10 months ago

You can do this from an operations model like this:

2023-01-01 [sugarcane].PARAMNAME = xxx

Where PARAMNAME is the name of the variable and the date should be the date (yyyy-mm-dd) of the start of your simulation. After you press the '.' character it should bring up an intellisense menu that lists the available variables you can access. I suspect though that most variables are NOT accessible because the sugarcane model was ported a while ago and hasn't had a lot of use in Next Gen. The model needs a bit of refactoring to make it more usable.

Q: What crop parameters do you want to change?

The parameters are shown in the following figure, and I want to modify those parameters. Then I have another question, where is the input position of this parameter? Thank you for your reply. para

hol353 commented 10 months ago

RUE is a parameter that we don't normally change. It isn't a cultivar parameter. The value of RUE is considered a constant that should work across genetics, environments and managements.

I've had a quick look at the code. Changing these isn't currently possible. We will need to make some changes in APSIM before you can continue. Notes for us:

Next week we will be back on APSIM maintenance so we'll see if we can find time to fix this.

Clzuy commented 10 months ago

RUE is a parameter that we don't normally change. It isn't a cultivar parameter. The value of RUE is considered a constant that should work across genetics, environments and managements.

I've had a quick look at the code. Changing these isn't currently possible. We will need to make some changes in APSIM before you can continue. Notes for us:

  • [ ] Make line 1154 public: c# private CropConstants crop;
  • [ ] Make line 1175 public: c# private CultivarConstants cult;
  • [ ] Write an example manager script to show how to change the variables.

Next week we will be back on APSIM maintenance so we'll see if we can find time to fix this.

Thank you very much for taking the time to answer me. I look forward to hearing the good news that you have fixed the issue.

ric394 commented 10 months ago

Once the pull request #8427 has been merged the attached example has a manager script called "Change Sugarcane Params" that can be used. The manager script shows how to change the parameters at the start of the simulation. sugarCaneExample.zip

daSilva5 commented 2 months ago

Once the pull request #8427 has been merged the attached example has a manager script called "Change Sugarcane Params" that can be used. The manager script shows how to change the parameters at the start of the simulation. sugarCaneExample.zip

Hi, I have opened it in my APSIM desktop, but I do not know how to use it. I does not show the current parameter values for the varieties available in the model or a list of possible parameters. How do I know the full list of possible parameters and how to I actually use this script for changing values? Is there a specific position that this management script should be on the tree? Should the parameters tab be blank like this?

image

I do not have parameters that I am interested in changing. I would like to be able to reproduce workflows from previous studies done using APSIM and to learn from them. Parameters I have seen previous authors changed were: shoot_lag, tt_emerg_to_begcane, Tb and leaf area profile.

Kind regards, Isis