Used to represent the input configuration of fields
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 | :: | do_smart_update | = | .false. |
Used with |
|
logical, | public | :: | dump_response | = | .false. |
Writes files containing the field response matrix after
initialisation. This currently works for
|
|
logical, | public | :: | field_local_allreduce | = | .false. |
Set to true to use an allreduce (on |
|
logical, | public | :: | field_local_allreduce_sub | = | .false. |
Set to |
|
logical, | public | :: | field_local_nonblocking_collectives | = | .false. |
If |
|
logical, | public | :: | field_local_tuneminnrow | = | .false. |
Set to |
|
character(len=20), | public | :: | field_option | = | 'default' |
The
|
|
logical, | public | :: | field_subgath | = | .false. |
Set to true to use allgatherv to fetch parts of the field update
vector calculated on other procs. When false uses a sum_allreduce
instead. This doesn't rely on sub-communicators so should work for
any layout and processor count. Note: This only impacts
|
|
logical, | public | :: | force_maxwell_reinit | = | .true. |
If TodoConsider if this should this go into the reinit namelist. |
|
integer, | public | :: | minnrow | = | 16 |
Used with |
|
logical, | public | :: | read_response | = | .false. |
Reads files containing the field response matrix and uses to initialise GS2s response matrix rather than using the usual initialisation process. |
|
logical, | public | :: | remove_zonal_flows_switch | = | .false. |
Delete zonal flows at every timestep. |
|
character(len=256), | public | :: | response_dir | = | '' |
Sets location in which to store/look for response dump files. We don't currently check that this location exists before attempting to use it, which could cause problems. The default is to save them in the working directory. |
|
character(len=256), | public | :: | response_file | = | '' |
Allows customisation of the base filename to be used for
response files. If not set then we use |
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 fields_knobs namelist and populates the member variables
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(fields_config_type), | intent(inout) | :: | self |
Writes out a namelist representing the current state of the config object
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(fields_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(fields_config_type), | intent(inout) | :: | self |
Broadcasts all config parameters so object is populated identically on all processors
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(fields_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) :: fields_config_type
! namelist : fields_knobs
! indexed : false
!> Used with `field_option='local'`. If `true` and x/y are
!> distributed then in time advance only update local part of
!> field in operations like `phinew=phinew+phi` etc.
logical :: do_smart_update = .false.
!> Writes files containing the field response matrix after
!> initialisation. This currently works for
!> `field_option='implicit'` or `'local'`. We write to netcdf
!> files by default but fall back to fortran unformatted (binary)
!> files (which are not really portable) in the absence of
!> netcdf.
logical :: dump_response = .false.
!> Set to true to use an allreduce (on `mp_comm`) in field
!> calculation (`field_option='local'` only) rather than a
!> reduction on a sub-communicator followed by a global
!> broadcast. Typically a little faster than default performance
!> but may depend on MPI implementation.
logical :: field_local_allreduce = .false.
!> Set to `true`, along with [[field_local_allreduce]] and
!> [[layouts_knobs:intspec_sub]] , to replace the allreduce used
!> in the field calculation with an allreduce on a
!> sub-communicator followed by a reduction on a "perpendicular"
!> communicator. Typically a bit faster than default and scales
!> slightly more efficiently. Note if this option is active only
!> `proc0` has knowledge of the full field arrays. Other
!> processors know the full field for any supercell (connected
!> x-y domains) for which it has any of the xy indices local in
!> the `g_lo` layout.
logical :: field_local_allreduce_sub = .false.
!> If `true` then use nonblocking collective operations in the
!> [[fields_local]] field calculation. This may or may not
!> improve performance.
logical :: field_local_nonblocking_collectives = .false.
!> Set to `true` when using `field_option='local'` to
!> automatically tune and select the best performing minimum
!> block size (in a single supercell) assigned to a single
!> processor. This can improve performance, but is not guaranteed
!> to.
logical :: field_local_tuneminnrow = .false.
!> The `field_option` variable controls which time-advance
!> algorithm is used for the linear terms. Allowed values are:
!>
!> - 'implicit' Advance linear terms with Kotschenreuther's implicit algorithm.
!> - 'default' Same as 'implicit'.
!> - 'implicit_local' the same as 'local'.
!> - 'local' Same implicit algorithm as 'implicit' but with
!> different data decomposition (typically much faster for flux
!> tube runs).
!> - 'gf_local' Same as `'local'` but with `gf_lo` field
!> decomposition. To use this you also need to set
!> `gf_lo_integrate= .true.` in [[dist_fn_knobs]] and
!> `gf_local_fields = .true.` in [[layouts_knobs]].
!> - 'test' Use for debugging.
character(len = 20) :: field_option = 'default'
!> Set to true to use allgatherv to fetch parts of the field update
!> vector calculated on other procs. When false uses a sum_allreduce
!> instead. This doesn't rely on sub-communicators so should work for
!> any layout and processor count. Note: This only impacts
!> `field_option='implicit'`
logical :: field_subgath = .false.
!> If `true` then recalculate the fields from the distribution
!> function using [[get_init_field]] when restarting a
!> simulation rather than using the values in the restart file.
!>
!> @todo Consider if this should this go into the reinit namelist.
logical :: force_maxwell_reinit = .true.
!> Used with `field_option='local'` to set the minimum block size
!> (in a single supercell) assigned to a single processor. Tuning
!> this parameter changes the balance between work
!> parallelisation and communication. As this value is lowered,
!> more communication needs to be done, but more processors get
!> assigned work. This may reduce the time spent in computation
!> at the cost of time spent in communication. The optimal value
!> is likely to depend upon the size of the problem and the
!> number of processors being used. Furthermore it will affect
!> intialisation and advance in different ways. Can be
!> automatically tuned using [[fields_knobs:field_local_tuneminnrow]].
integer :: minnrow = 16
!> Reads files containing the field response matrix and uses to
!> initialise GS2s response matrix rather than using the usual
!> initialisation process.
logical :: read_response = .false.
!> Delete zonal flows at every timestep.
logical :: remove_zonal_flows_switch = .false.
!> Sets location in which to store/look for response dump files.
!> We don't currently check that this location exists before
!> attempting to use it, which could cause problems. The default
!> is to save them in the working directory.
character(len = 256) :: response_dir = ''
!> Allows customisation of the base filename to be used for
!> response files. If not set then we use `run_name` derived
!> from the input file name.
character(len = 256) :: response_file = ''
contains
procedure, public :: read => read_fields_config
procedure, public :: write => write_fields_config
procedure, public :: reset => reset_fields_config
procedure, public :: broadcast => broadcast_fields_config
procedure, public, nopass :: get_default_name => get_default_name_fields_config
procedure, public, nopass :: get_default_requires_index => get_default_requires_index_fields_config
end type fields_config_type