gs2_reinit Module

FIXME : Add documentation



Contents


Variables

Type Visibility Attributes Name Initial
real, public :: delt_adj
real, private :: dt0
real, private :: delt_cushion
real, private :: delt_minimum
real, public :: time_reinit(2) = 0.
logical, private :: abort_rapid_time_step_change
logical, private :: first = .true.
logical, public :: in_memory
logical, private :: initialized = .false.
type(reinit_config_type), private :: reinit_config

Derived Types

type, public, extends(abstract_config_type) ::  reinit_config_type

Used to represent the input configuration of reinit

Components

Type Visibility Attributes Name Initial
logical, public :: exist = .false.

Does the related namelist exist in the target input file?

integer, public :: index = 0

Used to hold the specific index of numbered namelists

logical, public :: skip_read = .false.

Do we want to skip the read step in init?

logical, public :: skip_broadcast = .false.

Do we want to skip the broadcast step in init?

logical, public :: abort_rapid_time_step_change = .true.

If true (default), exit if time step changes rapidly, that is, if the time step changes at four consecutive time steps.

real, public :: delt_adj = 2.0

When the time step needs to be changed it is adjusted by this factor, i.e dt --> dt/delt_adj or dt --> dt*delt_adj when reducing/increasing the timestep. For non-linear runs good choice of delt_adj can make a moderate difference to efficiency. Need to balance time taken to reinitialise against frequency of time step adjustments (i.e. if your run takes a long time to initialise you probably want to set delt_adj to be reasonably large).

real, public :: delt_cushion = 1.5

Used in deciding when to increase the time step to help prevent oscillations in time step around some value. We only increase the time step when it is less than the scaled cfl estimate divided by delt_adj*delt_cushion whilst we decrease it as soon as the time step is larger than the scaled cfl estimate.

real, public :: delt_minimum = 1.e-5

The minimum time step allowed is delt_minimum. If the code wants to drop below this value then the run will end.

real, public :: dt0 = 0.0

Sets the maximum value the time step can take.

Read more…
logical, public :: in_memory = .false.

If true then attempts to create temporary copies of the distribution fn and fields in memory to be restored after the time step reset rather than dumping to fields. This could be faster on machines with slow file systems. If the required memory allocation fails then we set in_memory=.false. and fall back to the traditional file based approach.

Type-Bound Procedures

procedure , public , :: is_initialised => is_initialised_generic Function
procedure , public , :: init => init_generic Subroutine
procedure , public , :: setup => setup_generic Subroutine
procedure , public , :: write_namelist_header Subroutine
procedure , public , :: get_name => get_name_generic Function
procedure , public , :: get_requires_index => get_requires_index_generic Function
procedure , public , nopass :: write_namelist_footer Subroutine
generic, public , :: write_key_val => write_key_val_string, write_key_val_real, write_key_val_complex, write_key_val_integer, write_key_val_logical, write_key_val_real_array, write_key_val_complex_array, write_key_val_integer_array
procedure , public :: read => read_reinit_config Subroutine
procedure , public :: write => write_reinit_config Subroutine
procedure , public :: reset => reset_reinit_config Subroutine
procedure , public :: broadcast => broadcast_reinit_config Subroutine
procedure , public , nopass :: get_default_name => get_default_name_reinit_config Function
procedure , public , nopass :: get_default_requires_index => get_default_requires_index_reinit_config Function

Functions

public function get_gs2_reinit_config()

Get the module level config instance

Arguments

None

Return Value type(reinit_config_type)

private function get_default_name_reinit_config()

Gets the default name for this namelist

Arguments

None

Return Value character(len=CONFIG_MAX_NAME_LEN)

Gets the default requires index for this namelist

Arguments

None

Return Value logical


Subroutines

public subroutine wnml_gs2_reinit(unit)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: unit

public subroutine reduce_time_step()

Reduces the time step by a factor delt_adj.

Arguments

None

public subroutine increase_time_step()

Increases the time step by a factor delt_adj up to a limit of code_dt_max set by dt0 or from the restart file.

Arguments

None

public subroutine reset_time_step(current_init, istep, my_exit, job_id)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
type(init_type), intent(inout) :: current_init
integer, intent(in) :: istep
logical, intent(inout) :: my_exit
integer, intent(in), optional :: job_id

public subroutine check_time_step(reset, exit)

FIXME : Add documentation

Arguments

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

public subroutine init_gs2_reinit()

FIXME : Add documentation

Arguments

None

public subroutine finish_gs2_reinit()

FIXME : Add documentation

Arguments

None

public subroutine init_reinit(reinit_config_in)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
type(reinit_config_type), intent(in), optional :: reinit_config_in

public subroutine set_gs2_reinit_config(gs2_reinit_config_in)

Set the module level config type Will abort if the module has already been initialised to avoid inconsistencies.

Arguments

Type IntentOptional Attributes Name
type(reinit_config_type), intent(in), optional :: gs2_reinit_config_in

private subroutine read_reinit_config(self)

Reads in the reinit_knobs namelist and populates the member variables

Arguments

Type IntentOptional Attributes Name
class(reinit_config_type), intent(inout) :: self

private subroutine write_reinit_config(self, unit)

Writes out a namelist representing the current state of the config object

Arguments

Type IntentOptional Attributes Name
class(reinit_config_type), intent(in) :: self
integer, intent(in), optional :: unit

private subroutine reset_reinit_config(self)

Resets the config object to the initial empty state

Arguments

Type IntentOptional Attributes Name
class(reinit_config_type), intent(inout) :: self

private subroutine broadcast_reinit_config(self)

Broadcasts all config parameters so object is populated identically on all processors

Arguments

Type IntentOptional Attributes Name
class(reinit_config_type), intent(inout) :: self