XGC1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Macros | Functions/Subroutines
charge.F90 File Reference
#include "t_coeff_mod_macro.h"
Include dependency graph for charge.F90:

Macros

#define OMP_ATOMIC
 

Functions/Subroutines

subroutine chargee (grid, psn, sp)
 Driver routine for electron charge deposition on CPU Calls several subroutines (search, weight update, scatter...). More...
 
subroutine chargee_scatter (grid, psn, sp)
 Electron scatter operation Evaluates raw electron density and paralel flow/current. This routine does not gather the density and flow data from all MPI ranks on a poloidal plane. This is done in chargee_mpi_sum. More...
 
subroutine update_elec_weight (grid, psn, sp)
 Update electron weight from change of background distribution function along the collisionless particle trajectory. More...
 
subroutine chargee_search_index (grid, psn, sp)
 Electron particle search routine. Loops over particles to identify in which triangle of the mesh they are. More...
 
subroutine chargee_mpisum (grid, psn)
 Gathers data from the electron scatter operation to obtain the electron density/flow on a full poloidal plane. More...
 
subroutine init_ff (grid, psn)
 Initialize the field-aligned mapping between adjacent planes. The routine traces magnetic field lines from each vertex of a plane in both toroidal directions to the adjacent mid-planes and full-step planes, records the triangle in which the field line intersects these planes and the corresponding interpolation weights. More...
 
subroutine cnvt_grid_ff2real (grid, tr, p, var_ff, var_real)
 Coordinate conversion from field following representation (two points on adjacent planes connected by a magnetic field line have the same radial-poloidal array index) to real space representation (points with the same R-Z coordinates have the same radial poloidal array index). More...
 
subroutine cnvt_grid_real2ff (grid, tr, p, var_real, var_ff)
 Coordinate conversion from real space representation (points with the same R-Z coordinates have the same radial poloidal array index) to field following representation (two points on adjacent planes connected by a magnetic field line have the same radial-poloidal array index). More...
 
subroutine bfollow_test (xp, xm, grid)
 Test of the quality of the field-alignment of the mesh (?]. More...
 
subroutine field_following_pos (x_org, phi, dir, w, delta_phi, x_dest)
 Project the input (R,phi,Z) coordinates along the magnetic field to a different toroidal angle. High-level routine. More...
 
subroutine field_following_pos2 (x_org, phi_org, phi_dest, x_dest)
 Project the input (R,phi,Z) coordinates along the magnetic field to a different toroidal angle. High-level routine. More...
 
subroutine derivs (x, phi, dx)
 
subroutine chargei (grid, psn, spall)
 Driver routine for ion charge deposition on CPU Calls several subroutines (search, weight update, scatter...). More...
 
subroutine update_ion_weight (grid, sp)
 Update ion weight from change of background distribution function along the collisionless particle trajectory. More...
 
subroutine chargei_scatter (grid, psn, sp)
 Ion scatter operation (gyroaverage-aware) Evaluates raw ion density and paralel flow/current. This routine does not gather the density and flow data from all MPI ranks on a poloidal plane. This is done in chargei_gyroavg. More...
 
subroutine chargei_search_index (grid, psn, sp)
 Ion particle search routine. Loops over particles to identify in which triangle of the mesh they are. More...
 
subroutine chargei_gyro_average (grid, psn)
 Gathers data from the ion scatter operation to obtain the electron density/flow on a full poloidal plane. This routine also includes the gyroaverage. More...
 
subroutine chargei_f0 (grid, psn)
 Calculation of the contribution of the 5D grid distribution function to the ion density. This must be called after calling update_f0_sp. The ion version of this routine is gyroaverage-aware. More...
 
subroutine chargee_f0 (grid, psn)
 Calculation of the contribution of the 5D grid distribution function to the electron density. This must be called after calling update_f0_sp. More...
 

Macro Definition Documentation

#define OMP_ATOMIC

Function/Subroutine Documentation

subroutine bfollow_test ( real (kind=8), dimension(2,grid%nnode)  xp,
real (kind=8), dimension(2,grid%nnode)  xm,
type(grid_type)  grid 
)

Test of the quality of the field-alignment of the mesh (?].

Parameters
[in]gridXGC grid data object, type(grid_type)
[in]xp(R,Z) coordinates on right plane (?], real(8)
[in]xm(R,Z) coordinates on left plane (?], real(8)

Here is the call graph for this function:

subroutine chargee ( type(grid_type), intent(in)  grid,
type(psn_type), intent(inout)  psn,
type(species_type), intent(inout)  sp 
)

Driver routine for electron charge deposition on CPU Calls several subroutines (search, weight update, scatter...).

Parameters
[in]gridXGC grid object, type(grid_type)
[in,out]psnXGC field data object, type(psn_type)
[in,out]spSpecies particle data object, type(species_type)

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine chargee_f0 ( type(grid_type)  grid,
type(psn_type)  psn 
)

Calculation of the contribution of the 5D grid distribution function to the electron density. This must be called after calling update_f0_sp.

Parameters
[in]gridXGC grid object, type(grid_type)
[in,out]psnXGC field data object, type(psn_type)

Here is the call graph for this function:

subroutine chargee_mpisum ( type(grid_type)  grid,
type(psn_type)  psn 
)

Gathers data from the electron scatter operation to obtain the electron density/flow on a full poloidal plane.

Parameters
[in]gridXGC grid object, type(grid_type)
[in,out]psnXGC field data object, type(psn_type)

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine chargee_scatter ( type(grid_type), intent(in)  grid,
type(psn_type), intent(inout)  psn,
type(species_type), intent(inout)  sp 
)

Electron scatter operation Evaluates raw electron density and paralel flow/current. This routine does not gather the density and flow data from all MPI ranks on a poloidal plane. This is done in chargee_mpi_sum.

Parameters
[in]gridXGC grid object, type(grid_type)
[in,out]psnXGC field data object, type(psn_type)
[in,out]spSpecies particle data object, type(species_type)

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine chargee_search_index ( type(grid_type)  grid,
type(psn_type), intent(inout)  psn,
type(species_type)  sp 
)

Electron particle search routine. Loops over particles to identify in which triangle of the mesh they are.

Parameters
[in]gridXGC grid object, type(grid_type)
[in,out]psnXGC field data object, type(psn_type)
[in,out]spSpecies particle data object, type(species_type)

Here is the call graph for this function:

subroutine chargei ( type(grid_type), intent(in)  grid,
type(psn_type), intent(inout)  psn,
type(species_type), dimension(0:ptl_nsp_max), intent(inout)  spall 
)

Driver routine for ion charge deposition on CPU Calls several subroutines (search, weight update, scatter...).

Parameters
[in]gridXGC grid object, type(grid_type)
[in,out]psnXGC field data object, type(psn_type)
[in,out]spSpecies particle data object, type(species_type)

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine chargei_f0 ( type(grid_type), intent(in)  grid,
type(psn_type), intent(inout)  psn 
)

Calculation of the contribution of the 5D grid distribution function to the ion density. This must be called after calling update_f0_sp. The ion version of this routine is gyroaverage-aware.

Parameters
[in]gridXGC grid object, type(grid_type)
[in,out]psnXGC field data object, type(psn_type)

Here is the call graph for this function:

subroutine chargei_gyro_average ( type(grid_type), intent(in)  grid,
type(psn_type), intent(inout)  psn 
)

Gathers data from the ion scatter operation to obtain the electron density/flow on a full poloidal plane. This routine also includes the gyroaverage.

Parameters
[in]gridXGC grid object, type(grid_type)
[in,out]psnXGC field data object, type(psn_type)

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine chargei_scatter ( type(grid_type), intent(in)  grid,
type(psn_type), intent(inout)  psn,
type(species_type)  sp 
)

Ion scatter operation (gyroaverage-aware) Evaluates raw ion density and paralel flow/current. This routine does not gather the density and flow data from all MPI ranks on a poloidal plane. This is done in chargei_gyroavg.

Parameters
[in]gridXGC grid object, type(grid_type)
[in,out]psnXGC field data object, type(psn_type)
[in,out]spSpecies particle data object, type(species_type)

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine chargei_search_index ( type(grid_type), intent(in)  grid,
type(psn_type), intent(inout)  psn,
type(species_type), intent(inout)  sp 
)

Ion particle search routine. Loops over particles to identify in which triangle of the mesh they are.

Parameters
[in]gridXGC grid object, type(grid_type)
[in,out]psnXGC field data object, type(psn_type)
[in,out]spSpecies particle data object, type(species_type)

Here is the call graph for this function:

subroutine cnvt_grid_ff2real ( type(grid_type), intent(in)  grid,
integer, dimension(grid%nnode,0:1), intent(in)  tr,
real (8), dimension(3,grid%nnode,0:1), intent(in)  p,
real (8), dimension(grid%nnode,0:1), intent(in)  var_ff,
real (8), dimension(grid%nnode,0:1), intent(out)  var_real 
)

Coordinate conversion from field following representation (two points on adjacent planes connected by a magnetic field line have the same radial-poloidal array index) to real space representation (points with the same R-Z coordinates have the same radial poloidal array index).

Parameters
[in]gridXGC grid data object, type(grid_type)
[in]trTriangle indices for transformation, integer
[in]pInterpolation weights corresponding to the triangle indices, real(8)
[in]var_ffInput data in field-aligned representation, real(8)
[out]var_realOutput data in real-space representation

Here is the caller graph for this function:

subroutine cnvt_grid_real2ff ( type(grid_type), intent(in)  grid,
integer, dimension(grid%nnode,0:1), intent(in)  tr,
real (8), dimension(3,grid%nnode,0:1), intent(in)  p,
real (8), dimension(grid%nnode,0:1), intent(in)  var_real,
real (8), dimension(grid%nnode,0:1), intent(out)  var_ff 
)

Coordinate conversion from real space representation (points with the same R-Z coordinates have the same radial poloidal array index) to field following representation (two points on adjacent planes connected by a magnetic field line have the same radial-poloidal array index).

Parameters
[in]gridXGC grid data object, type(grid_type)
[in]trTriangle indices for transformation, integer
[in]pInterpolation weights corresponding to the triangle indices, real(8)
[out]var_ffOutput data in field-aligned representation, real(8)
[in]var_realInput data in real-space representation

Here is the caller graph for this function:

subroutine field_following_pos2::derivs ( real (8), dimension(2), intent(in)  x,
real (8), intent(in)  phi,
real (8), dimension(2), intent(out)  dx 
)

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine field_following_pos ( real (kind=8), dimension(2), intent(in)  x_org,
real (kind=8), intent(in)  phi,
integer, intent(in)  dir,
real (kind=8), intent(in)  w,
real (kind=8), intent(in)  delta_phi,
real (kind=8), dimension(2), intent(out)  x_dest 
)

Project the input (R,phi,Z) coordinates along the magnetic field to a different toroidal angle. High-level routine.

Parameters
[in]x_orgInput (R,Z) coordinates, real(8)
[in]phiInput toroidal angle phi, real(8)
[in]dirDirection of the projection, (1) clockwise looking from above, (2) counter-clockwise, integer
[in]w???
[in]delta_phiToroidal shift, final angle is phi+dir*delta_phi, real(8)
[out]x_destProjected (R,Z) coordinates, real(8)

Here is the call graph for this function:

subroutine field_following_pos2 ( real (kind=8), dimension(2), intent(in)  x_org,
real (kind=8), intent(in)  phi_org,
real (kind=8), intent(in)  phi_dest,
real (kind=8), dimension(2), intent(out)  x_dest 
)

Project the input (R,phi,Z) coordinates along the magnetic field to a different toroidal angle. High-level routine.

Parameters
[in]x_orgInput (R,Z) coordinates, real(8)
[in]phi_orgInput toroidal angle phi, real(8)
[in]phi_destOutput toroidal angle phi, real(8)
[out]x_destProjected (R,Z) coordinates, real(8)

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine init_ff ( type(grid_type)  grid,
type(psn_type)  psn 
)

Initialize the field-aligned mapping between adjacent planes. The routine traces magnetic field lines from each vertex of a plane in both toroidal directions to the adjacent mid-planes and full-step planes, records the triangle in which the field line intersects these planes and the corresponding interpolation weights.

Parameters
[in]gridXGC grid object, type(grid_type)
[out]psnXGC field data object, type(psn_type)

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine update_elec_weight ( type(grid_type), intent(in)  grid,
type(psn_type), intent(in)  psn,
type(species_type), intent(inout)  sp 
)

Update electron weight from change of background distribution function along the collisionless particle trajectory.

Parameters
[in]gridXGC grid object, type(grid_type)
[in]psnXGC field data object, type(psn_type)
[in,out]spSpecies particle data object, type(species_type)

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine update_ion_weight ( type(grid_type)  grid,
type(species_type)  sp 
)

Update ion weight from change of background distribution function along the collisionless particle trajectory.

Parameters
[in]gridXGC grid object, type(grid_type)
[in,out]spSpecies particle data object, type(species_type)

Here is the call graph for this function:

Here is the caller graph for this function: