ajwdewit / pcse_notebooks

A collection of Jupyter notebooks that demonstrate usage of PCSE
MIT License
116 stars 72 forks source link

run LINTUL3 for potato #14

Closed frank0434 closed 2 years ago

frank0434 commented 2 years ago

Dear developer, Thanks for the great documentation and the easy-to-use python packages. I followed all the examples and they ran smoothly without any trouble.

So now I am trying to run the LINTUL3 model for a potato crop by following the 03 notebook. But got some error message about a parameter called DVSDR

File c:\Users\cflfcl\.conda\envs\py3_pcse\lib\site-packages\pcse\engine.py:228, in Engine.run_till_terminate(self)
    225 """Runs the system until a terminate signal is sent."""
    227 while self.flag_terminate is False:
--> 228     self._run()

File c:\Users\cflfcl\.conda\envs\py3_pcse\lib\site-packages\pcse\engine.py:208, in Engine._run(self)
    205 self.drv = self._get_driving_variables(self.day)
    207 # Agromanagement decisions
--> 208 self.agromanager(self.day, self.drv)
    210 # Rate calculation
    211 self.calc_rates(self.day, self.drv)

File c:\Users\cflfcl\.conda\envs\py3_pcse\lib\site-packages\pcse\agromanager.py:916, in AgroManager.__call__(self, day, drv)
    914 # call handlers for the crop calendar, timed and state events
    915 if self.crop_calendars[0] is not None:
--> 916     self.crop_calendars[0](day)
    918 if self.timed_event_dispatchers[0] is not None:
    919     for ev_dsp in self.timed_event_dispatchers[0]:
...
     64 value = parvalues[parname]
     65 if isinstance(getattr(self, parname), (Afgen)):
     66     # AFGEN table parameter

ParameterError: Value for parameter DVSDR missing.

What I did

  1. I modified the data\agro\lintul3_springwheat.agro to a fake potato crop.
    Version: 1.0
    AgroManagement:
    - 2021-10-01:
    CropCalendar:
        crop_name: 'potato'
        variety_name: 'potato01'
        crop_start_date: 2021-10-15
        crop_start_type: emergence
        crop_end_date: 2022-03-20
        crop_end_type: harvest
        max_duration: 300
    TimedEvents: null
    StateEvents: null
  2. Downloaded weather data from the NASA Power project and modified it to the nl1.xlsx format with the right input value and units. The ExcelWeatherDataProvider function parsed the file correctly.
  3. Used the example site and soil files. I had to fake a value for the parameter ROOTDI to make the soil file parser pass. Not sure what this parameter does.
    crop = CABOFileReader(os.path.join(data_dir, "crop", "POT701.CAB"))
    soil = PCSEFileReader(os.path.join(data_dir, "soil", "lintul3_springwheat.soil"))
    site = PCSEFileReader(os.path.join(data_dir, "site", "lintul3_springwheat.site"))

    Wondering what I've missed here.

Note: I've forked the repository and commit the changes I made back to my forked repository if you'd like to reproducible the error I got.

A bit of background about what I try to achieve.

I'd like to run some simulations for potato growth and development in India to see if the LINTUL model can help me make some decisions on the experiment design (e.g cultivar selection) and key dates to make observations on potato traits.

Thank you very much in advance for any feedback.

ajwdewit commented 2 years ago

Dear Frank034,

sorry for the very late reply. Is this still relevant?

Allard

frank0434 commented 2 years ago

hi Allard, I am able to use wofost potato. so I will close this now. Thank you for your reply.