diagnostics_fluxes Module

Module which contains functions for calculating and writing out the fluxes of heat and momentum etc.


Contents


Variables

Type Visibility Attributes Name Initial
real, public, dimension (:,:,:,:), allocatable :: qheat
real, public, dimension (:,:,:,:), allocatable :: qmheat
real, public, dimension (:,:,:,:), allocatable :: qbheat
real, public, dimension (:,:,:), allocatable :: pflux
real, public, dimension (:,:,:), allocatable :: vflux
real, public, dimension (:,:,:), allocatable :: vflux_par
real, public, dimension (:,:,:), allocatable :: vflux_perp
real, public, dimension (:,:,:), allocatable :: pflux_tormom
real, public, dimension (:,:,:), allocatable :: vflux0
real, public, dimension (:,:,:), allocatable :: vflux1
real, public, dimension (:,:,:), allocatable :: pmflux
real, public, dimension (:,:,:), allocatable :: vmflux
real, public, dimension (:,:,:), allocatable :: pbflux
real, public, dimension (:,:,:), allocatable :: vbflux
real, private, dimension (:,:), allocatable :: esflux_vs_e
real, private, dimension (:,:), allocatable :: apflux_vs_e
real, private, dimension (:,:), allocatable :: bpflux_vs_e
real, public, dimension (:,:,:), allocatable :: exchange
real, private, dimension (:,:,:), allocatable :: exchange_dummy
logical, private, parameter :: moment_to_allprocs = .false.
real, private, dimension (:,:), allocatable :: vpa1d
real, private, dimension (:,:,:), allocatable :: hermp1d
real, private, dimension (:,:,:,:,:), allocatable :: vpapts
real, private, dimension (:,:,:,:,:,:), allocatable :: hermp

Interfaces

private interface get_hermite_polynomials

  • private subroutine get_hermite_polynomials_1d(xptsdum, hpdum)

    Returns Gn = Hn / sqrt(2^n n!) / pi^(1/4), where Hn are the hermite polynomials i.e. int dx Gm * Gn exp(-x^2) = 1

    Arguments

    Type IntentOptional Attributes Name
    real, intent(in), dimension (:) :: xptsdum
    real, intent(out), dimension (:,0:) :: hpdum
  • private subroutine get_hermite_polynomials_4d(xptsdum, hpdum)

    Returns Gn = Hn / sqrt(2^n n!) / pi^(1/4), where Hn are the hermite polynomials i.e. int dx Gm * Gn exp(-x^2) = 1

    Arguments

    Type IntentOptional Attributes Name
    real, intent(in), dimension (-ntgrid:,:,:,:) :: xptsdum
    real, intent(out), dimension (-ntgrid:,:,:,:,0:) :: hpdum

Subroutines

public subroutine init_diagnostics_fluxes(gnostics)

Allocate and zero module-level arrays

Arguments

Type IntentOptional Attributes Name
type(diagnostics_type), intent(inout), optional :: gnostics

public subroutine finish_diagnostics_fluxes()

Clean up module, deallocate module-level arrays

Arguments

None

public subroutine reset_averages_and_counters(gnostics)

Set averages in gnostics\%current_results to 0.

Arguments

Type IntentOptional Attributes Name
type(diagnostics_type), intent(inout) :: gnostics

public subroutine calculate_fluxes(gnostics)

Calculate and possibly write fluxes.

Read more…

Arguments

Type IntentOptional Attributes Name
type(diagnostics_type), intent(inout) :: gnostics

public subroutine common_calculate_fluxes()

Calculate heat, particle, and momentum fluxes

Read more…

Arguments

None

private subroutine write_diffusive_estimates(gnostics)

Calculate estimates of the heat and particles fluxes using gamma / k^2 estimate of the diffusivity

Arguments

Type IntentOptional Attributes Name
type(diagnostics_type), intent(inout) :: gnostics

private subroutine calculate_standard_flux_properties(gnostics, flux_name, flux_description, flux_units, flux_value, distributed)

Writes a range of different summed and averaged properties of the given flux... e.g. the flux summed over kx as a function of ky, species and time

Arguments

Type IntentOptional Attributes Name
type(diagnostics_type), intent(inout) :: gnostics
character(len=*), intent(in) :: flux_name
character(len=*), intent(in) :: flux_description
character(len=*), intent(in) :: flux_units
real, intent(inout), dimension(ntheta0,naky,nspec) :: flux_value
logical, intent(in) :: distributed

private subroutine flux(phi, apar, bpar, pflux, qflux, vflux, vflux_par, vflux_perp, pmflux, qmflux, vmflux, pbflux, qbflux, vbflux, pflux_tormom)

Calculate various fluxes

Read more…

Arguments

Type IntentOptional Attributes Name
complex, intent(in), dimension (-ntgrid:,:,:) :: phi
complex, intent(in), dimension (-ntgrid:,:,:) :: apar
complex, intent(in), dimension (-ntgrid:,:,:) :: bpar
real, intent(out), dimension (:,:,:) :: pflux
real, intent(out), dimension (:,:,:,:) :: qflux
real, intent(out), dimension (:,:,:) :: vflux
real, intent(out), dimension (:,:,:) :: vflux_par
real, intent(out), dimension (:,:,:) :: vflux_perp
real, intent(out), dimension (:,:,:) :: pmflux
real, intent(out), dimension (:,:,:,:) :: qmflux
real, intent(out), dimension (:,:,:) :: vmflux
real, intent(out), dimension (:,:,:) :: pbflux
real, intent(out), dimension (:,:,:,:) :: qbflux
real, intent(out), dimension (:,:,:) :: vbflux
real, intent(out), dimension (:,:,:) :: pflux_tormom

private subroutine flux_vs_e(phi, apar, bpar, pflux, pmflux, pbflux)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
complex, intent(in), dimension (-ntgrid:,:,:) :: phi
complex, intent(in), dimension (-ntgrid:,:,:) :: apar
complex, intent(in), dimension (-ntgrid:,:,:) :: bpar
real, intent(inout), dimension (:,:) :: pflux
real, intent(inout), dimension (:,:) :: pmflux
real, intent(inout), dimension (:,:) :: pbflux

private subroutine get_flux(g_in, fld, flx)

Calculate the flux of a field

Arguments

Type IntentOptional Attributes Name
complex, intent(in), dimension (-ntgrid:,:,g_lo%llim_proc:) :: g_in

Input weighted distribution

complex, intent(in), dimension (-ntgrid:,:,:) :: fld

Input field

real, intent(out), dimension (:,:,:) :: flx

Output flux

private subroutine get_flux_vs_e(g_in, fld, flx)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
complex, intent(in), dimension (-ntgrid:,:,g_lo%llim_proc:) :: g_in

Input weighted distribution

complex, intent(in), dimension (-ntgrid:,:,:) :: fld
real, intent(inout), dimension (:,:) :: flx

private subroutine get_flux_dist(g_in, fld, flx_dist)

Identical to get_flux except don't integrate over poloidal angle ! JRB

Read more…

Arguments

Type IntentOptional Attributes Name
complex, intent(in), dimension (-ntgrid:,:,g_lo%llim_proc:) :: g_in

Input weighted distribution

complex, intent(in), dimension (-ntgrid:,:,:) :: fld
real, intent(inout), dimension (-ntgrid:,:,:,:) :: flx_dist

public subroutine flux_dist(phi, bpar, pflux_dist, vflux_par_dist, vflux_perp_dist, qflux_dist)

Diagnose the poloidal distribution of the particle, angular momentum, and energy fluxes

Read more…

Arguments

Type IntentOptional Attributes Name
complex, intent(in), dimension (-ntgrid:,:,:) :: phi
complex, intent(in), dimension (-ntgrid:,:,:) :: bpar
real, intent(out), dimension (-ntgrid:,:,:,:) :: pflux_dist
real, intent(out), dimension (-ntgrid:,:,:,:) :: vflux_par_dist
real, intent(out), dimension (-ntgrid:,:,:,:) :: vflux_perp_dist
real, intent(out), dimension (-ntgrid:,:,:,:) :: qflux_dist

private subroutine eexchange(phinew, phi, exchange_dummy, exchange_sym)

Calculate energy exchange diagnostic that numerically guarantees that the total energy exchange (summed over species) is zero

Read more…

Arguments

Type IntentOptional Attributes Name
complex, intent(in), dimension (-ntgrid:,:,:) :: phinew
complex, intent(in), dimension (-ntgrid:,:,:) :: phi
real, intent(out), dimension (:,:,:) :: exchange_dummy
real, intent(out), dimension (:,:,:) :: exchange_sym

public subroutine flux_vs_theta_vs_vpa(phinew, vflx)

Calculate the momentum flux as a function of

Arguments

Type IntentOptional Attributes Name
complex, intent(in), dimension(-ntgrid:,:,:) :: phinew
real, intent(out), dimension (-ntgrid:,:,:) :: vflx

private subroutine get_flux_vs_theta_vs_vpa(f, vflx)

Calculates and returns toroidal momentum flux as a function of vpar and theta

Arguments

Type IntentOptional Attributes Name
real, intent(in), dimension (-ntgrid:,:,:,:,:) :: f
real, intent(out), dimension (-ntgrid:,:,:) :: vflx

private subroutine get_hermite_polynomials_4d(xptsdum, hpdum)

Returns Gn = Hn / sqrt(2^n n!) / pi^(1/4), where Hn are the hermite polynomials i.e. int dx Gm * Gn exp(-x^2) = 1

Arguments

Type IntentOptional Attributes Name
real, intent(in), dimension (-ntgrid:,:,:,:) :: xptsdum
real, intent(out), dimension (-ntgrid:,:,:,:,0:) :: hpdum

private subroutine get_hermite_polynomials_1d(xptsdum, hpdum)

Returns Gn = Hn / sqrt(2^n n!) / pi^(1/4), where Hn are the hermite polynomials i.e. int dx Gm * Gn exp(-x^2) = 1

Arguments

Type IntentOptional Attributes Name
real, intent(in), dimension (:) :: xptsdum
real, intent(out), dimension (:,0:) :: hpdum