pylag.time_manager module

Time manager manages all time counters. It also tracks events, and can be used to flag when data should be written or synced to disk.

class pylag.time_manager.TimeManager(config)

Bases: object

Time manager

Time manager keeps track of all time counters, including the current simulation time. It is responsible for updating the current time. It can also be used as an event manage which flags when key events should happen, including when individual ensemble members should start and stop, and when data should be written or synced to disk.

Parameters

config (configparser.ConfigParser) – PyLag configuration object.

create_restart_file(self)

Create a restart file?

Return a flag signifying whether a restart file should be created.

current_release

Integer identifying the current particle release

datetime_current

Current datetime

datetime_end

Integration end datetime for the current release

datetime_start

Integration start datetime for the current release

new_simulation(self)

Start a new simulation?

If True, (re-)set all time variables and counters, then increment the indentifier for the current particle release.

number_of_particle_releases

The total number of particle releases

sync_data_to_disk(self)

Sync data to disk?

Return a flag signifying whether data should be synced to disk.

time

Current time (seconds elapsed since start of the current simulation)

time_end

Integration end time (seconds)

time_step

Integration time step (seconds)

update_current_time(self)

Update the current time

write_output_to_file(self)

Write data to file?

Return a flag signifying whether data should be written to file.