korc_avalanche Module


Uses

  • module~~korc_avalanche~~UsesGraph module~korc_avalanche korc_avalanche module~korc_input korc_input module~korc_avalanche->module~korc_input module~korc_hpc korc_hpc module~korc_avalanche->module~korc_hpc module~korc_profiles korc_profiles module~korc_avalanche->module~korc_profiles module~korc_hdf5 korc_HDF5 module~korc_avalanche->module~korc_hdf5 module~korc_constants korc_constants module~korc_avalanche->module~korc_constants module~korc_fields korc_fields module~korc_avalanche->module~korc_fields module~korc_coords korc_coords module~korc_avalanche->module~korc_coords module~korc_types korc_types module~korc_avalanche->module~korc_types module~korc_input->module~korc_hpc module~korc_input->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_profiles->module~korc_input module~korc_profiles->module~korc_hpc module~korc_profiles->module~korc_hdf5 module~korc_profiles->module~korc_coords module~korc_profiles->module~korc_types module~korc_interp korc_interp module~korc_profiles->module~korc_interp module~korc_hdf5->module~korc_hpc module~korc_hdf5->module~korc_constants module~korc_hdf5->module~korc_types HDF5 HDF5 module~korc_hdf5->HDF5 module~korc_constants->module~korc_types module~korc_fields->module~korc_input module~korc_fields->module~korc_hpc module~korc_fields->module~korc_hdf5 module~korc_fields->module~korc_coords module~korc_fields->module~korc_types module~korc_fields->module~korc_interp module~korc_coords->module~korc_constants module~korc_coords->module~korc_types iso_c_binding iso_c_binding module~korc_types->iso_c_binding module~korc_interp->module~korc_hpc module~korc_interp->module~korc_coords module~korc_interp->module~korc_types module~korc_rnd_numbers korc_rnd_numbers module~korc_interp->module~korc_rnd_numbers EZspline_obj EZspline_obj module~korc_interp->EZspline_obj EZspline EZspline module~korc_interp->EZspline module~korc_fio korc_fio module~korc_interp->module~korc_fio module~korc_rnd_numbers->module~korc_types ifport ifport module~korc_rnd_numbers->ifport module~korc_fio->module~korc_input module~korc_fio->module~korc_hdf5 module~korc_fio->module~korc_types module~korc_fio->iso_c_binding module~korc_fio->mpi

Used by

  • module~~korc_avalanche~~UsedByGraph module~korc_avalanche korc_avalanche module~korc_spatial_distribution korc_spatial_distribution module~korc_spatial_distribution->module~korc_avalanche module~korc_velocity_distribution korc_velocity_distribution module~korc_velocity_distribution->module~korc_avalanche module~korc_initialize korc_initialize module~korc_initialize->module~korc_spatial_distribution module~korc_initialize->module~korc_velocity_distribution program~main main program~main->module~korc_initialize

Contents


Variables

TypeVisibility AttributesNameInitial
type(AVALANCHE_PDF_PARAMS), private :: aval_params
real(kind=rp), private, parameter:: minmax_buffer_size =10.0_rp

Derived Types

type, private :: AVALANCHE_PDF_PARAMS

Components

TypeVisibility AttributesNameInitial
real(kind=rp), public :: max_pitch_angle

Maximum pitch angle of sampled PDF in degrees

real(kind=rp), public :: min_pitch_angle

Minimum pitch angle of sampled PDF in degrees

real(kind=rp), public :: min_energy

Minimum energy of sampled PDF in MeV

real(kind=rp), public :: max_energy

Maximum energy of sampled PDF in MeV

real(kind=rp), public :: min_p

Minimum momentum of sampled PDF

real(kind=rp), public :: max_p

Maximum momentum of sampled PDF

real(kind=rp), public :: ne

Background electron density in m^-3

real(kind=rp), public :: Zeff

Effective atomic number of ions

real(kind=rp), public :: Ec

Critical electric field in V/m

real(kind=rp), public :: Epar

Parallel electric field in V/m

real(kind=rp), public :: Ebar

Epar/Ec

real(kind=rp), public :: Te

Background electron temperature in eV

real(kind=rp), public :: lD

Debye length

real(kind=rp), public :: bmin

Maximum approach radius

real(kind=rp), public :: CoulombLog

Coulomb Logarithm

real(kind=rp), public :: Tau

Collisional time

real(kind=rp), public :: dth

Variance of sampling normal variate for pitch angle

real(kind=rp), public :: dp

Variance of sampling normal variate for momentum

real(kind=rp), public :: dR

Variance of sampling normal variate for R location

real(kind=rp), public :: dZ

Variance of sampling normal variate for Z location

real(kind=rp), public :: fo
real(kind=rp), public :: alpha
real(kind=rp), public :: cz
real(kind=rp), public :: C1
real(kind=rp), public :: C2

Functions

public function deg2rad(x)

Arguments

Type IntentOptional AttributesName
real(kind=rp), intent(in) :: x

Return Value real(kind=rp)

private function fRE(x, p)

Arguments

Type IntentOptional AttributesName
real(kind=rp), intent(in) :: x
real(kind=rp), intent(in) :: p

Return Value real(kind=rp)

public function log10fRE(x, p)

Arguments

Type IntentOptional AttributesName
real(kind=rp), intent(in) :: x
real(kind=rp), intent(in) :: p

Return Value real(kind=rp)

private function PSI_ROT(R, R0, sigR, Z, Z0, sigZ, theta)

Calculates value of argument of 2D Gaussian spatial distribution with with counter-clockwise rotation.

Arguments

Type IntentOptional AttributesName
real(kind=rp), intent(in) :: R

R-coordinate of MH sampled location

real(kind=rp), intent(in) :: R0

R-coordinate of center of 2D Gaussian

real(kind=rp), intent(in) :: sigR

Variance of first dimension of 2D Gaussian

real(kind=rp), intent(in) :: Z

Z-coordinate of MH sampled location

real(kind=rp), intent(in) :: Z0

Z-coordinate of center of 2D Gaussian

real(kind=rp), intent(in) :: sigZ

Variance of second dimension of 2D Gaussian

real(kind=rp), intent(in) :: theta

Angle of counter-clockwise rotation (in radians), of 2D Gaussian distribution relative to R,Z

Return Value real(kind=rp)

Argument of exponential comprising 2D Gaussian distribution

private function indicator(psi, psi_max)

Compares argument psi to chosen psi_max, returning step function.

Arguments

Type IntentOptional AttributesName
real(kind=rp), intent(in) :: psi
real(kind=rp), intent(in) :: psi_max

Return Value real(kind=rp)

private function random_norm(mean, sigma)

Arguments

Type IntentOptional AttributesName
real(kind=rp), intent(in) :: mean
real(kind=rp), intent(in) :: sigma

Return Value real(kind=rp)


Subroutines

public subroutine get_avalanche_distribution(params, g, eta, go, etao)

Arguments

Type IntentOptional AttributesName
type(KORC_PARAMS), intent(in) :: params
real(kind=rp), intent(inout), DIMENSION(:), ALLOCATABLE:: g
real(kind=rp), intent(inout), DIMENSION(:), ALLOCATABLE:: eta
real(kind=rp), intent(out) :: go
real(kind=rp), intent(out) :: etao

public subroutine get_Avalanche_4D(params, spp, P, F)

Arguments

Type IntentOptional AttributesName
type(KORC_PARAMS), intent(in) :: params
type(SPECIES), intent(inout) :: spp
type(PROFILES), intent(in) :: P
type(FIELDS), intent(in) :: F

An instance of the KORC derived type FIELDS.

private subroutine initialize_avalanche_params(params)

Arguments

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

private subroutine sample_distribution(params, g, eta, go, etao)

Arguments

Type IntentOptional AttributesName
type(KORC_PARAMS), intent(in) :: params
real(kind=rp), intent(inout), DIMENSION(:), ALLOCATABLE:: g
real(kind=rp), intent(inout), DIMENSION(:), ALLOCATABLE:: eta
real(kind=rp), intent(out) :: go
real(kind=rp), intent(out) :: etao

private subroutine update_avalanche_params(params, prtcls)

Updates the avalanche parameters aval_params% at each step in the MCMC after the profiles are interpolated at the sampled R,Z location.

Arguments

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

Core KORC simulation parameters.

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

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

private subroutine Avalanche_4D(params, spp, P, F)

Read more…

Arguments

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

Core KORC simulation parameters.

type(SPECIES), intent(inout) :: spp

An instance of the derived type SPECIES containing all the parameters and simulation variables of the different species in the simulation.

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

An instance of the KORC derived type PROFILES.

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

An instance of the KORC derived type FIELDS.

private subroutine save_avalanche_params(params)

Arguments

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