#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "event.h"
#include "utils_mci.h"
#include "utils_common.h"
Go to the source code of this file.
|
struct event * | yac_event_new () |
|
void | yac_event_add (struct event *event, char const *delta_model_time, char const *delta_coupling_time, int lag, enum yac_reduction_type time_operation, const char *startdate, const char *stopdate) |
|
void | yac_event_update (struct event *event) |
|
enum yac_action_type | yac_event_check (struct event *event) |
|
void | yac_event_delete (struct event *event) |
|
int | yac_get_event_lag (struct event *event) |
|
int | yac_get_event_time_operation (struct event *event) |
|
char * | yac_get_event_coupling_timestep (struct event *event, char *timedelta_str) |
|
char * | yac_get_event_model_timestep (struct event *event, char *timedelta_str) |
|
char * | yac_get_event_current_datetime (struct event *event, char *datetime_str) |
|
static int64_t | str2int64 (char const *time) |
|
char const * | yac_time_to_ISO (char const *time, enum yac_time_unit_type time_unit) |
|
◆ SECONDS_PER_DAY
#define SECONDS_PER_DAY 86400 |
◆ str2int64()
static int64_t str2int64 |
( |
char const * | time | ) |
|
|
static |
◆ yac_event_add()
void yac_event_add |
( |
struct event * | event, |
|
|
char const * | model_time_step, |
|
|
char const * | coupling_time_step, |
|
|
int | lag, |
|
|
enum yac_reduction_type | time_operation, |
|
|
const char * | start_date, |
|
|
const char * | stop_date ) |
Fill in the information for an event
- Parameters
-
[in] | event | event |
[in] | model_time_step | model time step as ISO 8061 string |
[in] | coupling_time_step | coupling period as ISO 8061 string |
[in] | lag | time lag (in model time steps) |
[in] | time_operation | online processing of coupling fields /average/minimum/maximum/accumulate/instant |
[in] | start_date | start date of the job |
[in] | stop_date | end date of the job |
- Examples
- test_events.c.
Definition at line 55 of file event.c.
◆ yac_event_check()
◆ yac_event_delete()
void yac_event_delete |
( |
struct event * | event | ) |
|
◆ yac_event_new()
struct event * yac_event_new |
( |
| ) |
|
◆ yac_event_update()
void yac_event_update |
( |
struct event * | event | ) |
|
◆ yac_get_event_coupling_timestep()
char * yac_get_event_coupling_timestep |
( |
struct event * | event, |
|
|
char * | timedelta_str ) |
Get the coupling time step for an event
- Parameters
-
[in] | event | event |
[in] | timedelta_str | string memory |
- Examples
- test_events.c.
Definition at line 291 of file event.c.
◆ yac_get_event_current_datetime()
char * yac_get_event_current_datetime |
( |
struct event * | event, |
|
|
char * | datetime_str ) |
Get the current datetime for an event
- Parameters
-
[in] | event | event |
[in] | datetime_str | string memory |
- Returns
- pointer to datetime_str on success, NULL otherwise
Definition at line 314 of file event.c.
◆ yac_get_event_lag()
int yac_get_event_lag |
( |
struct event * | event | ) |
|
◆ yac_get_event_model_timestep()
char * yac_get_event_model_timestep |
( |
struct event * | event, |
|
|
char * | timedelta_str ) |
Get the model time step for an event
- Parameters
-
[in] | event | event |
[in] | timedelta_str | string memory |
- Examples
- test_events.c.
Definition at line 304 of file event.c.
◆ yac_get_event_time_operation()
int yac_get_event_time_operation |
( |
struct event * | event | ) |
|
Get the time operation of an event
- Parameters
-
Definition at line 284 of file event.c.
◆ yac_time_to_ISO()
Converts time string to ISO 8601 time string
- Parameters
-
[in] | time | time string |
[in] | time_unit | unit of time string |
- Returns
- ISO 8601 time string
Definition at line 329 of file event.c.
◆ yac_number_of_events