From b2a7bd08b6c7dce2c0a3adae7fc1cef4b4452100 Mon Sep 17 00:00:00 2001 From: Grzegorz Kowal Date: Mon, 19 Jul 2021 13:16:31 -0300 Subject: [PATCH 1/2] EVOLUTION: Consider dte only for methods with error control. Signed-off-by: Grzegorz Kowal --- sources/evolution.F90 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sources/evolution.F90 b/sources/evolution.F90 index 118acdc..8f13a66 100644 --- a/sources/evolution.F90 +++ b/sources/evolution.F90 @@ -640,8 +640,12 @@ module evolution ! round the time ! - if (dte <= 0.0d+00) dte = dtn - if (dtnext > 0.0d+00) dt = min(dtn, dte, dtnext) + if (error_control) then + if (dte <= 0.0d+00) dte = dtn + dtn = min(dtn, dte) + end if + if (dtnext > 0.0d+00) dtn = min(dtn, dtnext) + dt = min(2.0d+00 * dt, dtn) #ifdef PROFILE ! stop accounting time for new time step estimation From a0b6e60d7e1f8f32b7e00e6ac922256be445226e Mon Sep 17 00:00:00 2001 From: Grzegorz Kowal Date: Mon, 19 Jul 2021 15:12:08 -0300 Subject: [PATCH 2/2] EVOLUTION: Simplify conditions for the new time step. Signed-off-by: Grzegorz Kowal --- sources/evolution.F90 | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/sources/evolution.F90 b/sources/evolution.F90 index 8f13a66..10a37c4 100644 --- a/sources/evolution.F90 +++ b/sources/evolution.F90 @@ -640,12 +640,9 @@ module evolution ! round the time ! - if (error_control) then - if (dte <= 0.0d+00) dte = dtn - dtn = min(dtn, dte) - end if + if (error_control .and. dte > 0.0d+00) dtn = min(dtn, dte) if (dtnext > 0.0d+00) dtn = min(dtn, dtnext) - dt = min(2.0d+00 * dt, dtn) + dt = dtn #ifdef PROFILE ! stop accounting time for new time step estimation