[GRASS-git] [OSGeo/grass] 8b60e9: r.sim: Write time series maps at their output step...

Vaclav Petras noreply at github.com
Fri Oct 2 20:09:09 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/OSGeo/grass
  Commit: 8b60e9ff0d0ec8dd9cbd4222f9159852a7b21081
      https://github.com/OSGeo/grass/commit/8b60e9ff0d0ec8dd9cbd4222f9159852a7b21081
  Author: Vaclav Petras <wenzeslaus at gmail.com>
  Date:   2026-10-02 (Fri, 02 Oct 2026)

  Changed paths:
    M raster/r.sim/r.sim.water/r.sim.water.html
    M raster/r.sim/r.sim.water/r.sim.water.md
    M raster/r.sim/r.sim.water/tests/r_sim_water_summary_test.py
    M raster/r.sim/r.sim.water/tests/r_sim_water_test.py
    A raster/r.sim/r.sim.water/tests/r_sim_water_time_series_test.py
    M raster/r.sim/simlib/hydro.c
    M raster/r.sim/simlib/input.c
    M raster/r.sim/simlib/output.c
    M raster/r.sim/simlib/simlib.h

  Log Message:
  -----------
  r.sim: Write time series maps at their output step times (#8003)

With -t, r.sim.water wrote the series maps every (int)(output_step /
time step) iterations and named them by the simulated time rounded to
whole minutes. The truncated interval made the write times drift away
from the output steps, so two writes could round to the same minute and
the first map was overwritten, names could skip a minute or land on odd
minutes with an even output_step, and the last step was often missing.
When the time step was longer than output_step, the interval was zero
and no map was written at all while the tool still succeeded.

Write output step j at the iteration whose simulated time is closest to
j times output_step, and name and timestamp the maps by that time. The
time step comes from the cell size and the mean velocity, so iterations
usually do not fall on the output times. When one iteration is the
closest one to several steps, write only the step closest to it and
warn that the time step is longer than output_step. Do not write steps
past the duration. Always end the series with maps named by the
duration which hold the state at the end of the run, also when the
duration is not a multiple of output_step or when the run stopped
early. Walker vector maps follow the same schedule.

For users, each output step now appears once, named and timestamped by
a multiple of output_step, and the maps named by the duration are always
present. A series map holds the state at most half a time step before
or after the time in its name instead of up to several minutes before
it. The depth and discharge values are unchanged and so are the outputs
without -t. In the run summary, simulated_time of an output is the time
the maps were written and timestamp the time they are named by. New
tests check the names, timestamps and write times of the series, a
duration which is not a multiple of output_step, time steps longer
than output_step including its multiples, a step past the duration, and
an early stop.

Written with the help of Claude Code.



To unsubscribe from these emails, change your notification settings at https://github.com/OSGeo/grass/settings/notifications


More information about the grass-commit mailing list