diagnostics_zonal_t Derived Type

type, public, extends(diagnostics_group_t) :: diagnostics_zonal_t


Contents


Components

Type Visibility Attributes Name Initial
character(len=:), public, allocatable :: groupname

Name of diagnostics group

character(len=:), public, allocatable :: dirpath

Path to diagnostics directory

type(diagnostic_variable_t), public :: tau

Time

type(diagnostic_variable_t), public, dimension(:), allocatable :: diags

Container of non-generic diagnostic variables

integer, public :: n_diags

Number of non-generic diagnostic variables

logical, public :: file_exists

Internal flag to track snapshot file status


Type-Bound Procedures

procedure, public :: init_diagnostics_group

  • public subroutine init_diagnostics_group(self, comm_handler, groupname)

    Initialize diagnostic

    Arguments

    Type IntentOptional Attributes Name
    class(diagnostics_group_t), intent(inout) :: self

    Instance of class

    type(comm_handler_t), intent(in) :: comm_handler

    MPI communication handler

    character(len=*), intent(in) :: groupname

    Directory suffix to write snapsfiles into

procedure, public :: allocate_diags

  • public subroutine allocate_diags(self, n_diags)

    Initialize diagnostic

    Arguments

    Type IntentOptional Attributes Name
    class(diagnostics_group_t), intent(inout) :: self

    Instance of class

    integer, intent(in) :: n_diags

    Directory to write snapsfiles into

procedure, public :: write_diagnostics

  • public subroutine write_diagnostics(self, tau, isnaps, idiag, start_new_file)

    Write all diagnostics

    Arguments

    Type IntentOptional Attributes Name
    class(diagnostics_group_t), intent(inout) :: self

    Instance of class

    real(kind=GP), intent(in) :: tau

    Time

    integer, intent(in) :: isnaps

    Snapshot file index

    integer, intent(in) :: idiag

    Diagnostic step index

    logical, intent(in) :: start_new_file

    If true, a new file will be created

procedure, public :: init_next_diagnostic

  • public subroutine init_next_diagnostic(self, ndim, dimname, varname, ind_out)

    Initialize single diagnostic and provide pointer to its vals field

    Arguments

    Type IntentOptional Attributes Name
    class(diagnostics_group_t), intent(inout) :: self

    Instance of class

    integer, intent(in) :: ndim

    Number of elements in diagnostic

    character(len=*), intent(in) :: dimname

    Name of dimension of diagnostic

    character(len=*), intent(in) :: varname

    Name of diagnostic

    integer, intent(out) :: ind_out

    Index of initiated diagnostic in diags array

procedure, public :: process_to_file

  • public subroutine process_to_file(self, diag_packet, comm_handler, equi, equi_on_cano, equi_on_stag, mesh_cano, mesh_stag, map, penalisation_cano, penalisation_stag, polars_cano, polars_stag, tau, ne, te, ti, pot, vort, upar, jpar, apar, apar_fluct, neutrals_dens, neutrals_parmom, neutrals_pressure, src_ne, src_te, src_ti, src_upar, src_vort, isnaps, idiag, start_new_file)

    Main diagnostics computation routine

    Arguments

    Type IntentOptional Attributes Name
    class(diagnostics_zonal_t), intent(inout) :: self

    Instance of class

    type(diagnostics_packet_t), intent(inout) :: diag_packet

    Diagnostic packet

    type(comm_handler_t), intent(in) :: comm_handler

    MPI communication handler

    class(equilibrium_t), intent(in) :: equi

    Magnetic equilibrium

    class(equilibrium_storage_t), intent(in) :: equi_on_cano

    Equilibrium storage on canonical plane enabling faster performance at certain locations

    class(equilibrium_storage_t), intent(in) :: equi_on_stag

    Equilibrium storage on staggered plane enabling faster performance at certain locations

    type(mesh_cart_t), intent(in) :: mesh_cano

    Mesh (canonical) within poloidal plane

    type(mesh_cart_t), intent(in) :: mesh_stag

    Mesh (staggered) within poloidal plane

    type(parallel_map_t), intent(in) :: map

    Parallel map

    type(penalisation_t), intent(in) :: penalisation_cano

    Penalisation (canonical)

    type(penalisation_t), intent(in) :: penalisation_stag

    Penalisation (staggered)

    type(polars_t), intent(in) :: polars_cano

    Polar grid and operators (canonical)

    type(polars_t), intent(in) :: polars_stag

    Polar grid and operators (staggered)

    real(kind=GP), intent(in) :: tau

    Time

    type(variable_t), intent(in) :: ne

    Electron density

    type(variable_t), intent(in) :: te

    Electron temperature

    type(variable_t), intent(in) :: ti

    Ion temperature

    type(variable_t), intent(in) :: pot

    Electrostatic potential

    type(variable_t), intent(in) :: vort

    Generalised vorticity

    type(variable_t), intent(in) :: upar

    Parallel ion velocity

    type(variable_t), intent(in) :: jpar

    Parallel current

    type(variable_t), intent(in) :: apar

    Parallel electromagnetic potential

    type(variable_t), intent(in) :: apar_fluct

    Parallel electromagnetic potential fluctation

    type(variable_t), intent(in) :: neutrals_dens

    Neutrals density

    type(variable_t), intent(in) :: neutrals_parmom

    Neutrals parallel momentum

    type(variable_t), intent(in) :: neutrals_pressure

    Neutrals pressure

    real(kind=GP), intent(in), dimension(mesh_cano%get_n_points_inner()) :: src_ne

    Particle source values on inner mesh points

    real(kind=GP), intent(in), dimension(mesh_cano%get_n_points_inner()) :: src_te

    Electron temperature source values on inner mesh points

    real(kind=GP), intent(in), dimension(mesh_cano%get_n_points_inner()) :: src_ti

    Ion temperature source values on inner mesh points

    real(kind=GP), intent(in), dimension(mesh_cano%get_n_points_inner()) :: src_upar

    Parallel momentum source values on inner mesh points

    real(kind=GP), intent(in), dimension(mesh_cano%get_n_points_inner()) :: src_vort

    Vorticity source values on inner mesh points

    integer, intent(in) :: isnaps

    Braginskii model snapshot number

    integer, intent(in) :: idiag

    Diagnostic snapshot number

    logical, intent(in) :: start_new_file

    Flag whether to write to new file

procedure, public :: project_zonal

  • public subroutine project_zonal(self, comm_handler, equi, equi_storage, mesh, map, polars, ind, u, mode)

    Project input onto zonal diagnostic dimension nrho

    Arguments

    Type IntentOptional Attributes Name
    class(diagnostics_zonal_t), intent(inout) :: self

    Instance of class

    type(comm_handler_t), intent(in) :: comm_handler

    MPI communication handler

    class(equilibrium_t) :: equi
    class(equilibrium_storage_t), intent(in) :: equi_storage

    Equilibrium storage enabling faster performance at certain locations

    type(mesh_cart_t), intent(in) :: mesh

    Mesh within poloidal plane

    type(parallel_map_t), intent(in) :: map

    Parallel map

    type(polars_t), intent(in) :: polars

    Polar grid and operators

    integer, intent(in) :: ind

    Work index in diagnostics array

    real(kind=GP), intent(in), dimension(:) :: u

    Input array

    character(len=*), intent(in) :: mode

    Projection mode, select from : 'ZONAVG' - zonal volume average aka 'flux surface average' 'ZONINT' - zonal volume integral 'SRFAVG' - surface average 'SRFINT' - surface integral