Skip to content

Output time column truncated to seconds, causing duplicate timestamps at milli-second output frequency #2804

Description

@ChitYanToe

Parcels version

Parcels v4

Description

When running a Parcels simulation with an output frequency (outputdt) on the order of milliseconds, the time variable written to the output file does not preserve the millisecond precision. Instead, time values appear to be truncated/rounded to the nearest second.
As a result, multiple consecutive output records for the same trajectory (Particle_ID) end up sharing an identical time value, even though they correspond to distinct simulation steps. This creates duplicate (trajectory, time) pairs in the output dataset, which breaks downstream analysis that assumes each (Particle_ID, time) pair is unique (e.g., indexing, grouping, or merging on time).

Code sample

output_file = parcels.ParticleFile(resultDir+"output-quickstart.parquet", outputdt=timedelta(seconds=0.4), mode="w") #

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugneeds-triageIssue that has not been reviewed by a Parcels team member

    Type

    No type

    Projects

    Status
    Backlog

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions