Used to represent the input configuration of 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 | :: | cfl | = | 0.95 |
Scales the estimate CFL limit used to determine when the
timestep should be changed. The maximum allowed timestep
satisfies |
|
real, | public | :: | error_target | = | 0.1 |
Set the error threshold used to determine when the timestep should change if use_order_based_error is true. |
|
logical, | public | :: | include_apar | = | .true. |
Flag for testing. If false do not include apar contribution to nonlinear term. |
|
logical, | public | :: | include_bpar | = | .true. |
Flag for testing. If false do not include bpar contribution to nonlinear term. |
|
logical, | public | :: | include_phi | = | .true. |
Flag for testing. If false do not include phi contribution to nonlinear term. |
|
integer, | public | :: | istep_error_start | = | 30 |
Set the first timestep for which the order based error checks are made if use_order_based_error is true. |
|
logical, | public | :: | nl_forbid_force_zero | = | .true. |
If |
|
character(len=20), | public | :: | nonlinear_mode | = | 'default' |
Determines if the nonlinear terms should be calculated. Must be one of:
Could consider changing this to a logical. |
|
logical, | public | :: | split_nonlinear | = | .false. |
Do we evolve the nonlinear term separately from the linear terms (true) or include the nonlinear term as a source in the standard algorithm (false). |
|
logical, | public | :: | use_2d_cfl | = | .true. |
If true then sum x and y cfl limiting velocities instead of taking the maximum. |
|
logical, | public | :: | use_cfl_limit | = | .true. |
If true then use the cfl limit to set the maximum timestep allowed. |
|
logical, | public | :: | use_order_based_error | = | .false. |
If true then use an error estimate from comparing the nonlinear source calculated using 2nd and 3rd order Adams-Bashforth schemes to control the timestep in use. This does not disable the CFL estimate. |
|
logical, | public | :: | zip | = | .false. |
Not currently used, should consider removing. Original
documentation was "Experts only (for secondary/tertiary
calculations)." which suggests a close relation to the
|
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 nonlinear_terms_knobs namelist and populates the member variables
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(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(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(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(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) :: nonlinear_terms_config_type
! namelist : nonlinear_terms_knobs
! indexed : false
!> Scales the estimate CFL limit used to determine when the
!> timestep should be changed. The maximum allowed timestep
!> satisfies `delt < cfl * min(Delta_perp/v_perp)` where `v_perp
!> * delt` is the maximum distance travelled in a single
!> timestep.
real :: cfl = 0.95
!> Set the error threshold used to determine when the timestep should change if
!> [[nonlinear_terms_knobs:use_order_based_error]] is true.
real :: error_target = 0.1
!> Flag for testing. If false do not include apar contribution to nonlinear term.
logical :: include_apar = .true.
!> Flag for testing. If false do not include bpar contribution to nonlinear term.
logical :: include_bpar = .true.
!> Flag for testing. If false do not include phi contribution to nonlinear term.
logical :: include_phi = .true.
!> Set the first timestep for which the order based error checks are made if
!> [[nonlinear_terms_knobs:use_order_based_error]] is true.
integer :: istep_error_start = 30
!> If `true` (default) then forces the nonlinear source term to
!> zero in the forbidden region.
logical :: nl_forbid_force_zero = .true.
!> Determines if the nonlinear terms should be calculated. Must
!> be one of:
!>
!> - 'none' - Do not include nonlinear terms, i.e. run a linear calculation.
!> - 'default' - The same as 'none'
!> - 'off' - The same as 'none'
!> - 'on' - Include nonlinear terms.
!>
!> Could consider changing this to a logical.
character(len = 20) :: nonlinear_mode = 'default'
!> Do we evolve the nonlinear term separately from the linear terms (true) or
!> include the nonlinear term as a source in the standard algorithm (false).
logical :: split_nonlinear = .false.
!> If true then sum x and y cfl limiting velocities instead of taking the maximum.
logical :: use_2d_cfl = .true.
!> If true then use the cfl limit to set the maximum timestep allowed.
logical :: use_cfl_limit = .true.
!> If true then use an error estimate from comparing the nonlinear source
!> calculated using 2nd and 3rd order Adams-Bashforth schemes to control
!> the timestep in use. This does not disable the CFL estimate.
logical :: use_order_based_error = .false.
!> Not currently used, should consider removing. Original
!> documentation was "Experts only (for secondary/tertiary
!> calculations)." which suggests a close relation to the
!> `eqzip` option of [[knobs]].
logical :: zip = .false.
contains
procedure, public :: read => read_nonlinear_terms_config
procedure, public :: write => write_nonlinear_terms_config
procedure, public :: reset => reset_nonlinear_terms_config
procedure, public :: broadcast => broadcast_nonlinear_terms_config
procedure, public, nopass :: get_default_name => get_default_name_nonlinear_terms_config
procedure, public, nopass :: get_default_requires_index => get_default_requires_index_nonlinear_terms_config
end type nonlinear_terms_config_type