storm-fsv-cvut / smoderp2d

SMODERP2D - Distributed event-based model for surface and subsurface runoff and erosion
https://storm-fsv-cvut.github.io/smoderp2d-manual/
GNU General Public License v3.0
7 stars 4 forks source link

runoff: newtime and oldtime computation - avoid Sisyphos work #379

Closed pesekon2 closed 2 months ago

pesekon2 commented 2 months ago
pesekon2 commented 2 months ago

Line newtime_minute_floor * 60. - oldtime changes the results a bit. the changes are only due to the precision of float operations. The old version was (newtime_minute_floor - oldtime / 60) * 60.).

I believe that mathematically, both operations should be equal (but they are not on a computer). I support the new version because I believe it is less prone to lose some precision (avoid some extra operations). @jerabekjak @landam @kavkapet: What is your opinion?