From 381433aa95d4868648801082e87c603b533754d9 Mon Sep 17 00:00:00 2001 From: Markus Metz <33666869+metzm@users.noreply.github.com> Date: Fri, 31 Jan 2025 09:22:57 +0100 Subject: [PATCH] r.sim.water: add info to manual, add info about progress (#4662) * `r.sim.water` is a module with a number of important but not well documented parameters. This PR adds more information about some parameters to the manual. * It takes quite some time to run a simulation, another message is added to the progress of the simulation. This PR tries to add info requested in https://github.com/OSGeo/grass/discussions/4475 to the manual Co-authored-by: Anna Petrasova Co-authored-by: Markus Neteler --- raster/r.sim/r.sim.sediment/main.c | 15 +++++- .../r.sim/r.sim.sediment/r.sim.sediment.html | 4 ++ raster/r.sim/r.sim.water/main.c | 15 +++++- raster/r.sim/r.sim.water/r.sim.water.html | 51 +++++++++++++++++++ raster/r.sim/simlib/hydro.c | 3 ++ raster/r.sim/simlib/input.c | 5 ++ raster/r.sim/simlib/simlib.h | 9 ++-- raster/r.sim/simlib/waterglobs.h | 1 + 8 files changed, 97 insertions(+), 6 deletions(-) diff --git a/raster/r.sim/r.sim.sediment/main.c b/raster/r.sim/r.sim.sediment/main.c index d0197c2abb1..f49fa8fb880 100644 --- a/raster/r.sim/r.sim.sediment/main.c +++ b/raster/r.sim/r.sim.sediment/main.c @@ -237,6 +237,18 @@ int main(int argc, char *argv[]) parm.niter->description = _("Time used for iterations [minutes]"); parm.niter->guisection = _("Parameters"); + parm.mintimestep = G_define_option(); + parm.mintimestep->key = "mintimestep"; + parm.mintimestep->type = TYPE_DOUBLE; + parm.mintimestep->answer = "0.0"; + parm.mintimestep->required = NO; + parm.mintimestep->label = + _("Minimum time step for the simulation [seconds]"); + parm.mintimestep->description = + _("A larger minimum time step substantially reduces processing time, " + "but at the cost of accuracy"); + parm.mintimestep->guisection = _("Parameters"); + parm.outiter = G_define_option(); parm.outiter->key = "output_step"; parm.outiter->type = TYPE_INTEGER; @@ -286,7 +298,7 @@ int main(int argc, char *argv[]) parm.threads->answer = NUM_THREADS; parm.threads->required = NO; parm.threads->description = - _("Number of threads which will be used for parallel compute"); + _("Number of threads which will be used for parallel computation."); parm.threads->guisection = _("Parameters"); if (G_parser(argc, argv)) @@ -389,6 +401,7 @@ int main(int argc, char *argv[]) /* sscanf(parm.nwalk->answer, "%d", &wp.maxwa); */ sscanf(parm.niter->answer, "%d", &wp.timesec); + sscanf(parm.mintimestep->answer, "%lf", &wp.mintimestep); sscanf(parm.outiter->answer, "%d", &wp.iterout); /* sscanf(parm.density->answer, "%d", &wp.ldemo); */ sscanf(parm.diffc->answer, "%lf", &wp.frac); diff --git a/raster/r.sim/r.sim.sediment/r.sim.sediment.html b/raster/r.sim/r.sim.sediment/r.sim.sediment.html index caebb9c308c..7f1b80867ca 100644 --- a/raster/r.sim/r.sim.sediment/r.sim.sediment.html +++ b/raster/r.sim/r.sim.sediment/r.sim.sediment.html @@ -41,6 +41,10 @@

DESCRIPTION

given by nwalkers should be used.
+

+Increasing the number of threads with nprocs does not really +speed up the simulation. +