APSIMInitiative / ApsimX

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

Set watertable depth in a certain period during the simulation #7919

Open KeLiu7 opened 1 year ago

KeLiu7 commented 1 year ago

I have several waterlogging treatmentsduring different growth stages. Does anyone know how to set different watertable depths during the simulations? The scripts below that I used are for APSIM Classic but have no idea how to realise it in APSIM Next Gen.

I have attached my sim file. Many thanks in advance😊 Barley_simulation with SWIM3.zip

if simulation_days <=44 then ! we are in the period prior to the water table treatment ! Water is flowing in to keep water table at 20cm and outflow tap is open bbc_potential = 15 !subsurface_drain_open = true endif

if simulation_days > 44 and simulation_days < 74 then ! we are in the period of water table treatment ! Water is flowing in to keep water table at 20cm and outflow tap is closed bbc_potential = 35 subsurface_drain_open = false endif

if simulation_days >= 74 and simulation_days < 182 then ! we are in the period after to the water table treatment but prior to anthesis ! Water is flowing in to keep water table at 20cm and outflow tap is open bbc_potential = 15 !subsurface_drain_open = true endif

if simulation_days >= 182 then ! we are in the period after anthesis ! No water flowing in and outflow tap is open bbc_gradient = -1 !subsurface_drain_open = true endif

par456 commented 1 year ago

I've gone through and updated your script to the new format for apsimx. The only tricky bit is that you've also got to add a SwimSubsurfaceDrain child node to the Swim3 node and give it some values.

I've attached an updated version of the apsimx file you sent me, let me know if it's working how it should.

Barley_simulation with SWIM3-updated.zip

KeLiu7 commented 1 year ago

I've gone through and updated your script to the new format for apsimx. The only tricky bit is that you've also got to add a SwimSubsurfaceDrain child node to the Swim3 node and give it some values.

I've attached an updated version of the apsimx file you sent me, let me know if it's working how it should.

Barley_simulation with SWIM3-updated.zip Fantastic!! Thanks Andrew😊 image

KeLiu7 commented 4 days ago

I've gone through and updated your script to the new format for apsimx. The only tricky bit is that you've also got to add a SwimSubsurfaceDrain child node to the Swim3 node and give it some values.

I've attached an updated version of the apsimx file you sent me, let me know if it's working how it should.

Barley_simulation with SWIM3-updated.zip

I've gone through and updated your script to the new format for apsimx. The only tricky bit is that you've also got to add a SwimSubsurfaceDrain child node to the Swim3 node and give it some values.

I've attached an updated version of the apsimx file you sent me, let me know if it's working how it should.

Barley_simulation with SWIM3-updated.zip

Hi Andrew @par456 , I am trying to set the date and duration of the groundwater level close to the surface in the model. The current setting is fine (Fig.1 ), but I would like to change the groundwater level date to the later period (12-Oct to 25-Oct). No matter how I adjust the simulation days, it remains the same (as shown in Fig.2). Can you help me check it out when you have time? Thank you! image Fig. 1 image Fig. 2

WT.zip

KeLiu7 commented 3 days ago

It seems relevant to the simulation_days...but still not resolve.

@par456 Do we need to add a simulation_days parameter to the model? This would make it clearer whether simulation days should be counted from the first day of sowing or the first day in the clock?

par456 commented 3 days ago

Your code is running, however it seems that when there is a crop growing, you are hitting some sort of limit on swim: image

I don't know enough about this topic for what's going wrong, but the summary log is outputting errors on that dates you are trying to change the values.

I also ran the simulation without sowing a crop and saw the change in the graph like you are expecting, so I would suggest there is some sort of interaction between the crop and swim that you'll need to account for. Might need help from someone who knows more about swim for this.

KeLiu7 commented 2 days ago

Your code is running, however it seems that when there is a crop growing, you are hitting some sort of limit on swim: image

I don't know enough about this topic for what's going wrong, but the summary log is outputting errors on that dates you are trying to change the values.

I also ran the simulation without sowing a crop and saw the change in the graph like you are expecting, so I would suggest there is some sort of interaction between the crop and swim that you'll need to account for. Might need help from someone who knows more about swim for this.

Thanks Andrew. @hut104 Hi Neil, could you please have a look?