How does Ichthyop manage time ?

Time management is tricky to handle because on the computer side a given time is usually expressed as a number of seconds elapsed since a time origin (e.g. 13629116520 seconds elapsed between 1900/01/01 00:00 and 2014/09/04 09:42), whereas the user expects to read time in a human readable format (e.g. 2014/09/04 09:42).

Ichthyop is no different: the program itself only understands a time as a number of seconds elapsed since a time origin, just like the hydrodynamic datasets ROMS, MARS, NEMO, etc. and time displayed in the console or the GUI uses a human readable format. Since time in the hydrodynamoc dataset is expressed as a number of seconds elapsed since a time origin, Ichthyop must be able to convert a human readable time (for example the time of begining of the simulation) into a number of seconds, so that it can compare this given time value to the time vector of the hydrodynamic dataset and interpolate the velocity fields at the correct time step. The key issue is how to convert a human readable time into a number of seconds elapsed since a time origin ?

In order to do so, we need a calendar that basically details how many days (a day is always considered as a 24h period) are there in each month for each year. Since Ichthyop has to read some variables from the hydrodynamic dataset at a given time, we must make sure that Ichthyop uses the same calendar than the hydrodynamic dataset.

The default calendar used by Ichthyop is the Gregorian calendar (the most widely used civil calendar), the one we use for our daily life.  The time origin is set by default at 1900/01/01 00:00. This value can be changed in the configuration file, in the Time section: tick the "Show hidden parameters" checkbox, change parameter Type of calendar to Gregorian calendar and adjust the value of parameter Origin of time so that it matches the origin of time set in the hydrodynamic dataset. Such information usually comes as an attribute of the time variable in the NetCDF output files of the hydrodynamic dataset.

Nonetheless some hydrodynamic simulations run with a different calendar than the Gregorian calendar. So far, Ichthyop includes an other calendar that we called the Climatology calendar. It is a commonly used calendar for climatological simulations, a year is divided in 12 months of 30 days each. In order to select this calendar from the editor of configuration, go to the Time section, tick the "Show hidden parameters" checkbox and select the Climatology calendar for parameter Type of calendar. The origin of time for the climatology calendar is set at 01/01/01 00:00 and cannot be changed.

Let's sum up the steps involved in the time management, using the example of the time of beginning of the simulation:

  • user provides a time for the beginning of the simulation 2014/09/04 09:42 ;
  • user sets up the calendar to be used in Ichthyop, the same one that has been used in the hydrodynamic dataset, e.g. Gregorian calendar with origin of time 1900/01/01 00:00 ;
  • Ichthyop converts 2014/09/04 09:42 into a number of seconds using the user-defined calendar, 13629116520 seconds ;
  • Ichthyop scans the time variable of the hydrodynamic dataset and identifies that time value 13629116520 falls in between time step 5 and 6 of the hydrodynamic time step (time step 5 and 6 are just an example) ;
  • Ichthyop can perfom the time integration of the velocity fields between time steps 5 and 6 of the hydrodynamic dataset and starts advecting the particles.

We provide a very simple utiliy programs in the Downloads section, Time converter, that illustrates how Ichthyop performs the time conversion, given a calendar and a time of origin.

Last bu not least: what if your hydrodynamic dataset uses an other calendar than Gregorian or Climatology calendars? Two options:

  1. Contact the developpers and ask how much work would it be to include your calendar in Ichthyop ?
  2. Select an existing calendar that is the most similar to yours and trick Ichthyop by providing a human readable time that you know it will be converted in the correct time value for the hydrodynamic dataset (thanks to the Time converter utility program).