gs2_time Module

FIXME : Add documentation


Contents


Variables

Type Visibility Attributes Name Initial
real, public, parameter :: dt_not_set = -1.0
real, public :: user_dt
real, public :: code_dt
real, public :: code_dt_prev1 = dt_not_set
real, public :: code_dt_prev2 = dt_not_set
real, private :: user_dt_cfl = 1e8
real, public :: code_dt_cfl = 1e8
real, public :: code_dt_min
real, private :: user_dt_min
real, public :: code_dt_max
real, private :: user_dt_max
real, public :: code_dt_old = 0.
real, public :: user_time = dt_not_set
real, public :: code_time = dt_not_set
real, public, dimension (:), allocatable :: wunits
real, public, dimension (:), allocatable :: woutunits
real, public, dimension (:), allocatable :: tunits

Functions

public function time_history_available()

Reports how many previous time steps are available by checking if the previous code_dt values have been set to anything. Note we assume that if a time step is set then all more recent values have also been set.

Arguments

None

Return Value integer

public function get_adams_bashforth_coefficients(maximum_order, target_dt) result(coefficients)

Returns the current set of Adams Bashforth coefficients. The order is determined by how much time history we have available up to a maximum of 3rd order. The coefficients are generalised for variable timestep.

Arguments

Type IntentOptional Attributes Name
integer, intent(in), optional :: maximum_order

If present then sets the maxmimum method order to use when calculating the coefficients. Limited by how much time history we have available and no higher than 3.

real, intent(in), optional :: target_dt

If present sets the intended time step size we want to take. Otherwise assume we want to step by code_dt.

Return Value real, dimension(:), allocatable

The result contains up to three coefficients. The first entry corresponds to the coefficient for the latest source term, the second entry corresponds to the coefficient for the previous source term and the last entry is for the oldest source term.


Subroutines

public subroutine init_gs2_time()

Initialise the gs2_time module

Read more…

Arguments

None

public subroutine finish_gs2_time()

Finalise the gs2_time module

Arguments

None

private subroutine adjust_time_norm()

FIXME : Add documentation

Arguments

None

public subroutine init_tstart(tstart)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
real, intent(in) :: tstart

public subroutine init_delt(delt, delt1, delt2)

Set the full timestep history. Inputs set the current, previous and last but one timesteps

Arguments

Type IntentOptional Attributes Name
real, intent(in) :: delt
real, intent(in) :: delt1
real, intent(in) :: delt2

public subroutine check_time_step_too_large(reset)

Check if the current time step is too big

Arguments

Type IntentOptional Attributes Name
logical, intent(out) :: reset

public subroutine update_time()

FIXME : Add documentation

Arguments

None

public subroutine save_dt_cfl(delt_cfl)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
real, intent(in) :: delt_cfl

public subroutine save_dt_min(dt_min)

Sets the minimum timestep size allowed based on passed value.

Arguments

Type IntentOptional Attributes Name
real, intent(in) :: dt_min

public subroutine save_dt_max(dt_max)

Sets the maximum timestep size allowed based on passed value.

Arguments

Type IntentOptional Attributes Name
real, intent(in) :: dt_max

public subroutine save_dt(delt)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
real, intent(in) :: delt

public subroutine write_dt()

FIXME : Add documentation

Arguments

None

public subroutine user2code(usertime, codetime)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
real, intent(in) :: usertime
real, intent(out) :: codetime