The principal function of this module is to evolve the distribution function, that is, to advance the discrete gyrokinetic equation. This involves calculating the source and dealing with the complexities of the parallel boundary conditions. In addition it contains a routine for implementing perpendicular velocity shear and calculating the right-hand side of the field equation, as well as a host of other functions. Initializes a limited selection of arrays, for example g, gnew, vperp2, typically those which are needed by other modules that don't need dist_fn to be fully initialized (e.g. nonlinear_terms) This initialization level depends on grid sizes.
Deallocates arrays allocated in init_dist_fn_arrays
Reads the dist_fn_knobs, source knobs, and dist_fn_species_knobs namelists. This has be done independently of initializing the distribution function because it needs to be possible to override parameters such as g_exb. Initializes parallel boundary conditions. This level depends on geometry. Initializes bessel functions and field_eq. Note that this level depends on species paramters. Fully initialize the dist_fn module. Note that this level depends on the size of the timestep. Done for slab, where itor_over_B is determined by angle between B-field and toroidal flow: itor_over_B = (d(u_z)/dx) / (d(u_y)/dx) = Btor / Bpol u = u0 (phihat) = x d(u0)/dx (phihat) = x d(uy)/dx (yhat + Btor/Bpol zhat) g_exb = d(uy)/dx => d(uz)/dx = g_exb * Btor/Bpol = g_exb * itor_over_B
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
real, | private, | dimension (:), allocatable | :: | fexp | |||
real, | private, | dimension (:), allocatable | :: | bkdiff | |||
real, | public | :: | apfac | ||||
real, | private | :: | driftknob | ||||
real, | private | :: | tpdriftknob | ||||
real, | private | :: | poisfac | ||||
real, | private | :: | vparknob | ||||
real, | private | :: | t0 | ||||
real, | public | :: | omega0 | ||||
real, | public | :: | gamma0 | ||||
real, | private | :: | source0 | ||||
real, | private | :: | phi_ext | ||||
real, | private | :: | afilter | ||||
real, | private | :: | exponential_boundary_factor | ||||
real, | private | :: | wfb | ||||
real, | public | :: | g_exb | ||||
real, | public | :: | g_exbfac | ||||
real, | private | :: | omprimfac | ||||
real, | private | :: | btor_slab | ||||
real, | private | :: | mach | ||||
real, | private | :: | g_exb_start_time | ||||
integer, | private | :: | g_exb_start_timestep | ||||
logical, | private | :: | hyper_in_initialisation | ||||
logical, | private | :: | start_from_previous_solution | ||||
logical, | private | :: | boundary_off_grid | ||||
logical, | private | :: | exponential_boundary | ||||
logical, | private | :: | nonad_zero | ||||
logical, | private | :: | esv | ||||
logical, | private | :: | opt_source | ||||
integer, | public | :: | adiabatic_option_switch | ||||
integer, | private, | parameter | :: | adiabatic_option_default | = | 1 | |
integer, | public, | parameter | :: | adiabatic_option_fieldlineavg | = | 3 | |
integer, | private, | parameter | :: | adiabatic_option_yavg | = | 4 | |
integer, | private | :: | source_option_switch | ||||
integer, | private, | parameter | :: | source_option_full | = | 1 | |
integer, | private, | parameter | :: | source_option_phiext_full | = | 5 | |
integer, | private, | parameter | :: | source_option_homogeneous | = | 6 | |
integer, | private | :: | boundary_option_switch | ||||
integer, | private, | parameter | :: | boundary_option_default | = | 0 | |
integer, | private, | parameter | :: | boundary_option_zero | = | 1 | |
integer, | private, | parameter | :: | boundary_option_self_periodic | = | 2 | |
integer, | private, | parameter | :: | boundary_option_linked | = | 4 | |
logical, | public | :: | def_parity | ||||
logical, | public | :: | even | ||||
logical, | private | :: | zero_forbid | ||||
logical, | public | :: | gf_lo_integrate | ||||
logical, | private | :: | mult_imp | ||||
real, | private, | dimension (:,:,:), allocatable | :: | wdrift | |||
real, | private, | dimension (:,:,:), allocatable | :: | wdriftttp | |||
real, | public, | dimension (:,:,:), allocatable | :: | gamtot | |||
real, | public, | dimension (:,:,:), allocatable | :: | gamtot1 | |||
real, | public, | dimension (:,:,:), allocatable | :: | gamtot2 | |||
real, | private, | dimension (:,:,:), allocatable | :: | gamtot3 | |||
complex, | private, | dimension (:,:,:), allocatable | :: | a | |||
complex, | private, | dimension (:,:,:), allocatable | :: | b | |||
complex, | private, | dimension (:,:,:), allocatable | :: | r | |||
complex, | private, | dimension (:,:,:), allocatable | :: | ainv | |||
real, | private, | dimension(:, :, :), allocatable | :: | vpar | |||
complex, | private, | dimension (:,:,:), allocatable | :: | g_h | |||
complex, | private, | dimension (:,:,:), allocatable | :: | g_adj | |||
integer, | private, | dimension(:), allocatable | :: | jump | |||
integer, | private, | dimension(:), allocatable | :: | ikx_indexed | |||
real, | private, | dimension(:,:), allocatable | :: | ufac | |||
complex, | private, | dimension (:,:,:), allocatable | :: | source_coeffs_phim | |||
complex, | private, | dimension (:,:,:), allocatable | :: | source_coeffs_phip | |||
complex, | private, | dimension (:,:,:), allocatable | :: | source_coeffs_aparm | |||
complex, | private, | dimension (:,:,:), allocatable | :: | source_coeffs_aparp | |||
real, | private, | allocatable, dimension(:,:) | :: | awgt | |||
complex, | public, | allocatable, dimension(:,:) | :: | fl_avg | |||
integer, | public, | dimension (:,:), allocatable | :: | itleft | |||
integer, | public, | dimension (:,:), allocatable | :: | itright | |||
integer, | public, | dimension(:, :), allocatable | :: | supercell_labels |
Labels the supercells as a function of {it, ik}. Primarily to help with post-processing, although can also help with conversion from flux tube to ballooning space. This probably really belongs in kt_grids, but placing here alongside related itleft, itright etc. |
||
integer, | public, | dimension(:), allocatable | :: | n_supercells |
Records the number of unique supercells for each ky, |
||
integer, | public, | dimension(:, :), allocatable | :: | n_cells |
Records the number of cells which are members of the supercell which owns the particular {it, ik} point. One would expect this to be equivalent to l_links + r_links + 1. |
||
real, | private, | dimension(:, :, :), allocatable | :: | inv_phi_denominator_g | |||
real, | private, | dimension(:, :, :), allocatable | :: | inv_bpar_denominator_g | |||
type(connections_type), | private, | dimension (:), allocatable, save | :: | connections | |||
type(redist_type), | private, | save | :: | links_p | |||
type(redist_type), | private, | save | :: | links_h | |||
type(redist_type), | private, | save | :: | wfb_p | |||
type(redist_type), | private, | save | :: | wfb_h | |||
type(redist_type), | public, | save | :: | pass_right | |||
type(redist_type), | private, | save | :: | pass_left | |||
type(redist_type), | private, | save | :: | incoming_links | |||
type(redist_type), | private, | save | :: | parity_redist | |||
integer, | public, | dimension (:,:), allocatable | :: | l_links | |||
integer, | public, | dimension (:,:), allocatable | :: | r_links | |||
integer, | private, | dimension (:,:,:), allocatable | :: | n_links | |||
logical, | private, | dimension (:,:), allocatable | :: | save_h | |||
logical, | private | :: | no_connections | = | .false. |
Indicates if there are connected theta domains in this simulation or not. Should only be used as a part of linked boundary conditions, but worth noting that the default given may suggest that there are connections in simulations with boundary conditions other than linked. |
|
integer, | public, | dimension(:), allocatable | :: | M_class | |||
integer, | public, | dimension(:), allocatable | :: | N_class | |||
integer, | public | :: | i_class | ||||
logical, | private | :: | initialized | = | .false. | ||
logical, | private | :: | exb_first | = | .true. | ||
logical, | private | :: | initialized_dist_fn_parameters | = | .false. | ||
logical, | private | :: | initialized_dist_fn_arrays | = | .false. | ||
logical, | private | :: | initialized_dist_fn_level_1 | = | .false. | ||
logical, | private | :: | initialized_dist_fn_level_2 | = | .false. | ||
logical, | private | :: | initialized_dist_fn_level_3 | = | .false. | ||
logical, | private | :: | readinit | = | .false. | ||
logical, | private | :: | bessinit | = | .false. | ||
logical, | private | :: | connectinit | = | .false. | ||
logical, | private | :: | feqinit | = | .false. | ||
integer, | private, | parameter | :: | max_allowed_links | = | 5000 |
Arbitrary limit on the maximum number of allowed links in connected boundary conditions |
logical, | private, | parameter | :: | moment_to_allprocs | = | .false. | |
type(dist_fn_config_type), | private | :: | dist_fn_config | ||||
type(source_config_type), | private | :: | source_config | ||||
type(dist_fn_species_config_type), | private, | dimension(:), allocatable | :: | dist_fn_species_config |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(profiles_overrides_type), | intent(in) | :: | prof_ov |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(optimisations_overrides_type), | intent(in) | :: | opt_ov |
A type to record information about connections between iglo points Store the iglo and iproc indices for connections to the left and right of a given point. Initialised to no connections, indicated by negative values
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public | :: | iproc_left | = | -1 | ||
integer, | public | :: | iglo_left | = | -1 | ||
integer, | public | :: | iproc_right | = | -1 | ||
integer, | public | :: | iglo_right | = | -1 | ||
logical, | public | :: | neighbor | = | .false. |
Used to represent the input configuration of dist_fn
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? |
|
character(len=30), | public | :: | adiabatic_option | = | 'default' |
The form of the adiabatic response (if a species is being modeled as adiabatic). Ignored if there are electrons in the species list. |
|
real, | public | :: | afilter | = | 0.0 |
For debugging only. |
|
real, | public | :: | apfac | = | 1.0 |
Leave as unity. For debugging. |
|
logical, | public | :: | boundary_off_grid | = | .false. |
If true then attempt to enforce gnew == 0 at a half grid point past the end of the grid rather than on the last grid point. This is an experimental feature which has been seen to help suppress grid scale oscillations near the boundary. |
|
character(len=20), | public | :: | boundary_option | = | 'default' |
Sets the boundary condition along the field line (i.e. the boundary conditions at in flux-tube simulations or in ballooning space). Possible values are: |
|
real, | public | :: | btor_slab | = | 0.0 |
Overrides the itor_over_B internal parameter, meant only for slab runs where it sets the angle between the magnetic field and the toroidal flow. |
|
logical, | public | :: | def_parity | = | .false. |
True only allows solutions of single parity as determined by the input even. |
|
real, | public | :: | driftknob | = | 1.0 |
Leave as unity for physical runs can be used for debugging. Multiplies the passing particle drifts (also see tpdriftknob). |
|
logical, | public | :: | esv | = | .false. |
If |
|
logical, | public | :: | even | = | .true. |
If |
|
logical, | public | :: | exponential_boundary | = | .false. |
If true then attempt to enforce an exponential decay boundary condition on gnew or hnew (depending on nonad_zero). Decay rate scaled by exponential_boundary_factor |
|
real, | public | :: | exponential_boundary_factor | = | 1.0 |
Factor scaling the exponential decay boundary condition |
|
real, | public | :: | g_exb | = | 0.0 |
where is toroidal angular velocity normalised to the reference frequency and is the normalised flux label which has value on the local surface. |
|
real, | public | :: | g_exb_start_time | = | -1 |
Flow shear switched on when simulation time exceeds this time. |
|
integer, | public | :: | g_exb_start_timestep | = | -1 |
Flow shear switched on when simulation timestep exceeds this timestep. |
|
real, | public | :: | g_exbfac | = | 1.0 |
Multiplies |
|
logical, | public | :: | gf_lo_integrate | = | .false. |
Perform velocity space integration using |
|
logical, | public | :: | hyper_in_initialisation | = | .true. |
Determines if we include the hyperviscosity term during the initialisation of the response matrix or not. |
|
real, | public | :: | mach | = | 0.0 |
Number multiplying the coriolis drift. |
|
logical, | public | :: | mult_imp | = | .false. |
Allow different species to have different values of |
|
logical, | public | :: | nonad_zero | = | .true. |
If true switches on "new" parallel boundary condition where h=0 at incoming boundary instead of g=0. This is considered the correct boundary condition but old behaviour retained for experimentation. |
|
real, | public | :: | omprimfac | = | 1.0 |
Factor multiplying the parallel shearing drive term when running with non-zero g_exb |
|
logical, | public | :: | opt_source | = | .false. |
If true then use an optimised linear source calculation which
uses pre-calculated coefficients, calculates both sigma
together and skips work associated with empty fields. Can
contribute at least 10-25% savings for linear electrostatic
collisionless simulations. For more complicated runs the
savings may be less. If enabled memory usage will
increase due to using an additional array of size 2-4 times
|
|
real, | public | :: | poisfac | = | 0.0 |
If non-zero, quasineutrality is not enforced,
|
|
logical, | public | :: | start_from_previous_solution | = | .false. |
Determines if we set gnew = 0 (if flag is false) or gnew = g in invert_rhs_1 or not. This is currently considered experimental, but the intention is to change the default to true. |
|
real, | public | :: | tpdriftknob | = | -9.9e9 |
For debugging only. Multiplies the trapped particle drifts (also see driftknob). |
|
real, | public | :: | vparknob | = | 1.0 |
For debugging only. Scales the calculated vparallel. |
|
real, | public | :: | wfb | = | 1.0 |
For debugging only. Sets the boundary value for the barely trapped/passing particle. |
|
logical, | public | :: | zero_forbid | = | .false. |
If true then force |
Used to represent the input configuration of source
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 | :: | gamma0 | = | 0.0 |
Growth rate of non-standard source used with |
|
real, | public | :: | omega0 | = | 0.0 |
Frequency of non-standard source used with |
|
real, | public | :: | phi_ext | = | 0.0 |
Amplitude of external phi added as source term with
|
|
real, | public | :: | source0 | = | 1.0 |
Amplitude of non-standard source used with |
|
character(len=20), | public | :: | source_option | = | 'default' |
Controls the source term used in the time advance. Should be one of: |
|
real, | public | :: | t0 | = | 100.0 |
Turn on any artificial sources after time = t0. Only used with
|
Used to represent the input configuration of dist_fn_species. There should be one of this namelist for each species simulated.
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 | :: | bakdif | = | 0.0 |
Spatial implicitness parameter. Any value greater than 0 adds
numerical dissipation which is often necessary to avoid grid
scale oscillations. When |
|
real, | public | :: | fexpr | = | 0.4 |
Sets the real part of the temporal implicitness parameter. Any
value smaller than 0.5 adds numerical dissipation. When |
Calculates the value of the magnetic drifts (curvature + grad-B)
corresponding to the theta grid location given by ig
for the iglo
index of interest.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | ig | |||
integer, | intent(in) | :: | iglo |
Calculates the value of the Coriolis drift at the location corresponding to the passed indices.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | ig | |||
integer, | intent(in) | :: | iglo |
Compute the spacing in kx indices between connected kx domains (cells) for the lowest non-zonal ky.
Helper function for finding the leftmost it of supercell
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | it | |||
integer, | intent(in) | :: | ik |
Helper function for finding the rightmost it of supercell
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | it | |||
integer, | intent(in) | :: | ik |
Returns true if we're using linked boundary conditions and false otherwise
Gets the default name for this namelist
Gets the default requires index for this namelist
Gets the default name for this namelist
Gets the default requires index for this namelist
Gets the default name for this namelist
Gets the default requires index for this namelist
Get the array of module level config instances. If it isn't allocated, then return a zero-length array
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | report_unit |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | unit |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | unit |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dist_fn_config_type), | intent(in), | optional | :: | dist_fn_config_in | ||
type(source_config_type), | intent(in), | optional | :: | source_config_in | ||
type(dist_fn_species_config_type), | intent(in), | optional, | dimension(:), allocatable | :: | dist_fn_species_config_in |
FIXME : Add documentation
FIXME : Add documentation
FIXME : Add documentation
FIXME : Add documentation
FIXME : Add documentation
FIXME : Add documentation
FIXME : Add documentation
FIXME : Add documentation
FIXME : Add documentation
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(profiles_overrides_type), | intent(in) | :: | prof_ov |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(optimisations_overrides_type), | intent(in) | :: | opt_ov |
FIXME : Add documentation
CMR, 19/10/10:
Override itor_over_B, if "dist_fn_knobs" parameter btor_slab ne 0
Not ideal to set geometry quantity here, but its historical!
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dist_fn_config_type), | intent(in), | optional | :: | dist_fn_config_in | ||
type(source_config_type), | intent(in), | optional | :: | source_config_in | ||
type(dist_fn_species_config_type), | intent(in), | optional, | dimension(:), allocatable | :: | dist_fn_species_config_in |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dist_fn_species_config_type), | intent(in), | optional, | dimension(:), allocatable | :: | dist_fn_species_config_in |
FIXME : Add documentation
FIXME : Add documentation
Initialised the on grid v|| (vpa) and grid-centred v|| (vpac) arrays
FIXME : Add documentation
FIXME : Add documentation
Compute and store the Bessel functions required for future usage, aj0 and aj1.
FIXME : Add documentation
Calculates the homogeneous solution g_h
used as a part of the
trapped particle and linked boundary condition solve in
invert_rhs. This solution only depends on r
so can be
calculated during initialisation. Note that r
depends on
physics terms that contain dt
so we must recalculate the
solution g_h
if the timestep changes.
!!!!!!!!!!!!!!!!!!!!!!!!!
time advance vpar < 0 !
!!!!!!!!!!!!!!!!!!!!!!!!!
time advance vpar < 0 homogeneous part: g_h
!!!!!!!!!!!!!!!!!!!!!!!!!
time advance vpar > 0 !
!!!!!!!!!!!!!!!!!!!!!!!!!
First set BCs for trapped particles at lower bounce point
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(out), | dimension(-ntgrid:, :, g_lo%llim_proc:) | :: | g_h | ||
logical, | intent(in), | optional | :: | force_passing |
FIXME : Add documentation
FIXME : Add documentation
Extracts the field like data corresponding to the supercell with the {it, ik} wavenumber pair as a member and constructs the ballooning space form. By default includes duplicate theta points but can drop these on request.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | it | |||
integer, | intent(in) | :: | ik | |||
complex, | intent(in), | dimension(-ntgrid:, :, :) | :: | field_like_ft | ||
real, | intent(out), | dimension(:), allocatable | :: | theta_bs | ||
complex, | intent(out), | dimension(:), allocatable | :: | field_like_bs | ||
logical, | intent(in), | optional | :: | drop_duplicates |
Assigns a label to each {it, ik} point denoting which unique supercell the point belongs to.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(out), | dimension(:, :) | :: | supercell_labels | ||
integer, | intent(out), | dimension(:) | :: | n_supercells | ||
integer, | intent(out), | dimension(:, :) | :: | n_cells |
For the passed jshift0 value determine the it (kx) indices to the left and right of each {it, ik} index pair. Used to construct the connected boundary conditions.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | jshift0 | |||
integer, | intent(out), | dimension(:, :) | :: | itleft | ||
integer, | intent(out), | dimension(:, :) | :: | itright |
Look up and store the iglo index and responsible processor for connections to the left and right of each local iglo index. Note this is only interested in passing particles and the non-trapped wfb. Trapped particles are considered to have no connections.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in), | dimension(:, :) | :: | itleft | ||
integer, | intent(in), | dimension(:, :) | :: | itright | ||
type(connections_type), | intent(out), | dimension(g_lo%llim_proc:) | :: | connections |
Set the save_h flag based on connections data
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(connections_type), | intent(in), | dimension(g_lo%llim_proc:) | :: | connections | ||
logical, | intent(out), | dimension(:, g_lo%llim_proc:) | :: | save_h |
Count how many links are to the left/right of each {it,ik} point
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in), | dimension(:, :) | :: | it_connections | ||
integer, | intent(out), | dimension(:, :) | :: | links |
Links is the number of links to the left or right |
Count the links to the left and right of each {it, ik} point and work out how many values are required to set the bc.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in), | dimension(:, :) | :: | itleft | ||
integer, | intent(in), | dimension(:, :) | :: | itright | ||
integer, | intent(out), | dimension(:, :) | :: | l_links | ||
integer, | intent(out), | dimension(:, :) | :: | r_links | ||
integer, | intent(out), | dimension(:, :, :) | :: | n_links |
Count the number of unique supercell sizes and setup the fields implicit arrays M_class and N_class.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in), | dimension(:, :) | :: | l_links | ||
integer, | intent(in), | dimension(:, :) | :: | r_links | ||
integer, | intent(out), | dimension(:), allocatable | :: | M_class |
M_class(i) = number of members in i_th class (How many supercells of this size) |
|
integer, | intent(out), | dimension(:), allocatable | :: | N_class |
N_class(i) = number of linked cells for i_th class (Size of supercell) |
|
integer, | intent(out) | :: | i_class |
i_class = number of classes (unique sizes of supercell) |
Populates the redistribute types describing the communication pattern required to deal with linked boundary conditions. Only deals with passing particles, including the wfb if passing_wfb is true. DD>Note the communications setup here are often equivalent to an all-to-all type
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in), | dimension(:, :) | :: | l_links | ||
integer, | intent(in), | dimension(:, :) | :: | r_links | ||
integer, | intent(in) | :: | n_links_max | |||
type(redist_type), | intent(out) | :: | links_p | |||
type(redist_type), | intent(out) | :: | links_h | |||
logical, | intent(out) | :: | no_connections |
Populates the redistribute types describing the communication pattern required to deal with linked boundary conditions for the mixed wfb. This is used when passing_wfb = trapped_wfb = false. This is the default.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in), | dimension(:, :) | :: | l_links | ||
integer, | intent(in), | dimension(:, :) | :: | r_links | ||
integer, | intent(in) | :: | n_links_max | |||
type(redist_type), | intent(out) | :: | wfb_p | |||
type(redist_type), | intent(out) | :: | wfb_h |
Setup the redistribute associated with passing the incoming boundary values to the previous connected cell, storing at its connected boundary. This is required in order to allow for non-zero incoming boundary conditions on internal cells.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in), | dimension(:, :) | :: | l_links | ||
integer, | intent(in), | dimension(:, :) | :: | r_links | ||
type(redist_type), | intent(out) | :: | incoming_links |
Coordinates the calculation of all data required for later application of linked boundary conditions. Deals with identifying the communication pattern and creating the associated redistributes used to perform the required communication.
Copy of CMR's init_pass_right (revision 2085) but in customisable direction to aid code reuse and with optional range in theta (i.e. so can pass more than just boundary points) An example use is: call init_pass_ends(pass_right,'r',1,'c',3) call fill(pass_right,gnew,gnew) This will pass gnew(ntgrid-2:ntgrid,1,iglo) to gnew(-ntgrid-2:-ntgrid,1,iglo_linked)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(redist_type), | intent(out) | :: | pass_obj |
Redist type object to hold communication logic |
||
character(len=1), | intent(in) | :: | dir |
Character string for direction of communication, should be 'l' for left and 'r' for right |
||
integer, | intent(in) | :: | sigma |
Which sigma index to send |
||
character(len=1), | intent(in) | :: | typestr |
Character string for type of data to be communicated. Should be 'c','r','i' or 'l' |
||
integer, | intent(in), | optional | :: | ngsend |
How many theta grid points are we sending |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | iglo | |||
integer, | intent(out) | :: | iglo_left | |||
integer, | intent(out) | :: | iproc_left |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | iglo | |||
integer, | intent(out) | :: | iglo_right | |||
integer, | intent(out) | :: | iproc_right |
FIXME : Add documentation
This function calculates the distribution function at the next timestep. It calculates both the inhomogeneous part, gnew, due to the sources (principly the drive terms and the nonlinear term) and the homogeneous part, g1. The actual evolution of the dist func is done in the subroutine invert_rhs.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | phi | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | apar | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | bpar | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | phinew | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | aparnew | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | bparnew | ||
integer, | intent(in) | :: | istep | |||
integer, | intent(in), | optional | :: | mode |
Advance collision term one timestep by implicit Euler.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | phi | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | bpar | ||
complex, | intent(inout), | dimension (-ntgrid:,:,:) | :: | phinew | ||
complex, | intent(inout), | dimension (-ntgrid:,:,:) | :: | aparnew | ||
complex, | intent(inout), | dimension (-ntgrid:,:,:) | :: | bparnew | ||
integer, | intent(in), | optional | :: | mode |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(inout), | dimension (-ntgrid:,:,g_lo%llim_proc:) | :: | g0 | ||
complex, | intent(inout), | dimension (-ntgrid:,:,:) | :: | phi | ||
complex, | intent(inout), | dimension (-ntgrid:,:,:) | :: | apar | ||
complex, | intent(inout), | dimension (-ntgrid:,:,:) | :: | bpar | ||
integer, | intent(in) | :: | istep | |||
logical, | intent(in), | optional | :: | field_local |
Subroutine to setup a redistribute object to be used in enforcing parity
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(redist_type), | intent(out) | :: | redist_obj | |||
integer, | intent(in), | optional | :: | ik_ind |
Return the iglo corresponding to the part of the domain given by iglo reflected in theta=theta0
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | iglo | |||
integer, | intent(out) | :: | iglo_conn | |||
integer, | intent(out) | :: | iproc_conn |
Enforce requested parity
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(redist_type), | intent(in), | optional | :: | redist_obj | ||
integer, | intent(in), | optional | :: | ik_ind |
FIXME : Add documentation !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Default choice: solve self-consistent equations !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Solve self-consistent terms + include external i omega_d * F_0 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Do matrix multiplications !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! special source term for totally trapped particles !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! CMR, 13/10/2014: Upper limit of following loops setting source changed from ntgrid to ntgrid-1 Source is allocated as: source(-ntgrid:ntgrid-1), so ntgrid is out of bounds.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | phi | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | apar | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | bpar | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | phinew | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | aparnew | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | bparnew | ||
logical, | intent(in) | :: | include_explicit | |||
real, | intent(in), | dimension(:), allocatable | :: | ab_coefficients | ||
integer, | intent(in) | :: | isgn | |||
integer, | intent(in) | :: | iglo | |||
integer, | intent(in) | :: | ik | |||
integer, | intent(in) | :: | it | |||
integer, | intent(in) | :: | il | |||
integer, | intent(in) | :: | ie | |||
integer, | intent(in) | :: | is | |||
complex, | intent(in) | :: | sourcefac | |||
complex, | intent(out), | dimension (-ntgrid:) | :: | source |
This is a version of get_source_term which does both sign (sigma) together and uses precalculated constant terms. Leads to more memory usage than original version but can be significantly faster (~50%)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | phi | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | apar | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | bpar | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | phinew | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | aparnew | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | bparnew | ||
logical, | intent(in) | :: | include_explicit | |||
real, | intent(in), | dimension(:), allocatable | :: | ab_coefficients | ||
integer, | intent(in) | :: | iglo | |||
integer, | intent(in) | :: | ik | |||
integer, | intent(in) | :: | it | |||
integer, | intent(in) | :: | il | |||
integer, | intent(in) | :: | ie | |||
integer, | intent(in) | :: | is | |||
complex, | intent(in) | :: | sourcefac | |||
complex, | intent(out), | dimension (-ntgrid:,:) | :: | source |
Calculates the regular source term on the entire local
domain and stores in the output source
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(inout), | dimension (-ntgrid:, :, g_lo%llim_proc:) | :: | source | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | phi | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | apar | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | bpar | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | phinew | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | aparnew | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | bparnew | ||
integer, | intent(in) | :: | istep |
Calculates the "new" distribution function for the passed source calculated using the passed fields and current distribution in g.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | phinew | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | bparnew | ||
complex, | intent(inout), | dimension (-ntgrid:,:,g_lo%llim_proc:) | :: | source |
Apply one of the "end of the grid" parallel boundary conditions
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(inout), | dimension (-ntgrid:,:,g_lo%llim_proc:) | :: | gnew | ||
complex, | intent(in), | dimension (-ntgrid:,:,g_lo%llim_proc:) | :: | source | ||
integer, | intent(in) | :: | it | |||
integer, | intent(in) | :: | ik | |||
integer, | intent(in) | :: | ie | |||
integer, | intent(in) | :: | is | |||
integer, | intent(in) | :: | iglo | |||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | phinew | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | bparnew | ||
logical, | intent(in) | :: | is_left_boundary | |||
logical, | intent(in) | :: | is_right_boundary |
Sets sum of homogeneous and inhomogeneous solutions to give a result gnew(ntgrid,2) = gnew(-ntgrid,2) gnew(ntgrid,1) = gnew(-ntgrid,1) ie periodic bcs at the ends of the flux tube.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(inout), | dimension(-ntgrid:, :, g_lo%llim_proc:) | :: | gnew | ||
complex, | intent(in), | dimension(-ntgrid:, :, g_lo%llim_proc:) | :: | g_h | ||
integer, | intent(in) | :: | iglo | |||
integer, | intent(in) | :: | is | |||
integer, | intent(in) | :: | ie | |||
integer, | intent(in) | :: | it | |||
integer, | intent(in) | :: | ik | |||
logical, | intent(in) | :: | is_wfb | |||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | phinew | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | bparnew |
A shorthand for apply_linked_boundary_conditions passing the regular module level instances of each of the required arguments. Primarily intended for testing to avoid having to expose additional data arrays.
Applies linked (twist-shift) boundary conditions to passed distribution function DD>Note these fill routines are often equivalent to an all-to-all type
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(inout), | dimension(-ntgrid:, :, g_lo%llim_proc:) | :: | g_in | ||
complex, | intent(inout), | dimension(-ntgrid:, :, g_lo%llim_proc:) | :: | g_h | ||
complex, | intent(inout), | dimension(:, :, g_lo%llim_proc:) | :: | g_adj | ||
complex, | intent(in), | dimension (-ntgrid:, :, :) | :: | phinew | ||
complex, | intent(in), | dimension (-ntgrid:, :, :) | :: | bparnew |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | phi | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | apar | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | bpar | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | phinew | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | aparnew | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | bparnew | ||
integer, | intent(in) | :: | istep |
Ensure that linked boundary values of passed complex field are single valued (e.g. kperp2(ntgrid,ikx,iky) is equal to kperp2(-ntgrid,ikx_link,iky) as these correspond to the same location).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(inout), | dimension (-ntgrid:,:,:) | :: | arr | ||
logical, | intent(in), | optional | :: | force_all |
Ensure that linked boundary values of passed real field are single valued (e.g. kperp2(ntgrid,ikx,iky) is equal to kperp2(-ntgrid,ikx_link,iky) as these correspond to the same location).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real, | intent(inout), | dimension (-ntgrid:,:,:) | :: | arr | ||
logical, | intent(in), | optional | :: | force_all |
Compute velocity space integrals over :
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | dimension(-ntgrid:, :, g_lo%llim_proc:) | :: | g_in | ||
complex, | intent(inout), | dimension (-ntgrid:,:,:) | :: | antot | ||
complex, | intent(inout), | dimension (-ntgrid:,:,:) | :: | antota | ||
complex, | intent(inout), | dimension (-ntgrid:,:,:) | :: | antotp | ||
logical, | intent(in), | optional | :: | local_only |
Compute velocity space integrals over :
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(inout), | dimension (-ntgrid:,:,:) | :: | antot | ||
complex, | intent(inout), | dimension (-ntgrid:,:,:) | :: | antota | ||
complex, | intent(inout), | dimension (-ntgrid:,:,:) | :: | antotp | ||
logical, | intent(in), | optional | :: | local_only |
Check if the passed distribution function shaped array has the same value at the duplicate theta points arising from the linked boundary conditions.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | dimension(-ntgrid:, :, g_lo%llim_proc:) | :: | g_array | ||
type(redist_type), | intent(inout) | :: | pass_right | |||
type(redist_type), | intent(inout) | :: | pass_left | |||
character(len=*), | intent(in), | optional | :: | identifier | ||
real, | intent(in), | optional | :: | tolerance |
FIXME : Add documentation
DD>Make sure gamtots are single valued
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | phi | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | apar | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | bpar | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | antot | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | antota | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | antotp | ||
complex, | intent(inout), | dimension (-ntgrid:,:,:) | :: | fieldeq | ||
complex, | intent(inout), | dimension (-ntgrid:,:,:) | :: | fieldeqa | ||
complex, | intent(inout), | dimension (-ntgrid:,:,:) | :: | fieldeqp | ||
logical, | intent(in), | optional | :: | local_only |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | phi | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | apar | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | bpar | ||
complex, | intent(inout), | dimension (-ntgrid:,:,:) | :: | fieldeq | ||
complex, | intent(inout), | dimension (-ntgrid:,:,:) | :: | fieldeqa | ||
complex, | intent(inout), | dimension (-ntgrid:,:,:) | :: | fieldeqp | ||
logical, | intent(in), | optional | :: | local_only |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | phi | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | apar | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | bpar | ||
complex, | intent(inout), | dimension (-ntgrid:,:,:) | :: | fieldeq | ||
complex, | intent(inout), | dimension (-ntgrid:,:,:) | :: | fieldeqa | ||
complex, | intent(inout), | dimension (-ntgrid:,:,:) | :: | fieldeqp | ||
logical, | intent(in), | optional | :: | local_only |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | phi | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | apar | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | bpar | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | antot | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | antota | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | antotp | ||
complex, | intent(inout), | dimension (-ntgrid:,:,:) | :: | fieldeq | ||
complex, | intent(inout), | dimension (-ntgrid:,:,:) | :: | fieldeqa | ||
complex, | intent(inout), | dimension (-ntgrid:,:,:) | :: | fieldeqp | ||
logical, | intent(in), | optional | :: | local_only |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(inout), | dimension (-ntgrid:ntgrid,ntheta0,naky) | :: | antot | ||
complex, | intent(inout), | dimension (-ntgrid:ntgrid,ntheta0,naky) | :: | antota | ||
complex, | intent(inout), | dimension (-ntgrid:ntgrid,ntheta0,naky) | :: | antotp | ||
complex, | intent(inout), | dimension (-ntgrid:ntgrid,ntheta0,naky) | :: | tempantot | ||
complex, | intent(inout), | dimension (-ntgrid:ntgrid,ntheta0,naky) | :: | tempantota | ||
complex, | intent(inout), | dimension (-ntgrid:ntgrid,ntheta0,naky) | :: | tempantotp |
Getan_nogath has been substantially changed to enable gf_lo field calculations, it can now operate in 2 modes; using the standard integrate_species (integrate_species_sub in le_grids) when called from fields_local and gf_lo_integrate is false (which is teh default, or doing the integrate in place when called from fields_gf_local or from fields_local when gf_lo_integrate is true. Note, if this is called from fields_local and gf_lo_integrate is true then the calculation will be done locally but there is a function called after this has finished in fields_local that sends the data back (from gf_lo to g_lo layouts). When call with gf_lo_integrate = .true. this routine does a gather that converts the gnew array from g_lo data distribution to gf_lo data distribution and stores the result in gfarray. With gf_lo_integrate = .false. g_in is used instead and this is in g_lo data distribution.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | dimension (-ntgrid:, :, g_lo%llim_proc:) | :: | g_in | ||
complex, | intent(inout), | dimension (-ntgrid:,:,:) | :: | antot | ||
complex, | intent(inout), | dimension (-ntgrid:,:,:) | :: | antota | ||
complex, | intent(inout), | dimension (-ntgrid:,:,:) | :: | antotp | ||
logical, | intent(in), | optional | :: | local_only |
Calls getan_nogath_from_dfn to calculate antot arrays for current gnew value
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(inout), | dimension (-ntgrid:,:,:) | :: | antot | ||
complex, | intent(inout), | dimension (-ntgrid:,:,:) | :: | antota | ||
complex, | intent(inout), | dimension (-ntgrid:,:,:) | :: | antotp | ||
logical, | intent(in), | optional | :: | local_only |
Calculates the potentials consistent with the passed nonadiabatic
distribution function, f_in
. Note this is not what GS2 usually
evolves as g
/gnew
but the adjusted version.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | dimension(-ntgrid:, :, g_lo%llim_proc:) | :: | f_in | ||
complex, | intent(out), | dimension(-ntgrid:, :, :) | :: | phi | ||
complex, | intent(out), | dimension(-ntgrid:, :, :) | :: | apar | ||
complex, | intent(out), | dimension(-ntgrid:, :, :) | :: | bpar | ||
logical, | intent(in), | optional | :: | gf_lo | ||
logical, | intent(in), | optional | :: | local_only |
Precomputes constants used in the inversion of the field equations: gamtot * phi - gamtot1 * bpar = antot kperp2 * apar = antota beta/2 * gamtot1 * phi + (beta * gamtot2 + 1) * bpar = - beta * antotp
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real, | intent(inout), | dimension(:, :, :), allocatable | :: | phi_denom | ||
real, | intent(inout), | dimension(:, :, :), allocatable | :: | bpar_denom |
Inverts the field equations: gamtot * phi - gamtot1 * bpar = antot kperp2 * apar = antota beta/2 * gamtot1 * phi + (beta * gamtot2 + 1) * bpar = - beta * antotp
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | dimension (:,:,:) | :: | g_in | ||
complex, | intent(out), | dimension (-ntgrid:,:,:) | :: | phi | ||
complex, | intent(out), | dimension (-ntgrid:,:,:) | :: | apar | ||
complex, | intent(out), | dimension (-ntgrid:,:,:) | :: | bpar | ||
logical, | intent(in), | optional | :: | gf_lo | ||
logical, | intent(in), | optional | :: | local_only |
Calls get_fields_direct_from_dfn to solve for fields consistent with current gnew
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(out), | dimension (:,:,:) | :: | phi | ||
complex, | intent(out), | dimension (:,:,:) | :: | apar | ||
complex, | intent(out), | dimension (:,:,:) | :: | bpar | ||
logical, | intent(in), | optional | :: | gf_lo |
Calculates the potentials directly from the passed distribution function and compares the result to the passed potentials. Returns the maximum relative error for each potential.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | dimension(:,:,:) | :: | g_in | ||
complex, | intent(in), | dimension(:,:,:) | :: | phi_in | ||
complex, | intent(in), | dimension(:,:,:) | :: | apar_in | ||
complex, | intent(in), | dimension(:,:,:) | :: | bpar_in | ||
real, | intent(out) | :: | phi_err | |||
real, | intent(out) | :: | apar_err | |||
real, | intent(out) | :: | bpar_err |
Routine to dump the current source term used in invert_rhs.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | istep | |||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | phi | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | apar | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | bpar | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | phinew | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | aparnew | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | bparnew |
Routine to dump the homogeneous solution
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
logical, | intent(in), | optional | :: | force_passing |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | iglo | |||
integer, | intent(out) | :: | iglo_left | |||
integer, | intent(out) | :: | ipleft |
FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | iglo | |||
integer, | intent(out) | :: | iglo_right | |||
integer, | intent(out) | :: | ipright |
Calculate the flux surface average term for the adiabatic response.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(out), | dimension (ntheta0, naky) | :: | fl_avg | ||
complex, | intent(in), | dimension (-ntgrid:ntgrid,ntheta0,naky) | :: | antot |
Set the module level config types Will abort if the module has already been initialised to avoid inconsistencies.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dist_fn_config_type), | intent(in), | optional | :: | dist_fn_config_in | ||
type(source_config_type), | intent(in), | optional | :: | source_config_in | ||
type(dist_fn_species_config_type), | intent(in), | optional, | dimension(:), allocatable | :: | dist_fn_species_config_in |
Reads in the dist_fn_knobs namelist and populates the member variables
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(dist_fn_config_type), | intent(inout) | :: | self |
Writes out a namelist representing the current state of the config object
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(dist_fn_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(dist_fn_config_type), | intent(inout) | :: | self |
Broadcasts all config parameters so object is populated identically on all processors
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(dist_fn_config_type), | intent(inout) | :: | self |
Reads in the source_knobs namelist and populates the member variables
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(source_config_type), | intent(inout) | :: | self |
Writes out a namelist representing the current state of the config object
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(source_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(source_config_type), | intent(inout) | :: | self |
Broadcasts all config parameters so object is populated identically on all processors
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(source_config_type), | intent(inout) | :: | self |
Reads in the dist_fn_species_knobs namelist and populates the member variables
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(dist_fn_species_config_type), | intent(inout) | :: | self |
Writes out a namelist representing the current state of the config object
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(dist_fn_species_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(dist_fn_species_config_type), | intent(inout) | :: | self |
Broadcasts all config parameters so object is populated identically on all processors
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(dist_fn_species_config_type), | intent(inout) | :: | self |