diff --git a/sources/evolution.F90 b/sources/evolution.F90 index 10a37c4..329ba12 100644 --- a/sources/evolution.F90 +++ b/sources/evolution.F90 @@ -77,6 +77,7 @@ module evolution real(kind=8) , save :: time = 0.0d+00 real(kind=8) , save :: dt = 1.0d+00 real(kind=8) , save :: dtn = 1.0d+00 + real(kind=8) , save :: dth = 1.0d+00 real(kind=8) , save :: dte = 0.0d+00 ! the absolute and relative tolerances, limiting factors, the maximum error, @@ -108,7 +109,7 @@ module evolution ! declare public variables ! - public :: step, time, dt, dtn, dte, cfl, glm_alpha, registers + public :: step, time, dt, dtn, dth, dte, cfl, glm_alpha, registers public :: atol, rtol, mrej, niterations, nrejections, errs, maxerr !- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -635,11 +636,12 @@ module evolution ! calculate the new time step ! - dtn = cfl * dx_min / max(cmax & + dth = cfl * dx_min / max(cmax & + 2.0d+00 * max(viscosity, resistivity) / dx_min, eps) ! round the time ! + dtn = dth if (error_control .and. dte > 0.0d+00) dtn = min(dtn, dte) if (dtnext > 0.0d+00) dtn = min(dtn, dtnext) dt = dtn diff --git a/sources/integrals.F90 b/sources/integrals.F90 index 8b3d009..b016d09 100644 --- a/sources/integrals.F90 +++ b/sources/integrals.F90 @@ -437,7 +437,7 @@ module integrals use equations , only : ien, imx, imy, imz use equations , only : magnetized, adiabatic_index, csnd use equations , only : errors - use evolution , only : step, time, dtn, dte + use evolution , only : step, time, dtn, dth, dte use forcing , only : einj, rinj, arms use helpers , only : flush_and_sync #ifdef MPI @@ -1358,7 +1358,7 @@ module integrals , avarr(5), mnarr(5), mxarr(5) & , avarr(6), mnarr(6), mxarr(6) & , avarr(7), mnarr(7), mxarr(7) - write(eunit,efmt) step, time, dtn, dte, maxval(errors(:)), errors(:) + write(eunit,efmt) step, time, dth, dte, maxval(errors(:)), errors(:) write(runit,"(i9, 24es25.15e3)") step, time, inarr(11:33) call flush_and_sync(funit)