COPdate

From Agri4castWiki
Revision as of 13:24, 8 February 2019 by Raymond (talk | contribs) (Created page with "__NOTOC__ {{scientific}} ==Introduction== COP stands for Climatically Optimal Planting. The concept is implemented in the COPdate oracle package. By running the package for al...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Introduction

COP stands for Climatically Optimal Planting. The concept is implemented in the COPdate oracle package. By running the package for all historical years, the earliest and latest optimal sowing date can be found (sowing date window). By processing a specific year, the optimal sowing date for that year is found.

Finding sowing dates

Since the package is used to find optimal sowing dates for specific years, only the find_sowing_date function (for a single year) and sowing_dates_years function (for multiple years) are called. Both functions find a sowing date for a specific combination of crop, grid and year, according expert rules.

Architecture

Required objects inside the oracle schema where the COPdata is to be applied (e.g. CGMS14RUK):

  • COPDATE package
  • MRSDATES package
  • COP_CROP_GRID_REGIMES table
  • COP_CROP_REGIMES table
  • COP_WINDOWS table
  • INIT_TASKS procedure
  • NEW_TASK_ISW_INPROGRESS view
  • TASKLIST view
  • TASKLIST_COP_SD view
  • TASKLIST_COP_SD_ALLYEARS view
  • TASKLIST_COP_WDW view
  • TASKLIST_ISW view
  • ADD_PROCESS_LOG synonym
  • SIGNALS synonym
  • TASK synonym
  • TD_KEY_VALUE synonym
  • TD_KEY_VALUES synonym
  • TASKSET sequence

Required objects inside the assisting oracle schema for managing task processing (e.g. RUKMAN):

  • SIGNALS package
  • TASK package
  • TD_KEY_VALUE types
  • TD_KEY_VALUES types
  • ADD_PROCESS_LOG procedure

Configuration

To initialize tasks for COPdate, the INIT_TASKS procedure is used. Five or six arguments are required:

initialize single year:

  • task (= cop-sd)
  • initial status (= pending)
  • crop
  • year
  • regime (winter or spring)

initialize multiple years:

  • task (= cop-sd)
  • initial status (= pending)
  • crop
  • start year
  • end year
  • regime (winter or spring)

The procedure provides content for TASK_LIST object in the assisting schema (e.g. RUKMAN) that transfers the tasks via views TASKLIST to the various TASKLIST views in the main schema (e.g. CGMS14RUK).

If both year1 and year2 are null then all the years in the crop_calendar will be processed for the crop and gridcell(s). I.e. the whole archive for these crop.

  1. If one of year1 and year2 is NOT null then this value will be used as starting resp. ending year of the range of years; the other value will be derived from the crop_calendar.
  2. If both of year1 and year2 are NOT null these values will be used as starting resp. ending year of the range of years. Only this range will be processed.
  3. The starting and ending year will be included in the range to be processed.
  4. Only sd is processed for gridcell(s) listed in p_qry_grid. If the query/list is empty then all grids will be processed.


Results

Whenever the package finds a sowing date, it updates directly the CROP_CALENDARS table for the processed crop, grid and year.