Module for advancing and initialising the fields for a fluxtube simulation
Advance fields for fluxtube routines Initialise Routine
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | private | :: | zm |
If we are parallelising over (vpa,mu) then this subroutine is called This is the more common version used compared with parallelising over (kx,ky,z) and is the default for stella. Here we calculate: sum_s int dv (J0 * g) and then call get_phi which divides this by the appropriate gamtot factor TODO-GA: remove apar from this and make it only needed for EM stella
Layouts
Arrays
Parameters
Grids
Calculations
Routines from other field modules
Note that this advances phi for the electrostatic, fluxtube case.
If electromagnetic effects are included then phi will be advanced below
First gyroaverage the distribution function g at each phase space location
and store this as g_scratch =
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | dimension(:, :, -nzgrid:, :, vmu_lo%llim_proc:) | :: | g | ||
complex, | intent(out), | dimension(:, :, -nzgrid:, :) | :: | phi | ||
complex, | intent(out), | dimension(:, :, -nzgrid:, :) | :: | apar | ||
complex, | intent(out), | dimension(:, :, -nzgrid:, :) | :: | bpar | ||
character(len=*), | intent(in) | :: | dist | |||
logical, | intent(in), | optional | :: | skip_fsa |
If we are parallelising over (kx,ky,z) then this subroutine is called
This is the less common version used compared with parallelising over
(vpa, mu). This is NOT the default routine for stella, and the flag
Layouts
Arrays
Parameters
Grids
Calculations
Routines from other field modules
Note that this advances phi for the electrostatic, fluxtube case.
If electromagnetic effects are included then phi will be advanced below
First gyroaverage the distribution function g at each phase space location
and store this as g0 =
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | dimension(:, :, kxkyz_lo%llim_proc:) | :: | g | ||
complex, | intent(inout), | dimension(:, :, -nzgrid:, :) | :: | phi | ||
complex, | intent(inout), | dimension(:, :, -nzgrid:, :) | :: | apar | ||
complex, | intent(inout), | dimension(:, :, -nzgrid:, :) | :: | bpar | ||
character(len=*), | intent(in) | :: | dist | |||
logical, | intent(in), | optional | :: | skip_fsa |
This calls the appropriate routines needed to advance phi in the main code when using fluxtube stella, depending on the distribution (i.e. if the information is parallelised over (kx,ky,z) or (vpa,mu) ). Note that Apar and Bpar are only advanced when using EM so these are in fields_electromagnetic.fpp
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | 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 | ||
character(len=*), | intent(in) | :: | dist | |||
logical, | intent(in), | optional | :: | skip_fsa |
If we are parallelising over (vpa,mu) then this subroutine is called This is the more common version used compared with parallelising over (kx,ky,z) and is the default for stella. Here we calculate: sum_s int dv (J0 * g) and then call get_phi which divides this by the appropriate gamtot factor TODO-GA: remove apar from this and make it only needed for EM stella
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | dimension(:, :, -nzgrid:, :, vmu_lo%llim_proc:) | :: | g | ||
complex, | intent(out), | dimension(:, :, -nzgrid:, :) | :: | phi | ||
complex, | intent(out), | dimension(:, :, -nzgrid:, :) | :: | apar | ||
complex, | intent(out), | dimension(:, :, -nzgrid:, :) | :: | bpar | ||
character(len=*), | intent(in) | :: | dist | |||
logical, | intent(in), | optional | :: | skip_fsa |
If we are parallelising over (kx,ky,z) then this subroutine is called
This is the less common version used compared with parallelising over
(vpa, mu). This is NOT the default routine for stella, and the flag
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | dimension(:, :, kxkyz_lo%llim_proc:) | :: | g | ||
complex, | intent(inout), | dimension(:, :, -nzgrid:, :) | :: | phi | ||
complex, | intent(inout), | dimension(:, :, -nzgrid:, :) | :: | apar | ||
complex, | intent(inout), | dimension(:, :, -nzgrid:, :) | :: | bpar | ||
character(len=*), | intent(in) | :: | dist | |||
logical, | intent(in), | optional | :: | skip_fsa |
The 'phi' variable passed in is: sum_s int dv (J0 * g) This routine divides by the appropriate gamtot factor depending on if we have kinetic or adiabatic electrons, and also on whether we are using 'g' or 'h' as our distribution function that we are evolving. Note that this routine is only called in the Electrostatic, Fluxtube case.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(inout), | dimension(:, :, -nzgrid:, :) | :: | phi | ||
character(len=*), | intent(in) | :: | dist | |||
logical, | intent(in), | optional | :: | skip_fsa |
Initialise arrays that are needed during the main time advance loop in the field solve for the flux tube simulations only These are initialised once and then used throughout the rest of the simulation gamtot = 1 - gamma0 = Z^2*n/T * int e^(-v^2) * (1 - J0^2) dv If using adiabatic electrons then this factor is modified and we use gamtot3 which includes the Boltmann response