advance_implicit_terms Subroutine

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

store g_n from pervious time step if using delphi formulation for response matrix, then phi = phi^n replaces phi^{n+1} in the inhomogeneous GKE; else set phi_{n+1} to zero in inhomogeneous equation NB: for FFS phi_source = 0.0 for inhomogeneous step - this is always set below for fluxtube this ordering doesn't matter save the incoming pdf and phi, as they will be needed later this will become g^{n+1, i} -- the g from the previous iteration
if using delphi formulation for response matrix, then phi = phi^n replaces phi^{n+1} in the inhomogeneous GKE; else set phi_{n+1} to zero in inhomogeneous equation set the g on the RHS to be g from the previous time step
FFS will have a RHS source term modify being passes in will make sure that this source is included We now have g_{inh}^{n+1, i+1} stored in g calculate associated fields (phi_{inh}^{n+1, i+1}) For FFS we want to re-solve for bar{phi} NB the 'g' here is g_inh^{n+1, i+1} g2 = g^{n+1, i} phi_old = phi^{n+1, i} solve response_matrix(phi^{n+1}-phi^{n}) = phi_{inh}^{n+1}-phi^{n} phi = phi_{inh}^{n+1}-phi^{n} is input and overwritten by phi = phi^{n+1}-phi^{n} for Drift kinetic implicit this is full phi^{n+1, i+1} If using deltaphi formulation, must account for fact that phi = phi^{n+1}-phi^{n}, but tupwnd_p should multiply phi^{n+1} Pass in modify to include RHS source term solving for full g = g_{inh} + g_{hom}

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