Merge branch 'master' into reconnection
This commit is contained in:
commit
8d154f8582
@ -49,7 +49,7 @@ program amun
|
||||
use evolution , only : initialize_evolution, finalize_evolution
|
||||
use evolution , only : print_evolution
|
||||
use evolution , only : advance, new_time_step
|
||||
use evolution , only : registers, step, time, dt, maxerr
|
||||
use evolution , only : registers, step, time, dt, errtol
|
||||
use forcing , only : initialize_forcing, finalize_forcing
|
||||
use forcing , only : print_forcing
|
||||
use gravity , only : initialize_gravity, finalize_gravity
|
||||
@ -604,16 +604,16 @@ program amun
|
||||
!
|
||||
write(*,*)
|
||||
write(*,"(1x,a)" ) "Evolving the system:"
|
||||
write(*,"(4x,'step',5x,'time',11x,'timestep',7x,'error',5x," // &
|
||||
write(*,"(4x,'step',5x,'time',11x,'timestep',6x,'err/tol',4x," // &
|
||||
"'blocks',7x,'ETA')")
|
||||
#ifdef __INTEL_COMPILER
|
||||
write(*,"(i8,2(1x,1es14.6),1x,1es10.2,2x,i8,2x," // &
|
||||
"1i4.1,'d',1i2.2,'h',1i2.2,'m',1i2.2,'s',15x,a1,$)") &
|
||||
step, time, dt, maxerr, get_nleafs(), ed, eh, em, es, char(13)
|
||||
step, time, dt, errtol, get_nleafs(), ed, eh, em, es, char(13)
|
||||
#else /* __INTEL_COMPILER */
|
||||
write(*,"(i8,2(1x,1es14.6),1x,1es10.2,2x,i8,2x," // &
|
||||
"1i4.1,'d',1i2.2,'h',1i2.2,'m',1i2.2,'s',15x,a1)",advance="no") &
|
||||
step, time, dt, maxerr, get_nleafs(), ed, eh, em, es, char(13)
|
||||
step, time, dt, errtol, get_nleafs(), ed, eh, em, es, char(13)
|
||||
#endif /* __INTEL_COMPILER */
|
||||
|
||||
end if
|
||||
@ -699,11 +699,11 @@ program amun
|
||||
#ifdef __INTEL_COMPILER
|
||||
write(*,"(i8,2(1x,1es14.6),1x,1es10.2,2x,i8,2x," // &
|
||||
"1i4.1,'d',1i2.2,'h',1i2.2,'m',1i2.2,'s',15x,a1,$)") &
|
||||
step, time, dt, maxerr, get_nleafs(), ed, eh, em, es, char(13)
|
||||
step, time, dt, errtol, get_nleafs(), ed, eh, em, es, char(13)
|
||||
#else /* __INTEL_COMPILER */
|
||||
write(*,"(i8,2(1x,1es14.6),1x,1es10.2,2x,i8,2x," // &
|
||||
"1i4.1,'d',1i2.2,'h',1i2.2,'m',1i2.2,'s',15x,a1)",advance="no")&
|
||||
step, time, dt, maxerr, get_nleafs(), ed, eh, em, es, char(13)
|
||||
step, time, dt, errtol, get_nleafs(), ed, eh, em, es, char(13)
|
||||
#endif /* __INTEL_COMPILER */
|
||||
|
||||
! update the timestamp
|
||||
|
@ -96,7 +96,7 @@ module evolution
|
||||
real(kind=8) , save :: fac = 9.0d-01
|
||||
real(kind=8) , save :: facmin = 1.0d-01
|
||||
real(kind=8) , save :: facmax = 5.0d+00
|
||||
real(kind=8) , save :: maxerr = 0.0d+00
|
||||
real(kind=8) , save :: errtol = 1.0d+00
|
||||
real(kind=8) , save :: chi = 1.0d+00
|
||||
integer , save :: mrej = 5
|
||||
integer , save :: niterations = 0
|
||||
@ -122,7 +122,7 @@ module evolution
|
||||
! declare public variables
|
||||
!
|
||||
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, errtol
|
||||
|
||||
!- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
!
|
||||
@ -941,7 +941,7 @@ module evolution
|
||||
|
||||
logical :: test
|
||||
integer :: n, l, nrej
|
||||
real(kind=8) :: tm, dtm, ds, umax, utol, emax
|
||||
real(kind=8) :: tm, dtm, ds, umax, emax
|
||||
real(kind=8) :: fc, fcmn, fcmx
|
||||
|
||||
logical , save :: first = .true.
|
||||
@ -1105,9 +1105,7 @@ module evolution
|
||||
|
||||
! calculate tolerance and time step
|
||||
!
|
||||
maxerr = maxval(errors)
|
||||
utol = atol + rtol * umax
|
||||
emax = maxerr / utol
|
||||
emax = maxval(errors) / (atol + rtol * umax)
|
||||
|
||||
if (emax <= 1.0d+00 .or. nrej >= mrej) then
|
||||
test = .false.
|
||||
@ -1116,7 +1114,7 @@ module evolution
|
||||
errs(2) = errs(1)
|
||||
errs(1) = emax
|
||||
|
||||
maxerr = maxerr / umax
|
||||
errtol = emax
|
||||
|
||||
dte = dt * min(fcmx, max(fcmn, &
|
||||
fc * errs(1)**k1 * errs(2)**k2 * errs(3)**k3))
|
||||
@ -1676,8 +1674,8 @@ module evolution
|
||||
|
||||
! calculate the tolerance and estimate the next time step due to the error
|
||||
!
|
||||
maxerr = maxval(errors)
|
||||
errs(1) = maxerr
|
||||
errtol = maxval(errors)
|
||||
errs(1) = errtol
|
||||
fc = product(errs(:)**betas(:))
|
||||
fc = 1.0d+00 + chi * atan((fc - 1.0d+00) / chi)
|
||||
dte = dt * fc
|
||||
@ -1981,7 +1979,7 @@ module evolution
|
||||
|
||||
logical :: test
|
||||
integer :: i, l, nrej
|
||||
real(kind=8) :: tm, dtm, ds, umax, utol, emax
|
||||
real(kind=8) :: tm, dtm, ds, umax, emax
|
||||
real(kind=8) :: fc, fcmn, fcmx
|
||||
|
||||
real(kind=8), dimension(:,:,:,:,:), allocatable :: lerr
|
||||
@ -2238,9 +2236,7 @@ module evolution
|
||||
|
||||
! calculate tolerance and time step
|
||||
!
|
||||
maxerr = maxval(errors)
|
||||
utol = atol + rtol * umax
|
||||
emax = maxerr / utol
|
||||
emax = maxval(errors) / (atol + rtol * umax)
|
||||
|
||||
if (emax <= 1.0d+00 .or. nrej >= mrej) then
|
||||
test = .false.
|
||||
@ -2249,7 +2245,7 @@ module evolution
|
||||
errs(2) = errs(1)
|
||||
errs(1) = emax
|
||||
|
||||
maxerr = maxerr / umax
|
||||
errtol = emax
|
||||
|
||||
dte = dt * min(fcmx, max(fcmn, &
|
||||
fc * errs(1)**k1 * errs(2)**k2 * errs(3)**k3))
|
||||
|
Loading…
x
Reference in New Issue
Block a user