korc_interp Module

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


Uses


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_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_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_r8), public :: A

Interpolant of a scalar field .

type(EZspline3_r8), public :: R

Interpolant of .

type(EZspline3_r8), public :: PHI

Interpolant of .

type(EZspline3_r8), 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_r8), public :: A

Interpolant of a scalar field .

type(EZspline3_r8), public :: R

Interpolant of .

type(EZspline3_r8), public :: T

Interpolant of .

type(EZspline3_r8), 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_r8), public :: A

Interpolant of a scalar field .

type(EZspline2_r8), public :: R

Interpolant of .

type(EZspline2_r8), public :: PHI

Interpolant of .

type(EZspline2_r8), 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_r8), public :: A

Interpolant of a scalar field .

type(EZspline1_r8), public :: R

Interpolant of .

type(EZspline1_r8), public :: PHI

Interpolant of .

type(EZspline1_r8), 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_r8), public :: ne

Interpolant of background electron density .

type(EZspline3_r8), public :: Te

Interpolant of background electron temperature .

type(EZspline3_r8), 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_r8), public :: ne

Interpolant of background electron density .

type(EZspline2_r8), public :: Te

Interpolant of background electron temperature .

type(EZspline2_r8), 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_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.

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_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(F, Y_R, Y_PHI, Y_Z, flag)

Read more…

Arguments

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

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(Y_R, Y_PHI, Y_Z, flag)

Arguments

Type IntentOptional AttributesName
real(kind=rp), intent(in), DIMENSION(8):: Y_R
real(kind=rp), intent(in), DIMENSION(8):: Y_PHI
real(kind=rp), intent(in), DIMENSION(8):: Y_Z
integer(kind=is), intent(inout), DIMENSION(8):: 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(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
type(FIELDS), intent(in) :: F
real(kind=rp), intent(in), DIMENSION(8):: Y_R
real(kind=rp), intent(in), DIMENSION(8):: Y_PHI
real(kind=rp), intent(in), DIMENSION(8):: Y_Z
real(kind=rp), intent(out), DIMENSION(8):: B_X
real(kind=rp), intent(out), DIMENSION(8):: B_Y
real(kind=rp), intent(out), DIMENSION(8):: B_Z
real(kind=rp), intent(out), DIMENSION(8):: E_X
real(kind=rp), intent(out), DIMENSION(8):: E_Y
real(kind=rp), intent(out), DIMENSION(8):: E_Z
real(kind=rp), intent(out), DIMENSION(8):: PSIp
integer(kind=is), intent(inout), DIMENSION(8):: flag_cache

public subroutine interp_FOfields1_p(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
type(FIELDS), intent(in) :: F
real(kind=rp), intent(in), DIMENSION(8):: Y_R
real(kind=rp), intent(in), DIMENSION(8):: Y_PHI
real(kind=rp), intent(in), DIMENSION(8):: Y_Z
real(kind=rp), intent(out), DIMENSION(8):: B_X
real(kind=rp), intent(out), DIMENSION(8):: B_Y
real(kind=rp), intent(out), DIMENSION(8):: B_Z
real(kind=rp), intent(out), DIMENSION(8):: E_X
real(kind=rp), intent(out), DIMENSION(8):: E_Y
real(kind=rp), intent(out), DIMENSION(8):: E_Z
real(kind=rp), intent(out), DIMENSION(8):: PSIp
integer(kind=is), intent(inout), DIMENSION(8):: flag_cache

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

Arguments

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

public subroutine interp_fields_p(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
type(FIELDS), intent(in) :: F
real(kind=rp), intent(in), DIMENSION(8):: Y_R
real(kind=rp), intent(in), DIMENSION(8):: Y_PHI
real(kind=rp), intent(in), DIMENSION(8):: Y_Z
real(kind=rp), intent(out), DIMENSION(8):: B_R
real(kind=rp), intent(out), DIMENSION(8):: B_PHI
real(kind=rp), intent(out), DIMENSION(8):: B_Z
real(kind=rp), intent(out), DIMENSION(8):: E_R
real(kind=rp), intent(out), DIMENSION(8):: E_PHI
real(kind=rp), intent(out), DIMENSION(8):: E_Z
real(kind=rp), intent(out), DIMENSION(8):: curlB_R
real(kind=rp), intent(out), DIMENSION(8):: curlB_PHI
real(kind=rp), intent(out), DIMENSION(8):: curlB_Z
real(kind=rp), intent(out), DIMENSION(8):: gradB_R
real(kind=rp), intent(out), DIMENSION(8):: gradB_PHI
real(kind=rp), intent(out), DIMENSION(8):: gradB_Z
integer(kind=is), intent(inout), DIMENSION(8):: flag_cache

public subroutine interp_fields_3D_p(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
type(FIELDS), intent(in) :: F
real(kind=rp), intent(in), DIMENSION(8):: Y_R
real(kind=rp), intent(in), DIMENSION(8):: Y_PHI
real(kind=rp), intent(in), DIMENSION(8):: Y_Z
real(kind=rp), intent(out), DIMENSION(8):: B_R
real(kind=rp), intent(out), DIMENSION(8):: B_PHI
real(kind=rp), intent(out), DIMENSION(8):: B_Z
real(kind=rp), intent(out), DIMENSION(8):: E_R
real(kind=rp), intent(out), DIMENSION(8):: E_PHI
real(kind=rp), intent(out), DIMENSION(8):: E_Z
real(kind=rp), intent(out), DIMENSION(8):: curlB_R
real(kind=rp), intent(out), DIMENSION(8):: curlB_PHI
real(kind=rp), intent(out), DIMENSION(8):: curlB_Z
real(kind=rp), intent(out), DIMENSION(8):: gradB_R
real(kind=rp), intent(out), DIMENSION(8):: gradB_PHI
real(kind=rp), intent(out), DIMENSION(8):: gradB_Z
integer(kind=is), intent(inout), DIMENSION(8):: flag_cache

public subroutine interp_collision_p(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
real(kind=rp), intent(in), DIMENSION(8):: Y_R
real(kind=rp), intent(in), DIMENSION(8):: Y_PHI
real(kind=rp), intent(in), DIMENSION(8):: Y_Z
real(kind=rp), intent(out), DIMENSION(8):: B_R
real(kind=rp), intent(out), DIMENSION(8):: B_PHI
real(kind=rp), intent(out), DIMENSION(8):: B_Z
real(kind=rp), intent(out), DIMENSION(8):: E_R
real(kind=rp), intent(out), DIMENSION(8):: E_PHI
real(kind=rp), intent(out), DIMENSION(8):: E_Z
real(kind=rp), intent(out), DIMENSION(8):: ne
real(kind=rp), intent(out), DIMENSION(8):: Te
real(kind=rp), intent(out), DIMENSION(8):: Zeff
integer(kind=is), intent(inout), DIMENSION(8):: flag_cache

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

Arguments

Type IntentOptional AttributesName
real(kind=rp), intent(in), DIMENSION(8):: Y_R
real(kind=rp), intent(in), DIMENSION(8):: Y_PHI
real(kind=rp), intent(in), DIMENSION(8):: Y_Z
real(kind=rp), intent(out), DIMENSION(8):: B_R
real(kind=rp), intent(out), DIMENSION(8):: B_PHI
real(kind=rp), intent(out), DIMENSION(8):: 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(F, Y_R, Y_Z, B_R, B_PHI, B_Z)

Arguments

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

public subroutine calculate_2DBdBfields_p(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
type(FIELDS), intent(in) :: F
real(kind=rp), intent(in), DIMENSION(8):: Y_R
real(kind=rp), intent(in), DIMENSION(8):: Y_PHI
real(kind=rp), intent(in), DIMENSION(8):: Y_Z
real(kind=rp), intent(out), DIMENSION(8):: B_R
real(kind=rp), intent(out), DIMENSION(8):: B_PHI
real(kind=rp), intent(out), DIMENSION(8):: B_Z
real(kind=rp), intent(out), DIMENSION(8):: E_R
real(kind=rp), intent(out), DIMENSION(8):: E_PHI
real(kind=rp), intent(out), DIMENSION(8):: E_Z
real(kind=rp), intent(out), DIMENSION(8):: curlb_R
real(kind=rp), intent(out), DIMENSION(8):: curlb_PHI
real(kind=rp), intent(out), DIMENSION(8):: curlb_Z
real(kind=rp), intent(out), DIMENSION(8):: gradB_R
real(kind=rp), intent(out), DIMENSION(8):: gradB_PHI
real(kind=rp), intent(out), DIMENSION(8):: gradB_Z
integer(kind=is), intent(inout), DIMENSION(8):: flag_cache
real(kind=rp), intent(out), DIMENSION(8):: PSIp

public subroutine calculate_3DBdBfields_p(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
type(FIELDS), intent(in) :: F
real(kind=rp), intent(in), DIMENSION(8):: Y_R
real(kind=rp), intent(in), DIMENSION(8):: Y_PHI
real(kind=rp), intent(in), DIMENSION(8):: Y_Z
real(kind=rp), intent(out), DIMENSION(8):: B_R
real(kind=rp), intent(out), DIMENSION(8):: B_PHI
real(kind=rp), intent(out), DIMENSION(8):: B_Z
real(kind=rp), intent(out), DIMENSION(8):: E_R
real(kind=rp), intent(out), DIMENSION(8):: E_PHI
real(kind=rp), intent(out), DIMENSION(8):: E_Z
real(kind=rp), intent(out), DIMENSION(8):: curlb_R
real(kind=rp), intent(out), DIMENSION(8):: curlb_PHI
real(kind=rp), intent(out), DIMENSION(8):: curlb_Z
real(kind=rp), intent(out), DIMENSION(8):: gradB_R
real(kind=rp), intent(out), DIMENSION(8):: gradB_PHI
real(kind=rp), intent(out), DIMENSION(8):: gradB_Z
integer(kind=is), intent(inout), DIMENSION(8):: flag_cache

public subroutine calculate_3DBdBfields1_p(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
type(FIELDS), intent(in) :: F
real(kind=rp), intent(in), DIMENSION(8):: Y_R
real(kind=rp), intent(in), DIMENSION(8):: Y_PHI
real(kind=rp), intent(in), DIMENSION(8):: Y_Z
real(kind=rp), intent(out), DIMENSION(8):: B_R
real(kind=rp), intent(out), DIMENSION(8):: B_PHI
real(kind=rp), intent(out), DIMENSION(8):: B_Z
real(kind=rp), intent(out), DIMENSION(8):: E_R
real(kind=rp), intent(out), DIMENSION(8):: E_PHI
real(kind=rp), intent(out), DIMENSION(8):: E_Z
real(kind=rp), intent(out), DIMENSION(8):: curlb_R
real(kind=rp), intent(out), DIMENSION(8):: curlb_PHI
real(kind=rp), intent(out), DIMENSION(8):: curlb_Z
real(kind=rp), intent(out), DIMENSION(8):: gradB_R
real(kind=rp), intent(out), DIMENSION(8):: gradB_PHI
real(kind=rp), intent(out), DIMENSION(8):: gradB_Z
integer(kind=is), intent(inout), DIMENSION(8):: flag_cache
real(kind=rp), intent(out), DIMENSION(8):: PSIp

public subroutine calculate_GCfieldswE_p(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
type(FIELDS), intent(in) :: F
real(kind=rp), intent(in), DIMENSION(8):: Y_R
real(kind=rp), intent(in), DIMENSION(8):: Y_PHI
real(kind=rp), intent(in), DIMENSION(8):: Y_Z
real(kind=rp), intent(out), DIMENSION(8):: B_R
real(kind=rp), intent(out), DIMENSION(8):: B_PHI
real(kind=rp), intent(out), DIMENSION(8):: B_Z
real(kind=rp), intent(out), DIMENSION(8):: E_R
real(kind=rp), intent(out), DIMENSION(8):: E_PHI
real(kind=rp), intent(out), DIMENSION(8):: E_Z
real(kind=rp), intent(out), DIMENSION(8):: curlb_R
real(kind=rp), intent(out), DIMENSION(8):: curlb_PHI
real(kind=rp), intent(out), DIMENSION(8):: curlb_Z
real(kind=rp), intent(out), DIMENSION(8):: gradB_R
real(kind=rp), intent(out), DIMENSION(8):: gradB_PHI
real(kind=rp), intent(out), DIMENSION(8):: gradB_Z
integer(kind=is), intent(inout), DIMENSION(8):: flag_cache
real(kind=rp), intent(out), DIMENSION(8):: PSIp

public subroutine calculate_GCfields_p(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
type(FIELDS), intent(in) :: F
real(kind=rp), intent(in), DIMENSION(8):: Y_R
real(kind=rp), intent(in), DIMENSION(8):: Y_PHI
real(kind=rp), intent(in), DIMENSION(8):: Y_Z
real(kind=rp), intent(out), DIMENSION(8):: B_R
real(kind=rp), intent(out), DIMENSION(8):: B_PHI
real(kind=rp), intent(out), DIMENSION(8):: B_Z
real(kind=rp), intent(out), DIMENSION(8):: E_R
real(kind=rp), intent(out), DIMENSION(8):: E_PHI
real(kind=rp), intent(out), DIMENSION(8):: E_Z
real(kind=rp), intent(out), DIMENSION(8):: curlb_R
real(kind=rp), intent(out), DIMENSION(8):: curlb_PHI
real(kind=rp), intent(out), DIMENSION(8):: curlb_Z
real(kind=rp), intent(out), DIMENSION(8):: gradB_R
real(kind=rp), intent(out), DIMENSION(8):: gradB_PHI
real(kind=rp), intent(out), DIMENSION(8):: gradB_Z
integer(kind=is), intent(inout), DIMENSION(8):: flag_cache
real(kind=rp), intent(out), DIMENSION(8):: PSIp

public subroutine calculate_GCfields_2x1t_p(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
type(FIELDS), intent(in) :: F
real(kind=rp), intent(in), DIMENSION(8):: Y_R
real(kind=rp), intent(in), DIMENSION(8):: Y_PHI
real(kind=rp), intent(in), DIMENSION(8):: Y_Z
real(kind=rp), intent(out), DIMENSION(8):: B_R
real(kind=rp), intent(out), DIMENSION(8):: B_PHI
real(kind=rp), intent(out), DIMENSION(8):: B_Z
real(kind=rp), intent(out), DIMENSION(8):: E_R
real(kind=rp), intent(out), DIMENSION(8):: E_PHI
real(kind=rp), intent(out), DIMENSION(8):: E_Z
real(kind=rp), intent(out), DIMENSION(8):: curlb_R
real(kind=rp), intent(out), DIMENSION(8):: curlb_PHI
real(kind=rp), intent(out), DIMENSION(8):: curlb_Z
real(kind=rp), intent(out), DIMENSION(8):: gradB_R
real(kind=rp), intent(out), DIMENSION(8):: gradB_PHI
real(kind=rp), intent(out), DIMENSION(8):: gradB_Z
integer(kind=is), intent(inout), DIMENSION(8):: flag_cache
real(kind=rp), intent(out), DIMENSION(8):: PSIp
real(kind=rp), intent(in) :: time

public subroutine calculate_GCfields_p_FS(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
type(FIELDS), intent(in) :: F
real(kind=rp), intent(in), DIMENSION(8):: Y_R
real(kind=rp), intent(in), DIMENSION(8):: Y_PHI
real(kind=rp), intent(in), DIMENSION(8):: Y_Z
real(kind=rp), intent(out), DIMENSION(8):: B_R
real(kind=rp), intent(out), DIMENSION(8):: B_PHI
real(kind=rp), intent(out), DIMENSION(8):: B_Z
real(kind=rp), intent(out), DIMENSION(8):: E_R
real(kind=rp), intent(out), DIMENSION(8):: E_PHI
real(kind=rp), intent(out), DIMENSION(8):: E_Z
real(kind=rp), intent(out), DIMENSION(8):: curlb_R
real(kind=rp), intent(out), DIMENSION(8):: curlb_PHI
real(kind=rp), intent(out), DIMENSION(8):: curlb_Z
real(kind=rp), intent(out), DIMENSION(8):: gradB_R
real(kind=rp), intent(out), DIMENSION(8):: gradB_PHI
real(kind=rp), intent(out), DIMENSION(8):: gradB_Z
integer(kind=is), intent(inout), DIMENSION(8):: flag_cache
real(kind=rp), intent(out), DIMENSION(8):: 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(8):: Y_R
real(kind=rp), intent(in), DIMENSION(8):: Y_PHI
real(kind=rp), intent(in), DIMENSION(8):: Y_Z
real(kind=rp), intent(inout), DIMENSION(8):: 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(8):: PSIp
real(kind=rp), intent(inout), DIMENSION(8):: 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.

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