Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
logical, | private | :: | time_advance_initialized | = | .false. | ||
logical, | private | :: | wdriftinit | = | .false. | ||
logical, | private | :: | wstarinit | = | .false. | ||
logical, | private | :: | parnlinit | = | .false. | ||
logical, | private | :: | readinit | = | .false. | ||
logical, | private | :: | radialinit | = | .false. | ||
logical, | private | :: | driftimpinit | = | .false. | ||
real, | private, | dimension(:, :), allocatable | :: | par_nl_fac | |||
real, | private, | dimension(:, :), allocatable | :: | d_par_nl_fac_dr | |||
real, | private, | dimension(:, :), allocatable | :: | par_nl_curv | |||
real, | private, | dimension(:, :), allocatable | :: | d_par_nl_curv_dr | |||
real, | private, | dimension(:), allocatable | :: | par_nl_driftx | |||
real, | private, | dimension(:), allocatable | :: | par_nl_drifty | |||
real, | private, | dimension(:), allocatable | :: | d_par_nl_driftx_dr | |||
real, | private, | dimension(:), allocatable | :: | d_par_nl_drifty_dr | |||
real, | public, | dimension(2, 10) | :: | time_gke | = | 0. | |
real, | public, | dimension(2, 2) | :: | time_parallel_nl | = | 0. |
compute dg/dy in k-space accepts g(ky,kx)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | dimension(:, :) | :: | g | ||
complex, | intent(out), | dimension(:, :) | :: | dgdy |
compute dg/dy in k-space accepts g(ky,kx,z,tube)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | dimension(:, :, -nzgrid:, :) | :: | g | ||
complex, | intent(out), | dimension(:, :, -nzgrid:, :) | :: | dgdy |
compute dg/dy in k-space accepts g(ky,kx,z,tube,(vpa,mu,spec))
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | dimension(:, :, -nzgrid:, :, vmu_lo%llim_proc:) | :: | g | ||
complex, | intent(out), | dimension(:, :, -nzgrid:, :, vmu_lo%llim_proc:) | :: | dgdy |
compute dg/dx in k-space accepts g(ky,kx)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | dimension(:, :) | :: | g | ||
complex, | intent(out), | dimension(:, :) | :: | dgdx |
compute dg/dx in k-space accepts g(ky,kx,z,tube)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | dimension(:, :, -nzgrid:, :) | :: | g | ||
complex, | intent(out), | dimension(:, :, -nzgrid:, :) | :: | dgdx |
compute dg/dx in k-space accepts g(ky,kx,z,tube,(vpa,mu,spec))
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | dimension(:, :, -nzgrid:, :, vmu_lo%llim_proc:) | :: | g | ||
complex, | intent(out), | dimension(:, :, -nzgrid:, :, vmu_lo%llim_proc:) | :: | dgdx |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | dimension(:, :, -nzgrid:, :) | :: | field | ||
real, | intent(out) | :: | total |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | dimension(:, :, -nzgrid:, :, vmu_lo%llim_proc:) | :: | dist | ||
real, | intent(out) | :: | total | |||
logical, | intent(in), | optional | :: | norm |
read time_advance_knobs namelist from the input file; sets the explicit time advance option, as well as allows for scaling of the x and y components of the magnetic drifts and of the drive term allocate distribution function sized arrays needed, e.g., for Runge-Kutta time advance set up neoclassical corrections to the equilibrium Maxwellian; only calculated/needed when simulating higher order terms in rhostar for intrinsic rotation calculate the term multiplying dg/dvpa in the mirror term and set up either the semi-Lagrange machinery or the tridiagonal matrix to be inverted if solving implicitly calculate the term multiplying dg/dz in the parallel streaming term and set up the tridiagonal matrix to be inverted if solving implicitly allocate and calculate the factors multiplying dg/dx, dg/dy, dphi/dx and dphi/dy in the magnetic drift terms allocate and calculate the factor multiplying dphi/dy in the gradient drive term
allocate wdriftx_phi, the factor multiplying dphi/dx in the magnetic drift term
allocate wdrifty_phi, the factor multiplying dphi/dy in the magnetic drift term
allocate wdriftx_bpar, the factor multiplying dbpar/dx in the magnetic drift term
allocate wdrifty_bpar, the factor multiplying dbpar/dy in the magnetic drift term
allocate wdriftx_g, the factor multiplying dg/dx in the magnetic drift term
allocate wdrifty_g, the factor multiplying dg/dy in the magnetic drift term
this is the curvature drift piece of wdrifty with missing factor of vpa
vpa factor is missing to avoid singularity when including
non-Maxwellian corrections to equilibrium
this is the grad-B drift piece of wdrifty
if including neoclassical correction to equilibrium Maxwellian,
then add in v_E^{nc} . grad y dg/dy coefficient here
if maxwwellian_normalization = .true., evolved distribution function is normalised by a Maxwellian
otherwise, it is not; a Maxwellian weighting factor must thus be included
assign wdrifty_bpar, neoclassical terms not supported
if including neoclassical corrections to equilibrium,
add in -(Ze/m) * v_curv/vpa . grad y d
TODO:GA- add correct CFL condition
unless running in multibox mode, no need to worry about mb_communicate calls as the subroutine is immediately exited if not in multibox mode. save value of phi & apar for use in diagnostics (to obtain frequency) reverse the order of operations every time step as part of alternating direction operator splitting this is needed to ensure 2nd order accuracy in time
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | istep | |||
logical, | intent(inout) | :: | stop_stella |
advance_explicit takes as input the guiding centre distribution function in k-space and updates it to account for all of the terms in the GKE that are advanced explicitly in time
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(inout), | dimension(:, :, -nzgrid:, :, vmu_lo%llim_proc:) | :: | g | ||
logical, | intent(inout) | :: | restart_time_step | |||
integer, | intent(in) | :: | istep |
advance_explicit_euler uses forward Euler to advance one time step
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(inout), | dimension(:, :, -nzgrid:, :, vmu_lo%llim_proc:) | :: | g | ||
logical, | intent(inout) | :: | restart_time_step | |||
integer, | intent(in) | :: | istep |
advance_expliciit_rk2 uses strong stability-preserving RK2 to advance one time step
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(inout), | dimension(:, :, -nzgrid:, :, vmu_lo%llim_proc:) | :: | g | ||
logical, | intent(inout) | :: | restart_time_step | |||
integer, | intent(in) | :: | istep |
strong stability-preserving RK3
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(inout), | dimension(:, :, -nzgrid:, :, vmu_lo%llim_proc:) | :: | g | ||
logical, | intent(inout) | :: | restart_time_step | |||
integer, | intent(in) | :: | istep |
standard RK4
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(inout), | dimension(:, :, -nzgrid:, :, vmu_lo%llim_proc:) | :: | g | ||
logical, | intent(inout) | :: | restart_time_step | |||
integer, | intent(in) | :: | istep |
solve_gke accepts as argument pdf, the guiding centre distribution function in k-space,
and returns rhs_ky, the right-hand side of the gyrokinetic equation in k-space;
i.e., if dg/dt = r, then rhs_ky = rdt;
note that if include_apar = T, then the input pdf is actually gbar = g + (Ze/T)(vpa/c)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(inout), | dimension(:, :, -nzgrid:, :, vmu_lo%llim_proc:) | :: | |||
complex, | intent(out), | dimension(:, :, -nzgrid:, :, vmu_lo%llim_proc:), target | :: | rhs_ky | ||
logical, | intent(out) | :: | restart_time_step | |||
integer, | intent(in) | :: | istep |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | dimension(:, :, -nzgrid:, :, vmu_lo%llim_proc:) | :: | gin | ||
complex, | intent(inout), | dimension(:, :, -nzgrid:, :, vmu_lo%llim_proc:) | :: | gout |
start timing the time advance due to the driving gradients
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | dimension(:, :, -nzgrid:, :) | :: | phi | ||
complex, | intent(inout), | dimension(:, :, -nzgrid:, :, vmu_lo%llim_proc:) | :: | gout |
advance_wdrifty_explicit subroutine calculates and adds the y-component of the magnetic drift term to the RHS of the GK equation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | dimension(:, :, -nzgrid:, :, vmu_lo%llim_proc:) | :: | g | ||
complex, | intent(in), | dimension(:, :, -nzgrid:, :) | :: | phi | ||
complex, | intent(in), | dimension(:, :, -nzgrid:, :) | :: | bpar | ||
complex, | intent(inout), | dimension(:, :, -nzgrid:, :, vmu_lo%llim_proc:) | :: | gout |
advance_wdriftx_explicit subroutine calculates and adds the x-component of the magnetic drift term to the RHS of the GK equation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | dimension(:, :, -nzgrid:, :, vmu_lo%llim_proc:) | :: | g | ||
complex, | intent(in), | dimension(:, :, -nzgrid:, :) | :: | phi | ||
complex, | intent(in), | dimension(:, :, -nzgrid:, :) | :: | bpar | ||
complex, | intent(inout), | dimension(:, :, -nzgrid:, :, vmu_lo%llim_proc:) | :: | gout |
compute phase factor needed when running with equilibrium flow shear
compute ikyg
FFT to get dg/dy in (y,x) space
compute ikx
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(inout), | dimension(:, :, -nzgrid:, :, vmu_lo%llim_proc:) | :: | g | ||
complex, | intent(inout), | dimension(:, :, -nzgrid:, :, vmu_lo%llim_proc:) | :: | gout | ||
logical, | intent(out) | :: | restart_time_step | |||
integer, | intent(in) | :: | istep |
check estimated cfl_dt to see if the time step size needs to be changed
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | dimension(:, :, -nzgrid:, :, vmu_lo%llim_proc:) | :: | g | ||
complex, | intent(inout), | dimension(:, :, -nzgrid:, :, vmu_lo%llim_proc:) | :: | gout | ||
logical, | intent(out) | :: | restart_time_step |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | dimension(:, :, -nzgrid:, :, vmu_lo%llim_proc:) | :: | g | ||
complex, | intent(inout), | dimension(:, :, -nzgrid:, :, vmu_lo%llim_proc:) | :: | gout |
compute dg/dy in k-space accepts g(ky,kx)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | dimension(:, :) | :: | g | ||
complex, | intent(out), | dimension(:, :) | :: | dgdy |
compute dg/dy in k-space accepts g(ky,kx,z,tube)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | dimension(:, :, -nzgrid:, :) | :: | g | ||
complex, | intent(out), | dimension(:, :, -nzgrid:, :) | :: | dgdy |
compute dg/dy in k-space accepts g(ky,kx,z,tube,(vpa,mu,spec))
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | dimension(:, :, -nzgrid:, :, vmu_lo%llim_proc:) | :: | g | ||
complex, | intent(out), | dimension(:, :, -nzgrid:, :, vmu_lo%llim_proc:) | :: | dgdy |
compute dg/dx in k-space accepts g(ky,kx)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | dimension(:, :) | :: | g | ||
complex, | intent(out), | dimension(:, :) | :: | dgdx |
compute dg/dx in k-space accepts g(ky,kx,z,tube)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | dimension(:, :, -nzgrid:, :) | :: | g | ||
complex, | intent(out), | dimension(:, :, -nzgrid:, :) | :: | dgdx |
compute dg/dx in k-space accepts g(ky,kx,z,tube,(vpa,mu,spec))
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | dimension(:, :, -nzgrid:, :, vmu_lo%llim_proc:) | :: | g | ||
complex, | intent(out), | dimension(:, :, -nzgrid:, :, vmu_lo%llim_proc:) | :: | dgdx |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | dimension(:, :, -nzgrid:, :, vmu_lo%llim_proc:) | :: | g | ||
real, | intent(in), | dimension(-nzgrid:, vmu_lo%llim_proc:) | :: | pre_factor | ||
complex, | intent(inout), | dimension(:, :, -nzgrid:, :, vmu_lo%llim_proc:) | :: | src |
add vM . grad y d
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | dimension(:, :, -nzgrid:, :, vmu_lo%llim_proc:) | :: | g | ||
real, | intent(in), | dimension(:, -nzgrid:, vmu_lo%llim_proc:) | :: | pre_factor | ||
complex, | intent(inout), | dimension(:, :, -nzgrid:, :, vmu_lo%llim_proc:) | :: | src |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | istep | |||
complex, | intent(inout), | dimension(:, :, -nzgrid:, :) | :: | phi | ||
complex, | intent(inout), | dimension(:, :, -nzgrid:, :) | :: | apar | ||
complex, | intent(inout), | dimension(:, :, -nzgrid:, :) | :: | bpar | ||
complex, | intent(inout), | dimension(:, :, -nzgrid:, :, vmu_lo%llim_proc:) | :: | g |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(inout), | dimension(:, :, -nzgrid:, :, vmu_lo%llim_proc:) | :: | g_in |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | dimension(:, :, -nzgrid:, :) | :: | field | ||
real, | intent(out) | :: | total |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | dimension(:, :, -nzgrid:, :, vmu_lo%llim_proc:) | :: | dist | ||
real, | intent(out) | :: | total | |||
logical, | intent(in), | optional | :: | norm |