From 8517904d1796a58f241605ec7b6304b8222544f4 Mon Sep 17 00:00:00 2001 From: James Date: Thu, 31 Aug 2023 15:57:46 -0400 Subject: [PATCH] OutputFieldsDefault: hotfix for tfield_interval=0 --- src/include/OutputFieldsDefault.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/include/OutputFieldsDefault.h b/src/include/OutputFieldsDefault.h index 907acf2e5..f1e672e2d 100644 --- a/src/include/OutputFieldsDefault.h +++ b/src/include/OutputFieldsDefault.h @@ -114,9 +114,11 @@ class OutputFieldsItem : public OutputFieldsItemParams pfield_next_ = timestep + pfield_interval; tfield_next_ = timestep + tfield_interval; - tfield_next_ = timestep / tfield_interval * tfield_interval; - if (timestep % tfield_interval > 0) - tfield_next_ += tfield_interval; + if (tfield_interval > 0) { + tfield_next_ = timestep / tfield_interval * tfield_interval; + if (timestep % tfield_interval > 0) + tfield_next_ += tfield_interval; + } } }