Used to represent the input configuration of reinit
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 |
|
real, | public | :: | delt_adj | = | 2.0 |
When the time step needs to be changed it is adjusted by this
factor, i.e |
|
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 |
|
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. NoteThis gets a smart default of delt. |
|
logical, | public | :: | in_memory | = | .false. |
If |
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 |
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 |
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 reinit_knobs namelist and populates the member variables
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(reinit_config_type), | intent(inout) | :: | self |
Writes out a namelist representing the current state of the config object
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(reinit_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(reinit_config_type), | intent(inout) | :: | self |
Broadcasts all config parameters so object is populated identically on all processors
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(reinit_config_type), | intent(inout) | :: | self |
Gets the default name for this namelist
Gets the default requires index for this namelist
Set the smart defaults for the reinit_config_type instance
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(reinit_config_type), | intent(inout) | :: | self |
type, extends(abstract_config_type) :: reinit_config_type
! namelist : reinit_knobs
! indexed : false
!> If `true` (default), exit if time step changes rapidly, that
!> is, if the time step changes at four consecutive time steps.
logical :: abort_rapid_time_step_change = .true.
!> 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 :: delt_adj = 2.0
!> 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 :: delt_cushion = 1.5
!> The minimum time step allowed is delt_minimum. If the code
!> wants to drop below this value then the run will end.
real :: delt_minimum = 1.e-5
!> Sets the maximum value the time step can take.
!>
!> @note This gets a smart default of [[knobs:delt]].
real :: dt0 = 0.0
!> 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.
logical :: in_memory = .false.
contains
procedure, public :: read => read_reinit_config
procedure, public :: write => write_reinit_config
procedure, public :: reset => reset_reinit_config
procedure, public :: broadcast => broadcast_reinit_config
procedure, public, nopass :: get_default_name => get_default_name_reinit_config
procedure, public, nopass :: get_default_requires_index => get_default_requires_index_reinit_config
procedure :: set_smart_defaults => set_smart_defaults_local
end type reinit_config_type