runtraj.execution.worker.run_particles#
- runtraj.execution.worker.run_particles(sim, *, workdir, keep_workdir=False, timeout=None)[source]#
Run the transport model for a simulation and write its particles to the output directory.
The transport model the variant names runs in workdir (
runtraj.models.run_model()), with the variant’s met. Its log is written to the output directory whether the run succeeds or fails. The working directory is then removed, unless the run failed or keep_workdir is set, in which case it is copied under the output directory’sscratch/first.- Parameters:
sim (runtraj.simulation.Simulation) – What to run.
workdir (
Path) – Directory to run in, made here. Anything in it is removed first, so each run needs its own.keep_workdir (
bool) – Keep the working directory of a successful run too.timeout (
int|None) – Time limit for the transport model run, in seconds.
- Returns:
The particles, also written to the output directory.
- Return type:
- Raises:
SimulationError – As the transport model raises it (with a
reason), or withreasonNO_PARTICLE_DATAwhen the model wrote no particles.MeteorologyErrorwhen the met files are missing.