implicit_solve Module



Variables

Type Visibility Attributes Name Initial
real, public, dimension(2, 3) :: time_implicit_advance = 0.

Subroutines

public subroutine advance_implicit_terms(g, phi, apar, bpar)

dist_choice indicates whether the non-Boltzmann part of the pdf (h) is evolved in parallel streaming or if the guiding centre distribution (g = ) is evolved

Read more…

Arguments

Type IntentOptional Attributes Name
complex, intent(inout), dimension(:, :, -nzgrid:, :, vmu_lo%llim_proc:) :: g
complex, intent(inout), dimension(:, :, -nzgrid:, :) :: phi
complex, intent(inout), dimension(:, :, -nzgrid:, :) :: apar
complex, intent(inout), dimension(:, :, -nzgrid:, :) :: bpar

public subroutine get_gke_rhs(ivmu, iky, ie, pdf, phi, apar, aparnew, aparold, bpar, rhs, phi_ffs)

get_gke_rhs calculates the RHS of the GK equation. as the response matrix approach requires separate solution of the 'inhomogeneous' GKE, the homogeneous GKE (to obtain the response matrix itself), and the full GKE, which RHS is obtained depends on the input values for 'pdf', 'phi', 'apar', 'aparnew' and 'aparold'

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: ivmu
integer, intent(in) :: iky
integer, intent(in) :: ie
complex, intent(in), dimension(:) :: pdf
complex, intent(in), dimension(:) :: phi
complex, intent(in), dimension(:) :: apar
complex, intent(in), dimension(:) :: aparnew
complex, intent(in), dimension(:) :: aparold
complex, intent(in), dimension(:) :: bpar
complex, intent(out), dimension(:) :: rhs
complex, intent(in), optional, dimension(:) :: phi_ffs

private subroutine get_contributions_from_fields(phi, apar, aparnew, bpar, ivmu, iky, ie, scratch, rhs)

get_contributions_from_fields takes as input the appropriately averaged electrostatic potential phi and magnetic vector potential components apar and returns in rhs the sum of the source terms involving phi and apar that appear on the RHS of the GK equation when g is the pdf

Arguments

Type IntentOptional Attributes Name
complex, intent(in), dimension(:) :: phi
complex, intent(in), dimension(:) :: apar
complex, intent(in), dimension(:) :: aparnew
complex, intent(in), dimension(:) :: bpar
integer, intent(in) :: ivmu
integer, intent(in) :: iky
integer, intent(in) :: ie
complex, intent(out), dimension(:) :: scratch
complex, intent(out), dimension(:) :: rhs

private subroutine get_contributions_from_phi(phi, ivmu, iky, iz_from_izext, ikx_from_izext, scratch, rhs)

get_contributions_from_phi takes as input the appropriately averaged electrostatic potential phi and returns in rhs the sum of the source terms involving phi that appear on the RHS of the GK equation when g is the pdf

Read more…

Arguments

Type IntentOptional Attributes Name
complex, intent(in), dimension(:) :: phi
integer, intent(in) :: ivmu
integer, intent(in) :: iky
integer, intent(in), dimension(:) :: iz_from_izext
integer, intent(in), dimension(:) :: ikx_from_izext
complex, intent(out), dimension(:) :: scratch
complex, intent(out), dimension(:) :: rhs

private subroutine get_contributions_from_bpar(bpar, ivmu, iky, iz_from_izext, ikx_from_izext, scratch, rhs)

get_contributions_from_bpar takes as input the appropriately averaged electrostatic potential bpar and returns in rhs the sum of the source terms involving bpar that appear on the RHS of the GK equation when g is the pdf

Arguments

Type IntentOptional Attributes Name
complex, intent(in), dimension(:) :: bpar
integer, intent(in) :: ivmu
integer, intent(in) :: iky
integer, intent(in), dimension(:) :: iz_from_izext
integer, intent(in), dimension(:) :: ikx_from_izext
complex, intent(out), dimension(:) :: scratch
complex, intent(out), dimension(:) :: rhs

private subroutine get_contributions_from_apar(apar, aparnew, ivmu, iky, iz_from_izext, ikx_from_izext, scratch, rhs)

get_contributions_from_apar takes as input the appropriately averaged parallel component of the vector potential, apar, and returns in rhs the sum of the source terms involving apar that appear on the RHS of the GK equation when g is the pdf

Arguments

Type IntentOptional Attributes Name
complex, intent(in), dimension(:) :: apar
complex, intent(in), dimension(:) :: aparnew
integer, intent(in) :: ivmu
integer, intent(in) :: iky
integer, intent(in), dimension(:) :: iz_from_izext
integer, intent(in), dimension(:) :: ikx_from_izext
complex, intent(out), dimension(:) :: scratch
complex, intent(inout), dimension(:) :: rhs

private subroutine add_gbar_to_g_contribution_apar(scratch2, iky, ia, iv, imu, is, nz_ext, iz_from_izext, rhs)

adds the contributions to the GKE RHS that comes from switching from gbar^{n+1} = g^{n+1} + (Ze/T)(vpa/c)*F0 to g^{n+1} = in the time derivative;

Arguments

Type IntentOptional Attributes Name
complex, intent(inout), dimension(:) :: scratch2
integer, intent(in) :: iky
integer, intent(in) :: ia
integer, intent(in) :: iv
integer, intent(in) :: imu
integer, intent(in) :: is
integer, intent(in) :: nz_ext
integer, intent(in), dimension(:) :: iz_from_izext
complex, intent(inout), dimension(:) :: rhs

private subroutine add_drifts_contribution_apar(scratch, iky, ia, ivmu, iv, is, nz_ext, iz_from_izext, rhs)

Arguments

Type IntentOptional Attributes Name
complex, intent(inout), dimension(:) :: scratch
integer, intent(in) :: iky
integer, intent(in) :: ia
integer, intent(in) :: ivmu
integer, intent(in) :: iv
integer, intent(in) :: is
integer, intent(in) :: nz_ext
integer, intent(in), dimension(:) :: iz_from_izext
complex, intent(inout), dimension(:) :: rhs

private subroutine gbar_to_g_zext(pdf, apar, facapar, iky, ivmu, ikx_from_izext, iz_from_izext)

Arguments

Type IntentOptional Attributes Name
complex, intent(inout), dimension(:) :: pdf
complex, intent(in), dimension(:) :: apar
real, intent(in) :: facapar
integer, intent(in) :: iky
integer, intent(in) :: ivmu
integer, intent(in), dimension(:) :: ikx_from_izext
integer, intent(in), dimension(:) :: iz_from_izext

private subroutine gyro_average_zext(iky, ivmu, ikx_from_izext, iz_from_izext, fld, gyro_fld)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: iky
integer, intent(in) :: ivmu
integer, intent(in), dimension(:) :: ikx_from_izext
integer, intent(in), dimension(:) :: iz_from_izext
complex, intent(in), dimension(:) :: fld
complex, intent(out), dimension(:) :: gyro_fld

private subroutine gyro_average_j1_zext(iky, ivmu, ikx_from_izext, iz_from_izext, fld, gyro_fld)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: iky
integer, intent(in) :: ivmu
integer, intent(in), dimension(:) :: ikx_from_izext
integer, intent(in), dimension(:) :: iz_from_izext
complex, intent(in), dimension(:) :: fld
complex, intent(out), dimension(:) :: gyro_fld

private subroutine get_contributions_from_pdf(pdf, apar, ivmu, iky, ie, rhs, source_ffs)

get_contributions_from_pdf takes as an argument the evolved pdf (either guiding centre distribution g= or maxwellian-normlized, non-Boltzmann distribution h/F0=f/F0+(Ze*phi/T)) and the scratch array rhs, and returns the source terms that depend on the pdf in rhs

Arguments

Type IntentOptional Attributes Name
complex, intent(in), dimension(:) :: pdf
complex, intent(in), dimension(:) :: apar
integer, intent(in) :: ivmu
integer, intent(in) :: iky
integer, intent(in) :: ie
complex, intent(out), dimension(:) :: rhs
complex, intent(in), optional, dimension(:) :: source_ffs

public subroutine sweep_g_zext(iky, ie, it, ivmu, pdf)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: iky
integer, intent(in) :: ie
integer, intent(in) :: it
integer, intent(in) :: ivmu
complex, intent(inout), dimension(:) :: pdf

private subroutine get_updated_pdf(iz, iv, is, sgn, iz1, iz2, wdrift_ext, pdf)

Arguments

Type IntentOptional Attributes Name
integer, intent(inout) :: iz
integer, intent(in) :: iv
integer, intent(in) :: is
integer, intent(in) :: sgn
integer, intent(in) :: iz1
integer, intent(in) :: iz2
complex, intent(in), dimension(:) :: wdrift_ext
complex, intent(inout), dimension(:) :: pdf

public subroutine sweep_zed_zonal(iky, iv, is, sgn, g, llim)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: iky
integer, intent(in) :: iv
integer, intent(in) :: is
integer, intent(in) :: sgn
complex, intent(inout), dimension(llim:) :: g
integer, intent(in) :: llim

private subroutine invert_parstream_response(phi, apar, bpar)

use the LU-decomposed response matrix and the contributions from the 'inhomogeneous' fields (phi, apar) to solve for (phi^{n+1}, apar^{n+1})

Arguments

Type IntentOptional Attributes Name
complex, intent(inout), dimension(:, :, -nzgrid:, :) :: phi
complex, intent(inout), dimension(:, :, -nzgrid:, :) :: apar
complex, intent(inout), dimension(:, :, -nzgrid:, :) :: bpar