Used to represent the input configuration of parameter_scan
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? |
|
real, | public | :: | delta_t_inc | = | 0.0 |
When the increment condition is |
|
real, | public | :: | delta_t_init | = | 0.0 |
When the increment condition is |
|
character(len=20), | public | :: | inc_con | = | 'delta_t' |
Specifies the condition for incrementing the parameter. Possible values are:
|
|
integer, | public | :: | nstep_inc | = | 0 |
When the increment condition is |
|
integer, | public | :: | nstep_init | = | 0 |
When the increment condition is 'n_timesteps' or 'saturated', the parameter will not be changed until nstep_init have elapsed from the beginning of the simulation. Note that if the simulation is restarted, this parameter will measure from the restart. |
|
real, | public | :: | par_end | = | 0.0 |
If the scan is being run in 'range' mode, specifies the value of the parameter that will be reached. |
|
real, | public | :: | par_inc | = | 0.0 |
If the parameter scan is being run in 'range' or 'target' modes, specifies the amount by which the parameter is varied at one go. |
|
real, | public | :: | par_start | = | 0.0 |
Specifies the starting value for the parameter scan. |
|
character(len=20), | public | :: | scan_par | = | 'tprim' |
Specify the parameter to be varied. If the parameter pertains to a species, the scan_spec must be specified as well. |
|
logical, | public | :: | scan_restarted | = | .false. |
Specify the parameter to be varied. If the parameter pertains to a species, the scan_spec must be specified as well. |
|
integer, | public | :: | scan_spec | = | 1 |
When parameter pertains to a species, specifies the index of the species. |
|
character(len=20), | public | :: | scan_type | = | 'none' |
Specifies the way that the parameter scan is conducted. Possible values are:
|
|
character(len=20), | public | :: | target_par | = | 'hflux_tot' |
If the scan is being run in 'target' or 'root_finding' mode, specifies the target parameter. Possible values are:
|
|
real, | public | :: | target_val | = | 0.0 |
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 parameter_scan_knobs namelist and populates the member variables
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(parameter_scan_config_type), | intent(inout) | :: | self |
Writes out a namelist representing the current state of the config object
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(parameter_scan_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(parameter_scan_config_type), | intent(inout) | :: | self |
Broadcasts all config parameters so object is populated identically on all processors
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(parameter_scan_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) :: parameter_scan_config_type
! namelist : parameter_scan_knobs
! indexed : false
!> When the increment condition is `"delta_t"`, the parameter will be changed
!> every time `delta_t_inc` time has elapsed.
real :: delta_t_inc = 0.0
!> When the increment condition is `"delta_t"`, the parameter will not be
!> changed until `delta_t_init` time has elapsed from the beginning of the
!> simulation. Note, that if the simulation is restarted, this parameter
!> will measure from beginning of original simulation.
real :: delta_t_init = 0.0
!> Specifies the condition for incrementing the parameter. Possible values are:
!>
!> - "n_timesteps": change the parameter after a given number of time steps
!> - "delta_t": change the parameter after an elapsed time
!> - "saturated": change the parameter after the simulation has reached a
!> saturated state (determined using the target parameter) at the current
!> value of the parameter
character(len = 20) :: inc_con = 'delta_t'
!> When the increment condition is `'n_timesteps'`, the parameter will be
!> changed every `nstep_inc`.
integer :: nstep_inc = 0
!> When the increment condition is 'n_timesteps' or 'saturated', the
!> parameter will not be changed until nstep_init have elapsed from the
!> beginning of the simulation. Note that if the simulation is restarted,
!> this parameter will measure from the restart.
integer :: nstep_init = 0
!> If the scan is being run in 'range' mode, specifies the value of the
!> parameter that will be reached.
real :: par_end = 0.0
!> If the parameter scan is being run in 'range' or 'target' modes,
!> specifies the amount by which the parameter is varied at one go.
real :: par_inc = 0.0
!> Specifies the starting value for the parameter scan.
real :: par_start = 0.0
!> Specify the parameter to be varied. If the parameter pertains to a
!> species, the scan_spec must be specified as well.
character(len = 20) :: scan_par = 'tprim'
!> Specify the parameter to be varied. If the parameter pertains to a
!> species, the scan_spec must be specified as well.
logical :: scan_restarted = .false.
!> When parameter pertains to a species, specifies the index of the
!> species.
integer :: scan_spec = 1
!> Specifies the way that the parameter scan is conducted. Possible values are:
!>
!> - 'none': do not conduct a parameter scan (default)
!> - 'range': vary parameter in constant increments between 2 values:
!> par_start and par_end. The step size is given by par_inc.
!> - 'target': start with the parameter at par_start, and then change the
!> parameter by par_inc until the target parameter has reached the target
!> value
!> - 'root_finding': the same as target, but the increment is changed
!> intelligently using a Newton-like method.
character(len = 20) :: scan_type = 'none'
!> If the scan is being run in 'target' or 'root_finding' mode, specifies
!> the target parameter. Possible values are:
!>
!> - 'hflux_tot'
!> - 'momflux_tot'
!> - 'phi2_tot'
character(len = 20) :: target_par = 'hflux_tot'
!>
real :: target_val = 0.0
contains
procedure, public :: read => read_parameter_scan_config
procedure, public :: write => write_parameter_scan_config
procedure, public :: reset => reset_parameter_scan_config
procedure, public :: broadcast => broadcast_parameter_scan_config
procedure, public, nopass :: get_default_name => get_default_name_parameter_scan_config
procedure, public, nopass :: get_default_requires_index => get_default_requires_index_parameter_scan_config
end type parameter_scan_config_type