initial_values_overrides_type Derived Type

type, public :: initial_values_overrides_type

A type for storing overrides of the intial values of the fields and distribution function. This override is different to all the others, because in order to minimise memory usage and disk writes, this override is used internally during the simulation, and its values can thus change over the course of the simulation. In contrast, no other overrides are modified by running gs2. Also, depending on the value of in_memory, the override values will either be taken from the the arrays within the object, or from the restart files. If you want to externally modify the initial field and dist fn values, you need to use in_memory = .true. If you just want to use this override to allow you to reinitialise the equations and start from the same values, you can use either memory or restart files. If you want to want to change the number of processors and then reinitialise and then use this override you must use in_memory = .false., because currently the memory is allocated on a processor by processor basis. Changing grid sizes and then using this override is not supported. This one is too complicated to generate automatically


Contents


Components

Type Visibility Attributes Name Initial
logical, private :: init = .false.

True if the object has been initialized.

logical, public :: in_memory = .true.

If true, override values are read from the arrays in this object. If not, they are read from the restart files. The value of in_memory should not be changed without reinitializing this object (doing so is an excellent way of generating segmentation faults).

logical, public :: override = .false.

Whether to override initial values or not, i.e., whether or not this override is switched on. If it is switched on, initial values will be determined by the values in the arrays or the restart files, depending on the value of in_memory. If false, initial values will be determined by the gs2 input file (note that of course, this can result in initial values being taken from the input files).

complex, public, dimension (:,:,:), allocatable :: phi
complex, public, dimension (:,:,:), allocatable :: apar
complex, public, dimension (:,:,:), allocatable :: bpar
complex, public, dimension (:,:,:), allocatable :: g
complex, public, dimension (:,:,:), allocatable :: gexp_1
complex, public, dimension (:,:,:), allocatable :: gexp_2
complex, public, dimension (:,:,:), allocatable :: gexp_3
real, public, dimension(2) :: vnmult

Type-Bound Procedures

procedure, public, :: initialise => init_initial_values_overrides

  • public subroutine init_initial_values_overrides(overrides_obj, ntgrid, ntheta0, naky, g_llim, g_ulim, force_maxwell_reinit, in_memory, has_explicit_terms)

    overrides%in_memory after calling this function

    Arguments

    Type IntentOptional Attributes Name
    class(initial_values_overrides_type), intent(inout) :: overrides_obj
    integer, intent(in) :: ntgrid
    integer, intent(in) :: ntheta0
    integer, intent(in) :: naky
    integer, intent(in) :: g_llim
    integer, intent(in) :: g_ulim
    logical, intent(in) :: force_maxwell_reinit
    logical, intent(in) :: in_memory
    logical, intent(in) :: has_explicit_terms

procedure, public, :: finish => finish_initial_values_overrides

procedure, public, :: is_initialised => is_initialised_initial_values_overrides

Source Code

type initial_values_overrides_type
  !> True if the object has been initialized.
  logical, private :: init = .false.
  !> If true, override values are read from the
  !> arrays in this object. If not, they are read
  !> from the restart files. The value of in_memory
  !> should not be changed without reinitializing this
  !> object (doing so is an excellent way of generating
  !> segmentation faults).
  logical :: in_memory = .true.
  !> Whether to override initial values or not,
  !> i.e., whether or not this override is switched on.
  !> If it is switched on, initial values will be determined
  !> by the values in the arrays or the restart files,
  !> depending on the value of in_memory. If false,
  !> initial values will be determined by the gs2 input file
  !> (note that of course, this can result in initial values
  !> being taken from the input files).
  logical :: override = .false.
  ! The force_maxwell_reinit component has been removed to avoid problems in gs2_init. See comments there and in gs2_main for details.
  complex, dimension (:,:,:), allocatable :: phi
  complex, dimension (:,:,:), allocatable :: apar
  complex, dimension (:,:,:), allocatable :: bpar
  complex, dimension (:,:,:), allocatable :: g
  complex, dimension (:,:,:), allocatable :: gexp_1, gexp_2, gexp_3
  real, dimension(2) :: vnmult
 contains
  procedure :: initialise => init_initial_values_overrides
  procedure :: finish => finish_initial_values_overrides
  procedure :: is_initialised => is_initialised_initial_values_overrides
end type initial_values_overrides_type