Used to represent the input configuration of split_nonlinear_terms
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 | :: | skip_smart_defaults | = | .false. |
Do we want to skip the smaart defaults in init? |
|
real, | public | :: | absolute_tolerance | = | 1.0e-3 |
The absolute tolerance used in error controlled schemes. Attempt to adjust time step to keep error below this tolerance. |
|
logical, | public | :: | advance_nonadiabatic_dfn | = | .false. |
If true then nonlinear integrator advances the nonadiabatic dfn, h, rather than the modified distribution function, g. |
|
real, | public | :: | convergence_tolerance | = | 1.0e-1 |
The tolerance used in convergence checks. Currently only used for halting the fixed-point iteration in the beuler method |
|
real, | public | :: | relative_tolerance | = | 1.0e-2 |
The relative tolerance used in error controlled schemes. Attempt to adjust time step to keep error below this tolerance. |
|
character(len=20), | public | :: | rk_method | = | 'default' |
Choose which specific RK scheme to use in the RK method. Generally if the tolerances are small a higher order scheme will be more effective than low order. At loose tolerances low order schemes are generally more efficient Valid options include:
See rk_schemes for other options. |
|
logical, | public | :: | show_statistics | = | .false. |
If true then reports the number of right hand side (NL term) calculations, the number of failed internal steps and the number of successful steps at the end of each linear size step. |
|
character(len=20), | public | :: | split_method | = | 'default' |
What algorithm do we use to advance the nonlinear term if split_nonlinear is true. Valid options include:
|
|
logical, | public | :: | strang_split | = | .false. |
If true then indicates that we want to use a strang split approach where we advance the NL operator by a half step, linear by a full step and then NL by another half step. This should be second order accurate whilst the regular split is only first order accurate. |
|
real, | public | :: | time_step_safety_factor | = | 0.9 |
Multiplies the new time step calculated from either the error or cfl limits. Smaller values are more conservative but may help avoid repeated violation of the error/cfl limits and hence reduce the number of failed steps. |
Is this instance initialised?
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_config_type), | intent(in) | :: | self |
Fully initialise the config object
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_config_type), | intent(inout) | :: | self | |||
character(len=*), | intent(in), | optional | :: | name | ||
logical, | intent(in), | optional | :: | requires_index | ||
integer, | intent(in), | optional | :: | index | ||
logical, | intent(in), | optional | :: | skip_smart_defaults | ||
logical, | intent(in), | optional | :: | skip_read | ||
logical, | intent(in), | optional | :: | skip_broadcast |
Do some standard setup/checking
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_config_type), | intent(inout) | :: | self | |||
character(len=*), | intent(in), | optional | :: | name | ||
logical, | intent(in), | optional | :: | requires_index | ||
integer, | intent(in), | optional | :: | index |
Write the namelist header for this instance
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_config_type), | intent(in) | :: | self | |||
integer, | intent(in) | :: | unit |
Returns the namelist name. Not very useful at the moment but may want to do more interesting things in the future
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_config_type), | intent(in) | :: | self |
Returns the requires_index value. Allows access whilst keeping the variable private
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_config_type), | intent(in) | :: | self |
An no-op implementation of the set_smart_defaults method. Unless over-ridden the specific config instance will have no smart defaults applied.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_config_type), | intent(inout) | :: | self |
Has to be intent in out as over-riding procedures need to change self |
Write the namelist footer
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | unit |
Writes a {key,val} pair where the value is of type character
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | key | |||
character(len=*), | intent(in) | :: | val | |||
integer, | intent(in) | :: | unit |
Writes a {key,val} pair where the value is of type real
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | key | |||
real, | intent(in) | :: | val | |||
integer, | intent(in) | :: | unit |
Writes a {key,val} pair where the value is of type complex
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | key | |||
complex, | intent(in) | :: | val | |||
integer, | intent(in) | :: | unit |
Writes a {key,val} pair where the value is of type integer
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | key | |||
integer, | intent(in) | :: | val | |||
integer, | intent(in) | :: | unit |
Writes a {key,val} pair where the value is of type logical
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | key | |||
logical, | intent(in) | :: | val | |||
integer, | intent(in) | :: | unit |
Writes a {key,val} pair where the value is of type real array
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_config_type), | intent(in) | :: | self | |||
character(len=*), | intent(in) | :: | key | |||
real, | intent(in), | dimension(:) | :: | val | ||
integer, | intent(in) | :: | unit |
Writes a {key,val} pair where the value is of type complex array
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_config_type), | intent(in) | :: | self | |||
character(len=*), | intent(in) | :: | key | |||
complex, | intent(in), | dimension(:) | :: | val | ||
integer, | intent(in) | :: | unit |
Writes a {key,val} pair where the value is of type integer array
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_config_type), | intent(in) | :: | self | |||
character(len=*), | intent(in) | :: | key | |||
integer, | intent(in), | dimension(:) | :: | val | ||
integer, | intent(in) | :: | unit |
Reads in the split_nonlinear_terms_knobs namelist and populates the member variables
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(split_nonlinear_terms_config_type), | intent(inout) | :: | self |
Writes out a namelist representing the current state of the config object
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(split_nonlinear_terms_config_type), | intent(in) | :: | self | |||
integer, | intent(in), | optional | :: | unit |
Resets the config object to the initial empty state
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(split_nonlinear_terms_config_type), | intent(inout) | :: | self |
Broadcasts all config parameters so object is populated identically on all processors
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(split_nonlinear_terms_config_type), | intent(inout) | :: | self |
Gets the default name for this namelist
Gets the default requires index for this namelist
type, extends(abstract_config_type) :: split_nonlinear_terms_config_type
! namelist : split_nonlinear_terms_knobs
! indexed : false
!> The absolute tolerance used in error controlled schemes. Attempt to adjust
!> time step to keep error below this tolerance.
real :: absolute_tolerance = 1.0e-3
!> If true then nonlinear integrator advances the nonadiabatic dfn, h,
!> rather than the modified distribution function, g.
logical :: advance_nonadiabatic_dfn = .false.
!> The tolerance used in convergence checks. Currently only used
!> for halting the fixed-point iteration in the beuler method
real :: convergence_tolerance = 1.0e-1
!> The relative tolerance used in error controlled schemes. Attempt to adjust
!> time step to keep error below this tolerance.
real :: relative_tolerance = 1.0e-2
!> Choose which specific RK scheme to use in the RK method.
!> Generally if the tolerances are small a higher order scheme
!> will be more effective than low order. At loose tolerances
!> low order schemes are generally more efficient
!> Valid options include:
!>
!> - 'cashkarp' -- Cash-Karp scheme of order 4(5)
!> - 'default' -- Same as heun
!> - 'heun' -- Heun scheme of order 1(2)
!>
!> See [[rk_schemes]] for other options.
character(len = 20) :: rk_method = 'default'
!> If true then reports the number of right hand side (NL term) calculations,
!> the number of failed internal steps and the number of successful steps at the
!> end of each linear size step.
logical :: show_statistics = .false.
!> What algorithm do we use to advance the nonlinear term if
!> split_nonlinear is true.
!> Valid options include:
!>
!> - 'AB3' -- Adams-Bashforth (up to) 3rd order. CLF controlled time step.
!> - 'beuler' -- Backwards Euler. Relative and absolute error controlled time step.
!> Newton iteration controlled by convergence_tolerance.
!> - 'default' -- The same as 'RK'.
!> - 'RK' -- RK scheme with embedded error estimate. Exact scheme can be switched out
!> using rk_method switch. Relative and absolute error controlled time step.
!> - 'picard' -- Use simple Picard iteration. Not generally recommended but available
!> for experimentation.
!>
character(len = 20) :: split_method = 'default'
!> If true then indicates that we want to use a strang split approach where
!> we advance the NL operator by a half step, linear by a full step and then
!> NL by another half step. This _should_ be second order accurate whilst the
!> regular split is only first order accurate.
logical :: strang_split = .false.
!> Multiplies the new time step calculated from either the error or
!> cfl limits. Smaller values are more conservative but may help avoid
!> repeated violation of the error/cfl limits and hence reduce the
!> number of failed steps.
real :: time_step_safety_factor = 0.9
contains
procedure, public :: read => read_split_nonlinear_terms_config
procedure, public :: write => write_split_nonlinear_terms_config
procedure, public :: reset => reset_split_nonlinear_terms_config
procedure, public :: broadcast => broadcast_split_nonlinear_terms_config
procedure, public, nopass :: get_default_name => get_default_name_split_nonlinear_terms_config
procedure, public, nopass :: get_default_requires_index => get_default_requires_index_split_nonlinear_terms_config
end type split_nonlinear_terms_config_type