korc_interp Module

For a detailed documentation of the PSPLINE library we refer the user to "https://w3.pppl.gov/ntcc/PSPLINE/".


Uses

  • module~~korc_interp~~UsesGraph module~korc_interp korc_interp module~korc_hpc korc_hpc module~korc_interp->module~korc_hpc EZspline_obj EZspline_obj module~korc_interp->EZspline_obj module~korc_rnd_numbers korc_rnd_numbers module~korc_interp->module~korc_rnd_numbers module~korc_fio korc_fio module~korc_interp->module~korc_fio EZspline EZspline module~korc_interp->EZspline module~korc_coords korc_coords module~korc_interp->module~korc_coords module~korc_types korc_types module~korc_interp->module~korc_types module~korc_hpc->module~korc_types omp_lib omp_lib module~korc_hpc->omp_lib mpi mpi module~korc_hpc->mpi module~korc_rnd_numbers->module~korc_types ifport ifport module~korc_rnd_numbers->ifport module~korc_fio->module~korc_types iso_c_binding iso_c_binding module~korc_fio->iso_c_binding module~korc_input korc_input module~korc_fio->module~korc_input module~korc_fio->mpi module~korc_hdf5 korc_HDF5 module~korc_fio->module~korc_hdf5 module~korc_coords->module~korc_types module~korc_constants korc_constants module~korc_coords->module~korc_constants module~korc_types->iso_c_binding module~korc_input->module~korc_hpc module~korc_input->module~korc_types module~korc_constants->module~korc_types module~korc_hdf5->module~korc_hpc module~korc_hdf5->module~korc_types module~korc_hdf5->module~korc_constants HDF5 HDF5 module~korc_hdf5->HDF5

Used by

  • module~~korc_interp~~UsedByGraph module~korc_interp korc_interp program~main main program~main->module~korc_interp module~korc_profiles korc_profiles program~main->module~korc_profiles module~korc_collisions korc_collisions program~main->module~korc_collisions module~korc_fields korc_fields program~main->module~korc_fields module~korc_ppusher korc_ppusher program~main->module~korc_ppusher module~korc_initialize korc_initialize program~main->module~korc_initialize module~korc_finalize korc_finalize program~main->module~korc_finalize module~korc_profiles->module~korc_interp module~korc_collisions->module~korc_interp module~korc_collisions->module~korc_profiles module~korc_collisions->module~korc_fields module~korc_experimental_pdf korc_experimental_pdf module~korc_experimental_pdf->module~korc_interp module~korc_experimental_pdf->module~korc_fields module~korc_fields->module~korc_interp module~korc_ppusher->module~korc_interp module~korc_ppusher->module~korc_profiles module~korc_ppusher->module~korc_collisions module~korc_ppusher->module~korc_fields module~korc_initialize->module~korc_fields module~korc_spatial_distribution korc_spatial_distribution module~korc_initialize->module~korc_spatial_distribution module~korc_velocity_distribution korc_velocity_distribution module~korc_initialize->module~korc_velocity_distribution module~korc_avalanche korc_avalanche module~korc_avalanche->module~korc_profiles module~korc_avalanche->module~korc_fields module~korc_spatial_distribution->module~korc_profiles module~korc_spatial_distribution->module~korc_experimental_pdf module~korc_spatial_distribution->module~korc_fields module~korc_spatial_distribution->module~korc_avalanche module~korc_velocity_distribution->module~korc_experimental_pdf module~korc_velocity_distribution->module~korc_fields module~korc_velocity_distribution->module~korc_avalanche module~korc_finalize->module~korc_profiles module~korc_finalize->module~korc_fields

Contents


Variables

TypeVisibility AttributesNameInitial
type(KORC_2D_FIELDS_INTERPOLANT), private :: bfield_2d

An instance of KORC_2D_FIELDS_INTERPOLANT for interpolating the magnetic field.

type(KORC_3D_FIELDS_INTERPOLANT), private :: bfield_3d

An instance of KORC_3D_FIELDS_INTERPOLANT for interpolating the magnetic field.

type(KORC_2D_FIELDS_INTERPOLANT), private :: b1Refield_2d
type(KORC_2D_FIELDS_INTERPOLANT), private :: b1Imfield_2d
type(KORC_2DX_FIELDS_INTERPOLANT), private :: b1Refield_2dx
type(KORC_2DX_FIELDS_INTERPOLANT), private :: b1Imfield_2dx
type(KORC_2DX_FIELDS_INTERPOLANT), private :: e1Refield_2dx
type(KORC_2DX_FIELDS_INTERPOLANT), private :: e1Imfield_2dx
type(KORC_2X1T_FIELDS_INTERPOLANT), private :: bfield_2X1T
type(KORC_2D_FIELDS_INTERPOLANT), private :: dbdR_2d
type(KORC_2D_FIELDS_INTERPOLANT), private :: dbdPHI_2d
type(KORC_2D_FIELDS_INTERPOLANT), private :: dbdZ_2d

An instance of KORC_2D_FIELDS_INTERPOLANT for interpolating the magnetic field.

type(KORC_3D_FIELDS_INTERPOLANT), private :: dbdR_3d
type(KORC_3D_FIELDS_INTERPOLANT), private :: dbdPHI_3d
type(KORC_3D_FIELDS_INTERPOLANT), private :: dbdZ_3d

An instance of KORC_3D_FIELDS_INTERPOLANT for interpolating the magnetic field.

type(KORC_2D_FIELDS_INTERPOLANT), private :: efield_2d

An instance of KORC_2D_FIELDS_INTERPOLANT for interpolating the electric field.

type(KORC_3D_FIELDS_INTERPOLANT), private :: efield_3d

An instance of KORC_3D_FIELDS_INTERPOLANT for interpolating the electric field.

type(KORC_1D_FIELDS_INTERPOLANT), private :: efield_SC1d

An instance of KORC_1D_FIELDS_INTERPOLANT for interpolating the self-consistent electric field.

type(KORC_2D_FIELDS_INTERPOLANT), private :: gradB_2d

An instance of KORC_2D_FIELDS_INTERPOLANT for interpolating the magnetic field.

type(KORC_2D_FIELDS_INTERPOLANT), private :: curlb_2d

An instance of KORC_2D_FIELDS_INTERPOLANT for interpolating the magnetic field.

type(KORC_3D_FIELDS_INTERPOLANT), private :: gradB_3d

An instance of KORC_2D_FIELDS_INTERPOLANT for interpolating the magnetic field.

type(KORC_3D_FIELDS_INTERPOLANT), private :: curlb_3d

An instance of KORC_2D_FIELDS_INTERPOLANT for interpolating the magnetic field.

type(KORC_INTERPOLANT_DOMAIN), private :: fields_domain

An instance of KORC_INTERPOLANT_DOMAIN used for interpolating fields.

type(KORC_2D_PROFILES_INTERPOLANT), private :: profiles_2d

An instance of KORC_2D_PROFILES_INTERPOLANT for interpolating plasma profiles.

type(KORC_3D_PROFILES_INTERPOLANT), private :: profiles_3d

An instance of KORC_3D_PROFILES_INTERPOLANT for interpolating plasma profiles.

type(KORC_2D_HOLLMANN_INTERPOLANT), private :: hollmann_2d

An instance of KORC_2D_PROFILES_INTERPOLANT for interpolating plasma profiles.

type(KORC_INTERPOLANT_DOMAIN), private :: profiles_domain

An instance of KORC_INTERPOLANT_DOMAIN used for interpolating plasma profiles.

integer, public :: ezerr

Error status during PSPLINE interpolations.


Derived Types

type, private :: KORC_3D_FIELDS_INTERPOLANT

Read more…

Components

TypeVisibility AttributesNameInitial
type(EZspline3), public :: A

Interpolant of a scalar field .

type(EZspline3), public :: R

Interpolant of .

type(EZspline3), public :: PHI

Interpolant of .

type(EZspline3), public :: Z

Interpolant of .

integer, public :: NR

Size of mesh containing the field data along the -axis.

integer, public :: NPHI

Size of mesh containing the field data along the -axis.

integer, public :: NZ

Size of mesh containing the field data along the -axis.

integer, public, DIMENSION(2):: BCSR =(/0, 0/)

Not-a-knot boundary condition for the interpolants at both ends of the direction.

integer, public, DIMENSION(2):: BCSPHI =(/-1, -1/)

Periodic boundary condition for the interpolants at both ends of the direction.

integer, public, DIMENSION(2):: BCSZ =(/0, 0/)

Not-a-knot boundary condition for the interpolants at both ends of the direction.

Read more…

Components

TypeVisibility AttributesNameInitial
type(EZspline3), public :: A

Interpolant of a scalar field .

type(EZspline3), public :: R

Interpolant of .

type(EZspline3), public :: T

Interpolant of .

type(EZspline3), public :: Z

Interpolant of .

integer, public :: NR

Size of mesh containing the field data along the -axis.

integer, public :: NT

Size of mesh containing the field data along the -axis.

integer, public :: NZ

Size of mesh containing the field data along the -axis.

integer, public, DIMENSION(2):: BCSR =(/0, 0/)

Not-a-knot boundary condition for the interpolants at both ends of the direction.

integer, public, DIMENSION(2):: BCST =(/0, 0/)

Periodic boundary condition for the interpolants at both ends of the direction.

integer, public, DIMENSION(2):: BCSZ =(/0, 0/)

Not-a-knot boundary condition for the interpolants at both ends of the direction.

type, private :: KORC_2DX_FIELDS_INTERPOLANT

Read more…

Components

TypeVisibility AttributesNameInitial
type(EZspline2), public :: A

Interpolant of a scalar field .

type(EZspline2), public :: X

Interpolant of .

type(EZspline2), public :: Y

Interpolant of .

type(EZspline2), public :: Z

Interpolant of .

integer, public :: NR

Size of mesh containing the field data along the -axis.

integer, public :: NZ

Size of mesh containing the field data along the -axis.

integer, public, DIMENSION(2):: BCSR =(/0, 0/)

Not-a-knot boundary condition for the interpolants at both ends of the direction.

integer, public, DIMENSION(2):: BCSZ =(/0, 0/)

Not-a-knot boundary condition for the interpolants at both ends of the direction.

type, private :: KORC_2D_FIELDS_INTERPOLANT

Read more…

Components

TypeVisibility AttributesNameInitial
type(EZspline2), public :: A

Interpolant of a scalar field .

type(EZspline2), public :: R

Interpolant of .

type(EZspline2), public :: PHI

Interpolant of .

type(EZspline2), public :: Z

Interpolant of .

integer, public :: NR

Size of mesh containing the field data along the -axis.

integer, public :: NZ

Size of mesh containing the field data along the -axis.

integer, public, DIMENSION(2):: BCSR =(/0, 0/)

Not-a-knot boundary condition for the interpolants at both ends of the direction.

integer, public, DIMENSION(2):: BCSZ =(/0, 0/)

Not-a-knot boundary condition for the interpolants at both ends of the direction.

type, private :: KORC_1D_FIELDS_INTERPOLANT

Read more…

Components

TypeVisibility AttributesNameInitial
type(EZspline1), public :: A

Interpolant of a scalar field .

type(EZspline1), public :: R

Interpolant of .

type(EZspline1), public :: PHI

Interpolant of .

type(EZspline1), public :: Z

Interpolant of .

integer, public :: Nrm

Size of mesh containing the field data along the -axis.

integer, public, DIMENSION(2):: BCSrm =(/0, 0/)

Not-a-knot boundary condition for the interpolants at both ends of the direction.

integer, public :: NPSIP

Size of mesh containing the field data along the -axis.

integer, public, DIMENSION(2):: BCSPSIP =(/0, 0/)

Not-a-knot boundary condition for the interpolants at both ends of the direction.

Read more…

Components

TypeVisibility AttributesNameInitial
type(EZspline3), public :: ne

Interpolant of background electron density .

type(EZspline3), public :: Te

Interpolant of background electron temperature .

type(EZspline3), public :: Zeff

Interpolant of effective charge number .

integer, public :: NR

Size of mesh containing the field data along the -axis.

integer, public :: NPHI

Size of mesh containing the field data along the -axis.

integer, public :: NZ

Size of mesh containing the field data along the -axis.

integer, public, DIMENSION(2):: BCSR =(/0, 0/)

Not-a-knot boundary condition for the interpolants at both ends of the direction.

integer, public, DIMENSION(2):: BCSPHI =(/-1, -1/)

Periodic boundary condition for the interpolants at both ends of the direction.

integer, public, DIMENSION(2):: BCSZ =(/0, 0/)

Not-a-knot boundary condition for the interpolants at both ends of the direction.

Read more…

Components

TypeVisibility AttributesNameInitial
type(EZspline2), public :: ne

Interpolant of background electron density .

type(EZspline2), public :: Te

Interpolant of background electron temperature .

type(EZspline2), public :: Zeff

Interpolant of effective charge number

type(EZspline2), public :: RHON
type(EZspline2), public :: nRE
type(EZspline2), public :: nAr0
type(EZspline2), public :: nAr1
type(EZspline2), public :: nAr2
type(EZspline2), public :: nAr3
type(EZspline2), public :: nD
type(EZspline2), public :: nD1
integer, public :: NR

Size of mesh containing the field data along the -axis.

integer, public :: NZ

Size of mesh containing the field data along the -axis.

integer, public, DIMENSION(2):: BCSR =(/0, 0/)

Not-a-knot boundary condition for the interpolants at both ends of the direction.

integer, public, DIMENSION(2):: BCSZ =(/0, 0/)

Not-a-knot boundary condition for the interpolants at both ends of the direction.

Read more…

Components

TypeVisibility AttributesNameInitial
type(EZspline2), public :: fRE_E
type(EZspline2), public :: fRE_pitch
integer, public :: NE

Size of mesh containing the field data along the -axis.

integer, public :: NRHO

Size of mesh containing the field data along the -axis.

integer, public, DIMENSION(2):: BCRHO =(/0, 0/)

Not-a-knot boundary condition for the interpolants at both ends of the direction.

integer, public, DIMENSION(2):: BCE =(/0, 0/)

Not-a-knot boundary condition for the interpolants at both ends of the direction.

type, private :: KORC_3D_FIELDS_INTERPOLANT

Read more…

Components

TypeVisibility AttributesNameInitial
type(EZspline3_r4), public :: R

Interpolant of .

type(EZspline3_r4), public :: PHI

Interpolant of .

type(EZspline3_r4), public :: Z

Interpolant of .

integer, public :: NR

Size of mesh containing the field data along the -axis.

integer, public :: NPHI

Size of mesh containing the field data along the -axis.

integer, public :: NZ

Size of mesh containing the field data along the -axis.

integer, public, DIMENSION(2):: BCSR =(/0, 0/)

Not-a-knot boundary condition for the interpolants at both ends of the direction.

integer, public, DIMENSION(2):: BCSPHI =(/-1, -1/)

Periodic boundary condition for the interpolants at both ends of the direction.

integer, public, DIMENSION(2):: BCSZ =(/0, 0/)

Not-a-knot boundary condition for the interpolants at both ends of the direction.

Read more…

Components

TypeVisibility AttributesNameInitial
type(EZspline3_r4), public :: R

Interpolant of .

type(EZspline3_r4), public :: T

Interpolant of .

type(EZspline3_r4), public :: Z

Interpolant of .

integer, public :: NR

Size of mesh containing the field data along the -axis.

integer, public :: NT

Size of mesh containing the field data along the -axis.

integer, public :: NZ

Size of mesh containing the field data along the -axis.

integer, public, DIMENSION(2):: BCSR =(/0, 0/)

Not-a-knot boundary condition for the interpolants at both ends of the direction.

integer, public, DIMENSION(2):: BCST =(/0, 0/)

Periodic boundary condition for the interpolants at both ends of the direction.

integer, public, DIMENSION(2):: BCSZ =(/0, 0/)

Not-a-knot boundary condition for the interpolants at both ends of the direction.

type, private :: KORC_2D_FIELDS_INTERPOLANT

Read more…

Components

TypeVisibility AttributesNameInitial
type(EZspline2_r4), public :: A

Interpolant of a scalar field .

type(EZspline2_r4), public :: R

Interpolant of .

type(EZspline2_r4), public :: PHI

Interpolant of .

type(EZspline2_r4), public :: Z

Interpolant of .

integer, public :: NR

Size of mesh containing the field data along the -axis.

integer, public :: NZ

Size of mesh containing the field data along the -axis.

integer, public, DIMENSION(2):: BCSR =(/0, 0/)

Not-a-knot boundary condition for the interpolants at both ends of the direction.

integer, public, DIMENSION(2):: BCSZ =(/0, 0/)

Not-a-knot boundary condition for the interpolants at both ends of the direction.

type, private :: KORC_1D_FIELDS_INTERPOLANT

Read more…

Components

TypeVisibility AttributesNameInitial
type(EZspline1_r4), public :: A

Interpolant of a scalar field .

type(EZspline1_r4), public :: R

Interpolant of .

type(EZspline1_r4), public :: PHI

Interpolant of .

type(EZspline1_r4), public :: Z

Interpolant of .

integer, public :: Nrm

Size of mesh containing the field data along the -axis.

integer, public, DIMENSION(2):: BCSrm =(/0, 0/)

Not-a-knot boundary condition for the interpolants at both ends of the direction.

Read more…

Components

TypeVisibility AttributesNameInitial
type(EZspline3_r4), public :: ne

Interpolant of background electron density .

type(EZspline3_r4), public :: Te

Interpolant of background electron temperature .

type(EZspline3_r4), public :: Zeff

Interpolant of effective charge number .

integer, public :: NR

Size of mesh containing the field data along the -axis.

integer, public :: NPHI

Size of mesh containing the field data along the -axis.

integer, public :: NZ

Size of mesh containing the field data along the -axis.

integer, public, DIMENSION(2):: BCSR =(/0, 0/)

Not-a-knot boundary condition for the interpolants at both ends of the direction.

integer, public, DIMENSION(2):: BCSPHI =(/-1, -1/)

Periodic boundary condition for the interpolants at both ends of the direction.

integer, public, DIMENSION(2):: BCSZ =(/0, 0/)

Not-a-knot boundary condition for the interpolants at both ends of the direction.

Read more…

Components

TypeVisibility AttributesNameInitial
type(EZspline2_r4), public :: ne

Interpolant of background electron density .

type(EZspline2_r4), public :: Te

Interpolant of background electron temperature .

type(EZspline2_r4), public :: Zeff

Interpolant of effective charge number .

integer, public :: NR

Size of mesh containing the field data along the -axis.

integer, public :: NZ

Size of mesh containing the field data along the -axis.

integer, public, DIMENSION(2):: BCSR =(/0, 0/)

Not-a-knot boundary condition for the interpolants at both ends of the direction.

integer, public, DIMENSION(2):: BCSZ =(/0, 0/)

Not-a-knot boundary condition for the interpolants at both ends of the direction.

type, private :: KORC_INTERPOLANT_DOMAIN

Read more…

Components

TypeVisibility AttributesNameInitial
integer(kind=1), public, DIMENSION(:), ALLOCATABLE:: FLAG1D

2-D array with info of the spatial domain where the axisymmetric fields and plasma profiles are known.

integer(kind=1), public, DIMENSION(:,:), ALLOCATABLE:: FLAG2D

2-D array with info of the spatial domain where the axisymmetric fields and plasma profiles are known.

integer(kind=1), public, DIMENSION(:,:,:), ALLOCATABLE:: FLAG3D

3-D array with info of the spatial domain where the 3-D fields and plasma profiles are known.

integer(kind=1), public, DIMENSION(:,:), ALLOCATABLE:: LCFS2D

2-D array with info of the spatial domain where the axisymmetric fields and plasma profiles are known.

real(kind=rp), public :: Ro

Smaller radial position of the fields and profiles domain.

real(kind=rp), public :: Zo

Smaller vertical position of the fields and profiles domain

real(kind=rp), public :: To
real(kind=rp), public :: Drm
real(kind=rp), public :: DPSIP
real(kind=rp), public :: DR

Separation between grid points along the radial direction.

real(kind=rp), public :: DPHI
real(kind=rp), public :: DT
real(kind=rp), public :: DZ

Separation between grid points along the vertical direction.


Subroutines

public subroutine initialize_fields_interpolant(params, F)

Read more…

Arguments

Type IntentOptional AttributesName
type(KORC_PARAMS), intent(in) :: params

Core KORC simulation parameters.

type(FIELDS), intent(inout) :: F

An instance of KORC's derived type FIELDS containing all the information about the fields used in the simulation. See korc_types and korc_fields.

public subroutine initialize_Hollmann_interpolant(params, Nrho, NE, rho_axis, g_axis, fRE_E, fRE_pitch)

Read more…

Arguments

Type IntentOptional AttributesName
type(KORC_PARAMS), intent(in) :: params

Core KORC simulation parameters.

integer, intent(in) :: Nrho
integer, intent(in) :: NE
real(kind=rp), intent(in), DIMENSION(Nrho):: rho_axis
real(kind=rp), intent(in), DIMENSION(NE):: g_axis
real(kind=rp), intent(in), DIMENSION(Nrho,NE):: fRE_E
real(kind=rp), intent(in), DIMENSION(Nrho,NE):: fRE_pitch

public subroutine initialize_SC1D_field_interpolant(params, F)

Read more…

Arguments

Type IntentOptional AttributesName
type(KORC_PARAMS), intent(in) :: params

Core KORC simulation parameters.

type(FIELDS), intent(in) :: F

An instance of KORC's derived type FIELDS containing all the information about the fields used in the simulation. See korc_types and korc_fields.

public subroutine initialize_SC1D_field_interpolant_FS(params, F)

Read more…

Arguments

Type IntentOptional AttributesName
type(KORC_PARAMS), intent(in) :: params

Core KORC simulation parameters.

type(FIELDS), intent(in) :: F

An instance of KORC's derived type FIELDS containing all the information about the fields used in the simulation. See korc_types and korc_fields.

private subroutine check_if_in_fields_domain(F, Y, flag)

Read more…

Arguments

Type IntentOptional AttributesName
type(FIELDS), intent(in) :: F
real(kind=rp), intent(in), DIMENSION(:,:), ALLOCATABLE:: Y

Particles' position in cylindrical coordinates, Y(1,:) = , Y(2,:) = , and Y(3,:) = .

integer(kind=is), intent(inout), DIMENSION(:), ALLOCATABLE:: flag

Flag that determines whether particles are followed in the simulation (flag=1), or not (flag=0).

private subroutine check_if_in_fields_domain_p(pchunk, F, Y_R, Y_PHI, Y_Z, flag)

Read more…

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: pchunk
type(FIELDS), intent(in) :: F
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_R
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_PHI
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_Z
integer(kind=is), intent(inout), DIMENSION(pchunk):: flag

Flag that determines whether particles are followed in the simulation (flag=1), or not (flag=0).

private subroutine check_if_in_LCFS(F, Y, inLCFS)

Read more…

Arguments

Type IntentOptional AttributesName
type(FIELDS), intent(in) :: F
real(kind=rp), intent(in), DIMENSION(:,:), ALLOCATABLE:: Y

Particles' position in cylindrical coordinates, Y(1,:) = , Y(2,:) = , and Y(3,:) = .

integer(kind=is), intent(inout), DIMENSION(:), ALLOCATABLE:: inLCFS

Flag that determines whether particles are followed in the simulation (flag=1), or not (flag=0).

public subroutine initialize_profiles_interpolant(params, P)

Read more…

Arguments

Type IntentOptional AttributesName
type(KORC_PARAMS), intent(in) :: params

Core KORC simulation parameters.

type(PROFILES), intent(inout) :: P

An instance of KORC's derived type PROFILES containing all the information about the plasma profiles used in the simulation. See korc_types and korc_profiles.

private subroutine check_if_in_profiles_domain(Y, flag)

Read more…

Arguments

Type IntentOptional AttributesName
real(kind=rp), intent(in), DIMENSION(:,:), ALLOCATABLE:: Y

Particles' position in cylindrical coordinates, Y(1,:) = , Y(2,:) = , and Y(3,:) = .

integer(kind=is), intent(inout), DIMENSION(:), ALLOCATABLE:: flag

Flag that determines whether particles are followed in the simulation (flag=1), or not (flag=0).

private subroutine check_if_in_profiles_domain_p(pchunk, Y_R, Y_PHI, Y_Z, flag)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: pchunk
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_R
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_PHI
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_Z
integer(kind=is), intent(inout), DIMENSION(pchunk):: flag

Flag that determines whether particles are followed in the simulation (flag=1), or not (flag=0).

private subroutine interp_2D_bfields(params, Y, B, flag)

Read more…

Arguments

Type IntentOptional AttributesName
type(KORC_PARAMS), intent(in) :: params

Core KORC simulation parameters.

real(kind=rp), intent(in), DIMENSION(:,:), ALLOCATABLE:: Y

Particles' position in cylindrical coordinates, Y(1,:) = , Y(2,:) = , and Y(3,:) = .

real(kind=rp), intent(inout), DIMENSION(:,:), ALLOCATABLE:: B

Cartesian components of interpolated magnetic field components. B(1,:)=, B(2,:)=, and B(3,:)=.

integer(kind=is), intent(inout), DIMENSION(:), ALLOCATABLE:: flag

Flag that indicates whether particles are followed in the simulation (flag=1), or not (flag=0).

private subroutine gradient_2D_Bfields(Y, BR, BPHI, BZ, flag)

Read more…

Arguments

Type IntentOptional AttributesName
real(kind=rp), intent(in), DIMENSION(:,:), ALLOCATABLE:: Y

Particles' position in cylindrical coordinates, Y(1,:) = , Y(2,:) = , and Y(3,:) = .

real(kind=rp), intent(inout), DIMENSION(:,:), ALLOCATABLE:: BR

Cylindrical components of gradient of R-component of magnetic field.

real(kind=rp), intent(inout), DIMENSION(:,:), ALLOCATABLE:: BPHI

Cylindrical components of gradient of R-component of magnetic field.

real(kind=rp), intent(inout), DIMENSION(:,:), ALLOCATABLE:: BZ

Cylindrical components of gradient of R-component of magnetic field.

integer(kind=is), intent(inout), DIMENSION(:), ALLOCATABLE:: flag

Flag that indicates whether particles are followed in the simulation (flag=1), or not (flag=0).

private subroutine interp_2D_gradBfields(Y, gradB, flag)

Read more…

Arguments

Type IntentOptional AttributesName
real(kind=rp), intent(in), DIMENSION(:,:), ALLOCATABLE:: Y

Particles' position in cylindrical coordinates, Y(1,:) = , Y(2,:) = , and Y(3,:) = .

real(kind=rp), intent(inout), DIMENSION(:,:), ALLOCATABLE:: gradB

Cylindirical components of interpolated gradient of magnitude of magnetic field.

integer(kind=is), intent(inout), DIMENSION(:), ALLOCATABLE:: flag

Flag that indicates whether particles are followed in the simulation (flag=1), or not (flag=0).

private subroutine interp_2D_curlbfields(Y, curlb, flag)

Read more…

Arguments

Type IntentOptional AttributesName
real(kind=rp), intent(in), DIMENSION(:,:), ALLOCATABLE:: Y

Particles' position in cylindrical coordinates, Y(1,:) = , Y(2,:) = , and Y(3,:) = .

real(kind=rp), intent(inout), DIMENSION(:,:), ALLOCATABLE:: curlb

Cylindirical components of interpolated curl of direction of magnetic field.

integer(kind=is), intent(inout), DIMENSION(:), ALLOCATABLE:: flag

Flag that indicates whether particles are followed in the simulation (flag=1), or not (flag=0).

public subroutine interp_FOfields_p(pchunk, F, Y_R, Y_PHI, Y_Z, B_X, B_Y, B_Z, E_X, E_Y, E_Z, PSIp, flag_cache)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: pchunk
type(FIELDS), intent(in) :: F
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_R
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_PHI
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: B_X
real(kind=rp), intent(out), DIMENSION(pchunk):: B_Y
real(kind=rp), intent(out), DIMENSION(pchunk):: B_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: E_X
real(kind=rp), intent(out), DIMENSION(pchunk):: E_Y
real(kind=rp), intent(out), DIMENSION(pchunk):: E_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: PSIp
integer(kind=is), intent(inout), DIMENSION(pchunk):: flag_cache

public subroutine interp_FO3Dfields_p(pchunk, F, Y_R, Y_PHI, Y_Z, B_X, B_Y, B_Z, E_X, E_Y, E_Z, flag_cache)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: pchunk
type(FIELDS), intent(in) :: F
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_R
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_PHI
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: B_X
real(kind=rp), intent(out), DIMENSION(pchunk):: B_Y
real(kind=rp), intent(out), DIMENSION(pchunk):: B_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: E_X
real(kind=rp), intent(out), DIMENSION(pchunk):: E_Y
real(kind=rp), intent(out), DIMENSION(pchunk):: E_Z
integer(kind=is), intent(inout), DIMENSION(pchunk):: flag_cache

public subroutine interp_FOfields1_p(pchunk, F, Y_R, Y_PHI, Y_Z, B_X, B_Y, B_Z, E_X, E_Y, E_Z, PSIp, flag_cache)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: pchunk
type(FIELDS), intent(in) :: F
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_R
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_PHI
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: B_X
real(kind=rp), intent(out), DIMENSION(pchunk):: B_Y
real(kind=rp), intent(out), DIMENSION(pchunk):: B_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: E_X
real(kind=rp), intent(out), DIMENSION(pchunk):: E_Y
real(kind=rp), intent(out), DIMENSION(pchunk):: E_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: PSIp
integer(kind=is), intent(inout), DIMENSION(pchunk):: flag_cache

public subroutine interp_FOfields_mars(prtcls, F, params)

Arguments

Type IntentOptional AttributesName
type(PARTICLES), intent(inout) :: prtcls
type(FIELDS), intent(in) :: F
type(KORC_PARAMS), intent(in) :: params

public subroutine interp_FOfields_mars_p(params, pchunk, F, Y_R, Y_PHI, Y_Z, B_X, B_Y, B_Z, PSIp, flag_cache)

Arguments

Type IntentOptional AttributesName
type(KORC_PARAMS), intent(in) :: params
integer, intent(in) :: pchunk
type(FIELDS), intent(in) :: F
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_R
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_PHI
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: B_X
real(kind=rp), intent(out), DIMENSION(pchunk):: B_Y
real(kind=rp), intent(out), DIMENSION(pchunk):: B_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: PSIp
integer(kind=is), intent(inout), DIMENSION(pchunk):: flag_cache

public subroutine interp_FOfields_aorsa(prtcls, F, params)

Arguments

Type IntentOptional AttributesName
type(PARTICLES), intent(inout) :: prtcls
type(FIELDS), intent(in) :: F
type(KORC_PARAMS), intent(in) :: params

public subroutine interp_FOfields_aorsa_p(time, params, pchunk, F, Y_R, Y_PHI, Y_Z, B_X, B_Y, B_Z, E_X, E_Y, E_Z, PSIp, flag_cache)

Arguments

Type IntentOptional AttributesName
real(kind=rp), intent(in) :: time
type(KORC_PARAMS), intent(in) :: params
integer, intent(in) :: pchunk
type(FIELDS), intent(in) :: F
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_R
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_PHI
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: B_X
real(kind=rp), intent(out), DIMENSION(pchunk):: B_Y
real(kind=rp), intent(out), DIMENSION(pchunk):: B_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: E_X
real(kind=rp), intent(out), DIMENSION(pchunk):: E_Y
real(kind=rp), intent(out), DIMENSION(pchunk):: E_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: PSIp
integer(kind=is), intent(inout), DIMENSION(pchunk):: flag_cache

public subroutine interp_FOcollision_p(pchunk, Y_R, Y_PHI, Y_Z, ne, Te, Zeff, flag_cache)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: pchunk
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_R
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_PHI
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: ne
real(kind=rp), intent(out), DIMENSION(pchunk):: Te
real(kind=rp), intent(out), DIMENSION(pchunk):: Zeff
integer(kind=is), intent(inout), DIMENSION(pchunk):: flag_cache

public subroutine interp_fields_p(pchunk, F, Y_R, Y_PHI, Y_Z, B_R, B_PHI, B_Z, E_R, E_PHI, E_Z, curlB_R, curlB_PHI, curlB_Z, gradB_R, gradB_PHI, gradB_Z, flag_cache)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: pchunk
type(FIELDS), intent(in) :: F
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_R
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_PHI
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: B_R
real(kind=rp), intent(out), DIMENSION(pchunk):: B_PHI
real(kind=rp), intent(out), DIMENSION(pchunk):: B_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: E_R
real(kind=rp), intent(out), DIMENSION(pchunk):: E_PHI
real(kind=rp), intent(out), DIMENSION(pchunk):: E_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: curlB_R
real(kind=rp), intent(out), DIMENSION(pchunk):: curlB_PHI
real(kind=rp), intent(out), DIMENSION(pchunk):: curlB_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: gradB_R
real(kind=rp), intent(out), DIMENSION(pchunk):: gradB_PHI
real(kind=rp), intent(out), DIMENSION(pchunk):: gradB_Z
integer(kind=is), intent(inout), DIMENSION(pchunk):: flag_cache

public subroutine interp_fields_3D_p(pchunk, F, Y_R, Y_PHI, Y_Z, B_R, B_PHI, B_Z, E_R, E_PHI, E_Z, curlB_R, curlB_PHI, curlB_Z, gradB_R, gradB_PHI, gradB_Z, flag_cache)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: pchunk
type(FIELDS), intent(in) :: F
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_R
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_PHI
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: B_R
real(kind=rp), intent(out), DIMENSION(pchunk):: B_PHI
real(kind=rp), intent(out), DIMENSION(pchunk):: B_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: E_R
real(kind=rp), intent(out), DIMENSION(pchunk):: E_PHI
real(kind=rp), intent(out), DIMENSION(pchunk):: E_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: curlB_R
real(kind=rp), intent(out), DIMENSION(pchunk):: curlB_PHI
real(kind=rp), intent(out), DIMENSION(pchunk):: curlB_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: gradB_R
real(kind=rp), intent(out), DIMENSION(pchunk):: gradB_PHI
real(kind=rp), intent(out), DIMENSION(pchunk):: gradB_Z
integer(kind=is), intent(inout), DIMENSION(pchunk):: flag_cache

public subroutine interp_collision_p(pchunk, Y_R, Y_PHI, Y_Z, B_R, B_PHI, B_Z, E_R, E_PHI, E_Z, ne, Te, Zeff, flag_cache)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: pchunk
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_R
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_PHI
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: B_R
real(kind=rp), intent(out), DIMENSION(pchunk):: B_PHI
real(kind=rp), intent(out), DIMENSION(pchunk):: B_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: E_R
real(kind=rp), intent(out), DIMENSION(pchunk):: E_PHI
real(kind=rp), intent(out), DIMENSION(pchunk):: E_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: ne
real(kind=rp), intent(out), DIMENSION(pchunk):: Te
real(kind=rp), intent(out), DIMENSION(pchunk):: Zeff
integer(kind=is), intent(inout), DIMENSION(pchunk):: flag_cache

public subroutine interp_bmag_p(pchunk, Y_R, Y_PHI, Y_Z, B_R, B_PHI, B_Z)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: pchunk
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_R
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_PHI
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: B_R
real(kind=rp), intent(out), DIMENSION(pchunk):: B_PHI
real(kind=rp), intent(out), DIMENSION(pchunk):: B_Z

private subroutine interp_3D_bfields(params, Y, B, flag)

@brief Subroutine for interpolating the pre-computed, 3-D magnetic field to the particles' position.

Read more…

Arguments

Type IntentOptional AttributesName
type(KORC_PARAMS), intent(in) :: params
real(kind=rp), intent(in), DIMENSION(:,:), ALLOCATABLE:: Y
real(kind=rp), intent(inout), DIMENSION(:,:), ALLOCATABLE:: B
integer(kind=is), intent(inout), DIMENSION(:), ALLOCATABLE:: flag

public subroutine calculate_magnetic_field(params, Y, F, B, E, PSI_P, flag)

@brief Subroutine that calculates the axisymmetric magnetic field to the particles' position using the poloidal magnetic flux. @details When the poloidal magnetic flux is used in a KORC simulation, the magnetic field components are calculated as it follows:

Read more…

Arguments

Type IntentOptional AttributesName
type(KORC_PARAMS), intent(in) :: params
real(kind=rp), intent(in), DIMENSION(:,:), ALLOCATABLE:: Y
type(FIELDS), intent(in) :: F
real(kind=rp), intent(inout), DIMENSION(:,:), ALLOCATABLE:: B
real(kind=rp), intent(inout), DIMENSION(:,:), ALLOCATABLE:: E
real(kind=rp), intent(inout), DIMENSION(:), ALLOCATABLE:: PSI_P
integer(kind=is), intent(inout), DIMENSION(:), ALLOCATABLE:: flag

public subroutine calculate_magnetic_field_p(pchunk, F, Y_R, Y_Z, B_R, B_PHI, B_Z)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: pchunk
type(FIELDS), intent(in) :: F
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_R
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: B_R
real(kind=rp), intent(out), DIMENSION(pchunk):: B_PHI
real(kind=rp), intent(out), DIMENSION(pchunk):: B_Z

public subroutine calculate_2DBdBfields_p(pchunk, F, Y_R, Y_PHI, Y_Z, B_R, B_PHI, B_Z, E_R, E_PHI, E_Z, curlb_R, curlb_PHI, curlb_Z, gradB_R, gradB_PHI, gradB_Z, flag_cache, PSIp)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: pchunk
type(FIELDS), intent(in) :: F
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_R
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_PHI
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: B_R
real(kind=rp), intent(out), DIMENSION(pchunk):: B_PHI
real(kind=rp), intent(out), DIMENSION(pchunk):: B_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: E_R
real(kind=rp), intent(out), DIMENSION(pchunk):: E_PHI
real(kind=rp), intent(out), DIMENSION(pchunk):: E_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: curlb_R
real(kind=rp), intent(out), DIMENSION(pchunk):: curlb_PHI
real(kind=rp), intent(out), DIMENSION(pchunk):: curlb_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: gradB_R
real(kind=rp), intent(out), DIMENSION(pchunk):: gradB_PHI
real(kind=rp), intent(out), DIMENSION(pchunk):: gradB_Z
integer(kind=is), intent(inout), DIMENSION(pchunk):: flag_cache
real(kind=rp), intent(out), DIMENSION(pchunk):: PSIp

public subroutine calculate_3DBdBfields_p(pchunk, F, Y_R, Y_PHI, Y_Z, B_R, B_PHI, B_Z, E_R, E_PHI, E_Z, curlb_R, curlb_PHI, curlb_Z, gradB_R, gradB_PHI, gradB_Z, flag_cache)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: pchunk
type(FIELDS), intent(in) :: F
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_R
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_PHI
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: B_R
real(kind=rp), intent(out), DIMENSION(pchunk):: B_PHI
real(kind=rp), intent(out), DIMENSION(pchunk):: B_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: E_R
real(kind=rp), intent(out), DIMENSION(pchunk):: E_PHI
real(kind=rp), intent(out), DIMENSION(pchunk):: E_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: curlb_R
real(kind=rp), intent(out), DIMENSION(pchunk):: curlb_PHI
real(kind=rp), intent(out), DIMENSION(pchunk):: curlb_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: gradB_R
real(kind=rp), intent(out), DIMENSION(pchunk):: gradB_PHI
real(kind=rp), intent(out), DIMENSION(pchunk):: gradB_Z
integer(kind=is), intent(inout), DIMENSION(pchunk):: flag_cache

public subroutine calculate_3DBdBfields1_p(pchunk, F, Y_R, Y_PHI, Y_Z, B_R, B_PHI, B_Z, E_R, E_PHI, E_Z, curlb_R, curlb_PHI, curlb_Z, gradB_R, gradB_PHI, gradB_Z, flag_cache, PSIp)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: pchunk
type(FIELDS), intent(in) :: F
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_R
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_PHI
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: B_R
real(kind=rp), intent(out), DIMENSION(pchunk):: B_PHI
real(kind=rp), intent(out), DIMENSION(pchunk):: B_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: E_R
real(kind=rp), intent(out), DIMENSION(pchunk):: E_PHI
real(kind=rp), intent(out), DIMENSION(pchunk):: E_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: curlb_R
real(kind=rp), intent(out), DIMENSION(pchunk):: curlb_PHI
real(kind=rp), intent(out), DIMENSION(pchunk):: curlb_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: gradB_R
real(kind=rp), intent(out), DIMENSION(pchunk):: gradB_PHI
real(kind=rp), intent(out), DIMENSION(pchunk):: gradB_Z
integer(kind=is), intent(inout), DIMENSION(pchunk):: flag_cache
real(kind=rp), intent(out), DIMENSION(pchunk):: PSIp

public subroutine calculate_GCfieldswE_p(pchunk, F, Y_R, Y_PHI, Y_Z, B_R, B_PHI, B_Z, E_R, E_PHI, E_Z, curlb_R, curlb_PHI, curlb_Z, gradB_R, gradB_PHI, gradB_Z, flag_cache, PSIp)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: pchunk
type(FIELDS), intent(in) :: F
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_R
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_PHI
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: B_R
real(kind=rp), intent(out), DIMENSION(pchunk):: B_PHI
real(kind=rp), intent(out), DIMENSION(pchunk):: B_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: E_R
real(kind=rp), intent(out), DIMENSION(pchunk):: E_PHI
real(kind=rp), intent(out), DIMENSION(pchunk):: E_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: curlb_R
real(kind=rp), intent(out), DIMENSION(pchunk):: curlb_PHI
real(kind=rp), intent(out), DIMENSION(pchunk):: curlb_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: gradB_R
real(kind=rp), intent(out), DIMENSION(pchunk):: gradB_PHI
real(kind=rp), intent(out), DIMENSION(pchunk):: gradB_Z
integer(kind=is), intent(inout), DIMENSION(pchunk):: flag_cache
real(kind=rp), intent(out), DIMENSION(pchunk):: PSIp

public subroutine calculate_GCfields_p(pchunk, F, Y_R, Y_PHI, Y_Z, B_R, B_PHI, B_Z, E_R, E_PHI, E_Z, curlb_R, curlb_PHI, curlb_Z, gradB_R, gradB_PHI, gradB_Z, flag_cache, PSIp)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: pchunk
type(FIELDS), intent(in) :: F
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_R
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_PHI
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: B_R
real(kind=rp), intent(out), DIMENSION(pchunk):: B_PHI
real(kind=rp), intent(out), DIMENSION(pchunk):: B_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: E_R
real(kind=rp), intent(out), DIMENSION(pchunk):: E_PHI
real(kind=rp), intent(out), DIMENSION(pchunk):: E_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: curlb_R
real(kind=rp), intent(out), DIMENSION(pchunk):: curlb_PHI
real(kind=rp), intent(out), DIMENSION(pchunk):: curlb_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: gradB_R
real(kind=rp), intent(out), DIMENSION(pchunk):: gradB_PHI
real(kind=rp), intent(out), DIMENSION(pchunk):: gradB_Z
integer(kind=is), intent(inout), DIMENSION(pchunk):: flag_cache
real(kind=rp), intent(out), DIMENSION(pchunk):: PSIp

public subroutine calculate_GCfields_2x1t_p(pchunk, F, Y_R, Y_PHI, Y_Z, B_R, B_PHI, B_Z, E_R, E_PHI, E_Z, curlb_R, curlb_PHI, curlb_Z, gradB_R, gradB_PHI, gradB_Z, flag_cache, PSIp, time)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: pchunk
type(FIELDS), intent(in) :: F
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_R
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_PHI
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: B_R
real(kind=rp), intent(out), DIMENSION(pchunk):: B_PHI
real(kind=rp), intent(out), DIMENSION(pchunk):: B_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: E_R
real(kind=rp), intent(out), DIMENSION(pchunk):: E_PHI
real(kind=rp), intent(out), DIMENSION(pchunk):: E_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: curlb_R
real(kind=rp), intent(out), DIMENSION(pchunk):: curlb_PHI
real(kind=rp), intent(out), DIMENSION(pchunk):: curlb_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: gradB_R
real(kind=rp), intent(out), DIMENSION(pchunk):: gradB_PHI
real(kind=rp), intent(out), DIMENSION(pchunk):: gradB_Z
integer(kind=is), intent(inout), DIMENSION(pchunk):: flag_cache
real(kind=rp), intent(out), DIMENSION(pchunk):: PSIp
real(kind=rp), intent(in) :: time

public subroutine calculate_GCfields_p_FS(pchunk, F, Y_R, Y_PHI, Y_Z, B_R, B_PHI, B_Z, E_R, E_PHI, E_Z, curlb_R, curlb_PHI, curlb_Z, gradB_R, gradB_PHI, gradB_Z, flag_cache, PSIp)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: pchunk
type(FIELDS), intent(in) :: F
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_R
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_PHI
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: B_R
real(kind=rp), intent(out), DIMENSION(pchunk):: B_PHI
real(kind=rp), intent(out), DIMENSION(pchunk):: B_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: E_R
real(kind=rp), intent(out), DIMENSION(pchunk):: E_PHI
real(kind=rp), intent(out), DIMENSION(pchunk):: E_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: curlb_R
real(kind=rp), intent(out), DIMENSION(pchunk):: curlb_PHI
real(kind=rp), intent(out), DIMENSION(pchunk):: curlb_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: gradB_R
real(kind=rp), intent(out), DIMENSION(pchunk):: gradB_PHI
real(kind=rp), intent(out), DIMENSION(pchunk):: gradB_Z
integer(kind=is), intent(inout), DIMENSION(pchunk):: flag_cache
real(kind=rp), intent(out), DIMENSION(pchunk):: PSIp

public subroutine add_interp_SCE_p(params, F, Y_R, Y_PHI, Y_Z, E_PHI)

Arguments

Type IntentOptional AttributesName
type(KORC_PARAMS), intent(in) :: params
type(FIELDS), intent(in) :: F
real(kind=rp), intent(in), DIMENSION(params%pchunk):: Y_R
real(kind=rp), intent(in), DIMENSION(params%pchunk):: Y_PHI
real(kind=rp), intent(in), DIMENSION(params%pchunk):: Y_Z
real(kind=rp), intent(inout), DIMENSION(params%pchunk):: E_PHI

public subroutine add_interp_SCE_p_FS(params, F, PSIp, E_PHI)

Arguments

Type IntentOptional AttributesName
type(KORC_PARAMS), intent(in) :: params
type(FIELDS), intent(in) :: F
real(kind=rp), intent(in), DIMENSION(params%pchunk):: PSIp
real(kind=rp), intent(inout), DIMENSION(params%pchunk):: E_PHI

public subroutine calculate_initial_magnetic_field(F)

Arguments

Type IntentOptional AttributesName
type(FIELDS), intent(inout) :: F

public subroutine sample_poloidal_flux(F)

Arguments

Type IntentOptional AttributesName
type(FIELDS), intent(inout) :: F

private subroutine interp_2D_efields(params, Y, E, flag)

@brief Subroutine for interpolating the pre-computed, axisymmetric electric field to the particles' position.

Read more…

Arguments

Type IntentOptional AttributesName
type(KORC_PARAMS), intent(in) :: params

Core KORC simulation parameters.

real(kind=rp), intent(in), DIMENSION(:,:), ALLOCATABLE:: Y
real(kind=rp), intent(inout), DIMENSION(:,:), ALLOCATABLE:: E
integer(kind=is), intent(inout), DIMENSION(:), ALLOCATABLE:: flag

private subroutine interp_3D_efields(params, Y, E, flag)

@brief Subroutine for interpolating the pre-computed 3-D electric field to the particles' position.

Read more…

Arguments

Type IntentOptional AttributesName
type(KORC_PARAMS), intent(in) :: params
real(kind=rp), intent(in), DIMENSION(:,:), ALLOCATABLE:: Y
real(kind=rp), intent(inout), DIMENSION(:,:), ALLOCATABLE:: E
integer(kind=is), intent(inout), DIMENSION(:), ALLOCATABLE:: flag

public subroutine interp_fields(params, prtcls, F)

Read more…

Arguments

Type IntentOptional AttributesName
type(KORC_PARAMS), intent(in) :: params

Core KORC simulation parameters.

type(PARTICLES), intent(inout) :: prtcls

An instance of PARTICLES containing the variables of a given species.

type(FIELDS), intent(in) :: F

An instance of KORC's derived type FIELDS containing all the information about the fields used in the simulation. See korc_types and korc_fields.

public subroutine interp_Hcollision_p(pchunk, Y_R, Y_PHI, Y_Z, ne, Te, Zeff, nAr0, nAr1, nAr2, nAr3, nD, nD1, flag_cache)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: pchunk
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_R
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_PHI
real(kind=rp), intent(in), DIMENSION(pchunk):: Y_Z
real(kind=rp), intent(out), DIMENSION(pchunk):: ne
real(kind=rp), intent(out), DIMENSION(pchunk):: Te
real(kind=rp), intent(out), DIMENSION(pchunk):: Zeff
real(kind=rp), intent(out), DIMENSION(pchunk):: nAr0
real(kind=rp), intent(out), DIMENSION(pchunk):: nAr1
real(kind=rp), intent(out), DIMENSION(pchunk):: nAr2
real(kind=rp), intent(out), DIMENSION(pchunk):: nAr3
real(kind=rp), intent(out), DIMENSION(pchunk):: nD
real(kind=rp), intent(out), DIMENSION(pchunk):: nD1
integer(kind=is), intent(inout), DIMENSION(pchunk):: flag_cache

public subroutine interp_nRE(params, Y_R, Y_PHI, Y_Z, PSIp, EPHI, ne, Te, nRE, nAr0, nAr1, nAr2, nAr3, nD, nD1, g_test, fRE_out, rho1D)

Arguments

Type IntentOptional AttributesName
type(KORC_PARAMS), intent(in) :: params
real(kind=rp), intent(in) :: Y_R
real(kind=rp), intent(in) :: Y_PHI
real(kind=rp), intent(in) :: Y_Z
real(kind=rp), intent(out) :: PSIp
real(kind=rp), intent(out) :: EPHI
real(kind=rp), intent(out) :: ne
real(kind=rp), intent(out) :: Te
real(kind=rp), intent(out) :: nRE
real(kind=rp), intent(out) :: nAr0
real(kind=rp), intent(out) :: nAr1
real(kind=rp), intent(out) :: nAr2
real(kind=rp), intent(out) :: nAr3
real(kind=rp), intent(out) :: nD
real(kind=rp), intent(out) :: nD1
real(kind=rp), intent(in) :: g_test
real(kind=rp), intent(out) :: fRE_out
real(kind=rp), intent(in), optional :: rho1D

private subroutine interp_2D_profiles(Y, ne, Te, Zeff, flag)

Read more…

Arguments

Type IntentOptional AttributesName
real(kind=rp), intent(in), DIMENSION(:,:), ALLOCATABLE:: Y

Particles' position in cylindrical coordinates, Y(1,:) = , Y(2,:) = , and Y(3,:) = .

real(kind=rp), intent(inout), DIMENSION(:), ALLOCATABLE:: ne

Interpolated background electron density !!.

real(kind=rp), intent(inout), DIMENSION(:), ALLOCATABLE:: Te

Interpolated background electron temperature .

real(kind=rp), intent(inout), DIMENSION(:), ALLOCATABLE:: Zeff

Interpolated effective charge number .

integer(kind=is), intent(inout), DIMENSION(:), ALLOCATABLE:: flag

Flag that indicates whether particles are followed in the simulation (flag=1), or not (flag=0).

private subroutine interp_3D_profiles(Y, ne, Te, Zeff, flag)

Read more…

Arguments

Type IntentOptional AttributesName
real(kind=rp), intent(in), DIMENSION(:,:), ALLOCATABLE:: Y

Particles' position in cylindrical coordinates, Y(1,:) = , Y(2,:) = , and Y(3,:) = .

real(kind=rp), intent(inout), DIMENSION(:), ALLOCATABLE:: ne

Interpolated background electron density .

real(kind=rp), intent(inout), DIMENSION(:), ALLOCATABLE:: Te

Interpolated background electron temperature .

real(kind=rp), intent(inout), DIMENSION(:), ALLOCATABLE:: Zeff

Interpolated effective charge number .

integer(kind=is), intent(inout), DIMENSION(:), ALLOCATABLE:: flag

Flag that indicates whether particles are followed in the simulation (flag=1), or not (flag=0).

public subroutine interp_profiles(params, prtcls, P)

Read more…

Arguments

Type IntentOptional AttributesName
type(KORC_PARAMS), intent(in) :: params

Core KORC simulation parameters.

type(PARTICLES), intent(inout) :: prtcls

An instance of PARTICLES containing the variables of a given species. Call to this subroutine generally passes spp%vars.

type(PROFILES), intent(in) :: P

An instance of KORC's derived type PROFILES containing all the information about the plasma profiles used in the simulation. See[[ korc_types]] and korc_profiles.

public subroutine finalize_interpolants(params)

@brief Subroutine that frees memory allocated for PSPLINE interpolants.

Read more…

Arguments

Type IntentOptional AttributesName
type(KORC_PARAMS), intent(in) :: params

public subroutine get_fio_magnetic_fields(prtcls, F, params)

Arguments

Type IntentOptional AttributesName
type(PARTICLES), intent(inout) :: prtcls
type(FIELDS), intent(in) :: F
type(KORC_PARAMS), intent(in) :: params

public subroutine get_fio_FOmagnetic_fields_p(params, F, Y_R, Y_PHI, Y_Z, B_X, B_Y, B_Z, flag, hint)

Arguments

Type IntentOptional AttributesName
type(KORC_PARAMS), intent(in) :: params
type(FIELDS), intent(in) :: F
real(kind=rp), intent(in), DIMENSION(params%pchunk):: Y_R
real(kind=rp), intent(in), DIMENSION(params%pchunk):: Y_PHI
real(kind=rp), intent(in), DIMENSION(params%pchunk):: Y_Z
real(kind=rp), intent(inout), DIMENSION(params%pchunk):: B_X
real(kind=rp), intent(inout), DIMENSION(params%pchunk):: B_Y
real(kind=rp), intent(inout), DIMENSION(params%pchunk):: B_Z
integer(kind=is), intent(inout), DIMENSION(params%pchunk):: flag
type(C_PTR), intent(inout), DIMENSION(params%pchunk):: hint

public subroutine get_fio_GCmagnetic_fields_p(params, F, Y_R, Y_PHI, Y_Z, B_R, B_PHI, B_Z, gradB_R, gradB_PHI, gradB_Z, curlb_R, curlb_PHI, curlb_Z, flag, hint)

Arguments

Type IntentOptional AttributesName
type(KORC_PARAMS), intent(in) :: params
type(FIELDS), intent(in) :: F
real(kind=rp), intent(in), DIMENSION(params%pchunk):: Y_R
real(kind=rp), intent(in), DIMENSION(params%pchunk):: Y_PHI
real(kind=rp), intent(in), DIMENSION(params%pchunk):: Y_Z
real(kind=rp), intent(inout), DIMENSION(params%pchunk):: B_R
real(kind=rp), intent(inout), DIMENSION(params%pchunk):: B_PHI
real(kind=rp), intent(inout), DIMENSION(params%pchunk):: B_Z
real(kind=rp), intent(inout), DIMENSION(params%pchunk):: gradB_R
real(kind=rp), intent(inout), DIMENSION(params%pchunk):: gradB_PHI
real(kind=rp), intent(inout), DIMENSION(params%pchunk):: gradB_Z
real(kind=rp), intent(inout), DIMENSION(params%pchunk):: curlb_R
real(kind=rp), intent(inout), DIMENSION(params%pchunk):: curlb_PHI
real(kind=rp), intent(inout), DIMENSION(params%pchunk):: curlb_Z
integer(kind=is), intent(inout), DIMENSION(params%pchunk):: flag
type(C_PTR), intent(inout), DIMENSION(params%pchunk):: hint

public subroutine get_fio_vector_potential(prtcls, F, params)

Arguments

Type IntentOptional AttributesName
type(PARTICLES), intent(inout) :: prtcls
type(FIELDS), intent(in) :: F
type(KORC_PARAMS), intent(in) :: params

public subroutine get_fio_vector_potential_p(params, F, Y_R, Y_PHI, Y_Z, PSIp, flag, hint)

Arguments

Type IntentOptional AttributesName
type(KORC_PARAMS), intent(in) :: params
type(FIELDS), intent(in) :: F
real(kind=rp), intent(in), DIMENSION(params%pchunk):: Y_R
real(kind=rp), intent(in), DIMENSION(params%pchunk):: Y_PHI
real(kind=rp), intent(in), DIMENSION(params%pchunk):: Y_Z
real(kind=rp), intent(inout), DIMENSION(params%pchunk):: PSIp
integer(kind=is), intent(inout), DIMENSION(params%pchunk):: flag
type(C_PTR), intent(inout), DIMENSION(params%pchunk):: hint

public subroutine get_fio_electric_fields(prtcls, F, params)

Arguments

Type IntentOptional AttributesName
type(PARTICLES), intent(inout) :: prtcls
type(FIELDS), intent(in) :: F
type(KORC_PARAMS), intent(in) :: params

public subroutine get_fio_FOelectric_fields_p(params, F, Y_R, Y_PHI, Y_Z, E_X, E_Y, E_Z, flag, hint)

Arguments

Type IntentOptional AttributesName
type(KORC_PARAMS), intent(in) :: params
type(FIELDS), intent(in) :: F
real(kind=rp), intent(in), DIMENSION(params%pchunk):: Y_R
real(kind=rp), intent(in), DIMENSION(params%pchunk):: Y_PHI
real(kind=rp), intent(in), DIMENSION(params%pchunk):: Y_Z
real(kind=rp), intent(out), DIMENSION(params%pchunk):: E_X
real(kind=rp), intent(out), DIMENSION(params%pchunk):: E_Y
real(kind=rp), intent(out), DIMENSION(params%pchunk):: E_Z
integer(kind=is), intent(inout), DIMENSION(params%pchunk):: flag
type(C_PTR), intent(inout), DIMENSION(params%pchunk):: hint

public subroutine get_fio_GCelectric_fields_p(params, F, Y_R, Y_PHI, Y_Z, E_R, E_PHI, E_Z, flag, hint)

Arguments

Type IntentOptional AttributesName
type(KORC_PARAMS), intent(in) :: params
type(FIELDS), intent(in) :: F
real(kind=rp), intent(in), DIMENSION(params%pchunk):: Y_R
real(kind=rp), intent(in), DIMENSION(params%pchunk):: Y_PHI
real(kind=rp), intent(in), DIMENSION(params%pchunk):: Y_Z
real(kind=rp), intent(out), DIMENSION(params%pchunk):: E_R
real(kind=rp), intent(out), DIMENSION(params%pchunk):: E_PHI
real(kind=rp), intent(out), DIMENSION(params%pchunk):: E_Z
integer(kind=is), intent(inout), DIMENSION(params%pchunk):: flag
type(C_PTR), intent(inout), DIMENSION(params%pchunk):: hint

public subroutine get_fio_profile(prtcls, P, params)

Arguments

Type IntentOptional AttributesName
type(PARTICLES), intent(inout) :: prtcls
type(PROFILES), intent(in) :: P
type(KORC_PARAMS), intent(in) :: params

public subroutine get_fio_profile_p(params, P, Y_R, Y_PHI, Y_Z, n_e, T_e, flag, hint)

Arguments

Type IntentOptional AttributesName
type(KORC_PARAMS), intent(in) :: params
type(PROFILES), intent(in) :: P
real(kind=rp), intent(in), DIMENSION(params%pchunk):: Y_R
real(kind=rp), intent(in), DIMENSION(params%pchunk):: Y_PHI
real(kind=rp), intent(in), DIMENSION(params%pchunk):: Y_Z
real(kind=rp), intent(inout), DIMENSION(params%pchunk):: n_e
real(kind=rp), intent(inout), DIMENSION(params%pchunk):: T_e
integer(kind=is), intent(inout), DIMENSION(params%pchunk):: flag
type(C_PTR), intent(inout), DIMENSION(params%pchunk):: hint

public subroutine get_fio_ion_p(params, P, Y_R, Y_PHI, Y_Z, n_e, n_i, nimp, Zeff, flag, hint)

Arguments

Type IntentOptional AttributesName
type(KORC_PARAMS), intent(in) :: params
type(PROFILES), intent(in) :: P
real(kind=rp), intent(in), DIMENSION(params%pchunk):: Y_R
real(kind=rp), intent(in), DIMENSION(params%pchunk):: Y_PHI
real(kind=rp), intent(in), DIMENSION(params%pchunk):: Y_Z
real(kind=rp), intent(in), DIMENSION(params%pchunk):: n_e
real(kind=rp), intent(inout), DIMENSION(params%pchunk):: n_i
real(kind=rp), intent(inout), DIMENSION(params%pchunk,params%num_impurity_species):: nimp
real(kind=rp), intent(inout), DIMENSION(params%pchunk):: Zeff
integer(kind=is), intent(inout), DIMENSION(params%pchunk):: flag
type(C_PTR), intent(inout), DIMENSION(params%pchunk):: hint