runtraj.execution.worker.run_result#
- runtraj.execution.worker.run_result(sim, *, workdir, keep_workdir=False, timeout=None)[source]#
Run the transport model for a simulation and write its result 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. A failed run’s copy leaves out the model’sresult_files.- Parameters:
sim (
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 result, of the variant’s type (the particles, for most), 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 (NO_CONCENTRATION_DATAfor a concentration result).MeteorologyErrorwhen the met files are missing.