YetAnotherCoupler 3.5.2
Loading...
Searching...
No Matches
event.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "event.h"
#include "utils_mci.h"
#include "utils_common.h"
Include dependency graph for event.c:

Go to the source code of this file.

Data Structures

struct  event
 

Macros

#define SECONDS_PER_DAY   86400
 

Functions

struct eventyac_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)
 

Variables

int yac_number_of_events
 

Macro Definition Documentation

◆ SECONDS_PER_DAY

#define SECONDS_PER_DAY   86400

Definition at line 14 of file event.c.

Function Documentation

◆ str2int64()

static int64_t str2int64 ( char const * time)
static

Definition at line 320 of file event.c.

Here is the caller graph for this function:

◆ 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]eventevent
[in]model_time_stepmodel time step as ISO 8061 string
[in]coupling_time_stepcoupling period as ISO 8061 string
[in]lagtime lag (in model time steps)
[in]time_operationonline processing of coupling fields /average/minimum/maximum/accumulate/instant
[in]start_datestart date of the job
[in]stop_dateend date of the job
Examples
test_events.c.

Definition at line 55 of file event.c.

Here is the caller graph for this function:

◆ yac_event_check()

enum yac_action_type yac_event_check ( struct event * event)

Check for an event

Parameters
[in]eventevent
Examples
test_events.c.

Definition at line 182 of file event.c.

Here is the caller graph for this function:

◆ yac_event_delete()

void yac_event_delete ( struct event * event)

Delete an event

Parameters
[in]eventevent
Examples
test_events.c.

Definition at line 258 of file event.c.

Here is the caller graph for this function:

◆ yac_event_new()

struct event * yac_event_new ( )

Event constructor

Returns
event event
Examples
test_events.c.

Definition at line 36 of file event.c.

Here is the caller graph for this function:

◆ yac_event_update()

void yac_event_update ( struct event * event)

Add delta time to an event

Parameters
[in]eventevent
Examples
test_events.c.

Definition at line 170 of file event.c.

Here is the caller graph for this function:

◆ 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]eventevent
[in]timedelta_strstring 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]eventevent
[in]datetime_strstring memory
Returns
pointer to datetime_str on success, NULL otherwise
Remarks
the buffer associated to datetime_str has to have at least a size of MAX_DATETIME_STR_LEN

Definition at line 314 of file event.c.

Here is the caller graph for this function:

◆ yac_get_event_lag()

int yac_get_event_lag ( struct event * event)

Get the time lag of an event

Parameters
[in]eventevent
Examples
test_events.c.

Definition at line 277 of file event.c.

◆ 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]eventevent
[in]timedelta_strstring 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
[in]eventevent

Definition at line 284 of file event.c.

Here is the caller graph for this function:

◆ yac_time_to_ISO()

char const * yac_time_to_ISO ( char const * time,
enum yac_time_unit_type time_unit )

Converts time string to ISO 8601 time string

Parameters
[in]timetime string
[in]time_unitunit of time string
Returns
ISO 8601 time string

Definition at line 329 of file event.c.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ yac_number_of_events

int yac_number_of_events

Definition at line 16 of file event.c.