How to set crop over a year?

I am simulating a Sugar Cane crop with planting month equal to 4 (April) and harvest month equal to 5 (May), but it should start in April of the first year and end in May of the second year. How can I set up the crop?

Hey @arthurbbm ,

So, you will mention the planting and harvest date at two places.

First, while instantiating the CropClass and second at the time of instantiating the AquaCropModel.

So, let’s suppose the planting date is 11th April, 2021, and the latest possible harvest date 11th May, 2022, then you’d initialize the CropClass and the AquaCropCustom as following -

sugarcane = CropClass(‘custom’
, PlantingDate=‘04/11’
, HarvestDate=‘05/11’
// list out other crop parameters with their values here)

aq_model = AquaCropModel(SimStartTime=‘2021/04/11’
, SimEndTime=‘2022/05/11’
, wdf=weather_data_object
, Soil=custom_soil_object
, Crop=sugarcane
, InitWC=init_wc_object
, FieldMngt=field_mngt_object
)

@amoolyaudaishetty, thanks for replying! I am already doing this, but I am getting the following error message: “not enough growing degree days in simulation (180) to reach maturity (1625)”. After debuging I realized it only run 30 steps, but I can´t say why. My weather data has 2 years of daily data with temperatures always between Tbase and Tupp. Can you say what can have caused this error?

Here is the code:

    def aquacrop(self, planting_year, harvest_year):
        self.SimStartTime = f'{planting_year}/{self.planting_month:02d}/{self.planting_day:02d}'
        self.SimEndTime = f'{harvest_year}/{self.harvest_month:02d}/{self.harvest_day:02d}'
        self.soil = SoilClass(soilType='custom', dz=[0.1 * 20])
        self.__choose_layer_method()
        self.initial_water_content = InitWCClass()
        self.crop = CropClass(c_name=self.crop_properties.base_crop,
                              PlantingDate=f'{self.planting_month:02d}/{self.planting_day:02d}',
                              HarvestDate=f'{self.harvest_month:02d}/{self.harvest_day:02d}',
                              Tbase=self.crop_properties.base_temperature,
                              Tupp=self.crop_properties.upper_temperature,
                              GDD_up=self.crop_properties.minimun_degree_days_to_full_biomass,
                              fshape_r=self.crop_properties.shape_factor_on_root_expansion,
                              SeedSize=self.crop_properties.seed_size,
                              CDC=self.crop_properties.crop_decline_coefficient,
                              Kcb=self.crop_properties.crop_coefficient,
                              fage=self.crop_properties.plant_cane_aged_decline_coefficient,
                              p_up1=self.crop_properties.upper_depletion_threshold_on_expansion,
                              p_up2=self.crop_properties.upper_depletion_threshold_on_stomatal_control,
                              p_up3=self.crop_properties.upper_depletion_threshold_on_senescence,
                              p_lo1=self.crop_properties.lower_depletion_threshold_on_expansion,
                              fshape_w1=self.crop_properties.shape_factor_water_stress_on_expansion,
                              fshape_w2=self.crop_properties.shape_factor_water_stress_on_stomatal_control,
                              fshape_w3=self.crop_properties.shape_factor_water_stress_on_senescence)

        model = AquaCropModel(SimStartTime=self.SimStartTime, SimEndTime=self.SimEndTime, wdf=self.dataframe,
                              Soil=self.soil,
                              Crop=self.crop, InitWC=self.initial_water_content)
        model.initialize()
        model.step(till_termination=True)
        self.Outputs = model.Outputs

Here are the values used to create CropClass:

    self.base_crop = 'Maize'
    self.base_temperature = 17.5
    self.upper_temperature = 38.0
    self.seed_size = 20.0 
    self.crop_coefficient = 1.1
    self.crop_decline_coefficient = 4.0
    self.plant_cane_aged_decline_coefficient = 0.3
    self.ratoon_cane_aged_decline_coefficient = 0.4
    self.upper_depletion_threshold_on_expansion = 0.25
    self.lower_depletion_threshold_on_expansion = 0.57
    self.shape_factor_water_stress_on_expansion = 3.0
    self.upper_depletion_threshold_on_stomatal_control = 0.5
    self.shape_factor_water_stress_on_stomatal_control = 3.0
    self.upper_depletion_threshold_on_senescence = 0.64
    self.shape_factor_water_stress_on_senescence = 5.0
    self.shape_factor_on_root_expansion = 1.3
    self.minimun_degree_days_to_full_transpiration = 10.0

@arthurbbm, Sure, will have a look at it. Also, can you please share the weather file with me?

Hi happy to look at this also, you can share the weather file through Dropbox or some equivalent.

I don’t think I have tested the model yet for a crop growing season over 365 days so will be useful to see if there are any bugs/issues.

Tom

@amoolyaudaishetty and @tom, I already solved the problem. After looking at some code into the library, I found a way to allow crop over a year.

model.initialize()
model.ClockStruct.nSeasons = 1
model.ClockStruct.HarvestDates = pd.DatetimeIndex([dt.datetime(harvest_year, self.harvest_month, self.harvest_day)])
model.step(till_termination=True)  

As you can see, I changed the number of seasons to run once and changed the harvest date. I think this is the only way the library would allow running crop over a year. Even because if it was possible to run more than a season, it would overlap ending data from one season with stating data from the next season on output dataframes.

@amoolyaudaishetty and @amoolyaudaishetty,

Here is the weather data that I used.

I am going to delete it after 10 days, so be sure to download it before.

Hey

Tried this and it also worked for me for a crop growing across two calendar years.

Thanks for saving my day.