Used to represent the input configuration of hyper
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? |
|
logical, | public | :: | const_amp | = | .false. |
Determines whether hyperviscosity includes time dependent amplitude
factor when calculating damping rate. Recommend |
|
real, | public | :: | d_hyper | = | -10.0 |
If |
|
real, | public | :: | d_hyper3d | = | -10. |
Used with the simple3D hyperviscosity model of the form D_hyper3D * (|kperp|/ max |kperp|)^P_hyper3D and ky_cut, kx_cut set max |kperp| |
|
real, | public | :: | d_hyperres | = | -10.0 |
Sets hyperresistivity parameter multiplying damping term. |
|
real, | public | :: | d_hypervisc | = | -10.0 |
Sets hyperviscosity parameter multiplying damping term. See E. Belli (2006) thesis for more information. |
|
logical, | public | :: | damp_zonal_only | = | .false. |
If |
|
logical, | public | :: | gridnorm | = | .true. |
If |
|
character(len=9), | public | :: | hyper_option | = | 'default' |
Selects the type of hyper terms included. Should be one of
|
|
logical, | public | :: | isotropic_model | = | .true. |
if true damp zonal and drift waves with same dissipation formula |
|
logical, | public | :: | isotropic_shear | = | .true. |
If |
|
real, | public | :: | kx_cut | = | -10. |
Used with the simple3D hyperviscosity model of the form D_hyper3D * (|kperp|/ max |kperp|)^P_hyper3D and ky_cut, kx_cut set max |kperp| |
|
real, | public | :: | ky_cut | = | -10. |
Used with the simple3D hyperviscosity model of the form D_hyper3D * (|kperp|/ max |kperp|)^P_hyper3D and ky_cut, kx_cut set max |kperp| |
|
integer, | public | :: | nexp | = | 2 |
Sets the power to which is raised in the dissipation filter. |
|
real, | public | :: | omega_osc | = | 0.4 |
Sets a parameter in the anisotropic shearing rate calculation. |
|
real, | public | :: | p_hyper3d | = | 4. |
Used with the simple3D hyperviscosity model of the form D_hyper3D * (|kperp|/ max |kperp|)^P_hyper3D and ky_cut, kx_cut set max |kperp| |
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 hyper_knobs namelist and populates the member variables
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(hyper_config_type), | intent(inout) | :: | self |
Writes out a namelist representing the current state of the config object
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(hyper_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(hyper_config_type), | intent(inout) | :: | self |
Broadcasts all config parameters so object is populated identically on all processors
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(hyper_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) :: hyper_config_type
! namelist : hyper_knobs
! indexed : false
!> Determines whether hyperviscosity includes time dependent amplitude
!> factor when calculating damping rate. Recommend `true` for
!> linear runs and `false` for nolinear runs, since amplutide of
!> turbulence grows linearly with time in linear run.
logical :: const_amp = .false.
!> If `hyper_option = 'both'` is used then this sets both the
!> hyperresistivity and hyperviscosity damping coefficients. Can
!> override the individual coefficients with
!> [[hyper_knobs:D_hyperres]] and [[hyper_knobs:D_hypervisc]].
real :: d_hyper = -10.0
!> Used with the simple3D hyperviscosity model of the form
!> D_hyper3D * (|kperp|/ max |kperp|)^P_hyper3D
!> and ky_cut, kx_cut set max |kperp|
real :: d_hyper3d = -10.
!> Sets hyperresistivity parameter multiplying damping term.
real :: d_hyperres = -10.0
!> Sets hyperviscosity parameter multiplying damping term. See
!> [E. Belli (2006)
!> thesis](https://citeseerx.ist.psu.edu/viewdoc/download;jsessionid=50BFD54A8F8D72FC225D025FDEDFFFA5?doi=10.1.1.706.9568&rep=rep1&type=pdf)
!> for more information.
real :: d_hypervisc = -10.0
!> If `true` then hyperdissipation only applied to the zonal
!> mode.
logical :: damp_zonal_only = .false.
!> If `true` (default) then set wavenumber parameters entering
!> the models based on the maximum `ky` and `kx` included in the
!> current simulation. If `false` then these values are set to 1.
logical :: gridnorm = .true.
!> Selects the type of hyper terms included. Should be one of
!>
!> - 'default' -- no hyper terms included.
!> - 'none' -- the same as default.
!> - 'visc_only' -- only hyperviscosity included.
!> - 'res_only' -- only hyperresistivity included.
!> - 'both' -- both viscosity and resistivity included.
!> - 'simple3D' -- simple hyperviscous dissipation rate of the
!> form D_hyper3D * (|kperp|/ max |kperp|)^P_hyper3D
!> described in [“Multiscale turbulence in magnetic
!> confinement fusion devices”, M. Hardman, DPhil Thesis,
!> appendix
!> B.4](https://ora.ox.ac.uk/objects/uuid:233a22cb-3c8b-4fe0-a689-4a37d8fe0314)
!> note that the dissipation in this version is applied to g, not h, as
!> in the reference.
character(len = 9) :: hyper_option = 'default'
!> if true damp zonal and drift waves with same dissipation formula
logical :: isotropic_model = .true.
!> If `true` then use isotropic shear model.
logical :: isotropic_shear = .true.
!> Used with the simple3D hyperviscosity model of the form
!> D_hyper3D * (|kperp|/ max |kperp|)^P_hyper3D
!> and ky_cut, kx_cut set max |kperp|
real :: kx_cut = -10.
!> Used with the simple3D hyperviscosity model of the form
!> D_hyper3D * (|kperp|/ max |kperp|)^P_hyper3D
!> and ky_cut, kx_cut set max |kperp|
real :: ky_cut = -10.
!> Sets the power to which \(k_\bot^2\) is raised in the dissipation filter.
integer :: nexp = 2
!> Sets a parameter in the anisotropic shearing rate calculation.
real :: omega_osc = 0.4
!> Used with the simple3D hyperviscosity model of the form
!> D_hyper3D * (|kperp|/ max |kperp|)^P_hyper3D
!> and ky_cut, kx_cut set max |kperp|
real :: p_hyper3d = 4.
contains
procedure, public :: read => read_hyper_config
procedure, public :: write => write_hyper_config
procedure, public :: reset => reset_hyper_config
procedure, public :: broadcast => broadcast_hyper_config
procedure, public, nopass :: get_default_name => get_default_name_hyper_config
procedure, public, nopass :: get_default_requires_index => get_default_requires_index_hyper_config
end type hyper_config_type