Merge branch 'master' into reconnection
This commit is contained in:
commit
1e7099123e
@ -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, errtol
|
||||
use evolution , only : registers, step, time, dt, dtp, errtol
|
||||
use forcing , only : initialize_forcing, finalize_forcing
|
||||
use forcing , only : print_forcing
|
||||
use gravity , only : initialize_gravity, finalize_gravity
|
||||
@ -116,7 +116,6 @@ program amun
|
||||
real(kind=8) :: ymin = 0.0d+00, ymax = 1.0d+00
|
||||
real(kind=8) :: zmin = 0.0d+00, zmax = 1.0d+00
|
||||
real(kind=8) :: tmax = 0.0d+00, trun = 9.999d+03, tsav = 3.0d+01
|
||||
real(kind=8) :: dtnext = 0.0d+00
|
||||
|
||||
! timer indices
|
||||
!
|
||||
@ -327,9 +326,9 @@ program amun
|
||||
!
|
||||
trun = trun - tsav / 6.0d+01
|
||||
|
||||
! initialize dtnext
|
||||
! initialize dtp
|
||||
!
|
||||
dtnext = 2.0d+00 * tmax
|
||||
dtp = 2.0d+00 * tmax
|
||||
|
||||
! get integral calculation interval
|
||||
!
|
||||
@ -533,7 +532,7 @@ program amun
|
||||
|
||||
! update boundaries
|
||||
!
|
||||
call boundary_variables(time, dtnext)
|
||||
call boundary_variables(time, 0.0d+00)
|
||||
|
||||
else
|
||||
|
||||
@ -552,11 +551,11 @@ program amun
|
||||
|
||||
! update boundaries
|
||||
!
|
||||
call boundary_variables(0.0d+00, dtnext)
|
||||
call boundary_variables(0.0d+00, 0.0d+00)
|
||||
|
||||
! calculate new timestep
|
||||
!
|
||||
call new_time_step(dtnext)
|
||||
call new_time_step()
|
||||
|
||||
end if
|
||||
|
||||
@ -624,11 +623,11 @@ program amun
|
||||
|
||||
! get the next snapshot time
|
||||
!
|
||||
if (precise_snapshots) dtnext = next_tout() - time
|
||||
if (precise_snapshots) dtp = next_tout() - time
|
||||
|
||||
! performe one step evolution
|
||||
!
|
||||
call advance(dtnext, status)
|
||||
call advance(status)
|
||||
|
||||
if (check_status(status /= 0)) then
|
||||
if (master) then
|
||||
|
@ -86,6 +86,7 @@ module evolution
|
||||
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 :: dtp = 1.0d+00 ! dt for the precise snapshots
|
||||
|
||||
! the absolute and relative tolerances, limiting factors, the maximum error,
|
||||
! the maximum number of passes for the adaptive step,
|
||||
@ -121,7 +122,7 @@ module evolution
|
||||
|
||||
! declare public variables
|
||||
!
|
||||
public :: step, time, dt, dtn, dth, dte, cfl, glm_alpha, registers
|
||||
public :: step, time, dt, dtn, dth, dte, dtp, cfl, glm_alpha, registers
|
||||
public :: atol, rtol, mrej, niterations, nrejections, errs, errtol
|
||||
|
||||
!- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
@ -504,12 +505,11 @@ module evolution
|
||||
!
|
||||
! Arguments:
|
||||
!
|
||||
! dtnext - the next time step;
|
||||
! status - the subroutine call status: 0 for success, otherwise failure;
|
||||
!
|
||||
!===============================================================================
|
||||
!
|
||||
subroutine advance(dtnext, status)
|
||||
subroutine advance(status)
|
||||
|
||||
! references
|
||||
!
|
||||
@ -524,8 +524,7 @@ module evolution
|
||||
|
||||
! input variables
|
||||
!
|
||||
real(kind=8), intent(in) :: dtnext
|
||||
integer , intent(out) :: status
|
||||
integer, intent(out) :: status
|
||||
!
|
||||
!-------------------------------------------------------------------------------
|
||||
!
|
||||
@ -537,7 +536,7 @@ module evolution
|
||||
|
||||
! find new time step
|
||||
!
|
||||
call new_time_step(dtnext)
|
||||
call new_time_step()
|
||||
|
||||
! advance the solution using the selected method
|
||||
!
|
||||
@ -600,11 +599,10 @@ module evolution
|
||||
!
|
||||
! Arguments:
|
||||
!
|
||||
! dtnext - next time step;
|
||||
!
|
||||
!===============================================================================
|
||||
!
|
||||
subroutine new_time_step(dtnext)
|
||||
subroutine new_time_step()
|
||||
|
||||
! include external procedures
|
||||
!
|
||||
@ -626,10 +624,6 @@ module evolution
|
||||
!
|
||||
implicit none
|
||||
|
||||
! subroutine arguments
|
||||
!
|
||||
real(kind=8), intent(in) :: dtnext
|
||||
|
||||
! local pointers
|
||||
!
|
||||
type(block_data), pointer :: pdata
|
||||
@ -711,9 +705,14 @@ module evolution
|
||||
! 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
|
||||
if (error_control) then
|
||||
if (dte > 0.0d+00) then
|
||||
dtn = min(dtn, dte)
|
||||
else
|
||||
dte = dth
|
||||
end if
|
||||
end if
|
||||
dt = min(dtn, dtp)
|
||||
|
||||
#ifdef PROFILE
|
||||
! stop accounting time for new time step estimation
|
||||
|
Loading…
x
Reference in New Issue
Block a user