Merge branch 'master' into reconnection

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
This commit is contained in:
Grzegorz Kowal 2021-08-17 11:29:04 -03:00
commit 0a10b48678
2 changed files with 6 additions and 4 deletions

View File

@ -77,6 +77,7 @@ module evolution
real(kind=8) , save :: time = 0.0d+00 real(kind=8) , save :: time = 0.0d+00
real(kind=8) , save :: dt = 1.0d+00 real(kind=8) , save :: dt = 1.0d+00
real(kind=8) , save :: dtn = 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 real(kind=8) , save :: dte = 0.0d+00
! the absolute and relative tolerances, limiting factors, the maximum error, ! the absolute and relative tolerances, limiting factors, the maximum error,
@ -108,7 +109,7 @@ module evolution
! declare public variables ! 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 public :: atol, rtol, mrej, niterations, nrejections, errs, maxerr
!- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - !- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -635,11 +636,12 @@ module evolution
! calculate the new time step ! 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) + 2.0d+00 * max(viscosity, resistivity) / dx_min, eps)
! round the time ! round the time
! !
dtn = dth
if (error_control .and. dte > 0.0d+00) dtn = min(dtn, dte) if (error_control .and. dte > 0.0d+00) dtn = min(dtn, dte)
if (dtnext > 0.0d+00) dtn = min(dtn, dtnext) if (dtnext > 0.0d+00) dtn = min(dtn, dtnext)
dt = dtn dt = dtn

View File

@ -437,7 +437,7 @@ module integrals
use equations , only : ien, imx, imy, imz use equations , only : ien, imx, imy, imz
use equations , only : magnetized, adiabatic_index, csnd use equations , only : magnetized, adiabatic_index, csnd
use equations , only : errors 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 forcing , only : einj, rinj, arms
use helpers , only : flush_and_sync use helpers , only : flush_and_sync
#ifdef MPI #ifdef MPI
@ -1358,7 +1358,7 @@ module integrals
, avarr(5), mnarr(5), mxarr(5) & , avarr(5), mnarr(5), mxarr(5) &
, avarr(6), mnarr(6), mxarr(6) & , avarr(6), mnarr(6), mxarr(6) &
, avarr(7), mnarr(7), mxarr(7) , 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) write(runit,"(i9, 24es25.15e3)") step, time, inarr(11:33)
call flush_and_sync(funit) call flush_and_sync(funit)