TimeManager

This module contains functions that handle dates and times in simulations. The functions in this module often call functions from Julia's Dates module.

TimeManager API

ClimaCoupler.TimeManager.current_dateFunction
current_date(cs::Interfacer.CoupledSimulation, t::Int)

Return the model date at the current timestep.

Arguments

  • cs: [CoupledSimulation] containing info about the simulation
  • t: [Real] number of seconds since simulation began
ClimaCoupler.TimeManager.strdate_to_datetimeFunction
strdate_to_datetime(strdate::String)

Convert from String ("YYYYMMDD") to Date format, required by the official AMIP input files.

Arguments

  • strdate: [String] to be converted to Date type
ClimaCoupler.TimeManager.trigger_callbackFunction
trigger_callback(cs, ::Monthly)

Returns true if the current date is equal to or exceeds the saved first of the month at time of 00:00:00.

Arguments

  • cs: [CoupledSimulation] containing info about the simulation
ClimaCoupler.TimeManager.trigger_callback!Function
trigger_callback!(cs::Interfacer.CoupledSimulation, cb::CouplerCallback)

This function triggers a callback function if the current date is equal to or exceeds the saved callback reference date. As well as executing the functions func, it automatically updates the reference date, ref_date, for the next callback interval.

ClimaCoupler.TimeManager.dt_cbFunction
dt_cb(cb::HourlyCallback)
dt_cb(cb::MonthlyCallback)

This function returns the time interval for the callback function.