Open
Description
When using float32, there may be roundoff errors in model time, which could cause problems. For example:
julia> t=Float32(390*24*60*60)
3.3696f7
julia> tt = t+150
3.369615f7
julia> tt-t
152.0f0
Potential solution:
use a different mechanism for internally storing current time, either
- a higher-precision Float64
- an integer, either number of time steps or number of seconds (or equivalently using a DateTime object, which internally uses milliseconds since an epoch)
From Tapio: Standard solution is to use an integer step counter j, then write output every n steps. Of course, this only works with constant dt, but every climate model I know has that anyway.
Metadata
Metadata
Assignees
Labels
No labels