EVOLUTION: Add dth to track hydrodynamic timestep.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
This commit is contained in:
parent
c766bb9059
commit
7713df3ebf
@ -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
|
||||
|
@ -380,7 +380,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
|
||||
@ -650,7 +650,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(:)
|
||||
|
||||
call flush_and_sync(funit)
|
||||
call flush_and_sync(sunit)
|
||||
|
Loading…
x
Reference in New Issue
Block a user