API Reference

TJLF

TJLF.gauss_hermiteFunction
gauss_hermite(inputs::InputTJLF{T}) where T<:Real

parameters: inputs::InputTJLF{T} - InputTJLF struct constructed in tjlfreadinput.jl

outputs: OutputHermite(x,wx,h) - OutputHermite struct

description: computes abscisca's and weights for Gauss- Hermite integration adapted from Numerical Recipes in Fortran Pg.147 reversed order of roots so that x(m) is largest and x(1) is smallest only the positive roots are found and stored #––––––––––––––––––––––––––––––– initializes the hermite basis functions and ten point Gauss-Hermite integration with absissas x and weights w.

source
TJLF.get_ky_spectrumFunction
get_ky_spectrum(inputs::InputTJLF{T}, grad_r0::T)::Vector{T} where T<:Real

parameters: inputs::InputTJLF{T} - InputTJLF struct constructed in tjlfreadinput.jl gradr0::T - value from SaturationParameters struct from tjlfgeometry.jl

outputs: ky_spectrum::Vector{T} - array of floats that form the ky grid

description: the input file provides the type of kygrid to create (values 1 to 5) and this function creates it accordingly

source
TJLF.get_ky_spectrum_sizeFunction
get_ky_spectrum_size(nky::Int,kygrid_model::Int)::Int

parameters: nky::Int - nky from input file kygridmodel::Int - kygridmodel from input file

outputs: size of the ky_spectrum array

description: called before creation of InputTJLF struct to get the size of ky_spectrum

source
TJLF.get_sat_paramsFunction
get_sat_params(inputs::InputTJLF{T}; ms::Int=128) where T<:Real

parameters: inputs::InputTJLF{T} - InputTJLF struct constructed in tjlfreadinput.jl

outputs: SaturationParameters{Float64}() - SaturationParameters struct calculated

description: compute the geometric coefficients on the x-grid

location: tjlf_geometry.jl

source
TJLF.readInputFunction
readInput(baseDirectory::String)

parameter: baseDirectory::String - string of the directory (include a '\' at the end) of input.tglf (NOT input.tglf.gen)

return: inputTJLF::InputTJLF - return InputTJLF struct based off the input.tglf file

description: parse through a input.tglf file found in baseDirectory parameter, creates a inputTJLF struct and populates the fields based off the values in the file. has some check to make sure the file is written properly

source
TJLF.sum_ky_spectrumFunction
sum_ky_spectrum(inputs::InputTJLF{T},satParams::SaturationParameters{T},gamma_matrix::Matrix{T},QL::Array{T,5})where T <: Real

parameters: inputs - InputTJLF struct constructed using the input.TGLF file gammamatrix - matrix of gamma (mode, ky) QLweights - split into separate types of QL weights (field, species, mode, ky, type) type: (particle, energy, torodial stress, parallel stress, exchange) (optional) - a lot of optional parameters that I don't use -DSUN

outputs: QLfluxout - flux integral of the QL weights (field, species, type)

takes in the input.tglf file, ky values, gammas, quasilinear weights, calls
intensity_sat() which returns the QL intensity values, then calls
flux_integrals() which numerically integrates the fluxes
source
TJLF.tjlf_TMFunction
tjlf_TM(inputs::InputTJLF{T},satParams::SaturationParameters{T},outputHermite::OutputHermite{T}) where T<:Real

parameters: inputs::InputTJLF{T} - InputTJLF struct constructed in tjlfreadinput.jl satParams::SaturationParameters{T} - SaturationParameters struct constructed in tjlfgeometry.jl outputHermite::OutputHermite{T} - OutputHermite struct constructed in tjlfhermite.jl

outputs: QLweights - 5d array of QL weights (field, species, mode, ky, type), type: (particle, energy, torodial stress, parallel stress, exchange) firstPasseigenvalue - 3d array of eigenvalues (mode, ky, type) type: (gamma, frequency)

description: Main transport model function. Calls linear TGLF over a spectrum of ky's and computes spectral integrals of field, intensity, and fluxes.

source
TJLF.xgrid_functions_geoFunction
xgrid_functions_geo(inputs::InputTJLF{T}, satParams::SaturationParameters{T}, gamma_matrix::Matrix{T};small::T=0.00000001)

parameters: inputs::InputTJLF{T} - InputTJLF struct constructed in tjlfreadinput.jl satParams::SaturationParameters{T} - SaturationParameters struct constructed in tjlfgeometry.jl gammamatrix::Vector{T} - growth rate eigenvalues for each mode

outputs: kx0e - value of kx0e for tge given gamma value

description: calculate kx0_e (spectral shift) given the growthrate used for the second pass of TM

location: tjlf_geometry.jl

source
xgrid_functions_geo(inputs::InputTJLF{T}, satParams::SaturationParameters{T}, outHermite::OutputHermite{T}, ky::T, ky_index::Int; kx0_e::T=NaN, ms::Int=128)

parameters: inputs::InputTJLF{T} - InputTJLF struct constructed in tjlfreadinput.jl satParams::SaturationParameters{T} - SaturationParameters struct constructed in tjlfgeometry.jl outputHermite::OutputHermite{T} - OutputHermite struct constructed in tjlfhermite.jl ky::T - ky value kyindex::Int - index used for multithreading kx0e::T=NaN - spectral shift provided for second pass

outputs: OutputGeometry{Float64}() - OutputGeometry struct for different WIDTHS value

description: create the OutputGeometry struct for the specific WIDTHS value used to calculate Ave structs (tjlf_matrix.jl) used in eigenmatrix population

location: tjlf_geometry.jl

source