aj0_alpha will contain J_0 as a function of k_alpha and alpha j0_B will contain J_0Bexp(-v^2) as a function of k_alpha and alpha for each value of alpha, take kperp^2 calculated on domain kx = [-kx_max, kx_max] and ky = [0, ky_max] and use symmetry to obtain kperp^2 on domain kx = [0, kx_max] and ky = [-ky_max, ky_max] this makes later convolutions involving sums over all ky more straightforward calculate the argument of the Bessel function, which depends on both alpha and k_alpha
compute J_0Bexp(-v^2), needed when integrating g over v-space in Maxwell's equations, due to B in v-space Jacobian fourier transform aj0_alpha and j0_B. note that fourier coefficients aj0_kalpha and j0_B_kalpha have been filtered to avoid aliasing given the Fourier coefficients aj0_kalpha, calculate the minimum number of coefficients needed, called j0_ffs%max_idx, to ensure that the relative error in the total spectral energy is below a specified tolerance given the Fourier coefficients j0_B_kalpha, calculate the minimum number of coefficients needed, called j0_B_ffs%max_idx, to ensure that the relative error in the total spectral energy is below a specified tolerance keep track of the total number of coefficients that must be retained across different phase space points keep track of the total number of coefficients that must be retained across different phase space points allocate array to hold the reduced number of Fourier coefficients fill the array with the requisite coefficients
fill the array with the requisite coefficients
calculate the reduction factor of Fourier modes used to represent J0 avoid overflow by converting integers to reals before multiplying